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

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

Issue 5741003: Allow optimizing compiler to compute Math.log using untagged doubles. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years 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 | « src/ia32/lithium-codegen-ia32.h ('k') | src/ia32/lithium-ia32.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after
2228 2228
2229 // Return value is in st(0) on ia32. 2229 // Return value is in st(0) on ia32.
2230 // Store it into the (fixed) result register. 2230 // Store it into the (fixed) result register.
2231 __ sub(Operand(esp), Immediate(kDoubleSize)); 2231 __ sub(Operand(esp), Immediate(kDoubleSize));
2232 __ fstp_d(Operand(esp, 0)); 2232 __ fstp_d(Operand(esp, 0));
2233 __ movdbl(ToDoubleRegister(instr->result()), Operand(esp, 0)); 2233 __ movdbl(ToDoubleRegister(instr->result()), Operand(esp, 0));
2234 __ add(Operand(esp), Immediate(kDoubleSize)); 2234 __ add(Operand(esp), Immediate(kDoubleSize));
2235 } 2235 }
2236 2236
2237 2237
2238 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) {
2239 ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
2240 TranscendentalCacheSSE2Stub stub(TranscendentalCache::LOG);
2241 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
2242 }
2243
2244
2238 void LCodeGen::DoUnaryMathOperation(LUnaryMathOperation* instr) { 2245 void LCodeGen::DoUnaryMathOperation(LUnaryMathOperation* instr) {
2239 switch (instr->op()) { 2246 switch (instr->op()) {
2240 case kMathAbs: 2247 case kMathAbs:
2241 DoMathAbs(instr); 2248 DoMathAbs(instr);
2242 break; 2249 break;
2243 case kMathFloor: 2250 case kMathFloor:
2244 DoMathFloor(instr); 2251 DoMathFloor(instr);
2245 break; 2252 break;
2246 case kMathRound: 2253 case kMathRound:
2247 DoMathRound(instr); 2254 DoMathRound(instr);
2248 break; 2255 break;
2249 case kMathSqrt: 2256 case kMathSqrt:
2250 DoMathSqrt(instr); 2257 DoMathSqrt(instr);
2251 break; 2258 break;
2252 case kMathPowHalf: 2259 case kMathPowHalf:
2253 DoMathPowHalf(instr); 2260 DoMathPowHalf(instr);
2254 break; 2261 break;
2262 case kMathLog:
2263 DoMathLog(instr);
2264 break;
2265
2255 default: 2266 default:
2256 UNREACHABLE(); 2267 UNREACHABLE();
2257 } 2268 }
2258 } 2269 }
2259 2270
2260 2271
2261 void LCodeGen::DoCallKeyed(LCallKeyed* instr) { 2272 void LCodeGen::DoCallKeyed(LCallKeyed* instr) {
2262 ASSERT(ToRegister(instr->result()).is(eax)); 2273 ASSERT(ToRegister(instr->result()).is(eax));
2263 2274
2264 int arity = instr->arity(); 2275 int arity = instr->arity();
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
3155 ASSERT(!environment->HasBeenRegistered()); 3166 ASSERT(!environment->HasBeenRegistered());
3156 RegisterEnvironmentForDeoptimization(environment); 3167 RegisterEnvironmentForDeoptimization(environment);
3157 ASSERT(osr_pc_offset_ == -1); 3168 ASSERT(osr_pc_offset_ == -1);
3158 osr_pc_offset_ = masm()->pc_offset(); 3169 osr_pc_offset_ = masm()->pc_offset();
3159 } 3170 }
3160 3171
3161 3172
3162 #undef __ 3173 #undef __
3163 3174
3164 } } // namespace v8::internal 3175 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.h ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698