OLD | NEW |
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 2985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2996 // Fall through intended | 2996 // Fall through intended |
2997 case INTEGER: | 2997 case INTEGER: |
2998 // xmm1: base as double | 2998 // xmm1: base as double |
2999 // eax: exponent as untagged integer | 2999 // eax: exponent as untagged integer |
3000 case DOUBLE: | 3000 case DOUBLE: |
3001 // xmm1: base as double | 3001 // xmm1: base as double |
3002 // xmm2: exponent as double | 3002 // xmm2: exponent as double |
3003 // Check base in xmm1 for NaN or +/-Infinity | 3003 // Check base in xmm1 for NaN or +/-Infinity |
3004 const int kExponentShift = kBitsPerByte * | 3004 const int kExponentShift = kBitsPerByte * |
3005 (HeapNumber::kExponentOffset - HeapNumber::kMantissaOffset); | 3005 (HeapNumber::kExponentOffset - HeapNumber::kMantissaOffset); |
3006 if (CpuFeatures::IsSupported(SSE4_1)) { | 3006 __ movsd(xmm4, xmm1); |
3007 __ extractps(ecx, xmm1, kExponentShift); | 3007 __ psrlq(xmm4, kExponentShift); |
3008 } else { | 3008 __ movd(ecx, xmm4); |
3009 __ movsd(xmm4, xmm1); | |
3010 __ psrlq(xmm4, kExponentShift); | |
3011 __ movd(ecx, xmm4); | |
3012 } | |
3013 __ and_(ecx, HeapNumber::kExponentMask); | 3009 __ and_(ecx, HeapNumber::kExponentMask); |
3014 __ cmp(ecx, Immediate(HeapNumber::kExponentMask)); | 3010 __ cmp(ecx, Immediate(HeapNumber::kExponentMask)); |
3015 __ j(equal, &generic_runtime); | 3011 __ j(equal, &generic_runtime); |
3016 break; | 3012 break; |
3017 } | 3013 } |
3018 | 3014 |
3019 if (exponent_type_ != INTEGER) { | 3015 if (exponent_type_ != INTEGER) { |
3020 Label not_minus_half, fast_power; | 3016 Label not_minus_half, fast_power; |
3021 // xmm1: base as double that is not +/- Infinity or NaN | 3017 // xmm1: base as double that is not +/- Infinity or NaN |
3022 // xmm2: exponent as double | 3018 // xmm2: exponent as double |
(...skipping 4255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7278 false); | 7274 false); |
7279 __ pop(edx); | 7275 __ pop(edx); |
7280 __ ret(0); | 7276 __ ret(0); |
7281 } | 7277 } |
7282 | 7278 |
7283 #undef __ | 7279 #undef __ |
7284 | 7280 |
7285 } } // namespace v8::internal | 7281 } } // namespace v8::internal |
7286 | 7282 |
7287 #endif // V8_TARGET_ARCH_IA32 | 7283 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |