public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Can't generate a 'movd' instructuction
@ 2004-11-26  7:52 James HAUXWELL
  2004-11-26  8:32 ` Sriharsha Vedurmudi
  2004-11-27  5:25 ` Ankit Jain
  0 siblings, 2 replies; 4+ messages in thread
From: James HAUXWELL @ 2004-11-26  7:52 UTC (permalink / raw)
  To: gcc-help

Hi,

I have a piece of code using mmx/sse intrinsics

    ta = __builtin_ia32_pmaddwd(ia, one);
    tb = (v2si)__builtin_ia32_psrlq((di)ta, 32);
    dest.__v = __builtin_ia32_paddd(ta, tb);
    satd = dest.__a[0];

At the phase where I move the bottom 32bits of the mmx register to a 
normal register I should be able to use a movd instruction (according to 
intel documentation), but what ever I do I can't generate one.  It is 
currently generating a movq to a memory loacation and then doing a 
shorter load from the same location.

should be something like.

    ta = __builtin_ia32_pmaddwd(ia, one);
    tb = (v2si)__builtin_ia32_psrlq((di)ta, 32);
    satd = (int)__builtin_ia32_paddd(ta, tb);

Is anyone familiar enough with intrinsics to know why this doesn't work?

Jim

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can't generate a 'movd' instructuction
  2004-11-26  7:52 Can't generate a 'movd' instructuction James HAUXWELL
@ 2004-11-26  8:32 ` Sriharsha Vedurmudi
  2004-11-27  5:25 ` Ankit Jain
  1 sibling, 0 replies; 4+ messages in thread
From: Sriharsha Vedurmudi @ 2004-11-26  8:32 UTC (permalink / raw)
  To: gcc-help

Probably the MMX-specific "movd" instruction is not defined into gcc or that the definition of such a statement is built like that (use a 
movq and then use a short load).

I believe, no matter how many instructions a processor supports, only a set of them would be needed by gcc to generate assembly code for a 
given source. I can say this, because, we have a processor and a port of gcc for it and when the definition for one of our instruction was 
misinterpreted by our developers (for a processor simulator), they informed us that they will change the definition in the simulator and 
asked us not to worry abt the compiler as that instruction is not used in the compiler.

Thanks,
Sriharsha.

James HAUXWELL wrote:
> Hi,
> 
> I have a piece of code using mmx/sse intrinsics
> 
>    ta = __builtin_ia32_pmaddwd(ia, one);
>    tb = (v2si)__builtin_ia32_psrlq((di)ta, 32);
>    dest.__v = __builtin_ia32_paddd(ta, tb);
>    satd = dest.__a[0];
> 
> At the phase where I move the bottom 32bits of the mmx register to a 
> normal register I should be able to use a movd instruction (according to 
> intel documentation), but what ever I do I can't generate one.  It is 
> currently generating a movq to a memory loacation and then doing a 
> shorter load from the same location.
> 
> should be something like.
> 
>    ta = __builtin_ia32_pmaddwd(ia, one);
>    tb = (v2si)__builtin_ia32_psrlq((di)ta, 32);
>    satd = (int)__builtin_ia32_paddd(ta, tb);
> 
> Is anyone familiar enough with intrinsics to know why this doesn't work?
> 
> Jim
> 

