Re: Loading single word to a xmm register
- From: Frank Kotler <fbkotler@xxxxxxxxxxx>
- Date: Tue, 28 Feb 2006 07:45:33 -0500
enjoyamalp@xxxxxxxxx wrote:
....
All these 8
words are stored in different memory location.
(just wanted to repeat that for Wannabee's benefit :) Bummer!
I haven't used these instructions, either. Would "PINSRW" do aything for you???
mov esi, pD1
mov ax, [esi]
shl eax, 16
IF we can be assured that there's valid memory a couple bytes below pD1, you might replace the load to ax and shift with:
mov eax, [esi - 2]
.... this would load your value into the high word of eax, filling ax with "garbage" to be overwritten with the next load.
add esi,nRastOffset
mov ax, [esi]
movd xmm0, eax
add esi,nRastOffset
mov ax, [esi]
shl eax, 16
And here...
add esi,nRastOffset
mov ax, [esi]
movd xmm1, eax
PSLLDQ xmm1, 4
I'm confused. Why 4?
orps xmm0, xmm1
add esi,nRastOffset
mov ax, [esi]
shl eax, 16
And here...
add esi,nRastOffset
mov ax, [esi]
movd xmm1, eax
PSLLDQ xmm1, 8
And (confused) here...
orps xmm0, xmm1
add esi,nRastOffset
mov ax, [esi]
shl eax, 16
Annnnd here...
mov bx, 2[esi]
shl ebx, 16
I'm not sure what you're doing here... maybe load ebx from [esi] instead of bx from 2[esi]???
add esi,nRastOffset
mov ax, [esi]
movd xmm1, eax
PSLLDQ xmm1, 12
And (confused) here...
orps xmm0, xmm1
add esi,nRastOffset
So this code is taking some time to copy first to the eax and then
copying to the xmm. I have done it in this way because I can't find any
instruction that loads a 16 bit value from memory to an xmm register.
Is there any instruction for that? Or is there any way to speed up this
thing a bit?
There's *gotta* be a better way to do this - working with words in 16-bit code is... awkward. (I'd don't suppose you'd redesign the hardware? :) I don't know what the answer is, unless that "PINSRW" would help...
Best,
Frank
.
- Follow-Ups:
- Re: Loading single word to a xmm register
- From: \\\~\o/~///annabee
- Re: Loading single word to a xmm register
- References:
- Loading single word to a xmm register
- From: enjoyamalp
- Loading single word to a xmm register
- Prev by Date: Re: Loading single word to a xmm register
- Next by Date: Re: Loading single word to a xmm register
- Previous by thread: Re: Loading single word to a xmm register
- Next by thread: Re: Loading single word to a xmm register
- Index(es):
Relevant Pages
|