craig.topper added inline comments.
================ Comment at: lib/CodeGen/CGBuiltin.cpp:7897 + Value *MaxVec = CGF.Builder.CreateVectorSplat(NumElements, Max); + Value *ExtMaxVec = Signed ? CGF.Builder.CreateSExt(MaxVec, ExtType) + : CGF.Builder.CreateZExt(MaxVec, ExtType); ---------------- Can we just create the constant in the extended type? ================ Comment at: lib/CodeGen/CGBuiltin.cpp:7910 + llvm::APInt::getSignedMinValue(ElementType->getPrimitiveSizeInBits()); + Value *Min = llvm::ConstantInt::get(ElementType, SignedMinValue); + Value *MinVec = CGF.Builder.CreateVectorSplat(NumElements, Min); ---------------- ConstantInt::get should be able to splat on its own if you give it a vector type. Same with getAllOnesValue above ================ Comment at: lib/CodeGen/CGBuiltin.cpp:8922 + case X86::BI__builtin_ia32_psubusw128: + return EmitX86AddSubSatExpr(*this, E, Ops, false, false); // Substraction, unsigned. + case X86::BI__builtin_ia32_psubsb512_mask: ---------------- Substraction->Subtraction ================ Comment at: lib/CodeGen/CGBuiltin.cpp:8929 + case X86::BI__builtin_ia32_psubsw128: + return EmitX86AddSubSatExpr(*this, E, Ops, false, true); // Substraction, signed. } ---------------- Substraction->Subtraction Repository: rC Clang https://reviews.llvm.org/D44786 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits