Dear all,

I used gcc-4.3.2 to compile the c source(*) and it generated
"vmhraddshs" instruction when I compiled with -mcpu=8540.
00010388: 9421F700  stwu     rsp,-2304(rsp)
0001038C: 7C0802A6  mflr     r0
00010390: 38C00100  li       r6,256
00010394: 39200000  li       r9,0
00010398: 7CC903A6  mtctr    r6
0001039C: 39610870  addi     r11,rsp,2160
000103A0: 90010904  stw      r0,2308(rsp)
000103A4: 11EB0321  vmhraddshs vr15,vr11,vr0,vr12
000103A8: 10000216  dc.l     0x10000216
000103AC: 120B0B21  vmhraddshs vr16,vr11,vr1,vr12
000103B0: 122B1321  vmhraddshs vr17,vr11,vr2,vr12
000103B4: 124B1B21  vmhraddshs vr18,vr11,vr3,vr12
000103B8: 126B2321  vmhraddshs vr19,vr11,vr4,vr12
000103BC: 128B2B21  vmhraddshs vr20,vr11,vr5,vr12
000103C0: 12AB3321  vmhraddshs vr21,vr11,vr6,vr12
000103C4: 12CB3B21  vmhraddshs vr22,vr11,vr7,vr12
000103C8: 12EB4321  vmhraddshs vr23,vr11,vr8,vr12
000103CC: 130B4B21  vmhraddshs vr24,vr11,vr9,vr12
000103D0: 132B5321  vmhraddshs vr25,vr11,vr10,vr12
000103D4: 134B5B21  vmhraddshs vr26,vr11,vr11,vr12
000103D8: 136B6321  vmhraddshs vr27,vr11,vr12,vr12
000103DC: 138B6B21  vmhraddshs vr28,vr11,vr13,vr12
000103E0: 13AB7321  vmhraddshs vr29,vr11,vr14,vr12
000103E4: 13CB7B21  vmhraddshs vr30,vr11,vr15,vr12
000103E8: 13EB8321  vmhraddshs vr31,vr11,vr16,vr12
000103EC: 9061085C  stw      r3,2140(rsp)
000103F0: 3CE00003  lis      r7,3
000103F4: 3D000003  lis      r8,3
000103F8: 38E7F3A8  subi     r7,r7,3160
000103FC: 39081BA8  addi     r8,r8,7080
00010400: 10074B20  vmhaddshs vr0,vr7,vr9,vr12
00010404: 10084B20  vmhaddshs vr0,vr8,vr9,vr12

I used the compiler flag (**):
gcc -c  -mcpu=8540 -misel=yes -mmultiple -mads -Wa,-mregnames
-gdwarf-2 -O3    -DE500_BOARD
-I/cygdrive/d/gcc/gcc-4.3.2/powerpc-eabispe/include
-I/cygdrive/d/gcc/gcc-4.3.2/lib/gcc/powerpc-eabispe/4.3.2/include

gcc-4.2.4 compiled it(*) and generated e500 instructions (didn't
generate vmhaddshs)

I couldn't send the source for your reproduce. But I'd like to add
some more information as follow:
1/ I have two files (c1 and c2: source c). In each of file, it has two
parts. c1 and c2 have the same part 1, and the different part 2. When
I compiled c1 and c2 with the same compiler flag(**), gcc generated
e500 instruction for c1 but it generated vmhaddshs instruction for c2.
It makes c2 executive file hang out when running on 8548 board.

2/ I tried to compile gcc-4.3.x(gcc-4.3.0, gcc-4.3.1 and gcc-4.3.2)
for powerpc, it compiled ok but I have the error when using gcc-4.3.x
as follow:
"gcc: error trying to exec 'cc1': execvp: No such file or directory"
I tried to add path of cc1 and include and library paths, it passed
when compiling 8540

But I compiled gcc-4.2.x(x=0,1,2,3) and used them ok.

I used binutils-2.17.tar.gz,
gcc-core-4.2.x.tar.bz2(gcc-core-4.2.x.tar.bz2), newlib-1.14.0.tar.gz
and compiled gcc : /cygdrive/d/gcc/src/gcc-4.2.3/configure
--target=$TARGET --prefix=$PREFIX --disable-libssp
--disable-libmudflap --enable-languages=c --with-newlib
--without-headers

And I compiled source for 8540 by gcc-4.3.x
compiler flags: gcc -c  -mcpu=8540 -misel=yes -mmultiple -mads
-Wa,-mregnames -gdwarf-2 -O3    -DE500_BOARD
-I/cygdrive/d/gcc/gcc-4.3.2/powerpc-eabispe/include
-I/cygdrive/d/gcc/gcc-4.3.2/lib/gcc/powerpc-eabispe/4.3.2/include

linker flags: gcc -mcpu=8540 -misel=yes -mmultiple -mads -mads -Wl,-T
"/cygdrive/d/lcf/elf32ppc.x" -Wl,-e,_start -nodefaultlibs
-Wl,-L,"/cygdrive/d/gcc_ppc"
-Wl,-lgcc,-start-group,-lc,-lm,-lads,-end-group,-lgcc,-lsyscall
-L/cygdrive/d/gcc/gcc-4.3.2/lib/gcc/powerpc-eabispe/4.3.2
-L/cygdrive/d/gcc/gcc-4.3.2/powerpc-eabispe/lib

But I don't use the include and gcc library path  when compiling by gcc-4.2.x
compiler flags:-mcpu=8540 -misel=yes -mmultiple -mads -Wa,-mregnames
-gdwarf-2 -O3 -DE500_BOARD -DNDEBUG -DAUTOGO=TRUE

linker flags:-mcpu=8540 -misel=yes -mmultiple -mads -mads -Wl,-T
/cygdrive/d/ha/cvs_gccppc/mw_test/Cross_Products/Compiler/mw_test_harness/product_utils/gcc_ppc/lcf/elf32ppc.x
-Wl,-e,_start -nodefaultlibs
-Wl,-L,/cygdrive/d/ha/cvs_gccppc/mw_test/Cross_Products/Compiler/mw_test_harness/product_utils/gcc_ppc

Could you please help me? Please kindly let me know if you need more
information.

Thank you,
Ha Luong

Reply via email to