Skip to content

Commit 831dafd

Browse files
committed
Rebase
1 parent ec83291 commit 831dafd

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,9 @@ let Features = "avx2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] i
602602
def mpsadbw256 : X86Builtin<"_Vector<32, char>(_Vector<32, char>, _Vector<32, char>, _Constant char)">;
603603
def palignr256 : X86Builtin<"_Vector<32, char>(_Vector<32, char>, "
604604
"_Vector<32, char>, _Constant int)">;
605-
def pmulhrsw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Vector<16, short>)">;
605+
def pmulhrsw256
606+
: X86Builtin<
607+
"_Vector<16, short>(_Vector<16, short>, _Vector<16, short>)">;
606608
def psadbw256 : X86Builtin<"_Vector<4, long long int>(_Vector<32, char>, _Vector<32, char>)">;
607609
def psignb256 : X86Builtin<"_Vector<32, char>(_Vector<32, char>, _Vector<32, char>)">;
608610
def psignw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Vector<16, short>)">;

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2912,21 +2912,20 @@ static bool interp__builtin_ia32_movmsk_op(InterpState &S, CodePtr OpPC,
29122912
S.getASTContext().getTypeSize(Call->getType()); // Always 32-bit integer.
29132913
APInt Result(ResultLen, 0);
29142914

2915-
for (unsigned I = 0; I != SourceLen; ++I) {
2916-
APInt Elem;
2917-
if (ElemQT->isIntegerType()) {
2918-
INT_TYPE_SWITCH_NO_BOOL(*ElemT,
2919-
{ Elem = Source.elem<T>(I).toAPSInt(); });
2920-
} else if (ElemQT->isRealFloatingType()) {
2921-
using T = PrimConv<PT_Float>::T;
2922-
Elem = Source.elem<T>(I).getAPFloat().bitcastToAPInt();
2923-
} else {
2924-
return false;
2925-
}
2926-
Result.setBitVal(I, Elem.isNegative());
2915+
for (unsigned I = 0; I != SourceLen; ++I) {
2916+
APInt Elem;
2917+
if (ElemQT->isIntegerType()) {
2918+
INT_TYPE_SWITCH_NO_BOOL(*ElemT, { Elem = Source.elem<T>(I).toAPSInt(); });
2919+
} else if (ElemQT->isRealFloatingType()) {
2920+
using T = PrimConv<PT_Float>::T;
2921+
Elem = Source.elem<T>(I).getAPFloat().bitcastToAPInt();
2922+
} else {
2923+
return false;
29272924
}
2928-
pushInteger(S, Result, Call->getType());
2929-
return true;
2925+
Result.setBitVal(I, Elem.isNegative());
2926+
}
2927+
pushInteger(S, Result, Call->getType());
2928+
return true;
29302929
}
29312930

29322931
static bool interp__builtin_elementwise_triop(

0 commit comments

Comments
 (0)