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
2.0 KiB

  1. From 2c8b9d5807a515a0ff859899065f512beabcbaed Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?=C5=A0imon=20Bo=C5=99ek?= <simon.borek@nic.cz>
  3. Date: Sat, 16 Jul 2022 18:39:55 +0200
  4. Subject: [PATCH] PPC/e500 with SPE enabled: use soft float instead of failing
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. This allows building LuaJit for systems with Power ISA SPE
  9. extension[^1] support by using soft float on LuaJit side.
  10. While e500 CPU cores support SPE instruction set extension
  11. allowing them to perform floating point arithmetic natively,
  12. this isn't required. They can function with software floating
  13. point to integer arithmetic translation as well,
  14. just like FPU-less PowerPC CPUs without SPE support.
  15. Therefore I see no need to prevent them from running LuaJit
  16. explicitly.
  17. [^1]: https://www.nxp.com/docs/en/reference-manual/SPEPEM.pdf
  18. Signed-off-by: Pali Rohár <pali@kernel.org>
  19. Signed-off-by: Šimon Bořek <simon.borek@nic.cz>
  20. ---
  21. src/lj_arch.h | 7 ++-----
  22. 1 file changed, 2 insertions(+), 5 deletions(-)
  23. --- a/src/lj_arch.h
  24. +++ b/src/lj_arch.h
  25. @@ -256,7 +256,7 @@
  26. #define LJ_ARCH_NAME "ppc"
  27. #if !defined(LJ_ARCH_HASFPU)
  28. -#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
  29. +#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE) || defined(__NO_FPRS__)
  30. #define LJ_ARCH_HASFPU 0
  31. #else
  32. #define LJ_ARCH_HASFPU 1
  33. @@ -264,7 +264,7 @@
  34. #endif
  35. #if !defined(LJ_ABI_SOFTFP)
  36. -#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
  37. +#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE) || defined(__NO_FPRS__)
  38. #define LJ_ABI_SOFTFP 1
  39. #else
  40. #define LJ_ABI_SOFTFP 0
  41. @@ -442,9 +442,6 @@
  42. #if LJ_ARCH_PPC64
  43. #error "No support for PowerPC 64 bit mode (yet)"
  44. #endif
  45. -#if defined(__NO_FPRS__) && !defined(_SOFT_FLOAT)
  46. -#error "No support for PPC/e500 anymore (use LuaJIT 2.0)"
  47. -#endif
  48. #elif LJ_TARGET_MIPS32
  49. #if !((defined(_MIPS_SIM_ABI32) && _MIPS_SIM == _MIPS_SIM_ABI32) || (defined(_ABIO32) && _MIPS_SIM == _ABIO32))
  50. #error "Only o32 ABI supported for MIPS32"