gccint: Machine-Independent Predicates

1 
1 17.7.1 Machine-Independent Predicates
1 -------------------------------------
1 
1 These are the generic predicates available to all back ends.  They are
1 defined in 'recog.c'.  The first category of predicates allow only
1 constant, or "immediate", operands.
1 
1  -- Function: immediate_operand
1      This predicate allows any sort of constant that fits in MODE.  It
1      is an appropriate choice for instructions that take operands that
1      must be constant.
1 
1  -- Function: const_int_operand
1      This predicate allows any 'CONST_INT' expression that fits in MODE.
1      It is an appropriate choice for an immediate operand that does not
1      allow a symbol or label.
1 
1  -- Function: const_double_operand
1      This predicate accepts any 'CONST_DOUBLE' expression that has
1      exactly MODE.  If MODE is 'VOIDmode', it will also accept
1      'CONST_INT'.  It is intended for immediate floating point
1      constants.
1 
1 The second category of predicates allow only some kind of machine
1 register.
1 
1  -- Function: register_operand
1      This predicate allows any 'REG' or 'SUBREG' expression that is
1      valid for MODE.  It is often suitable for arithmetic instruction
1      operands on a RISC machine.
1 
1  -- Function: pmode_register_operand
1      This is a slight variant on 'register_operand' which works around a
1      limitation in the machine-description reader.
1 
1           (match_operand N "pmode_register_operand" CONSTRAINT)
1 
1      means exactly what
1 
1           (match_operand:P N "register_operand" CONSTRAINT)
1 
1      would mean, if the machine-description reader accepted ':P' mode
1      suffixes.  Unfortunately, it cannot, because 'Pmode' is an alias
1      for some other mode, and might vary with machine-specific options.
1      ⇒Misc.
1 
1  -- Function: scratch_operand
1      This predicate allows hard registers and 'SCRATCH' expressions, but
1      not pseudo-registers.  It is used internally by 'match_scratch'; it
1      should not be used directly.
1 
1 The third category of predicates allow only some kind of memory
1 reference.
1 
1  -- Function: memory_operand
1      This predicate allows any valid reference to a quantity of mode
1      MODE in memory, as determined by the weak form of
1      'GO_IF_LEGITIMATE_ADDRESS' (⇒Addressing Modes).
1 
1  -- Function: address_operand
1      This predicate is a little unusual; it allows any operand that is a
1      valid expression for the _address_ of a quantity of mode MODE,
1      again determined by the weak form of 'GO_IF_LEGITIMATE_ADDRESS'.
1      To first order, if '(mem:MODE (EXP))' is acceptable to
1      'memory_operand', then EXP is acceptable to 'address_operand'.
1      Note that EXP does not necessarily have the mode MODE.
1 
1  -- Function: indirect_operand
1      This is a stricter form of 'memory_operand' which allows only
1      memory references with a 'general_operand' as the address
1      expression.  New uses of this predicate are discouraged, because
1      'general_operand' is very permissive, so it's hard to tell what an
1      'indirect_operand' does or does not allow.  If a target has
1      different requirements for memory operands for different
1      instructions, it is better to define target-specific predicates
1      which enforce the hardware's requirements explicitly.
1 
1  -- Function: push_operand
1      This predicate allows a memory reference suitable for pushing a
1      value onto the stack.  This will be a 'MEM' which refers to
1      'stack_pointer_rtx', with a side effect in its address expression
1      (⇒Incdec); which one is determined by the 'STACK_PUSH_CODE'
1      macro (⇒Frame Layout).
1 
1  -- Function: pop_operand
1      This predicate allows a memory reference suitable for popping a
1      value off the stack.  Again, this will be a 'MEM' referring to
1      'stack_pointer_rtx', with a side effect in its address expression.
1      However, this time 'STACK_POP_CODE' is expected.
1 
1 The fourth category of predicates allow some combination of the above
1 operands.
1 
1  -- Function: nonmemory_operand
1      This predicate allows any immediate or register operand valid for
1      MODE.
1 
1  -- Function: nonimmediate_operand
1      This predicate allows any register or memory operand valid for
1      MODE.
1 
1  -- Function: general_operand
1      This predicate allows any immediate, register, or memory operand
1      valid for MODE.
1 
1 Finally, there are two generic operator predicates.
1 
1  -- Function: comparison_operator
1      This predicate matches any expression which performs an arithmetic
1      comparison in MODE; that is, 'COMPARISON_P' is true for the
1      expression code.
1 
1  -- Function: ordered_comparison_operator
1      This predicate matches any expression which performs an arithmetic
1      comparison in MODE and whose expression code is valid for integer
1      modes; that is, the expression code will be one of 'eq', 'ne',
1      'lt', 'ltu', 'le', 'leu', 'gt', 'gtu', 'ge', 'geu'.
1