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

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

Issue 8834007: Tweak to shorten generated code in Math.pow. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 9 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/code-stubs-ia32.cc ('k') | no next file » | 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 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 2174
2175 // Calculate power with integer exponent. 2175 // Calculate power with integer exponent.
2176 __ bind(&int_exponent); 2176 __ bind(&int_exponent);
2177 const XMMRegister double_scratch2 = double_exponent; 2177 const XMMRegister double_scratch2 = double_exponent;
2178 // Back up exponent as we need to check if exponent is negative later. 2178 // Back up exponent as we need to check if exponent is negative later.
2179 __ movq(scratch, exponent); // Back up exponent. 2179 __ movq(scratch, exponent); // Back up exponent.
2180 __ movsd(double_scratch, double_base); // Back up base. 2180 __ movsd(double_scratch, double_base); // Back up base.
2181 __ movsd(double_scratch2, double_result); // Load double_exponent with 1. 2181 __ movsd(double_scratch2, double_result); // Load double_exponent with 1.
2182 2182
2183 // Get absolute value of exponent. 2183 // Get absolute value of exponent.
2184 Label no_neg, while_true, no_multiply; 2184 Label while_true, no_multiply;
2185 __ cmpl(scratch, Immediate(0)); 2185 const uint32_t kClearSignBitMask = 0x7FFFFFFF;
2186 __ j(positive, &no_neg, Label::kNear); 2186 __ andl(scratch, Immediate(kClearSignBitMask));
2187 __ negl(scratch);
2188 __ bind(&no_neg);
2189 2187
2190 __ bind(&while_true); 2188 __ bind(&while_true);
2191 __ shrl(scratch, Immediate(1)); 2189 __ shrl(scratch, Immediate(1));
2192 __ j(not_carry, &no_multiply, Label::kNear); 2190 __ j(not_carry, &no_multiply, Label::kNear);
2193 __ mulsd(double_result, double_scratch); 2191 __ mulsd(double_result, double_scratch);
2194 __ bind(&no_multiply); 2192 __ bind(&no_multiply);
2195 2193
2196 __ mulsd(double_scratch, double_scratch); 2194 __ mulsd(double_scratch, double_scratch);
2197 __ j(not_zero, &while_true); 2195 __ j(not_zero, &while_true);
2198 2196
(...skipping 4016 matching lines...) Expand 10 before | Expand all | Expand 10 after
6215 xmm0, 6213 xmm0,
6216 &slow_elements); 6214 &slow_elements);
6217 __ ret(0); 6215 __ ret(0);
6218 } 6216 }
6219 6217
6220 #undef __ 6218 #undef __
6221 6219
6222 } } // namespace v8::internal 6220 } } // namespace v8::internal
6223 6221
6224 #endif // V8_TARGET_ARCH_X64 6222 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698