Skip to content

Commit f251199

Browse files
author
git apple-llvm automerger
committed
Merge commit 'edad89e4e052' from llvm.org/main into next
2 parents e806940 + edad89e commit f251199

File tree

3 files changed

+54
-27
lines changed

3 files changed

+54
-27
lines changed

clang/lib/Headers/emmintrin.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,8 +2127,9 @@ _mm_add_epi32(__m128i __a, __m128i __b) {
21272127
/// \param __b
21282128
/// A 64-bit integer.
21292129
/// \returns A 64-bit integer containing the sum of both parameters.
2130-
static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_add_si64(__m64 __a, __m64 __b) {
2131-
return (__m64)(((unsigned long long)__a) + ((unsigned long long)__b));
2130+
static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_add_si64(__m64 __a,
2131+
__m64 __b) {
2132+
return (__m64)(((__v1du)__a)[0] + ((__v1du)__b)[0]);
21322133
}
21332134

21342135
/// Adds the corresponding elements of two 128-bit vectors of [2 x i64],
@@ -2557,8 +2558,9 @@ _mm_sub_epi32(__m128i __a, __m128i __b) {
25572558
/// A 64-bit integer vector containing the subtrahend.
25582559
/// \returns A 64-bit integer vector containing the difference of the values in
25592560
/// the operands.
2560-
static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sub_si64(__m64 __a, __m64 __b) {
2561-
return (__m64)((unsigned long long)__a - (unsigned long long)__b);
2561+
static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_sub_si64(__m64 __a,
2562+
__m64 __b) {
2563+
return (__m64)(((__v1du)__a)[0] - ((__v1du)__b)[0]);
25622564
}
25632565

25642566
/// Subtracts the corresponding elements of two [2 x i64] vectors.

clang/lib/Headers/mmintrin.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ _mm_empty(void) {
8585
/// A 32-bit integer value.
8686
/// \returns A 64-bit integer vector. The lower 32 bits contain the value of the
8787
/// parameter. The upper 32 bits are set to 0.
88-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
88+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
8989
_mm_cvtsi32_si64(int __i)
9090
{
9191
return __extension__ (__m64)(__v2si){__i, 0};
@@ -102,7 +102,7 @@ _mm_cvtsi32_si64(int __i)
102102
/// A 64-bit integer vector.
103103
/// \returns A 32-bit signed integer value containing the lower 32 bits of the
104104
/// parameter.
105-
static __inline__ int __DEFAULT_FN_ATTRS_SSE2
105+
static __inline__ int __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
106106
_mm_cvtsi64_si32(__m64 __m)
107107
{
108108
return ((__v2si)__m)[0];
@@ -118,10 +118,10 @@ _mm_cvtsi64_si32(__m64 __m)
118118
/// A 64-bit signed integer.
119119
/// \returns A 64-bit integer vector containing the same bitwise pattern as the
120120
/// parameter.
121-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
121+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
122122
_mm_cvtsi64_m64(long long __i)
123123
{
124-
return (__m64)__i;
124+
return __extension__ (__m64)(__v1di){__i};
125125
}
126126

127127
/// Casts a 64-bit integer vector into a 64-bit signed integer value.
@@ -134,10 +134,10 @@ _mm_cvtsi64_m64(long long __i)
134134
/// A 64-bit integer vector.
135135
/// \returns A 64-bit signed integer containing the same bitwise pattern as the
136136
/// parameter.
137-
static __inline__ long long __DEFAULT_FN_ATTRS_SSE2
137+
static __inline__ long long __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
138138
_mm_cvtm64_si64(__m64 __m)
139139
{
140-
return (long long)__m;
140+
return ((__v1di)__m)[0];
141141
}
142142

143143
/// Converts, with saturation, 16-bit signed integers from both 64-bit integer
@@ -379,7 +379,7 @@ _mm_unpacklo_pi32(__m64 __m1, __m64 __m2)
379379
/// A 64-bit integer vector of [8 x i8].
380380
/// \returns A 64-bit integer vector of [8 x i8] containing the sums of both
381381
/// parameters.
382-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
382+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
383383
_mm_add_pi8(__m64 __m1, __m64 __m2)
384384
{
385385
return (__m64)(((__v8qu)__m1) + ((__v8qu)__m2));
@@ -400,7 +400,7 @@ _mm_add_pi8(__m64 __m1, __m64 __m2)
400400
/// A 64-bit integer vector of [4 x i16].
401401
/// \returns A 64-bit integer vector of [4 x i16] containing the sums of both
402402
/// parameters.
403-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
403+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
404404
_mm_add_pi16(__m64 __m1, __m64 __m2)
405405
{
406406
return (__m64)(((__v4hu)__m1) + ((__v4hu)__m2));
@@ -421,7 +421,7 @@ _mm_add_pi16(__m64 __m1, __m64 __m2)
421421
/// A 64-bit integer vector of [2 x i32].
422422
/// \returns A 64-bit integer vector of [2 x i32] containing the sums of both
423423
/// parameters.
424-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
424+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
425425
_mm_add_pi32(__m64 __m1, __m64 __m2)
426426
{
427427
return (__m64)(((__v2su)__m1) + ((__v2su)__m2));
@@ -536,7 +536,7 @@ _mm_adds_pu16(__m64 __m1, __m64 __m2)
536536
/// A 64-bit integer vector of [8 x i8] containing the subtrahends.
537537
/// \returns A 64-bit integer vector of [8 x i8] containing the differences of
538538
/// both parameters.
539-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
539+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
540540
_mm_sub_pi8(__m64 __m1, __m64 __m2)
541541
{
542542
return (__m64)(((__v8qu)__m1) - ((__v8qu)__m2));
@@ -557,7 +557,7 @@ _mm_sub_pi8(__m64 __m1, __m64 __m2)
557557
/// A 64-bit integer vector of [4 x i16] containing the subtrahends.
558558
/// \returns A 64-bit integer vector of [4 x i16] containing the differences of
559559
/// both parameters.
560-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
560+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
561561
_mm_sub_pi16(__m64 __m1, __m64 __m2)
562562
{
563563
return (__m64)(((__v4hu)__m1) - ((__v4hu)__m2));
@@ -578,7 +578,7 @@ _mm_sub_pi16(__m64 __m1, __m64 __m2)
578578
/// A 64-bit integer vector of [2 x i32] containing the subtrahends.
579579
/// \returns A 64-bit integer vector of [2 x i32] containing the differences of
580580
/// both parameters.
581-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
581+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
582582
_mm_sub_pi32(__m64 __m1, __m64 __m2)
583583
{
584584
return (__m64)(((__v2su)__m1) - ((__v2su)__m2));
@@ -745,7 +745,7 @@ _mm_mulhi_pi16(__m64 __m1, __m64 __m2)
745745
/// A 64-bit integer vector of [4 x i16].
746746
/// \returns A 64-bit integer vector of [4 x i16] containing the lower 16 bits
747747
/// of the products of both parameters.
748-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
748+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
749749
_mm_mullo_pi16(__m64 __m1, __m64 __m2)
750750
{
751751
return (__m64)(((__v4hu)__m1) * ((__v4hu)__m2));
@@ -1134,7 +1134,7 @@ _mm_srli_si64(__m64 __m, int __count)
11341134
/// A 64-bit integer vector.
11351135
/// \returns A 64-bit integer vector containing the bitwise AND of both
11361136
/// parameters.
1137-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1137+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
11381138
_mm_and_si64(__m64 __m1, __m64 __m2)
11391139
{
11401140
return (__m64)(((__v1du)__m1) & ((__v1du)__m2));
@@ -1155,7 +1155,7 @@ _mm_and_si64(__m64 __m1, __m64 __m2)
11551155
/// A 64-bit integer vector.
11561156
/// \returns A 64-bit integer vector containing the bitwise AND of the second
11571157
/// parameter and the one's complement of the first parameter.
1158-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1158+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
11591159
_mm_andnot_si64(__m64 __m1, __m64 __m2)
11601160
{
11611161
return (__m64)(~((__v1du)__m1) & ((__v1du)__m2));
@@ -1173,7 +1173,7 @@ _mm_andnot_si64(__m64 __m1, __m64 __m2)
11731173
/// A 64-bit integer vector.
11741174
/// \returns A 64-bit integer vector containing the bitwise OR of both
11751175
/// parameters.
1176-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1176+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
11771177
_mm_or_si64(__m64 __m1, __m64 __m2)
11781178
{
11791179
return (__m64)(((__v1du)__m1) | ((__v1du)__m2));
@@ -1191,7 +1191,7 @@ _mm_or_si64(__m64 __m1, __m64 __m2)
11911191
/// A 64-bit integer vector.
11921192
/// \returns A 64-bit integer vector containing the bitwise exclusive OR of both
11931193
/// parameters.
1194-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1194+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
11951195
_mm_xor_si64(__m64 __m1, __m64 __m2)
11961196
{
11971197
return (__m64)(((__v1du)__m1) ^ ((__v1du)__m2));
@@ -1213,7 +1213,7 @@ _mm_xor_si64(__m64 __m1, __m64 __m2)
12131213
/// A 64-bit integer vector of [8 x i8].
12141214
/// \returns A 64-bit integer vector of [8 x i8] containing the comparison
12151215
/// results.
1216-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1216+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
12171217
_mm_cmpeq_pi8(__m64 __m1, __m64 __m2)
12181218
{
12191219
return (__m64)(((__v8qi)__m1) == ((__v8qi)__m2));
@@ -1235,7 +1235,7 @@ _mm_cmpeq_pi8(__m64 __m1, __m64 __m2)
12351235
/// A 64-bit integer vector of [4 x i16].
12361236
/// \returns A 64-bit integer vector of [4 x i16] containing the comparison
12371237
/// results.
1238-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1238+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
12391239
_mm_cmpeq_pi16(__m64 __m1, __m64 __m2)
12401240
{
12411241
return (__m64)(((__v4hi)__m1) == ((__v4hi)__m2));
@@ -1257,7 +1257,7 @@ _mm_cmpeq_pi16(__m64 __m1, __m64 __m2)
12571257
/// A 64-bit integer vector of [2 x i32].
12581258
/// \returns A 64-bit integer vector of [2 x i32] containing the comparison
12591259
/// results.
1260-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1260+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
12611261
_mm_cmpeq_pi32(__m64 __m1, __m64 __m2)
12621262
{
12631263
return (__m64)(((__v2si)__m1) == ((__v2si)__m2));
@@ -1279,7 +1279,7 @@ _mm_cmpeq_pi32(__m64 __m1, __m64 __m2)
12791279
/// A 64-bit integer vector of [8 x i8].
12801280
/// \returns A 64-bit integer vector of [8 x i8] containing the comparison
12811281
/// results.
1282-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1282+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
12831283
_mm_cmpgt_pi8(__m64 __m1, __m64 __m2)
12841284
{
12851285
/* This function always performs a signed comparison, but __v8qi is a char
@@ -1303,7 +1303,7 @@ _mm_cmpgt_pi8(__m64 __m1, __m64 __m2)
13031303
/// A 64-bit integer vector of [4 x i16].
13041304
/// \returns A 64-bit integer vector of [4 x i16] containing the comparison
13051305
/// results.
1306-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1306+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
13071307
_mm_cmpgt_pi16(__m64 __m1, __m64 __m2)
13081308
{
13091309
return (__m64)((__v4hi)__m1 > (__v4hi)__m2);
@@ -1325,7 +1325,7 @@ _mm_cmpgt_pi16(__m64 __m1, __m64 __m2)
13251325
/// A 64-bit integer vector of [2 x i32].
13261326
/// \returns A 64-bit integer vector of [2 x i32] containing the comparison
13271327
/// results.
1328-
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
1328+
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
13291329
_mm_cmpgt_pi32(__m64 __m1, __m64 __m2)
13301330
{
13311331
return (__m64)((__v2si)__m1 > (__v2si)__m2);

0 commit comments

Comments
 (0)