The following proposed patch disables setting, saving and restoring
the VRSAVE register on all targets except Darwin.

VRSAVE was removed from the AIX ABI and was suppose to have been
removed from the PPC SVR4 ABI.  All recent versions of the Linux
kernel set and maintain VRSAVE itself, as a process-level flag, not as
individual bits, so no need for the compiler to set the register or to
save and restore it across calls.  All uses of VRSAVE (e.g., GLibc)
will continue to work using the value set by the kernel.

I don't think you can assume all embedded users do not use VRSAVE (or
even the majority).  And what about *BSD?

*************** rs6000_stack_info (void)
*** 17842,17848 ****
    else
      info_ptr->spe_gp_size = 0;

!   if (TARGET_ALTIVEC_ABI)
      info_ptr->vrsave_mask = compute_vrsave_mask ();
    else
      info_ptr->vrsave_mask = 0;
--- 17838,17845 ----
    else
      info_ptr->spe_gp_size = 0;

!   /* Only set VRSAVE register on Darwin.  */
!   if (DEFAULT_ABI == ABI_DARWIN)
      info_ptr->vrsave_mask = compute_vrsave_mask ();
    else
      info_ptr->vrsave_mask = 0;

This does completely disable VRSAVE setting -- it seems to me it
should be  if (TARGET_ALTIVEC_ABI && TARGET_ALTIVEC_VRSAVE)  in
the first place, and then you don't need the change when changing
the default for -mvrsave like this patch does?


Segher

Reply via email to