This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

UltraSPARC code generation weirdness


I'm seeing some strangeness in the way gcc (2.95.2) 
synthesizes integer multiplies with add/sub/shift
even on Ultra II targets. Witness:

(gcc -O3 -mcpu=ultrasparc -Wall  -g -c dither.c)

generates...

      return ((state * (sint_32) (0.707106 * 256.0))>>8);
24:   87 28 a0 10     sll  %g2, 0x10, %g3
28:   c4 32 a0 00     sth  %g2, [ %o2 ]
2c:   87 38 e0 10     sra  %g3, 0x10, %g3
30:   85 28 e0 01     sll  %g3, 1, %g2
34:   84 00 80 03     add  %g2, %g3, %g2
38:   91 28 a0 04     sll  %g2, 4, %o0
3c:   90 22 00 02     sub  %o0, %g2, %o0
40:   91 2a 20 02     sll  %o0, 2, %o0
44:   90 02 00 03     add  %o0, %g3, %o0
48:   91 2a 20 08     sll  %o0, 8, %o0
}
4c:   81 c3 e0 08     retl 
50:   91 32 20 10     srl  %o0, 0x10, %o0

Am I doing something silly or does gcc just not support
generating hardware multiplies that are supposedly in
Sparc V7 and up?

Thanks.

cheers,
aaron

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]