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

Side by Side Diff: src/ia32/code-stubs-ia32.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/assembler-ia32.cc ('k') | src/ia32/full-codegen-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 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 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 838
839 if (exponent_type_ != INTEGER) { 839 if (exponent_type_ != INTEGER) {
840 Label fast_power, try_arithmetic_simplification; 840 Label fast_power, try_arithmetic_simplification;
841 __ DoubleToI(exponent, double_exponent, double_scratch, 841 __ DoubleToI(exponent, double_exponent, double_scratch,
842 TREAT_MINUS_ZERO_AS_ZERO, &try_arithmetic_simplification); 842 TREAT_MINUS_ZERO_AS_ZERO, &try_arithmetic_simplification);
843 __ jmp(&int_exponent); 843 __ jmp(&int_exponent);
844 844
845 __ bind(&try_arithmetic_simplification); 845 __ bind(&try_arithmetic_simplification);
846 // Skip to runtime if possibly NaN (indicated by the indefinite integer). 846 // Skip to runtime if possibly NaN (indicated by the indefinite integer).
847 __ cvttsd2si(exponent, Operand(double_exponent)); 847 __ cvttsd2si(exponent, Operand(double_exponent));
848 __ cmp(exponent, Immediate(0x80000000u)); 848 __ cmp(exponent, Immediate(0x1));
849 __ j(equal, &call_runtime); 849 __ j(overflow, &call_runtime);
850 850
851 if (exponent_type_ == ON_STACK) { 851 if (exponent_type_ == ON_STACK) {
852 // Detect square root case. Crankshaft detects constant +/-0.5 at 852 // Detect square root case. Crankshaft detects constant +/-0.5 at
853 // compile time and uses DoMathPowHalf instead. We then skip this check 853 // compile time and uses DoMathPowHalf instead. We then skip this check
854 // for non-constant cases of +/-0.5 as these hardly occur. 854 // for non-constant cases of +/-0.5 as these hardly occur.
855 Label continue_sqrt, continue_rsqrt, not_plus_half; 855 Label continue_sqrt, continue_rsqrt, not_plus_half;
856 // Test for 0.5. 856 // Test for 0.5.
857 // Load double_scratch with 0.5. 857 // Load double_scratch with 0.5.
858 __ mov(scratch, Immediate(0x3F000000u)); 858 __ mov(scratch, Immediate(0x3F000000u));
859 __ movd(double_scratch, scratch); 859 __ movd(double_scratch, scratch);
(...skipping 4591 matching lines...) Expand 10 before | Expand all | Expand 10 after
5451 Operand(ebp, 7 * kPointerSize), 5451 Operand(ebp, 7 * kPointerSize),
5452 NULL); 5452 NULL);
5453 } 5453 }
5454 5454
5455 5455
5456 #undef __ 5456 #undef __
5457 5457
5458 } } // namespace v8::internal 5458 } } // namespace v8::internal
5459 5459
5460 #endif // V8_TARGET_ARCH_IA32 5460 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698