[Bug target/115755] mulx (with -mbmi2) does not show up with constant multiply
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jul 3 14:15:15 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115755
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Hongtao Liu from comment #1)
> mulx doesn't support imm operand, a register is still needed to put 123.
> mulq is used func/func1 should be ok.
Right, but mulx does not set the flags so it should be better to move around
and such.
clang produces mulx for this.
func: # @func
.cfi_startproc
# %bb.0:
movl $123, %eax
movq %rdi, %rdx
mulxq %rax, %rax, %rax
retq
func1: # @func1
.cfi_startproc
# %bb.0:
movl $123, %eax
movq %rdi, %rdx
mulxq %rax, %rax, %rdx
retq
More information about the Gcc-bugs
mailing list