[METABUG] --target=sh-elf V4SF mode metabug
tm
tm@mail.kloo.net
Fri Aug 2 02:19:00 GMT 2002
The file gcc/testsuite/gcc.c-torture/compile/simd-4.c looks like:
typedef float floatvect2 __attribute__((mode(V4SF)));
typedef union
{
floatvect2 vector;
float f[2];
}resfloatvect2;
void tempf(floatvect2 *x, floatvect2 *y)
{
floatvect2 temp= *x;
floatvect2 temp1=*y;
resfloatvect2 temp2;
*x=temp+temp1;
}
When this is compiled with options -O2 -m4, the compiler generates code
which dereferences y via integer instructions instead of floating point
instructions:
.type _tempf, @function
_tempf:
mov.l r8,@-r15
mov #0,r0
mov.l r9,@-r15
mov.l r10,@-r15
mov.l r14,@-r15
add #-48,r15
mov.l @r4,r1
mov r15,r14
mov.l r0,@(16,r14)
mov.l r0,@(20,r14)
mov.l r0,@(24,r14)
mov.l r0,@(28,r14)
mov.l @(4,r4),r0
mov.l r1,@(32,r14)
mov.l r0,@(36,r14)
mov.l @(8,r4),r1
mov.l @(12,r4),r0
mov.l r1,@(40,r14)
mov.l r0,@(44,r14)
mov #16,r0
mov.l .L3,r1
lds.l @r1+,fpscr
mov.l @r5,r7 <- here
lds r7,fpul <- here
mov.l @(4,r5),r8
mov.l @(8,r5),r9
fsts fpul,fr2 <- here
lds r8,fpul
fmov.s @r4,fr1
fadd fr2,fr1
mov.l @(12,r5),r10
fsts fpul,fr2
lds r9,fpul
fmov.s fr1,@(r0,r14)
...
Kinda nasty. It should load values directly into floating point registers
instead.
Toshi
More information about the Gcc-bugs
mailing list