Skip to content

Commit

Permalink
e2k: Deal with deprecated inefficient functions of lcc
Browse files Browse the repository at this point in the history
  • Loading branch information
makise-homura committed Feb 11, 2021
1 parent a46b197 commit f4817b6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
11 changes: 10 additions & 1 deletion simde/simde-arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,15 @@
#define SIMDE_BUG_LCC_WARNING_ON_SHIFTS
#define SIMDE_BUG_LCC_XOP_MISSING
#define SIMDE_BUG_LCC_FMA_WRONG_RESULT

/* May be defined to avoid usage of these functions.
* These functions are:
* _mm_clmulepi64_si128 (clmul.h)
* _mm_permute2_ps (xop.h)
* _mm_permute2_pd (xop.h)
* _mm256_permute2_ps (xop.h)
* _mm256_permute2_pd (xop.h)
#define SIMDE_LCC_DISABLE_INEFFICIENT_FUNCTIONS */
#endif

/* HP/PA / PA-RISC
Expand Down Expand Up @@ -317,7 +326,7 @@
# if defined(__GFNI__)
# define SIMDE_ARCH_X86_GFNI 1
# endif
# if defined(__PCLMUL__) && !defined(SIMDE_ARCH_E2K) /* E2K has inefficient implementation of PCLMUL */
# if defined(__PCLMUL__)
# define SIMDE_ARCH_X86_PCLMUL 1
# endif
# if defined(__VPCLMULQDQ__)
Expand Down
6 changes: 6 additions & 0 deletions simde/simde-diagnostic.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@
#define SIMDE_DIAGNOSTIC_DISABLE_USED_BUT_MARKED_UNUSED_
#endif

#if defined(__LCC__)
#define SIMDE_DIAGNOSTIC_DISABLE_LCC_DEPRECATED_FUNCTION_ _Pragma("diag_suppress 1444")
#else
#define SIMDE_DIAGNOSTIC_DISABLE_LCC_DEPRECATED_FUNCTION_
#endif

#if defined(__LCC__)
#define SIMDE_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION_ _Pragma("diag_suppress 3142")
#elif HEDLEY_HAS_WARNING("-Wunused-function")
Expand Down
5 changes: 4 additions & 1 deletion simde/x86/clmul.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@

HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
#if defined(__LCC__) && !defined(SIMDE_LCC_DISABLE_INEFFICIENT_FUNCTIONS)
SIMDE_DIAGNOSTIC_DISABLE_LCC_DEPRECATED_FUNCTION_
#endif
SIMDE_BEGIN_DECLS_

SIMDE_FUNCTION_ATTRIBUTES
Expand Down Expand Up @@ -203,7 +206,7 @@ simde_mm_clmulepi64_si128 (simde__m128i a, simde__m128i b, const int imm8)

return simde__m128i_from_private(r_);
}
#if defined(SIMDE_X86_PCLMUL_NATIVE)
#if defined(SIMDE_X86_PCLMUL_NATIVE) && !defined(SIMDE_LCC_DISABLE_INEFFICIENT_FUNCTIONS)
#define simde_mm_clmulepi64_si128(a, b, imm8) _mm_clmulepi64_si128(a, b, imm8)
#elif defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(__ARM_FEATURE_AES)
#define simde_mm_clmulepi64_si128(a, b, imm8) \
Expand Down
11 changes: 7 additions & 4 deletions simde/x86/xop.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@

HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
#if defined(__LCC__) && !defined(SIMDE_LCC_DISABLE_INEFFICIENT_FUNCTIONS)
SIMDE_DIAGNOSTIC_DISABLE_LCC_DEPRECATED_FUNCTION_
#endif
SIMDE_BEGIN_DECLS_

SIMDE_FUNCTION_ATTRIBUTES
Expand Down Expand Up @@ -3511,7 +3514,7 @@ simde_mm_permute2_ps (simde__m128 a, simde__m128 b, simde__m128i c, const int im

return simde__m128_from_private(r_);
}
#if defined(SIMDE_X86_XOP_NATIVE)
#if defined(SIMDE_X86_XOP_NATIVE) && !defined(SIMDE_LCC_DISABLE_INEFFICIENT_FUNCTIONS)
#define simde_mm_permute2_ps(a, b, c, imm8) _mm_permute2_ps((a), (b), (c), (imm8))
#endif
#if defined(SIMDE_X86_XOP_ENABLE_NATIVE_ALIASES)
Expand Down Expand Up @@ -3547,7 +3550,7 @@ simde_mm_permute2_pd (simde__m128d a, simde__m128d b, simde__m128i c, const int

return simde__m128d_from_private(r_);
}
#if defined(SIMDE_X86_XOP_NATIVE)
#if defined(SIMDE_X86_XOP_NATIVE) && !defined(SIMDE_LCC_DISABLE_INEFFICIENT_FUNCTIONS)
#define simde_mm_permute2_pd(a, b, c, imm8) _mm_permute2_pd((a), (b), (c), (imm8))
#endif
#if defined(SIMDE_X86_XOP_ENABLE_NATIVE_ALIASES)
Expand Down Expand Up @@ -3589,7 +3592,7 @@ simde_mm256_permute2_ps (simde__m256 a, simde__m256 b, simde__m256i c, const int

return simde__m256_from_private(r_);
}
#if defined(SIMDE_X86_XOP_NATIVE)
#if defined(SIMDE_X86_XOP_NATIVE) && !defined(SIMDE_LCC_DISABLE_INEFFICIENT_FUNCTIONS)
#define simde_mm256_permute2_ps(a, b, c, imm8) _mm256_permute2_ps((a), (b), (c), (imm8))
#endif
#if defined(SIMDE_X86_XOP_ENABLE_NATIVE_ALIASES)
Expand Down Expand Up @@ -3631,7 +3634,7 @@ simde_mm256_permute2_pd (simde__m256d a, simde__m256d b, simde__m256i c, const i

return simde__m256d_from_private(r_);
}
#if defined(SIMDE_X86_XOP_NATIVE)
#if defined(SIMDE_X86_XOP_NATIVE) && !defined(SIMDE_LCC_DISABLE_INEFFICIENT_FUNCTIONS)
#define simde_mm256_permute2_pd(a, b, c, imm8) _mm256_permute2_pd((a), (b), (c), (imm8))
#endif
#if defined(SIMDE_X86_XOP_ENABLE_NATIVE_ALIASES)
Expand Down

0 comments on commit f4817b6

Please sign in to comment.