Skip to content

Commit 6ee2d23

Browse files
committed
Address clang-format issue
1 parent 1a8c3b5 commit 6ee2d23

File tree

6 files changed

+39
-33
lines changed

6 files changed

+39
-33
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2592,7 +2592,7 @@ static bool interp__builtin_ia32_pmadd(
25922592
const Pointer &RHS = S.Stk.pop<Pointer>();
25932593
const Pointer &LHS = S.Stk.pop<Pointer>();
25942594
const Pointer &Dst = S.Stk.peek<Pointer>();
2595-
2595+
25962596
const auto *VT = Call->getArg(0)->getType()->castAs<VectorType>();
25972597
PrimType ElemT = *S.getContext().classify(VT->getElementType());
25982598
unsigned NumElems = VT->getNumElements();
@@ -3482,20 +3482,26 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
34823482
case clang::X86::BI__builtin_ia32_pmaddubsw128:
34833483
case clang::X86::BI__builtin_ia32_pmaddubsw256:
34843484
case clang::X86::BI__builtin_ia32_pmaddubsw512:
3485-
return interp__builtin_ia32_pmadd(S, OpPC, Call,
3486-
[](const APSInt &LoLHS, const APSInt &HiLHS, const APSInt &HiRHS, const APSInt &HiRHS) {
3487-
unsigned BitWidth = 2 * LHS.getBitWidth();
3488-
return (LoLHS.zext(BitWidth) * LoRHS.sext(BitWidth)).sadd_sat((HiLHS.zext(BitWidth) * HiRHS.sext(BitWidth)));
3489-
});
3490-
3485+
return interp__builtin_ia32_pmadd(
3486+
S, OpPC, Call,
3487+
[](const APSInt &LoLHS, const APSInt &HiLHS, const APSInt &HiRHS,
3488+
const APSInt &HiRHS) {
3489+
unsigned BitWidth = 2 * LHS.getBitWidth();
3490+
return (LoLHS.zext(BitWidth) * LoRHS.sext(BitWidth))
3491+
.sadd_sat((HiLHS.zext(BitWidth) * HiRHS.sext(BitWidth)));
3492+
});
3493+
34913494
case clang::X86::BI__builtin_ia32_pmaddwd128:
34923495
case clang::X86::BI__builtin_ia32_pmaddwd256:
34933496
case clang::X86::BI__builtin_ia32_pmaddwd512:
3494-
return interp__builtin_ia32_pmadd(S, OpPC, Call,
3495-
[](const APSInt &LoLHS, const APSInt &HiLHS, const APSInt &HiRHS, const APSInt &HiRHS) {
3496-
unsigned BitWidth = 2 * LHS.getBitWidth();
3497-
return (LoLHS.sext(BitWidth) * LoRHS.sext(BitWidth)) + (HiLHS.sext(BitWidth) * HiRHS.sext(BitWidth));
3498-
});
3497+
return interp__builtin_ia32_pmadd(
3498+
S, OpPC, Call,
3499+
[](const APSInt &LoLHS, const APSInt &HiLHS, const APSInt &HiRHS,
3500+
const APSInt &HiRHS) {
3501+
unsigned BitWidth = 2 * LHS.getBitWidth();
3502+
return (LoLHS.sext(BitWidth) * LoRHS.sext(BitWidth)) +
3503+
(HiLHS.sext(BitWidth) * HiRHS.sext(BitWidth));
3504+
});
34993505

35003506
case clang::X86::BI__builtin_ia32_pmulhuw128:
35013507
case clang::X86::BI__builtin_ia32_pmulhuw256:

clang/lib/AST/ExprConstant.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11805,14 +11805,19 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
1180511805
case clang::X86::BI__builtin_ia32_pmaddubsw128:
1180611806
case clang::X86::BI__builtin_ia32_pmaddubsw256:
1180711807
case clang::X86::BI__builtin_ia32_pmaddubsw512:
11808-
ResultElements.push_back(
11809-
APValue(APSInt((LoLHS.zext(BitWidth) * LoRHS.sext(BitWidth)).sadd_sat((HiLHS.zext(BitWidth) * HiRHS.sext(BitWidth)))), DestUnsigned));
11808+
ResultElements.push_back(APValue(
11809+
APSInt(
11810+
(LoLHS.zext(BitWidth) * LoRHS.sext(BitWidth))
11811+
.sadd_sat((HiLHS.zext(BitWidth) * HiRHS.sext(BitWidth)))),
11812+
DestUnsigned));
1181011813
break;
1181111814
case clang::X86::BI__builtin_ia32_pmaddwd128:
1181211815
case clang::X86::BI__builtin_ia32_pmaddwd256:
1181311816
case clang::X86::BI__builtin_ia32_pmaddwd512:
1181411817
ResultElements.push_back(
11815-
APValue(APSInt((LoLHS.sext(BitWidth) * LoRHS.sext(BitWidth)) + (HiLHS.sext(BitWidth) * HiRHS.sext(BitWidth))), DestUnsigned));
11818+
APValue(APSInt((LoLHS.sext(BitWidth) * LoRHS.sext(BitWidth)) +
11819+
(HiLHS.sext(BitWidth) * HiRHS.sext(BitWidth))),
11820+
DestUnsigned));
1181611821
break;
1181711822
}
1181811823
}

