flat assembler
Message board for the users of flat assembler.

Index > Main > How implement signum for float value ?

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
macgub



Joined: 11 Jan 2006
Posts: 376
Location: Poland
macgub 16 Aug 2026, 06:19
What about:
Code:
movd   xmm1, eax
pshufd xmm1, xmm1, 0
pslld  xmm1, 31       ; 0 or 0x80000000 per lane
xorps  xmm0, xmm1
subps  xmm7, xmm0 ; subps instead addps
    

?
Post 16 Aug 2026, 06:19
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 376
Location: Poland
macgub 17 Aug 2026, 16:56
Stop beeing lazy - I checked in x64dbg:
Code:
pcmpeqd xmm7,xmm7
pslld xmm7,31    ; 0x80000000 at lane
subps xmm7,xmm6
    

Negate signs in xmm6 as:
Code:
pxor xmm7,xmm7 ; 0  at each lane
subps xmm7,xmm6
    
Post 17 Aug 2026, 16:56
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< 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-2026, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.