Andrew Tsay
Andrew Tsay

Reputation: 1953

What's the SSE equivalent of fstp?

Correct me if I'm mistaken, but fstp pops the value from the top of the FPU stack such as st0?

i.e. fstp tword [rsp]

If I have values in an SSE register, xmm0, what's the equivalent? I want to print the values stored in the registers.

Upvotes: 1

Views: 300

Answers (1)

Ben Voigt
Ben Voigt

Reputation: 283793

SSE doesn't use a stack, its registers are directly accessible. If you want to display contents of an MMX or SSE register, then the "store" instruction is appropriate. It will copy the values into an array of primitive data types in program memory (although in many cases you can simply cast the SSE variable in high level languages, taking its address may interfere with optimizations, by forcing a register spill to memory. Prefer to use the load and store intrinsics.)

For example, the

MOVUPD

and

MOVUPS

instructions.

Upvotes: 3

Related Questions