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

Unified Diff: src/ia32/lithium-codegen-ia32.cc

Issue 6461021: Add a genuine unary minus instruction to Crankshaft.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 10 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/ia32/lithium-codegen-ia32.cc
===================================================================
--- src/ia32/lithium-codegen-ia32.cc (revision 6698)
+++ src/ia32/lithium-codegen-ia32.cc (working copy)
@@ -1021,6 +1021,36 @@
}
+void LCodeGen::DoNegI(LNegI* instr) {
+ Register input = ToRegister(instr->InputAt(0));
+ if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
+ __ test(eax, Operand(eax));
Kevin Millikin (Chromium) 2011/02/11 12:12:59 eax ==> input?
fschneider 2011/02/11 12:44:12 Thanks, of course.
+ DeoptimizeIf(zero, instr->environment());
+ }
+ __ neg(input);
+ if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
+ DeoptimizeIf(overflow, instr->environment());
+ }
+}
+
+
+void LCodeGen::DoNegD(LNegD* instr) {
+ XMMRegister reg = ToDoubleRegister(instr->InputAt(0));
+ Register temp = ToRegister(instr->TempAt(0));
+ __ Set(temp, Immediate(0x80000000));
+ __ movd(xmm0, Operand(temp));
+ __ psllq(xmm0, 32);
Kevin Millikin (Chromium) 2011/02/11 12:12:59 Gesundheit.
Vitaly Repeshko 2011/02/11 17:17:56 It might be faster to load the minus zero constant
+ __ xorpd(reg, xmm0);
+}
+
+
+void LCodeGen::DoNegT(LNegT* instr) {
+ UnaryOverwriteMode overwrite = UNARY_NO_OVERWRITE;
+ GenericUnaryOpStub stub(Token::SUB, overwrite, NO_UNARY_FLAGS);
+ CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+}
+
+
void LCodeGen::DoThrow(LThrow* instr) {
__ push(ToOperand(instr->InputAt(0)));
CallRuntime(Runtime::kThrow, 1, instr);

Powered by Google App Engine
This is Rietveld 408576698