Add an ifcmp_sp instruction.

This will be used to implement the stack_check macro.
This commit is contained in:
Jakob Stoklund Olesen
2018-02-09 13:59:49 -08:00
parent 69f70fc61d
commit 73c4c356c9
2 changed files with 12 additions and 0 deletions

View File

@@ -947,6 +947,7 @@ The prologue and epilogue of a function needs to manipulate special registers li
pointer and the frame pointer. These instructions should not be used in regular code. pointer and the frame pointer. These instructions should not be used in regular code.
.. autoinst:: adjust_sp_imm .. autoinst:: adjust_sp_imm
.. autoinst:: ifcmp_sp
.. autoinst:: copy_special .. autoinst:: copy_special
.. _extload-truncstore: .. _extload-truncstore:

View File

@@ -579,6 +579,17 @@ adjust_sp_imm = Instruction(
ins=(StackOffset,), ins=(StackOffset,),
other_side_effects=True) other_side_effects=True)
f = Operand('f', iflags)
ifcmp_sp = Instruction(
'ifcmp_sp', r"""
Compare ``addr`` with the stack pointer and set the CPU flags.
This is like :inst:`ifcmp` where ``addr`` is the LHS operand and the stack
pointer is the RHS.
""",
ins=addr, outs=f)
regspill = Instruction( regspill = Instruction(
'regspill', r""" 'regspill', r"""
Temporarily divert ``x`` from ``src`` to ``SS``. Temporarily divert ``x`` from ``src`` to ``SS``.