Next: Delay Slots, Previous: Insn Lengths, Up: Insn Attributes
一个define_attr的特殊形式,是其缺省值的表达式为一个const表达式,
这表示了对于一个给定的运行编译器的一个属性为常量。
常量熟性可以用于指定使用了哪个处理器的变种。例如,
(define_attr "cpu" "m88100,m88110,m88000"
(const
(cond [(symbol_ref "TARGET_88100") (const_string "m88100")
(symbol_ref "TARGET_88110") (const_string "m88110")]
(const_string "m88000"))))
(define_attr "memory" "fast,slow"
(const
(if_then_else (symbol_ref "TARGET_FAST_MEM")
(const_string "fast")
(const_string "slow"))))
针对常量属性生成的程序不具有任何参数,因为它不依赖于任何特定的insn。
用于定义常量属性的RTL表达式可以使用symbol_ref形式,
但是不可以使用包括insn属性的match_operand形式或者eq_attr形式。