Re: Loading single word to a xmm register



All these 8
words are stored in different memory location.

//
(just wanted to repeat that for Wannabee's benefit :) Bummer!

Frank //

Not to be pedantic, but the 8 words I am moving are also in diffrent
memory locations. In fact, 2 bytes a part :D :D

He didnt spesicfy what the nRastOffset was.
If it was 2 ......

I thought it was some schoolassignment :D

But I guess you may be right that this was too easy.

Anyways. I stepped his code in RosAsm, and you can do the same, to see
that in fact, even if I _did_ take a "spanish" one, I may have been
correct after all.


[<16 TestData: D§ 0_4321_ffff 0_4321_ffff 0_4321_ffff 0_4321_ffff]
[nRastOffset 2]
TestProc:

mov esi, TestData
mov ax, w§esi
shl eax, 16
add esi,nRastOffset


mov ax, w§esi
movd xmm0, eax
add esi,nRastOffset


mov ax, w§esi
shl eax, 16
add esi,nRastOffset


mov ax, w§esi
movd xmm1, eax
PSLLDQ xmm1, 4
orps xmm0, xmm1
add esi,nRastOffset


mov ax, w§esi
shl eax, 16
add esi,nRastOffset


mov ax, w§esi
movd xmm1, eax
PSLLDQ xmm1, 8
orps xmm0, xmm1
add esi,nRastOffset


mov ax, w§esi
shl eax, 16
mov bx, w§esi
shl ebx, 16
add esi,nRastOffset


mov ax, w§esi
movd xmm1, eax
PSLLDQ xmm1, 12
orps xmm0, xmm1
add esi,nRastOffset
ret

.



Relevant Pages

  • How to load a single word(16 bit) to xmm register in Intel P4?
    ... register using MOV and left shifting EAX by 16, ... word to AX and copies the dword to xmm1. ... mov ax, [esi] ...
    (comp.lang.asm.x86)
  • Loading single word to a xmm register
    ... register using MOV and left shifting EAX by 16, ... word to AX and copies the dword to xmm1. ... mov ax, [esi] ...
    (alt.lang.asm)
  • Re: How to do this faster?
    ... > mov ecx, eax ... > shl eax, 16 ... Why is this slower? ...
    (borland.public.delphi.language.basm)
  • Re: How to do this faster?
    ... > mov ah, al ... > shl eax, 8 ... When you modify smaller part of the register and then try to read bigger part of it then partial ... mov ecx, eax ...
    (borland.public.delphi.language.basm)
  • Re: * 256
    ... it's a color conversion so giving a color value it returns a ... > shl eax, 16 ... > mov al, cl ...
    (borland.public.delphi.language.basm)