Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: src/IceTargetLoweringX86BaseImpl.h

Issue 1631383002: Subzero. X8664. Fixes various small bugs. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInstX86BaseImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/IceInstX86BaseImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698