clang/lib/Headers/avx2intrin.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,9 +1036,8 @@ _mm256_hsubs_epi16(__m256i __a, __m256i __b)
10361036
/// A 256-bit vector containing one of the source operands.
10371037
/// \returns A 256-bit vector of [16 x i16] containing the result.
10381038
static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1039-
_mm256_maddubs_epi16(__m256i __a, __m256i __b)
1040-
{
1041-
return (__m256i)__builtin_ia32_pmaddubsw256((__v32qi)__a, (__v32qi)__b);
1039+
_mm256_maddubs_epi16(__m256i __a, __m256i __b) {
1040+
return (__m256i)__builtin_ia32_pmaddubsw256((__v32qi)__a, (__v32qi)__b);
10421041
}
10431042

10441043
/// Multiplies corresponding 16-bit elements of two 256-bit vectors of
@@ -1068,8 +1067,7 @@ _mm256_maddubs_epi16(__m256i __a, __m256i __b)
10681067
/// A 256-bit vector of [16 x i16] containing one of the source operands.
10691068
/// \returns A 256-bit vector of [8 x i32] containing the result.
10701069
static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1071-
_mm256_madd_epi16(__m256i __a, __m256i __b)
1072-
{
1070+
_mm256_madd_epi16(__m256i __a, __m256i __b) {
10731071
return (__m256i)__builtin_ia32_pmaddwd256((__v16hi)__a, (__v16hi)__b);
10741072
}
10751073

clang/lib/Headers/emmintrin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,8 +2290,8 @@ _mm_avg_epu16(__m128i __a, __m128i __b) {
22902290
/// A 128-bit signed [8 x i16] vector.
22912291
/// \returns A 128-bit signed [4 x i32] vector containing the sums of products
22922292
/// of both parameters.
2293-
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR _mm_madd_epi16(__m128i __a,
2294-
__m128i __b) {
2293+
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2294+
_mm_madd_epi16(__m128i __a, __m128i __b) {
22952295
return (__m128i)__builtin_ia32_pmaddwd128((__v8hi)__a, (__v8hi)__b);
22962296
}
22972297

clang/lib/Headers/mmintrin.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,10 +680,9 @@ _mm_subs_pu16(__m64 __m1, __m64 __m2) {
680680
/// \returns A 64-bit integer vector of [2 x i32] containing the sums of
681681
/// products of both parameters.
682682
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
683-
_mm_madd_pi16(__m64 __m1, __m64 __m2)
684-
{
685-
return __trunc64(__builtin_ia32_pmaddwd128((__v8hi)__zext128(__m1),
686-
(__v8hi)__zext128(__m2)));
683+
_mm_madd_pi16(__m64 __m1, __m64 __m2) {
684+
return __trunc64(__builtin_ia32_pmaddwd128((__v8hi)__zext128(__m1),
685+
(__v8hi)__zext128(__m2)));
687686
}
688687

689688
/// Multiplies each 16-bit signed integer element of the first 64-bit

clang/lib/Headers/tmmintrin.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -508,9 +508,8 @@ _mm_hsubs_pi16(__m64 __a, __m64 __b)
508508
/// \a R6 := (\a __a12 * \a __b12) + (\a __a13 * \a __b13) \n
509509
/// \a R7 := (\a __a14 * \a __b14) + (\a __a15 * \a __b15)
510510
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
511-
_mm_maddubs_epi16(__m128i __a, __m128i __b)
512-
{
513-
return (__m128i)__builtin_ia32_pmaddubsw128((__v16qi)__a, (__v16qi)__b);
511+
_mm_maddubs_epi16(__m128i __a, __m128i __b) {
512+
return (__m128i)__builtin_ia32_pmaddubsw128((__v16qi)__a, (__v16qi)__b);
514513
}
515514

516515
/// Multiplies corresponding pairs of packed 8-bit unsigned integer
@@ -538,10 +537,9 @@ _mm_maddubs_epi16(__m128i __a, __m128i __b)
538537
/// \a R2 := (\a __a4 * \a __b4) + (\a __a5 * \a __b5) \n
539538
/// \a R3 := (\a __a6 * \a __b6) + (\a __a7 * \a __b7)
540539
static __inline__ __m64 __DEFAULT_FN_ATTRS_CONSTEXPR
541-
_mm_maddubs_pi16(__m64 __a, __m64 __b)
542-
{
543-
return __trunc64(__builtin_ia32_pmaddubsw128((__v16qi)__zext128(__a),
544-
(__v16qi)__zext128(__b)));
540+
_mm_maddubs_pi16(__m64 __a, __m64 __b) {
541+
return __trunc64(__builtin_ia32_pmaddubsw128((__v16qi)__zext128(__a),
542+
(__v16qi)__zext128(__b)));
545543
}
546544

547545
/// Multiplies packed 16-bit signed integer values, truncates the 32-bit

0 commit comments

Comments
 (0)