| Index: src/IceTargetLoweringX86BaseImpl.h
|
| diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h
|
| index 01e2be0aca3697d2e6c71220c214587b8baccd0b..804c53a57799c541e0cd16fa2344c8f644eec605 100644
|
| --- a/src/IceTargetLoweringX86BaseImpl.h
|
| +++ b/src/IceTargetLoweringX86BaseImpl.h
|
| @@ -2488,7 +2488,8 @@ void TargetX86Base<TraitsType>::lowerCall(const InstCall *Instr) {
|
| Variable::NoRegister)) {
|
| XmmArgs.push_back(Arg);
|
| } else if (isScalarFloatingType(Ty) && Traits::X86_PASS_SCALAR_FP_IN_XMM &&
|
| - (Traits::getRegisterForXmmArgNum(0) != Variable::NoRegister)) {
|
| + (Traits::getRegisterForXmmArgNum(XmmArgs.size()) !=
|
| + Variable::NoRegister)) {
|
| XmmArgs.push_back(Arg);
|
| } else if (isScalarIntegerType(Ty) &&
|
| (Traits::getRegisterForGprArgNum(Ty, GprArgs.size()) !=
|
| @@ -4633,15 +4634,30 @@ void TargetX86Base<TraitsType>::lowerCountZeros(bool Cttz, Type Ty,
|
| Variable *T_Dest = makeReg(DestTy);
|
| Constant *_31 = Ctx->getConstantInt32(31);
|
| Constant *_32 = Ctx->getConstantInt(DestTy, 32);
|
| + Constant *_63 = Ctx->getConstantInt(DestTy, 63);
|
| + Constant *_64 = Ctx->getConstantInt(DestTy, 64);
|
| if (Cttz) {
|
| - _mov(T_Dest, _32);
|
| + if (DestTy == IceType_i64) {
|
| + _mov(T_Dest, _64);
|
| + } else {
|
| + _mov(T_Dest, _32);
|
| + }
|
| } else {
|
| - Constant *_63 = Ctx->getConstantInt(DestTy, 63);
|
| - _mov(T_Dest, _63);
|
| + Constant *_127 = Ctx->getConstantInt(DestTy, 127);
|
| + if (DestTy == IceType_i64) {
|
| + _mov(T_Dest, _127);
|
| + } else {
|
| + _mov(T_Dest, _63);
|
| + }
|
| }
|
| _cmov(T_Dest, T, Traits::Cond::Br_ne);
|
| if (!Cttz) {
|
| - _xor(T_Dest, _31);
|
| + if (DestTy == IceType_i64) {
|
| + Constant *_63 = Ctx->getConstantInt32(63);
|
| + _xor(T_Dest, _63);
|
| + } else {
|
| + _xor(T_Dest, _31);
|
| + }
|
| }
|
| if (Traits::Is64Bit || Ty == IceType_i32) {
|
| _mov(Dest, T_Dest);
|
|
|