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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 } 1014 }
1015 1015
1016 1016
1017 void LCodeGen::DoBitNotI(LBitNotI* instr) { 1017 void LCodeGen::DoBitNotI(LBitNotI* instr) {
1018 LOperand* input = instr->InputAt(0); 1018 LOperand* input = instr->InputAt(0);
1019 ASSERT(input->Equals(instr->result())); 1019 ASSERT(input->Equals(instr->result()));
1020 __ not_(ToRegister(input)); 1020 __ not_(ToRegister(input));
1021 } 1021 }
1022 1022
1023 1023
1024 void LCodeGen::DoNegI(LNegI* instr) {
1025 Register input = ToRegister(instr->InputAt(0));
1026 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
1027 __ 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.
1028 DeoptimizeIf(zero, instr->environment());
1029 }
1030 __ neg(input);
1031 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
1032 DeoptimizeIf(overflow, instr->environment());
1033 }
1034 }
1035
1036
1037 void LCodeGen::DoNegD(LNegD* instr) {
1038 XMMRegister reg = ToDoubleRegister(instr->InputAt(0));
1039 Register temp = ToRegister(instr->TempAt(0));
1040 __ Set(temp, Immediate(0x80000000));
1041 __ movd(xmm0, Operand(temp));
1042 __ 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
1043 __ xorpd(reg, xmm0);
1044 }
1045
1046
1047 void LCodeGen::DoNegT(LNegT* instr) {
1048 UnaryOverwriteMode overwrite = UNARY_NO_OVERWRITE;
1049 GenericUnaryOpStub stub(Token::SUB, overwrite, NO_UNARY_FLAGS);
1050 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
1051 }
1052
1053
1024 void LCodeGen::DoThrow(LThrow* instr) { 1054 void LCodeGen::DoThrow(LThrow* instr) {
1025 __ push(ToOperand(instr->InputAt(0))); 1055 __ push(ToOperand(instr->InputAt(0)));
1026 CallRuntime(Runtime::kThrow, 1, instr); 1056 CallRuntime(Runtime::kThrow, 1, instr);
1027 1057
1028 if (FLAG_debug_code) { 1058 if (FLAG_debug_code) {
1029 Comment("Unreachable code."); 1059 Comment("Unreachable code.");
1030 __ int3(); 1060 __ int3();
1031 } 1061 }
1032 } 1062 }
1033 1063
(...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after
3706 ASSERT(osr_pc_offset_ == -1); 3736 ASSERT(osr_pc_offset_ == -1);
3707 osr_pc_offset_ = masm()->pc_offset(); 3737 osr_pc_offset_ = masm()->pc_offset();
3708 } 3738 }
3709 3739
3710 3740
3711 #undef __ 3741 #undef __
3712 3742
3713 } } // namespace v8::internal 3743 } } // namespace v8::internal
3714 3744
3715 #endif // V8_TARGET_ARCH_IA32 3745 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698