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

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: Set isScalarFloatingType condition 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
Index: src/IceTargetLoweringMIPS32.cpp
diff --git a/src/IceTargetLoweringMIPS32.cpp b/src/IceTargetLoweringMIPS32.cpp
index 7bdf723d3796b4da898c12e1f0a54380a7fbff89..a6046cc8beed2d420c6d3ac095f19485a1b7f7c4 100644
--- a/src/IceTargetLoweringMIPS32.cpp
+++ b/src/IceTargetLoweringMIPS32.cpp
@@ -2173,6 +2173,8 @@ void TargetMIPS32::lowerInsertElement(const InstInsertElement *Instr) {
}
void TargetMIPS32::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
+ Variable *Dest = Instr->getDest();
+ Type DestTy = (Dest != nullptr) ? Dest->getType() : IceType_void;
Jim Stichnoth 2016/09/09 17:12:41 I would do it more like this: const Type DestTy
obucinac 2016/09/09 17:39:40 Done.
switch (Instr->getIntrinsicInfo().ID) {
case Intrinsics::AtomicCmpxchg: {
UnimplementedLoweringError(this, Instr);
@@ -2219,7 +2221,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: {
@@ -2279,7 +2289,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: {

Powered by Google App Engine
This is Rietveld 408576698