vfpmacros.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * arch/arm/include/asm/vfpmacros.h
  3. *
  4. * Assembler-only file containing VFP macros and register definitions.
  5. */
  6. #include "vfp.h"
  7. @ Macros to allow building with old toolkits (with no VFP support)
  8. .macro VFPFMRX, rd, sysreg, cond
  9. MRC\cond p10, 7, \rd, \sysreg, cr0, 0 @ FMRX \rd, \sysreg
  10. .endm
  11. .macro VFPFMXR, sysreg, rd, cond
  12. MCR\cond p10, 7, \rd, \sysreg, cr0, 0 @ FMXR \sysreg, \rd
  13. .endm
  14. @ read all the working registers back into the VFP
  15. .macro VFPFLDMIA, base, tmp
  16. #if __LINUX_ARM_ARCH__ < 6
  17. LDC p11, cr0, [\base],#33*4 @ FLDMIAX \base!, {d0-d15}
  18. #else
  19. LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15}
  20. #endif
  21. #ifdef CONFIG_VFPv3
  22. VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
  23. and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
  24. cmp \tmp, #2 @ 32 x 64bit registers?
  25. ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
  26. addne \base, \base, #32*4 @ step over unused register space
  27. #endif
  28. .endm
  29. @ write all the working registers out of the VFP
  30. .macro VFPFSTMIA, base, tmp
  31. #if __LINUX_ARM_ARCH__ < 6
  32. STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15}
  33. #else
  34. STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15}
  35. #endif
  36. #ifdef CONFIG_VFPv3
  37. VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
  38. and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
  39. cmp \tmp, #2 @ 32 x 64bit registers?
  40. stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
  41. addne \base, \base, #32*4 @ step over unused register space
  42. #endif
  43. .endm