0001-Use-the-standard-code-path-of-sljit_emit_cmov-on-mips-r6.patch 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. From 5d7f6573c1eef30a9720edd31a92c1a4b99b7d86 Mon Sep 17 00:00:00 2001
  2. From: Zoltan Herczeg <zherczeg.u-szeged@partner.samsung.com>
  3. Date: Tue, 3 Nov 2020 14:12:01 +0100
  4. Subject: [PATCH] Use the standard code path of sljit_emit_cmov on mips r6.
  5. (#97)
  6. [Retrieved (and updated to fix paths) from:
  7. https://github.com/zherczeg/sljit/commit/5d7f6573c1eef30a9720edd31a92c1a4b99b7d86
  8. SVN commit: https://vcs.pcre.org/pcre2?view=revision&revision=1281]
  9. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  10. ---
  11. sljit_src/sljitLir.c | 2 +-
  12. sljit_src/sljitNativeMIPS_common.c | 8 ++++----
  13. 2 files changed, 5 insertions(+), 5 deletions(-)
  14. diff --git a/src/sljit/sljitLir.c b/src/sljit/sljitLir.c
  15. index 4078613..d817c90 100644
  16. --- a/src/sljit/sljitLir.c
  17. +++ b/src/sljit/sljitLir.c
  18. @@ -2043,7 +2043,7 @@ static SLJIT_INLINE sljit_s32 emit_mov_before_return(struct sljit_compiler *comp
  19. #if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) \
  20. || (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC) \
  21. || (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) \
  22. - || ((defined SLJIT_CONFIG_MIPS && SLJIT_CONFIG_MIPS) && !(defined SLJIT_MIPS_REV && SLJIT_MIPS_REV >= 1))
  23. + || ((defined SLJIT_CONFIG_MIPS && SLJIT_CONFIG_MIPS) && !(defined SLJIT_MIPS_REV && SLJIT_MIPS_REV >= 1 && SLJIT_MIPS_REV < 6))
  24. static SLJIT_INLINE sljit_s32 sljit_emit_cmov_generic(struct sljit_compiler *compiler, sljit_s32 type,
  25. sljit_s32 dst_reg,
  26. diff --git a/src/sljit/sljitNativeMIPS_common.c b/src/sljit/sljitNativeMIPS_common.c
  27. index 8b8c12a..ecf4dac 100644
  28. --- a/src/sljit/sljitNativeMIPS_common.c
  29. +++ b/src/sljit/sljitNativeMIPS_common.c
  30. @@ -2186,14 +2186,14 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compil
  31. sljit_s32 dst_reg,
  32. sljit_s32 src, sljit_sw srcw)
  33. {
  34. -#if (defined SLJIT_MIPS_REV && SLJIT_MIPS_REV >= 1)
  35. +#if (defined SLJIT_MIPS_REV && SLJIT_MIPS_REV >= 1 && SLJIT_MIPS_REV < 6)
  36. sljit_ins ins;
  37. -#endif /* SLJIT_MIPS_REV >= 1 */
  38. +#endif /* SLJIT_MIPS_REV >= 1 && SLJIT_MIPS_REV < 6 */
  39. CHECK_ERROR();
  40. CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw));
  41. -#if (defined SLJIT_MIPS_REV && SLJIT_MIPS_REV >= 1)
  42. +#if (defined SLJIT_MIPS_REV && SLJIT_MIPS_REV >= 1 && SLJIT_MIPS_REV < 6)
  43. if (SLJIT_UNLIKELY(src & SLJIT_IMM)) {
  44. #if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
  45. @@ -2250,7 +2250,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compil
  46. return push_inst(compiler, ins | S(src) | D(dst_reg), DR(dst_reg));
  47. -#else /* SLJIT_MIPS_REV < 1 */
  48. +#else /* SLJIT_MIPS_REV < 1 || SLJIT_MIPS_REV >= 6 */
  49. return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw);
  50. #endif /* SLJIT_MIPS_REV >= 1 */
  51. }