| OLD | NEW |
| 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 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2218 | 2218 |
| 2219 if (on_successful_conversion) { | 2219 if (on_successful_conversion) { |
| 2220 B(on_successful_conversion, eq); | 2220 B(on_successful_conversion, eq); |
| 2221 } | 2221 } |
| 2222 if (on_failed_conversion) { | 2222 if (on_failed_conversion) { |
| 2223 B(on_failed_conversion, ne); | 2223 B(on_failed_conversion, ne); |
| 2224 } | 2224 } |
| 2225 } | 2225 } |
| 2226 | 2226 |
| 2227 | 2227 |
| 2228 void MacroAssembler::JumpIfMinusZero(DoubleRegister input, | 2228 void MacroAssembler::TestForMinusZero(DoubleRegister input) { |
| 2229 Label* on_negative_zero) { | |
| 2230 UseScratchRegisterScope temps(this); | 2229 UseScratchRegisterScope temps(this); |
| 2231 Register temp = temps.AcquireX(); | 2230 Register temp = temps.AcquireX(); |
| 2232 // Floating point -0.0 is kMinInt as an integer, so subtracting 1 (cmp) will | 2231 // Floating point -0.0 is kMinInt as an integer, so subtracting 1 (cmp) will |
| 2233 // cause overflow. | 2232 // cause overflow. |
| 2234 Fmov(temp, input); | 2233 Fmov(temp, input); |
| 2235 Cmp(temp, 1); | 2234 Cmp(temp, 1); |
| 2235 } |
| 2236 |
| 2237 |
| 2238 void MacroAssembler::JumpIfMinusZero(DoubleRegister input, |
| 2239 Label* on_negative_zero) { |
| 2240 TestForMinusZero(input); |
| 2236 B(vs, on_negative_zero); | 2241 B(vs, on_negative_zero); |
| 2237 } | 2242 } |
| 2238 | 2243 |
| 2239 | 2244 |
| 2240 void MacroAssembler::ClampInt32ToUint8(Register output, Register input) { | 2245 void MacroAssembler::ClampInt32ToUint8(Register output, Register input) { |
| 2241 // Clamp the value to [0..255]. | 2246 // Clamp the value to [0..255]. |
| 2242 Cmp(input.W(), Operand(input.W(), UXTB)); | 2247 Cmp(input.W(), Operand(input.W(), UXTB)); |
| 2243 // If input < input & 0xff, it must be < 0, so saturate to 0. | 2248 // If input < input & 0xff, it must be < 0, so saturate to 0. |
| 2244 Csel(output.W(), wzr, input.W(), lt); | 2249 Csel(output.W(), wzr, input.W(), lt); |
| 2245 // If input <= input & 0xff, it must be <= 255. Otherwise, saturate to 255. | 2250 // If input <= input & 0xff, it must be <= 255. Otherwise, saturate to 255. |
| (...skipping 2875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5121 } | 5126 } |
| 5122 } | 5127 } |
| 5123 | 5128 |
| 5124 | 5129 |
| 5125 #undef __ | 5130 #undef __ |
| 5126 | 5131 |
| 5127 | 5132 |
| 5128 } } // namespace v8::internal | 5133 } } // namespace v8::internal |
| 5129 | 5134 |
| 5130 #endif // V8_TARGET_ARCH_A64 | 5135 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |