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

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

Issue 5996002: Add untagged double versions of Math.sin and Math.cos. (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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 StringAddStub stub(NO_STRING_ADD_FLAGS); 679 StringAddStub stub(NO_STRING_ADD_FLAGS);
680 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 680 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
681 break; 681 break;
682 } 682 }
683 case CodeStub::StringCompare: { 683 case CodeStub::StringCompare: {
684 StringCompareStub stub; 684 StringCompareStub stub;
685 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 685 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
686 break; 686 break;
687 } 687 }
688 case CodeStub::TranscendentalCache: { 688 case CodeStub::TranscendentalCache: {
689 TranscendentalCacheStub stub(instr->transcendental_type()); 689 TranscendentalCacheStub stub(instr->transcendental_type(),
690 TranscendentalCacheStub::TAGGED);
690 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 691 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
691 break; 692 break;
692 } 693 }
693 default: 694 default:
694 UNREACHABLE(); 695 UNREACHABLE();
695 } 696 }
696 } 697 }
697 698
698 699
699 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { 700 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 // Store it into the (fixed) result register. 2308 // Store it into the (fixed) result register.
2308 __ sub(Operand(esp), Immediate(kDoubleSize)); 2309 __ sub(Operand(esp), Immediate(kDoubleSize));
2309 __ fstp_d(Operand(esp, 0)); 2310 __ fstp_d(Operand(esp, 0));
2310 __ movdbl(result_reg, Operand(esp, 0)); 2311 __ movdbl(result_reg, Operand(esp, 0));
2311 __ add(Operand(esp), Immediate(kDoubleSize)); 2312 __ add(Operand(esp), Immediate(kDoubleSize));
2312 } 2313 }
2313 2314
2314 2315
2315 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) { 2316 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) {
2316 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); 2317 ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
2317 TranscendentalCacheSSE2Stub stub(TranscendentalCache::LOG); 2318 TranscendentalCacheStub stub(TranscendentalCache::LOG,
2319 TranscendentalCacheStub::UNTAGGED);
2320 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
2321 }
2322
2323
2324 void LCodeGen::DoMathCos(LUnaryMathOperation* instr) {
2325 ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
2326 TranscendentalCacheStub stub(TranscendentalCache::COS,
2327 TranscendentalCacheStub::UNTAGGED);
2328 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
2329 }
2330
2331
2332 void LCodeGen::DoMathSin(LUnaryMathOperation* instr) {
2333 ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
2334 TranscendentalCacheStub stub(TranscendentalCache::SIN,
2335 TranscendentalCacheStub::UNTAGGED);
2318 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 2336 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
2319 } 2337 }
2320 2338
2321 2339
2322 void LCodeGen::DoUnaryMathOperation(LUnaryMathOperation* instr) { 2340 void LCodeGen::DoUnaryMathOperation(LUnaryMathOperation* instr) {
2323 switch (instr->op()) { 2341 switch (instr->op()) {
2324 case kMathAbs: 2342 case kMathAbs:
2325 DoMathAbs(instr); 2343 DoMathAbs(instr);
2326 break; 2344 break;
2327 case kMathFloor: 2345 case kMathFloor:
2328 DoMathFloor(instr); 2346 DoMathFloor(instr);
2329 break; 2347 break;
2330 case kMathRound: 2348 case kMathRound:
2331 DoMathRound(instr); 2349 DoMathRound(instr);
2332 break; 2350 break;
2333 case kMathSqrt: 2351 case kMathSqrt:
2334 DoMathSqrt(instr); 2352 DoMathSqrt(instr);
2335 break; 2353 break;
2336 case kMathPowHalf: 2354 case kMathPowHalf:
2337 DoMathPowHalf(instr); 2355 DoMathPowHalf(instr);
2338 break; 2356 break;
2357 case kMathCos:
2358 DoMathCos(instr);
2359 break;
2360 case kMathSin:
2361 DoMathSin(instr);
2362 break;
2339 case kMathLog: 2363 case kMathLog:
2340 DoMathLog(instr); 2364 DoMathLog(instr);
2341 break; 2365 break;
2342 2366
2343 default: 2367 default:
2344 UNREACHABLE(); 2368 UNREACHABLE();
2345 } 2369 }
2346 } 2370 }
2347 2371
2348 2372
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
3243 ASSERT(!environment->HasBeenRegistered()); 3267 ASSERT(!environment->HasBeenRegistered());
3244 RegisterEnvironmentForDeoptimization(environment); 3268 RegisterEnvironmentForDeoptimization(environment);
3245 ASSERT(osr_pc_offset_ == -1); 3269 ASSERT(osr_pc_offset_ == -1);
3246 osr_pc_offset_ = masm()->pc_offset(); 3270 osr_pc_offset_ = masm()->pc_offset();
3247 } 3271 }
3248 3272
3249 3273
3250 #undef __ 3274 #undef __
3251 3275
3252 } } // namespace v8::internal 3276 } } // 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