Questions about the instruction selection for sse2 intrinsic with -O optimization

haibo chbchb1130@sina.com
Tue Mar 9 03:36:00 GMT 2004


Hi:
	I am trying to compile sse2 program with gcc-3.4-02-25(prerelease version).
I found that I will get the suprise assembly code which is  different from
the syntax of the intrinsic function and the final result is wrong.
For example,for intrinsic :
 mark0=_mm_set1_epi16(0xffff);
 mark0 = _mm_insert_epi16(mark0,0,0);
I will get :
		movl    $65535, %eax
        movd    %eax, %xmm0
        punpcklwd       %xmm0, %xmm0
        pshufd  $0, %xmm0, %xmm0
        movdqa  %xmm0, -888(%ebp)
        movw    $15, %ax
        movd    %eax, %xmm0
        punpcklbw       %xmm0, %xmm0
        punpcklbw       %xmm0, %xmm0
        pshufd  $0, %xmm0, %xmm0
        movdqa  %xmm0, -568(%ebp) 
and no "pinsrw" found.
I wonder when and where gcc do these things in source code,
I have tried to step into the source code,and it do reach the code that
processes the _mm_insert_epi16 intrinsics and emit the rtl for it,but 
when gcc do insn match,It doesn't math it with sse2_pinsrw.
thanks.

 				

        haibo
        chbchb1130@sina.com
          2004-03-09


More information about the Gcc mailing list