OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.9 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../uclibc/pkg_patch/gcc-900-crt-align-1.patch
  5. # Copyright (C) 2006 The OpenSDE Project
  6. # Copyright (C) 2006 The T2 SDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This patch file is dual-licensed. It is available under the license the
  11. # patched project is licensed under, as long as it is an OpenSource license
  12. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  13. # of the GNU General Public License as published by the Free Software
  14. # Foundation; either version 2 of the License, or (at your option) any later
  15. # version.
  16. # --- SDE-COPYRIGHT-NOTE-END ---
  17. 2006-03-18 H.J. Lu <hongjiu.lu@intel.com>
  18. * config/i386/crtfastmath.c (set_fast_math): Align fxsave to
  19. 16byte by hand.
  20. Reference:
  21. http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01179.html
  22. --- ./gcc/config/i386/crtfastmath.c.align 2005-11-04 14:13:48.000000000 -0800
  23. +++ ./gcc/config/i386/crtfastmath.c 2006-03-18 08:34:13.000000000 -0800
  24. @@ -75,7 +75,7 @@ set_fast_math (void)
  25. if (edx & FXSAVE)
  26. {
  27. /* Check if DAZ is available. */
  28. - struct
  29. + struct fxsave
  30. {
  31. unsigned short int cwd;
  32. unsigned short int swd;
  33. @@ -90,13 +90,17 @@ set_fast_math (void)
  34. long int st_space[32];
  35. long int xmm_space[32];
  36. long int padding[56];
  37. - } __attribute__ ((aligned (16))) fxsave;
  38. + } *fxsave;
  39. - __builtin_memset (&fxsave, 0, sizeof (fxsave));
  40. + fxsave = (struct fxsave *)
  41. + (((unsigned long) __builtin_alloca (sizeof (*fxsave) + 15))
  42. + & ~15L);
  43. - asm volatile ("fxsave %0" : "=m" (fxsave) : "m" (fxsave));
  44. + __builtin_memset (fxsave, 0, sizeof (*fxsave));
  45. - if (fxsave.mxcsr_mask & MXCSR_DAZ)
  46. + asm volatile ("fxsave %0" : "=m" (*fxsave) : "m" (*fxsave));
  47. +
  48. + if (fxsave->mxcsr_mask & MXCSR_DAZ)
  49. mxcsr |= MXCSR_DAZ;
  50. }