mike.dvoretsky added inline comments.
================ Comment at: lib/CodeGen/CGBuiltin.cpp:8443 + Value *MaxVec = llvm::ConstantInt::get(RTy, MaxVal); + Res = EmitX86MinMax(CGF, ICmpInst::ICMP_SLT, {Res, MaxVec}); + Res = EmitX86MinMax(CGF, ICmpInst::ICMP_SGT, {Res, MinVec}); ---------------- craig.topper wrote: > Why arent' these unsigned compares for Unsigned? The compares are signed on purpose. PACKUS assumes that the input elements are signed, then uses unsigned saturation. So, for instance, an 0xffff value must be evaluated as -1 and saturated to 0, rather than to 0xff as it would be with unsigned comparisons. Repository: rC Clang https://reviews.llvm.org/D45720 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits