diff --git a/cranelift/docs/langref.rst b/cranelift/docs/langref.rst index 17a146ba07..b7fe64b924 100644 --- a/cranelift/docs/langref.rst +++ b/cranelift/docs/langref.rst @@ -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. .. autoinst:: adjust_sp_imm +.. autoinst:: ifcmp_sp .. autoinst:: copy_special .. _extload-truncstore: diff --git a/lib/cretonne/meta/base/instructions.py b/lib/cretonne/meta/base/instructions.py index 875a0e7537..b6ab96a16e 100644 --- a/lib/cretonne/meta/base/instructions.py +++ b/lib/cretonne/meta/base/instructions.py @@ -579,6 +579,17 @@ adjust_sp_imm = Instruction( ins=(StackOffset,), 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', r""" Temporarily divert ``x`` from ``src`` to ``SS``.