flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 02 Apr 2006, 07:23
Assuming your source register is xmm0
Code: movhlps xmm1,xmm0 addps xmm0,xmm1 shufps xmm1,xmm0,1 addps xmm0,xmm1 |
|||
![]() |
|
Madis731 02 Apr 2006, 09:49
revolution, you have an error in your code. The result of a shuffle gets defined by BOTH operands and you can't get the source's lower into destination's lower.
Give 1.0 2.0 3.0 4.0 IN: Code: movhlps xmm1,xmm0 addps xmm0,xmm1 movaps xmm1,xmm0 shufps xmm1,xmm1,1 addps xmm0,xmm1 ;or even addss because its 1µop faster and get X X X 10.0 OUT Give 1.0 2.0 3.0 4.0 IN: Code: movaps xmm1,xmm0 shufps xmm1,xmm1,00011011b addps xmm0,xmm1 movaps xmm1,xmm0 shufps xmm1,xmm1,01001110b addps xmm0,xmm1 and get 10.0 10.0 10.0 10.0 OUT Maybe useful sometimes. You can use the results in the XMM0 at the beginning of the edge of the 11th and 13th clock respectively. ![]() Code: haddps xmm0,xmm0 haddps xmm0,xmm0 The advantage is that you get all the four DWORDs filled with the same result. |
|||
![]() |
|
Raedwulf 02 Apr 2006, 11:49
Thanks!
This really helps ![]() Btw.... what debugger do you guys use ? - I use Ollydbg but as it doesn't support XMM registers, I have to inconveniently place the values into temporary memory spaces to view their contents (in debug time) Cheers! _________________ Raedwulf |
|||
![]() |
|
Raedwulf 02 Apr 2006, 12:04
Yeah SSE3 is bloody useful in these situations - unfortunately my desktop doesn't even support SSE2! Any willing doners for my humble cause are appreciated
![]() LOL Cheers! |
|||
![]() |
|
revolution 02 Apr 2006, 13:34
Quote: revolution, you have an error in your code. The result of a shuffle gets defined by BOTH operands and you can't get the source's lower into destination's lower. Code: movhlps xmm1,xmm0 addps xmm0,xmm1 pshufd xmm1,xmm0,1 addps xmm0,xmm1 |
|||
![]() |
|
Raedwulf 02 Apr 2006, 16:38
Thanks revolution
![]() I'll keep note of that - because that appears to be faster. However, it uses SSE2 -(PSHUFD) - and my desktop is antique and doesn't support it ![]() Cheers anyway....I'll add it into my program once i have better access to a SSE2 computer. _________________ Raedwulf |
|||
![]() |
|
Reverend 26 May 2006, 16:06
Raedwulf: OllyDbg can show SSE registers. Just go to 'Debuggin options' -> 'Registers' and match 'Decode SSE registers'
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.