| 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 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1840 | 1840 |
| 1841 if (on_successful_conversion) { | 1841 if (on_successful_conversion) { |
| 1842 B(on_successful_conversion, eq); | 1842 B(on_successful_conversion, eq); |
| 1843 } | 1843 } |
| 1844 if (on_failed_conversion) { | 1844 if (on_failed_conversion) { |
| 1845 B(on_failed_conversion, ne); | 1845 B(on_failed_conversion, ne); |
| 1846 } | 1846 } |
| 1847 } | 1847 } |
| 1848 | 1848 |
| 1849 | 1849 |
| 1850 void MacroAssembler::JumpIfMinusZero(DoubleRegister input, |
| 1851 Label* on_negative_zero) { |
| 1852 // Floating point -0.0 is kMinInt as an integer, so subtracting 1 (cmp) will |
| 1853 // cause overflow. |
| 1854 Fmov(Tmp0(), input); |
| 1855 Cmp(Tmp0(), 1); |
| 1856 B(vs, on_negative_zero); |
| 1857 } |
| 1858 |
| 1859 |
| 1850 void MacroAssembler::ClampInt32ToUint8(Register output, Register input) { | 1860 void MacroAssembler::ClampInt32ToUint8(Register output, Register input) { |
| 1851 // Clamp the value to [0..255]. | 1861 // Clamp the value to [0..255]. |
| 1852 Cmp(input.W(), Operand(input.W(), UXTB)); | 1862 Cmp(input.W(), Operand(input.W(), UXTB)); |
| 1853 // If input < input & 0xff, it must be < 0, so saturate to 0. | 1863 // If input < input & 0xff, it must be < 0, so saturate to 0. |
| 1854 Csel(output.W(), wzr, input.W(), lt); | 1864 Csel(output.W(), wzr, input.W(), lt); |
| 1855 // Create a constant 0xff. | 1865 // Create a constant 0xff. |
| 1856 Mov(WTmp0(), 255); | 1866 Mov(WTmp0(), 255); |
| 1857 // If input > input & 0xff, it must be > 255, so saturate to 255. | 1867 // If input > input & 0xff, it must be > 255, so saturate to 255. |
| 1858 Csel(output.W(), WTmp0(), output.W(), gt); | 1868 Csel(output.W(), WTmp0(), output.W(), gt); |
| 1859 } | 1869 } |
| (...skipping 2834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4694 } | 4704 } |
| 4695 } | 4705 } |
| 4696 | 4706 |
| 4697 | 4707 |
| 4698 #undef __ | 4708 #undef __ |
| 4699 | 4709 |
| 4700 | 4710 |
| 4701 } } // namespace v8::internal | 4711 } } // namespace v8::internal |
| 4702 | 4712 |
| 4703 #endif // V8_TARGET_ARCH_A64 | 4713 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |