help needed :about instructions

help needed :about instructions

In my program (written in assembly language)

I encounted a problem:
I load four integer (32bit) into xmm register
and I want to use the four integers seperately.

In my program I have to shift 32 bit each time ,it is very time consuming.

like this
movd %xmm5, %eax
60 psrldq $4, %xmm5
61 movsd (%rdi,%rax,8),%xmm2 #xvalue ---one a time
63 movd %xmm5,%eax
64 psrldq $4, %xmm5
65 movhpd (%rdi,%rax,8),%xmm2
67 mulpd %xmm2,%xmm0
70 movd %xmm5,%eax
71 psrldq $4,%xmm5
72 movsd (%rdi,%rax,8),%xmm6
74 movd %xmm5,%eax
75 movhpd (%rdi,%rax,8),%xmm6

Is there any instruction that I don't need to shift , and get the appropriate part of bits I need?
I haven't find such instruction so far ?
Does anyone know this instruction?

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

not sure what are you trying to implement.
in AVX you will have VPEXTRD that allow to extract dwords element from XMM.


Leave a Comment

Please sign in to add a comment. Not a member? Join today