Richard Sandiford <richard.sandif...@arm.com> wrote:
"Qian, Jianhua" <qia...@cn.fujitsu.com> writes:
Hi Richard
I found that some instructions are using '#' before immediate value,
and others are not. For example
(define_insn "insv_imm<mode>"
[(set (zero_extract:GPI (match_operand:GPI 0 "register_operand" "+r")
(const_int 16)
(match_operand:GPI 1 "const_int_operand" "n"))
(match_operand:GPI 2 "const_int_operand" "n"))]
"UINTVAL (operands[1]) < GET_MODE_BITSIZE (<MODE>mode)
&& UINTVAL (operands[1]) % 16 == 0"
"movk\\t%<w>0, %X2, lsl %1"
[(set_attr "type" "mov_imm")]
)
Are there any standards for this?
No, it's unfortunately inconsistent. FWIW, if we were going to change
this,
personally I've a slight preference for having the “#”.
Absence of the # makes assemblers based on the LLVM backend reject GCC’s
output, as such I’ve got a strong preference for adding it (I’ve got some
local
patches for this already).
e.g.
https://github.com/iains/gcc-darwin-arm64/commit/526ffb6b34ddb848853016cd14a438683aa0e6de
(hacking branch, please don’t shoot me, yet :) )
Iain