-- 
  *****************************
  * Sriharsha Vedurmudi			
  * Software Engineer		
  *
  * Redpine Signals Inc.	
  * Gate #395, Plot 87,88			
  * Sagar Society, Road #2,
  * Banjara Hills,		
  * Hyderabad - 500 034			
  * www.redpinesignals.com	
  *							
  * +91-40-23559911  (Office)
  * +91-9849133133   (Mobile)
  *****************************

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can't generate a 'movd' instructuction
  2004-11-26  7:52 Can't generate a 'movd' instructuction James HAUXWELL
  2004-11-26  8:32 ` Sriharsha Vedurmudi
@ 2004-11-27  5:25 ` Ankit Jain
  2004-11-29  8:22   ` James HAUXWELL
  1 sibling, 1 reply; 4+ messages in thread
From: Ankit Jain @ 2004-11-27  5:25 UTC (permalink / raw)
  To: James HAUXWELL, gcc-help

hi

 --- James HAUXWELL <james.hauxwell@st.com> wrote: 
> Hi,
> 
> I have a piece of code using mmx/sse intrinsics
> 
>     ta = __builtin_ia32_pmaddwd(ia, one);
>     tb = (v2si)__builtin_ia32_psrlq((di)ta, 32);
>     dest.__v = __builtin_ia32_paddd(ta, tb);
>     satd = dest.__a[0];
> 
> At the phase where I move the bottom 32bits of the
> mmx register to a 
> normal register

well i have a doubt in this i.e whether this is really
happening or not. because i am also usign gcc compiler
only and movd instrction works. if your things work
let me also know about it

thanks

 I should be able to use a movd
> instruction (according to 
> intel documentation), but what ever I do I can't
> generate one.  It is 
> currently generating a movq to a memory loacation
> and then doing a 
> shorter load from the same location.
> 
> should be something like.
> 
>     ta = __builtin_ia32_pmaddwd(ia, one);
>     tb = (v2si)__builtin_ia32_psrlq((di)ta, 32);
>     satd = (int)__builtin_ia32_paddd(ta, tb);
> 
> Is anyone familiar enough with intrinsics to know
> why this doesn't work?
> 
> Jim
>  

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can't generate a 'movd' instructuction
  2004-11-27  5:25 ` Ankit Jain
@ 2004-11-29  8:22   ` James HAUXWELL
  0 siblings, 0 replies; 4+ messages in thread
From: James HAUXWELL @ 2004-11-29  8:22 UTC (permalink / raw)
  To: Ankit Jain; +Cc: gcc-help

Ankit,

here is the objdump of the .o and it is definitely a movq instruction.

     765:       0f 6f c1                movq   %mm1,%mm0
     768:       0f 73 d0 20             psrlq  $0x20,%mm0
     76c:       0f fe c8                paddd  %mm0,%mm1
     76f:       0f 7f 4d e8             movq   %mm1,0xffffffe8(%ebp)
     773:       8b 45 e8                mov    0xffffffe8(%ebp),%eax

my compile options are -march=pentium4 -mfpmath=sse -msse2 -O3

I should have mentioned the version number I am on, so we can check if 
you are on a later version.

gcc (GCC) 3.4.1 (cygming special)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Jim

>hi
>
> --- James HAUXWELL <james.hauxwell@st.com> wrote: 
>  
>
>>Hi,
>>
>>I have a piece of code using mmx/sse intrinsics
>>
>>    ta = __builtin_ia32_pmaddwd(ia, one);
>>    tb = (v2si)__builtin_ia32_psrlq((di)ta, 32);
>>    dest.__v = __builtin_ia32_paddd(ta, tb);
>>    satd = dest.__a[0];
>>
>>At the phase where I move the bottom 32bits of the
>>mmx register to a 
>>normal register
>>    
>>
>
>well i have a doubt in this i.e whether this is really
>happening or not. because i am also usign gcc compiler
>only and movd instrction works. if your things work
>let me also know about it
>
>thanks
>
> I should be able to use a movd
>  
>
>>instruction (according to 
>>intel documentation), but what ever I do I can't
>>generate one.  It is 
>>currently generating a movq to a memory loacation
>>and then doing a 
>>shorter load from the same location.
>>
>>should be something like.
>>
>>    ta = __builtin_ia32_pmaddwd(ia, one);
>>    tb = (v2si)__builtin_ia32_psrlq((di)ta, 32);
>>    satd = (int)__builtin_ia32_paddd(ta, tb);
>>
>>Is anyone familiar enough with intrinsics to know
>>why this doesn't work?
>>
>>Jim
>> 
>>    
>>
>
>________________________________________________________________________
>Yahoo! Messenger - Communicate instantly..."Ping" 
>your friends today! Download Messenger Now 
>http://uk.messenger.yahoo.com/download/index.html
>  
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-11-29  8:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-26  7:52 Can't generate a 'movd' instructuction James HAUXWELL
2004-11-26  8:32 ` Sriharsha Vedurmudi
2004-11-27  5:25 ` Ankit Jain
2004-11-29  8:22   ` James HAUXWELL

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).