Chromium Code Reviews| 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 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1951 __ pinsrd(res, Operand(temp), 1); | 1951 __ pinsrd(res, Operand(temp), 1); |
| 1952 } | 1952 } |
| 1953 } else { | 1953 } else { |
| 1954 __ Set(temp, Immediate(upper)); | 1954 __ Set(temp, Immediate(upper)); |
| 1955 __ movd(res, Operand(temp)); | 1955 __ movd(res, Operand(temp)); |
| 1956 __ psllq(res, 32); | 1956 __ psllq(res, 32); |
| 1957 if (lower != 0) { | 1957 if (lower != 0) { |
| 1958 XMMRegister xmm_scratch = double_scratch0(); | 1958 XMMRegister xmm_scratch = double_scratch0(); |
| 1959 __ Set(temp, Immediate(lower)); | 1959 __ Set(temp, Immediate(lower)); |
| 1960 __ movd(xmm_scratch, Operand(temp)); | 1960 __ movd(xmm_scratch, Operand(temp)); |
| 1961 __ por(res, xmm_scratch); | 1961 __ orps(res, xmm_scratch); |
| 1962 } | 1962 } |
| 1963 } | 1963 } |
| 1964 } | 1964 } |
| 1965 } | 1965 } |
| 1966 } | 1966 } |
| 1967 | 1967 |
| 1968 | 1968 |
| 1969 void LCodeGen::DoConstantE(LConstantE* instr) { | 1969 void LCodeGen::DoConstantE(LConstantE* instr) { |
| 1970 __ lea(ToRegister(instr->result()), Operand::StaticVariable(instr->value())); | 1970 __ lea(ToRegister(instr->result()), Operand::StaticVariable(instr->value())); |
| 1971 } | 1971 } |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2177 } else { | 2177 } else { |
| 2178 // Since we operate on +0 and/or -0, addsd and andsd have the same effect. | 2178 // Since we operate on +0 and/or -0, addsd and andsd have the same effect. |
| 2179 __ addsd(left_reg, right_reg); | 2179 __ addsd(left_reg, right_reg); |
| 2180 } | 2180 } |
| 2181 __ jmp(&return_left, Label::kNear); | 2181 __ jmp(&return_left, Label::kNear); |
| 2182 | 2182 |
| 2183 __ bind(&check_nan_left); | 2183 __ bind(&check_nan_left); |
| 2184 __ ucomisd(left_reg, left_reg); // NaN check. | 2184 __ ucomisd(left_reg, left_reg); // NaN check. |
| 2185 __ j(parity_even, &return_left, Label::kNear); // left == NaN. | 2185 __ j(parity_even, &return_left, Label::kNear); // left == NaN. |
| 2186 __ bind(&return_right); | 2186 __ bind(&return_right); |
| 2187 __ movsd(left_reg, right_reg); | 2187 __ movaps(left_reg, right_reg); |
|
Sven Panne
2013/11/04 14:05:45
If I see things correctly, this doesn't really sol
| |
| 2188 | 2188 |
| 2189 __ bind(&return_left); | 2189 __ bind(&return_left); |
| 2190 } | 2190 } |
| 2191 } | 2191 } |
| 2192 | 2192 |
| 2193 | 2193 |
| 2194 void LCodeGen::DoArithmeticD(LArithmeticD* instr) { | 2194 void LCodeGen::DoArithmeticD(LArithmeticD* instr) { |
| 2195 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { | 2195 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { |
| 2196 CpuFeatureScope scope(masm(), SSE2); | 2196 CpuFeatureScope scope(masm(), SSE2); |
| 2197 XMMRegister left = ToDoubleRegister(instr->left()); | 2197 XMMRegister left = ToDoubleRegister(instr->left()); |
| (...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3988 DeoptimizeIf(equal, instr->environment()); | 3988 DeoptimizeIf(equal, instr->environment()); |
| 3989 __ jmp(&done); | 3989 __ jmp(&done); |
| 3990 | 3990 |
| 3991 __ bind(&below_one_half); | 3991 __ bind(&below_one_half); |
| 3992 __ movsd(xmm_scratch, Operand::StaticVariable(minus_one_half)); | 3992 __ movsd(xmm_scratch, Operand::StaticVariable(minus_one_half)); |
| 3993 __ ucomisd(xmm_scratch, input_reg); | 3993 __ ucomisd(xmm_scratch, input_reg); |
| 3994 __ j(below_equal, &round_to_zero); | 3994 __ j(below_equal, &round_to_zero); |
| 3995 | 3995 |
| 3996 // CVTTSD2SI rounds towards zero, we use ceil(x - (-0.5)) and then | 3996 // CVTTSD2SI rounds towards zero, we use ceil(x - (-0.5)) and then |
| 3997 // compare and compensate. | 3997 // compare and compensate. |
| 3998 __ movsd(input_temp, input_reg); // Do not alter input_reg. | 3998 __ movaps(input_temp, input_reg); // Do not alter input_reg. |
| 3999 __ subsd(input_temp, xmm_scratch); | 3999 __ subsd(input_temp, xmm_scratch); |
| 4000 __ cvttsd2si(output_reg, Operand(input_temp)); | 4000 __ cvttsd2si(output_reg, Operand(input_temp)); |
| 4001 // Catch minint due to overflow, and to prevent overflow when compensating. | 4001 // Catch minint due to overflow, and to prevent overflow when compensating. |
| 4002 __ cmp(output_reg, 0x80000000u); | 4002 __ cmp(output_reg, 0x80000000u); |
| 4003 __ RecordComment("D2I conversion overflow"); | 4003 __ RecordComment("D2I conversion overflow"); |
| 4004 DeoptimizeIf(equal, instr->environment()); | 4004 DeoptimizeIf(equal, instr->environment()); |
| 4005 | 4005 |
| 4006 __ Cvtsi2sd(xmm_scratch, output_reg); | 4006 __ Cvtsi2sd(xmm_scratch, output_reg); |
| 4007 __ ucomisd(xmm_scratch, input_temp); | 4007 __ ucomisd(xmm_scratch, input_temp); |
| 4008 __ j(equal, &done); | 4008 __ j(equal, &done); |
| (...skipping 2369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6378 FixedArray::kHeaderSize - kPointerSize)); | 6378 FixedArray::kHeaderSize - kPointerSize)); |
| 6379 __ bind(&done); | 6379 __ bind(&done); |
| 6380 } | 6380 } |
| 6381 | 6381 |
| 6382 | 6382 |
| 6383 #undef __ | 6383 #undef __ |
| 6384 | 6384 |
| 6385 } } // namespace v8::internal | 6385 } } // namespace v8::internal |
| 6386 | 6386 |
| 6387 #endif // V8_TARGET_ARCH_IA32 | 6387 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |