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

Unified Diff: src/IceTargetLoweringMIPS32.cpp

Issue 2325703002: Subzero, MIPS32: Intrinsic calls for ABS.fmt and SQRT.fmt (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressing comments + O2 test for SQRT ignored 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/llvm2ice_tests/nacl-other-intrinsics-mips.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 dd6133a5511da6b7077169e0a5153a8ca8697ce0..19a054b2c7a8551ab49613a424fbf16bfcc488d7 100644
--- a/src/IceTargetLoweringMIPS32.cpp
+++ b/src/IceTargetLoweringMIPS32.cpp
@@ -2548,6 +2548,8 @@ void TargetMIPS32::lowerInsertElement(const InstInsertElement *Instr) {
}
void TargetMIPS32::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
+ Variable *Dest = Instr->getDest();
+ Type DestTy = (Dest == nullptr) ? IceType_void : Dest->getType();
switch (Instr->getIntrinsicInfo().ID) {
case Intrinsics::AtomicCmpxchg: {
UnimplementedLoweringError(this, Instr);
@@ -2594,7 +2596,15 @@ void TargetMIPS32::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
return;
}
case Intrinsics::Fabs: {
- UnimplementedLoweringError(this, Instr);
+ if (isScalarFloatingType(DestTy)) {
+ Variable *T = makeReg(DestTy);
+ if (DestTy == IceType_f32) {
+ _abs_s(T, legalizeToReg(Instr->getArg(0)));
+ } else {
+ _abs_d(T, legalizeToReg(Instr->getArg(0)));
+ }
+ _mov(Dest, T);
+ }
return;
}
case Intrinsics::Longjmp: {
@@ -2654,7 +2664,15 @@ void TargetMIPS32::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
return;
}
case Intrinsics::Sqrt: {
- UnimplementedLoweringError(this, Instr);
+ if (isScalarFloatingType(DestTy)) {
+ Variable *T = makeReg(DestTy);
+ if (DestTy == IceType_f32) {
+ _sqrt_s(T, legalizeToReg(Instr->getArg(0)));
+ } else {
+ _sqrt_d(T, legalizeToReg(Instr->getArg(0)));
+ }
+ _mov(Dest, T);
+ }
return;
}
case Intrinsics::Stacksave: {
« no previous file with comments | « src/IceTargetLoweringMIPS32.h ('k') | tests_lit/llvm2ice_tests/nacl-other-intrinsics-mips.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698