Add scalar lowering for sqrt intrinsic.
Re-used test_arith_main.cpp, mostly to share the set of interesting
floating point constants.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3882
R=stichnot@chromium.org, wala@chromium.org
Review URL: https://codereview.chromium.org/384443003
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index 569fd9e..62a525c 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -2018,7 +2018,14 @@
lowerCall(Call);
return;
}
- case Intrinsics::Sqrt:
+ case Intrinsics::Sqrt: {
+ Operand *Src = legalize(Instr->getArg(0));
+ Variable *Dest = Instr->getDest();
+ Variable *T = makeReg(Dest->getType());
+ _sqrtss(T, Src);
+ _mov(Dest, T);
+ return;
+ }
case Intrinsics::Stacksave:
case Intrinsics::Stackrestore:
// TODO(jvoung): fill it in.