News:

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

Main Menu

alternative to movd

Started by daydreamer, August 31, 2023, 02:30:29 PM

Previous topic - Next topic

daydreamer

Hi
SSE xmm regs<> gp regs is simple use Movd
But fpu regs <> gp regs you need go thru memory storage
My idea is to try this
Push eax
; after fpu calculation
Fistp [esp+something ]
;want to store result on stack so
Pop eax ;eax = [esp+something ]
But I have too little experience with stack tricks


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

Caché GB

Hi daydreamer

Try this.

local  MyReal4:real4

            mov  eax, FLT4(123.456)
           push  eax
            fld  dword ptr[esp]

           fchs

           fstp  dword ptr[esp]
            pop  eax

            mov  MyReal4, eax
Caché GB's 1 and 0-nly language:MASM

jj2007

Here's one more, pure Masm32 SDK code (full source attached):

  rdtsc
  push edx
  push eax
  fild qword ptr [esp]
  invoke Sleep, 1000
  rdtsc
  push edx
  push eax
  fild qword ptr [esp]
  fsubr
  fdiv FP8(1048576.0)    ; ->mega
  fistp result

NoCforMe

Doesn't that leave the stack unbalanced? Four PUSHes and no POPs.
Assembly language programming should be fun. That's why I do it.

jj2007


NoCforMe

Look, I'm not gonna download a .zip file every time I see something posted here. Life's too short for that.
Assembly language programming should be fun. That's why I do it.

jj2007

Maybe you shouldn't waste so much of your precious life time on thread drift :cool:

daydreamer

Thanks Cache gb,jochen  :thumbsup:
Thread drift in forum in Sydney = Sydney drift, instead of Tokyo drift?  :biggrin:

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

NoCforMe

Quote from: daydreamer on September 01, 2023, 12:27:08 PMThread drift in forum in Sydney = Sydney drift, instead of Tokyo drift?  :biggrin:

Continental drift. Plate tectonics.
Assembly language programming should be fun. That's why I do it.