VSX? VMX? Altivec? VR? VSR?! How these PowerPC SIMD acronyms relate to each other?
Asked Answered
S

1

7

I've a heard a lot about Altivec registers but I don't even find it on a POWER9 ISA. On that document I only find VR and VSR registers under Chapter 6 "Vector Facility" and Chapter 7 "Vector-Scalar Floating-Point Operations".

On ABI I noticed how the registers are physically allocated: Vector Registers as Part of VSRs

and I still didn't get why there are 2 groups. Is Altivec legacy?

As far as I understood, the following is what happened:

  1. Altivec / VMX (Vector Multimedia eXtensions) is an old SIMD technology for PowerPc. I see it as the old Intel MMX.
  2. The new VSX (Vector Scalar eXtensions) are an upgrade of it but to avoid breaking compatibility with Altivec, they remained 32 registers (VSR32-VSR63) only and Altivec operations can't handle the other VSR0-VSR31. The VSX instructions, however, can operate on all 64 registers (VSR0-VSR63). I see it as the new Intel SSE.

Is that correct?

Sorcim answered 6/9, 2017 at 17:22 Comment(0)
J
7

To clarify the terminology a little:

  • VMX is the earlier implementation of vector support for POWER/PowerPC processors.
  • Altivec is a trademark for VMX; functionally, it should be equivalent
  • VSX is a newer implementation of vector support for POWER processors

VSX adds more vector registers (32 more, but still 128-bits per register), and VSX-specific instructions. As you've found, the higher-numbered VSX registers are shared with those used for VMX operations. Therefore, it'd be inadvisable to mix VMX and VSX instructions in a single process, unless you're careful with register allocations.

I'm not too familiar with Intel's vector implementations, but your analogies sound correct to me.

Jugum answered 7/9, 2017 at 0:32 Comment(2)
What do you mean with "it'd be inadvisable to mix VMX and VSX instructions in a single process, unless you're careful with register allocations"? Specially for gcc's inline assembly, you can use the %x modifier in order to flag that the same Vector Register need to be converted to VSX, like on this example. At most, I thought that it could have some performance issue on multi threading, but single process?!Sorcim
@gut: more that you don't want to inadvertently overwrite one of the VMX register's values by a write to a VSX register (and vice versa).Jugum

© 2022 - 2024 — McMap. All rights reserved.