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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 6515010: Add ArithmeticD instruction to x64 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
« no previous file with comments | « no previous file | src/x64/lithium-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 __ addl(ToRegister(left), ToOperand(right)); 971 __ addl(ToRegister(left), ToOperand(right));
972 } 972 }
973 973
974 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { 974 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
975 DeoptimizeIf(overflow, instr->environment()); 975 DeoptimizeIf(overflow, instr->environment());
976 } 976 }
977 } 977 }
978 978
979 979
980 void LCodeGen::DoArithmeticD(LArithmeticD* instr) { 980 void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
981 Abort("Unimplemented: %s", "DoArithmeticD"); 981 LOperand* left = instr->InputAt(0);
982 LOperand* right = instr->InputAt(1);
983 // Modulo uses a fixed result register.
Rico 2011/02/14 11:32:37 But we don't implement it, so this comment is a bi
984 ASSERT(instr->op() == Token::MOD || left->Equals(instr->result()));
985 switch (instr->op()) {
986 case Token::ADD:
987 __ addsd(ToDoubleRegister(left), ToDoubleRegister(right));
988 break;
989 case Token::SUB:
990 __ subsd(ToDoubleRegister(left), ToDoubleRegister(right));
991 break;
992 case Token::MUL:
993 __ mulsd(ToDoubleRegister(left), ToDoubleRegister(right));
994 break;
995 case Token::DIV:
996 __ divsd(ToDoubleRegister(left), ToDoubleRegister(right));
997 break;
998 case Token::MOD:
999 Abort("Unimplemented: %s", "DoArithmeticD MOD");
1000 break;
1001 default:
1002 UNREACHABLE();
1003 break;
1004 }
982 } 1005 }
983 1006
984 1007
985 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { 1008 void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
986 ASSERT(ToRegister(instr->InputAt(0)).is(rdx)); 1009 ASSERT(ToRegister(instr->InputAt(0)).is(rdx));
987 ASSERT(ToRegister(instr->InputAt(1)).is(rax)); 1010 ASSERT(ToRegister(instr->InputAt(1)).is(rax));
988 ASSERT(ToRegister(instr->result()).is(rax)); 1011 ASSERT(ToRegister(instr->result()).is(rax));
989 1012
990 TypeRecordingBinaryOpStub stub(instr->op(), NO_OVERWRITE); 1013 TypeRecordingBinaryOpStub stub(instr->op(), NO_OVERWRITE);
991 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 1014 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2123 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 2146 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
2124 Abort("Unimplemented: %s", "DoStoreKeyedGeneric"); 2147 Abort("Unimplemented: %s", "DoStoreKeyedGeneric");
2125 } 2148 }
2126 2149
2127 2150
2128 void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { 2151 void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) {
2129 LOperand* input = instr->InputAt(0); 2152 LOperand* input = instr->InputAt(0);
2130 ASSERT(input->IsRegister() || input->IsStackSlot()); 2153 ASSERT(input->IsRegister() || input->IsStackSlot());
2131 LOperand* output = instr->result(); 2154 LOperand* output = instr->result();
2132 ASSERT(output->IsDoubleRegister()); 2155 ASSERT(output->IsDoubleRegister());
2133 __ cvtlsi2sd(ToDoubleRegister(output), ToOperand(input)); 2156 if (input->IsRegister()) {
2157 __ cvtlsi2sd(ToDoubleRegister(output), ToRegister(input));
2158 } else {
2159 __ cvtlsi2sd(ToDoubleRegister(output), ToOperand(input));
2160 }
2134 } 2161 }
2135 2162
2136 2163
2137 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { 2164 void LCodeGen::DoNumberTagI(LNumberTagI* instr) {
2138 LOperand* input = instr->InputAt(0); 2165 LOperand* input = instr->InputAt(0);
2139 ASSERT(input->IsRegister() && input->Equals(instr->result())); 2166 ASSERT(input->IsRegister() && input->Equals(instr->result()));
2140 Register reg = ToRegister(input); 2167 Register reg = ToRegister(input);
2141 2168
2142 __ Integer32ToSmi(reg, reg); 2169 __ Integer32ToSmi(reg, reg);
2143 } 2170 }
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2654 2681
2655 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { 2682 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
2656 Abort("Unimplemented: %s", "DoOsrEntry"); 2683 Abort("Unimplemented: %s", "DoOsrEntry");
2657 } 2684 }
2658 2685
2659 #undef __ 2686 #undef __
2660 2687
2661 } } // namespace v8::internal 2688 } } // namespace v8::internal
2662 2689
2663 #endif // V8_TARGET_ARCH_X64 2690 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698