flat assembler
Message board for the users of flat assembler.

Index > Windows > SSE mul integer to integer without registers

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 815
Roman
I do on FPU.
Code:
Int10 DD 10
Int12 DD 12
Result DD 0 ;intgr number

FILD   DWORD [Int10]
FIMUL DWORD [Int12]
FISTP DWORD [Result]
    


But how do like this on SSE ?
I do bad example , but use ECX register :

Code:
Float12 DD 12.0
cvtsi2ss xmm1,dword [Int10]
mulss   xmm1,dword [Float12]
cvtss2si ecx,xmm1
    
Post 02 Jan 2014, 14:59
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
SSE always uses registers since it doesn't use the stack mechanism that the FPU uses. Note also that you can incur precision losses due to the float format.

SSE provides both floating point and integer operations; without more details on what you're doing I can only suggest using (v)pmul(u)dq for full precision or another pmul variant for optimisation unless you do actually want to represent very large numbers.

However if you're only performing scalar multiplication it may be better to use the normal mul instruction.
Post 02 Jan 2014, 15:55
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.