OLD | NEW |
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 3815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3826 ASSERT(instr->value()->Equals(instr->result())); | 3826 ASSERT(instr->value()->Equals(instr->result())); |
3827 Representation r = instr->hydrogen()->value()->representation(); | 3827 Representation r = instr->hydrogen()->value()->representation(); |
3828 | 3828 |
3829 CpuFeatureScope scope(masm(), SSE2); | 3829 CpuFeatureScope scope(masm(), SSE2); |
3830 if (r.IsDouble()) { | 3830 if (r.IsDouble()) { |
3831 XMMRegister scratch = xmm0; | 3831 XMMRegister scratch = xmm0; |
3832 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 3832 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
3833 __ xorps(scratch, scratch); | 3833 __ xorps(scratch, scratch); |
3834 __ subsd(scratch, input_reg); | 3834 __ subsd(scratch, input_reg); |
3835 __ pand(input_reg, scratch); | 3835 __ pand(input_reg, scratch); |
3836 } else if (r.IsInteger32()) { | 3836 } else if (r.IsSmiOrInteger32()) { |
3837 EmitIntegerMathAbs(instr); | 3837 EmitIntegerMathAbs(instr); |
3838 } else { // Tagged case. | 3838 } else { // Tagged case. |
3839 DeferredMathAbsTaggedHeapNumber* deferred = | 3839 DeferredMathAbsTaggedHeapNumber* deferred = |
3840 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr); | 3840 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr); |
3841 Register input_reg = ToRegister(instr->value()); | 3841 Register input_reg = ToRegister(instr->value()); |
3842 // Smi check. | 3842 // Smi check. |
3843 __ JumpIfNotSmi(input_reg, deferred->entry()); | 3843 __ JumpIfNotSmi(input_reg, deferred->entry()); |
3844 EmitIntegerMathAbs(instr); | 3844 EmitIntegerMathAbs(instr); |
3845 __ bind(deferred->exit()); | 3845 __ bind(deferred->exit()); |
3846 } | 3846 } |
(...skipping 2678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6525 FixedArray::kHeaderSize - kPointerSize)); | 6525 FixedArray::kHeaderSize - kPointerSize)); |
6526 __ bind(&done); | 6526 __ bind(&done); |
6527 } | 6527 } |
6528 | 6528 |
6529 | 6529 |
6530 #undef __ | 6530 #undef __ |
6531 | 6531 |
6532 } } // namespace v8::internal | 6532 } } // namespace v8::internal |
6533 | 6533 |
6534 #endif // V8_TARGET_ARCH_IA32 | 6534 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |