Skip to content

Commit 5031c16

Browse files
authored
[Headers][X86] _mm_cmpgt_epi64 is only available on SSE42 targets (#160491)
smmintrin.h redefines __DEFAULT_FN_ATTRS half way through the file to handle SSE42-only instructions - when we made _mm_cmpgt_epi64 constexpr we failed to redefine __DEFAULT_FN_ATTRS_CONSTEXPR as well to match
1 parent 290c2a7 commit 5031c16

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

clang/lib/Headers/smmintrin.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,9 +1534,16 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_minpos_epu16(__m128i __V) {
15341534
so we'll do the same. */
15351535

15361536
#undef __DEFAULT_FN_ATTRS
1537+
#undef __DEFAULT_FN_ATTRS_CONSTEXPR
15371538
#define __DEFAULT_FN_ATTRS \
15381539
__attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))
15391540

1541+
#if defined(__cplusplus) && (__cplusplus >= 201103L)
1542+
#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
1543+
#else
1544+
#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
1545+
#endif
1546+
15401547
/* These specify the type of data that we're comparing. */
15411548
#define _SIDD_UBYTE_OPS 0x00
15421549
#define _SIDD_UWORD_OPS 0x01

0 commit comments

Comments
 (0)