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

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

Issue 202083002: [ia32/x64] Smaller instruction to check NaN (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: only NaN related code remains Created 6 years, 9 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
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/full-codegen-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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 if (exponent_type_ != INTEGER) { 702 if (exponent_type_ != INTEGER) {
703 Label fast_power, try_arithmetic_simplification; 703 Label fast_power, try_arithmetic_simplification;
704 // Detect integer exponents stored as double. 704 // Detect integer exponents stored as double.
705 __ DoubleToI(exponent, double_exponent, double_scratch, 705 __ DoubleToI(exponent, double_exponent, double_scratch,
706 TREAT_MINUS_ZERO_AS_ZERO, &try_arithmetic_simplification); 706 TREAT_MINUS_ZERO_AS_ZERO, &try_arithmetic_simplification);
707 __ jmp(&int_exponent); 707 __ jmp(&int_exponent);
708 708
709 __ bind(&try_arithmetic_simplification); 709 __ bind(&try_arithmetic_simplification);
710 __ cvttsd2si(exponent, double_exponent); 710 __ cvttsd2si(exponent, double_exponent);
711 // Skip to runtime if possibly NaN (indicated by the indefinite integer). 711 // Skip to runtime if possibly NaN (indicated by the indefinite integer).
712 __ cmpl(exponent, Immediate(0x80000000u)); 712 __ cmpl(exponent, Immediate(0x1));
713 __ j(equal, &call_runtime); 713 __ j(overflow, &call_runtime);
714 714
715 if (exponent_type_ == ON_STACK) { 715 if (exponent_type_ == ON_STACK) {
716 // Detect square root case. Crankshaft detects constant +/-0.5 at 716 // Detect square root case. Crankshaft detects constant +/-0.5 at
717 // compile time and uses DoMathPowHalf instead. We then skip this check 717 // compile time and uses DoMathPowHalf instead. We then skip this check
718 // for non-constant cases of +/-0.5 as these hardly occur. 718 // for non-constant cases of +/-0.5 as these hardly occur.
719 Label continue_sqrt, continue_rsqrt, not_plus_half; 719 Label continue_sqrt, continue_rsqrt, not_plus_half;
720 // Test for 0.5. 720 // Test for 0.5.
721 // Load double_scratch with 0.5. 721 // Load double_scratch with 0.5.
722 __ movq(scratch, V8_UINT64_C(0x3FE0000000000000)); 722 __ movq(scratch, V8_UINT64_C(0x3FE0000000000000));
723 __ movq(double_scratch, scratch); 723 __ movq(double_scratch, scratch);
(...skipping 4591 matching lines...) Expand 10 before | Expand all | Expand 10 after
5315 return_value_operand, 5315 return_value_operand,
5316 NULL); 5316 NULL);
5317 } 5317 }
5318 5318
5319 5319
5320 #undef __ 5320 #undef __
5321 5321
5322 } } // namespace v8::internal 5322 } } // namespace v8::internal
5323 5323
5324 #endif // V8_TARGET_ARCH_X64 5324 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698