flat assembler
Message board for the users of flat assembler.

Index > Main > Sse roundss how get low parts?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1710
Roman 24 Apr 2023, 09:51
Xmm1= 4.982
I want get 0.982

But I try this
Code:
 
;xmm1 = 4.982 
roundss xmm1, xmm1, 1
;do xmm1 = 4.0
    

Yes I could do 4.982-4 and get 0.982

But roundss not have this variant to get number after point ?
I don't want do 3 asm commands, I expected do one roundss and get watch I want.
Post 24 Apr 2023, 09:51
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 919
Location: Russia
macomics 24 Apr 2023, 15:27
fxtract
Post 24 Apr 2023, 15:27
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1710
Roman 24 Apr 2023, 15:31
Easy write three sse commands.
Fpu three too

fld value
fxtract
fstp outmem


Strange why roundss not have option as fxtract ?
Post 24 Apr 2023, 15:31
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 919
Location: Russia
macomics 24 Apr 2023, 16:39
Because round <> extract
Post 24 Apr 2023, 16:39
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1710
Roman 24 Apr 2023, 19:28
But it could be Smile
Post 24 Apr 2023, 19:28
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3962
Location: vpcmipstrm
bitRAKE 24 Apr 2023, 22:14
Did you try ...
Code:
;xmm0 = 4.982
roundss xmm1, xmm0, 0x3 ; truncate
subss xmm0, xmm1
;do xmm0 = 0.982    
... or maybe I misunderstand?
(roundss is all about the integer part, it only helps with fractional part through subtraction)

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 24 Apr 2023, 22:14
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1710
Roman 25 Apr 2023, 02:45
Yes i do this.
Post 25 Apr 2023, 02:45
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.