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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 11418149: Faster implementation of Math.exp() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix Win build Created 8 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/x64/assembler-x64.cc ('k') | src/x64/codegen-x64.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 // B ^ E = (2^(E * log2(B)) - 1) + 1 = (2^X - 1) + 1 for X = E * log2(B) 2214 // B ^ E = (2^(E * log2(B)) - 1) + 1 = (2^X - 1) + 1 for X = E * log2(B)
2215 // FYL2X calculates st(1) * log2(st(0)) 2215 // FYL2X calculates st(1) * log2(st(0))
2216 __ fyl2x(); // X 2216 __ fyl2x(); // X
2217 __ fld(0); // X, X 2217 __ fld(0); // X, X
2218 __ frndint(); // rnd(X), X 2218 __ frndint(); // rnd(X), X
2219 __ fsub(1); // rnd(X), X-rnd(X) 2219 __ fsub(1); // rnd(X), X-rnd(X)
2220 __ fxch(1); // X - rnd(X), rnd(X) 2220 __ fxch(1); // X - rnd(X), rnd(X)
2221 // F2XM1 calculates 2^st(0) - 1 for -1 < st(0) < 1 2221 // F2XM1 calculates 2^st(0) - 1 for -1 < st(0) < 1
2222 __ f2xm1(); // 2^(X-rnd(X)) - 1, rnd(X) 2222 __ f2xm1(); // 2^(X-rnd(X)) - 1, rnd(X)
2223 __ fld1(); // 1, 2^(X-rnd(X)) - 1, rnd(X) 2223 __ fld1(); // 1, 2^(X-rnd(X)) - 1, rnd(X)
2224 __ faddp(1); // 1, 2^(X-rnd(X)), rnd(X) 2224 __ faddp(1); // 2^(X-rnd(X)), rnd(X)
2225 // FSCALE calculates st(0) * 2^st(1) 2225 // FSCALE calculates st(0) * 2^st(1)
2226 __ fscale(); // 2^X, rnd(X) 2226 __ fscale(); // 2^X, rnd(X)
2227 __ fstp(1); 2227 __ fstp(1);
2228 // Bail out to runtime in case of exceptions in the status word. 2228 // Bail out to runtime in case of exceptions in the status word.
2229 __ fnstsw_ax(); 2229 __ fnstsw_ax();
2230 __ testb(rax, Immediate(0x5F)); // Check for all but precision exception. 2230 __ testb(rax, Immediate(0x5F)); // Check for all but precision exception.
2231 __ j(not_zero, &fast_power_failed, Label::kNear); 2231 __ j(not_zero, &fast_power_failed, Label::kNear);
2232 __ fstp_d(Operand(rsp, 0)); 2232 __ fstp_d(Operand(rsp, 0));
2233 __ movsd(double_result, Operand(rsp, 0)); 2233 __ movsd(double_result, Operand(rsp, 0));
2234 __ addq(rsp, Immediate(kDoubleSize)); 2234 __ addq(rsp, Immediate(kDoubleSize));
(...skipping 4234 matching lines...) Expand 10 before | Expand all | Expand 10 after
6469 #endif 6469 #endif
6470 6470
6471 __ Ret(); 6471 __ Ret();
6472 } 6472 }
6473 6473
6474 #undef __ 6474 #undef __
6475 6475
6476 } } // namespace v8::internal 6476 } } // namespace v8::internal
6477 6477
6478 #endif // V8_TARGET_ARCH_X64 6478 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x64/codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698