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

Unified Diff: src/IceTargetLoweringMIPS32.cpp

Issue 2354293002: Subzero, MIPS32: Intrinsic call Ctlz for i32 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 3 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/IceTargetLoweringMIPS32.h ('k') | tests_lit/assembler/mips32/encoding_intrinsics.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringMIPS32.cpp
diff --git a/src/IceTargetLoweringMIPS32.cpp b/src/IceTargetLoweringMIPS32.cpp
index 6d6c6b9316f43f8e48f4e759d7493ea7a7eea595..e8ab8aa673e08dd3af60bc8edbe561823b952b68 100644
--- a/src/IceTargetLoweringMIPS32.cpp
+++ b/src/IceTargetLoweringMIPS32.cpp
@@ -2809,7 +2809,18 @@ void TargetMIPS32::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
return;
}
case Intrinsics::Ctlz: {
- UnimplementedLoweringError(this, Instr);
+ auto *Src = Instr->getArg(0);
+ Type SrcTy = Src->getType();
Jim Stichnoth 2016/09/22 13:48:27 const Type
obucinac 2016/09/22 15:42:07 Done.
+ if (isScalarIntegerType(SrcTy)) {
Jim Stichnoth 2016/09/22 13:48:27 This code seems a bit unbalanced - it appears to d
obucinac 2016/09/22 15:42:07 Done.
+ if (SrcTy == IceType_i64) {
+ UnimplementedLoweringError(this, Instr);
+ } else {
+ auto *DestR = legalizeToReg(Dest);
Jim Stichnoth 2016/09/22 13:48:27 This doesn't seem right to me. Dest shouldn't act
obucinac 2016/09/22 15:42:07 Done.
+ auto *SrcR = legalizeToReg(Src);
+ _clz(DestR, SrcR);
+ _mov(Dest, DestR);
+ }
+ }
return;
}
case Intrinsics::Cttz: {
« no previous file with comments | « src/IceTargetLoweringMIPS32.h ('k') | tests_lit/assembler/mips32/encoding_intrinsics.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698