Altivec registers in ppc64 u/sigcontext

Steve Munroe sjmunroe at
Thu Nov 27 03:59:46 EST 2003

Benjamin Herrenschmidt writes:

> I have a problem implementing the proper altivec stuffs on the signal
> frame and context frames (based on current ameslab-2.5).

On reflection the use of VRSAVE is a tertiary test for VMX context. The
primary and secondary controls are AT_HWCAP has VMX and the setting of
sigcontext.v_regs. For GLIBC the AT_HWCAP flag will be picked up in
libc_start_main and stored in a static flag. This flag will be used by
setjmp/longjmp and *context. If FALSE then VMX regs are not touched. This
required to allow integrated GLIBC VMX support to run on non-VMX hardware.
The sigcontext.v_regs pointer should be set (!=NULL) only if the VMX is
supported and can be set NULL if VMX is supported but not in use by this
process. The state of VRSAVE can only be tested/set if AT_HWCAP has VMX and
sigcontext.v_regs is != NULL.

So VRSAVE can only be user as a final optimization to avoid saving a subset
of the VRs.

Steven J. Munroe
Power Linux Toolchain Architect
IBM Corporation, Linux Technology Center

** Sent via the linuxppc64-dev mail list. See

More information about the Linuxppc64-dev mailing list