Index: src/IceTargetLoweringX8632.cpp |
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp |
index 1cb079e0ebffff07a102638c7dba97ec9c0c323d..0a41cc8d950a0c2aae25a1074c745ccc5be6d9d5 100644 |
--- a/src/IceTargetLoweringX8632.cpp |
+++ b/src/IceTargetLoweringX8632.cpp |
@@ -3094,6 +3094,10 @@ void TargetX8632::lowerIntrinsicCall(const InstIntrinsicCall *Instr) { |
Type Ty = Src->getType(); |
Variable *Dest = Instr->getDest(); |
Variable *T = makeVectorOfFabsMask(Ty); |
+ // The pand instruction operates on an m128 memory operand, so if |
+ // Src is an f32 or f64, we need to make sure it's in a register. |
+ if (!isVectorType(Ty)) |
+ Src = legalizeToVar(Src); |
_pand(T, Src); |
if (isVectorType(Ty)) |
_movp(Dest, T); |