------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-16 04:05
-------
Actually there are two ands for -march=pentiumpro also:
movl 4(%esp), %ecx
movzbl 8(%esp), %edx <--- one
movl (%ecx), %eax
andl $3, %edx <--- two
andl $-4, %eax <-- I have not figured out where this one comes from but it
shows up on x86
and x86-64 and also PPC
orl %edx, %eax
movl %eax, (%ecx)
ret
PPC produces:
lwz r0,0(r3)
rlwinm r4,r4,0,30,31
rlwimi r0,r4,30,0,1
stw r0,0(r3)
blr
which is responsible but not optimal as 3.3 produces better:
lwz r2,0(r3)
rlwimi r2,r4,30,0,1
stw r2,0(r3)
blr
(insn 11 10 12 0 0x0 (set (zero_extract:SI (reg:SI 2 r2 [120])
(const_int 2 [0x2])
(const_int 0 [0x0]))
(reg/v:SI 4 r4 [119])) 106 {insvsi} (insn_list:REG_DEP_OUTPUT 10 (nil))
(expr_list:REG_DEAD (reg/v:SI 4 r4 [119])
(nil)))
Should be the only thing which is produced but:
(insn 14 15 16 0 (parallel [
(set (reg:SI 4 r4 [121])
(and:SI (reg:SI 4 r4 [ v ])
(const_int 3 [0x3])))
(clobber (scratch:CC))
]) 100 {andsi3} (nil)
(expr_list:REG_UNUSED (scratch:CC)
(nil)))
(insn:TI 16 14 17 0 (set (zero_extract:SI (reg:SI 0 r0 [122])
(const_int 2 [0x2])
(const_int 0 [0x0]))
(reg:SI 4 r4 [121])) 125 {insvsi} (insn_list:REG_DEP_TRUE 14
(insn_list:REG_DEP_TRUE 15 (nil)))
(expr_list:REG_DEAD (reg:SI 4 r4 [121])
(nil)))
is produced, note the extra and 3 which is not needed for as the zero_extract does the
work for us (I
think this is equivalent to the extra and for -march=i386).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18008