Re: Combining two MMX registers into one SSE register?



Rich Fife schrieb:

> Is there a way to combine two MMX registers into the low and high quad
> words of an SSE register without getting memory involved? MOVQ2DQ does
> a zero extend, unfortunately, or it would be easy.
>
> -- Rich Fife --

Yes, two MOVQ2DQ and one additional, temporary used xmm-register is
required:

MOVQ2DQ xmm0, mm0
MOVQ2DQ xmm1, mm1
PUNPCKLQDQ xmm0, xmm1 ; xmm0 = mm1:mm0

note from:
---------------------------------------------------------------------------
Software Optimization Guide
for AMD Athlon? 64 and AMD Opteron? Processors

9.7 Storing Floating-Point Data in MMX? Registers (page 209)

Rationale
Using MOVDQ2Q or MOVQ2DQ to shuffle integer data between MMX and XMM
registers is useful to relieve register pressure; however, doing so
with floating-point data can impact performance. The impact is greater
if the floating-point data is denormalized.
---------------------------------------------------------------------------

Guess you are aware of the fact, that windows-64 bans mmx/x87, due to
not saving/restoring mmx/x87-registers during context switch ;-(

- Gerd


.



Relevant Pages

  • Re: Combining two MMX registers into one SSE register?
    ... I already had resigned to the fact not to use MMX under ... Can x87 instructions still be used by 64-bit applications? ... About x87 and mmx registers ... Can floating point registers be used in 64-bit Windows? ...
    (comp.lang.asm.x86)
  • Re: the performance of x86 processor and DSP
    ... between FPU and MMX modes? ... the code to save MMX registers at task switch. ... It really looks like Intel cooked up their instruction set additions by ...
    (comp.dsp)
  • Re: MMX instructions and floating point stack
    ... > floating point arithmetic. ... the FPU stack are also the MMX registers. ... So if I load ST0 with 1.0, then issue an MMX instruction, the entire ...
    (comp.lang.asm.x86)
  • Re: 16 byte alignment
    ... Are some of the registers are ... You can use the MMX registers at the same time as the SSE ... Interaction of SSE and SSE2 Instructions with x87 FPU ...
    (borland.public.delphi.language.basm)
  • Re: Interesting.cn
    ... which uses two such registers as ... What I may be remembering is AltiVec vs. MMX, ... "I'd be quite in favour of a military takeover of that benighted city, ...
    (alt.sysadmin.recovery)