News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

fistp stores integer p or rounded float?

Started by daydreamer, January 04, 2014, 03:57:30 AM

Previous topic - Next topic

daydreamer

?..or i need to set fp flags right to get integer part?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

qWord

Quote from: daydreamer2 on January 04, 2014, 03:57:30 AMi need to set fp flags right to get integer part?
yes, you need to set the rounding mode. The default value (FINIT) is "round to nearest". There is also the SSE3 instruction FISTTP, which always truncates (ignores the current rounding mode). Furthermore, using cvttsd2si or cvttss2si (SSE2) might be also an option.
MREAL macros - when you need floating point arithmetic while assembling!