JF Bastien | 5ca0bac | 2015-07-10 18:23:10 +0000 | [diff] [blame] | 1 | //===-- WebAssemblyInstrConv.td-WebAssembly Conversion support -*- tablegen -*-= |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
JF Bastien | 5ca0bac | 2015-07-10 18:23:10 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | /// |
| 9 | /// \file |
Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 10 | /// WebAssembly datatype conversions, truncations, reinterpretations, |
JF Bastien | 5ca0bac | 2015-07-10 18:23:10 +0000 | [diff] [blame] | 11 | /// promotions, and demotions operand code-gen constructs. |
| 12 | /// |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 15 | defm I32_WRAP_I64 : I<(outs I32:$dst), (ins I64:$src), (outs), (ins), |
Dan Gohman | bc58a7b | 2015-11-13 00:50:04 +0000 | [diff] [blame] | 16 | [(set I32:$dst, (trunc I64:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 17 | "i32.wrap_i64\t$dst, $src", "i32.wrap_i64", 0xa7>; |
Dan Gohman | dc51b96 | 2015-10-03 02:10:28 +0000 | [diff] [blame] | 18 | |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 19 | defm I64_EXTEND_S_I32 : I<(outs I64:$dst), (ins I32:$src), (outs), (ins), |
Dan Gohman | bc58a7b | 2015-11-13 00:50:04 +0000 | [diff] [blame] | 20 | [(set I64:$dst, (sext I32:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 21 | "i64.extend_i32_s\t$dst, $src", "i64.extend_i32_s", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 22 | 0xac>; |
| 23 | defm I64_EXTEND_U_I32 : I<(outs I64:$dst), (ins I32:$src), (outs), (ins), |
| 24 | [(set I64:$dst, (zext I32:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 25 | "i64.extend_i32_u\t$dst, $src", "i64.extend_i32_u", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 26 | 0xad>; |
Dan Gohman | dc51b96 | 2015-10-03 02:10:28 +0000 | [diff] [blame] | 27 | |
Dan Gohman | 5d2b935 | 2018-01-19 17:16:24 +0000 | [diff] [blame] | 28 | let Predicates = [HasSignExt] in { |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 29 | defm I32_EXTEND8_S_I32 : I<(outs I32:$dst), (ins I32:$src), (outs), (ins), |
| 30 | [(set I32:$dst, (sext_inreg I32:$src, i8))], |
| 31 | "i32.extend8_s\t$dst, $src", "i32.extend8_s", |
| 32 | 0xc0>; |
| 33 | defm I32_EXTEND16_S_I32 : I<(outs I32:$dst), (ins I32:$src), (outs), (ins), |
| 34 | [(set I32:$dst, (sext_inreg I32:$src, i16))], |
| 35 | "i32.extend16_s\t$dst, $src", "i32.extend16_s", |
| 36 | 0xc1>; |
| 37 | defm I64_EXTEND8_S_I64 : I<(outs I64:$dst), (ins I64:$src), (outs), (ins), |
| 38 | [(set I64:$dst, (sext_inreg I64:$src, i8))], |
| 39 | "i64.extend8_s\t$dst, $src", "i64.extend8_s", |
| 40 | 0xc2>; |
| 41 | defm I64_EXTEND16_S_I64 : I<(outs I64:$dst), (ins I64:$src), (outs), (ins), |
| 42 | [(set I64:$dst, (sext_inreg I64:$src, i16))], |
| 43 | "i64.extend16_s\t$dst, $src", "i64.extend16_s", |
| 44 | 0xc3>; |
| 45 | defm I64_EXTEND32_S_I64 : I<(outs I64:$dst), (ins I64:$src), (outs), (ins), |
| 46 | [(set I64:$dst, (sext_inreg I64:$src, i32))], |
| 47 | "i64.extend32_s\t$dst, $src", "i64.extend32_s", |
| 48 | 0xc4>; |
Dan Gohman | 5d2b935 | 2018-01-19 17:16:24 +0000 | [diff] [blame] | 49 | } // Predicates = [HasSignExt] |
Derek Schuff | a519fe5 | 2017-09-13 00:29:06 +0000 | [diff] [blame] | 50 | |
Dan Gohman | df00a9e | 2015-12-10 00:17:35 +0000 | [diff] [blame] | 51 | // Expand a "don't care" extend into zero-extend (chosen over sign-extend |
| 52 | // somewhat arbitrarily, although it favors popular hardware architectures |
| 53 | // and is conceptually a simpler operation). |
| 54 | def : Pat<(i64 (anyext I32:$src)), (I64_EXTEND_U_I32 I32:$src)>; |
| 55 | |
Dan Gohman | cdd48b8 | 2017-11-28 01:13:40 +0000 | [diff] [blame] | 56 | // Conversion from floating point to integer instructions which don't trap on |
| 57 | // overflow or invalid. |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 58 | defm I32_TRUNC_S_SAT_F32 : I<(outs I32:$dst), (ins F32:$src), (outs), (ins), |
| 59 | [(set I32:$dst, (fp_to_sint F32:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 60 | "i32.trunc_sat_f32_s\t$dst, $src", |
| 61 | "i32.trunc_sat_f32_s", 0xfc00>, |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 62 | Requires<[HasNontrappingFPToInt]>; |
| 63 | defm I32_TRUNC_U_SAT_F32 : I<(outs I32:$dst), (ins F32:$src), (outs), (ins), |
| 64 | [(set I32:$dst, (fp_to_uint F32:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 65 | "i32.trunc_sat_f32_u\t$dst, $src", |
| 66 | "i32.trunc_sat_f32_u", 0xfc01>, |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 67 | Requires<[HasNontrappingFPToInt]>; |
| 68 | defm I64_TRUNC_S_SAT_F32 : I<(outs I64:$dst), (ins F32:$src), (outs), (ins), |
| 69 | [(set I64:$dst, (fp_to_sint F32:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 70 | "i64.trunc_sat_f32_s\t$dst, $src", |
| 71 | "i64.trunc_sat_f32_s", 0xfc04>, |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 72 | Requires<[HasNontrappingFPToInt]>; |
| 73 | defm I64_TRUNC_U_SAT_F32 : I<(outs I64:$dst), (ins F32:$src), (outs), (ins), |
| 74 | [(set I64:$dst, (fp_to_uint F32:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 75 | "i64.trunc_sat_f32_u\t$dst, $src", |
| 76 | "i64.trunc_sat_f32_u", 0xfc05>, |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 77 | Requires<[HasNontrappingFPToInt]>; |
| 78 | defm I32_TRUNC_S_SAT_F64 : I<(outs I32:$dst), (ins F64:$src), (outs), (ins), |
| 79 | [(set I32:$dst, (fp_to_sint F64:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 80 | "i32.trunc_sat_f64_s\t$dst, $src", |
| 81 | "i32.trunc_sat_f64_s", 0xfc02>, |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 82 | Requires<[HasNontrappingFPToInt]>; |
| 83 | defm I32_TRUNC_U_SAT_F64 : I<(outs I32:$dst), (ins F64:$src), (outs), (ins), |
| 84 | [(set I32:$dst, (fp_to_uint F64:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 85 | "i32.trunc_sat_f64_u\t$dst, $src", |
| 86 | "i32.trunc_sat_f64_u", 0xfc03>, |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 87 | Requires<[HasNontrappingFPToInt]>; |
| 88 | defm I64_TRUNC_S_SAT_F64 : I<(outs I64:$dst), (ins F64:$src), (outs), (ins), |
| 89 | [(set I64:$dst, (fp_to_sint F64:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 90 | "i64.trunc_sat_f64_s\t$dst, $src", |
| 91 | "i64.trunc_sat_f64_s", 0xfc06>, |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 92 | Requires<[HasNontrappingFPToInt]>; |
| 93 | defm I64_TRUNC_U_SAT_F64 : I<(outs I64:$dst), (ins F64:$src), (outs), (ins), |
| 94 | [(set I64:$dst, (fp_to_uint F64:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 95 | "i64.trunc_sat_f64_u\t$dst, $src", |
| 96 | "i64.trunc_sat_f64_u", 0xfc07>, |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 97 | Requires<[HasNontrappingFPToInt]>; |
Dan Gohman | cdd48b8 | 2017-11-28 01:13:40 +0000 | [diff] [blame] | 98 | |
Thomas Lively | 2ebacb1 | 2018-10-11 00:01:25 +0000 | [diff] [blame] | 99 | // Lower llvm.wasm.trunc.saturate.* to saturating instructions |
| 100 | def : Pat<(int_wasm_trunc_saturate_signed F32:$src), |
| 101 | (I32_TRUNC_S_SAT_F32 F32:$src)>; |
| 102 | def : Pat<(int_wasm_trunc_saturate_unsigned F32:$src), |
| 103 | (I32_TRUNC_U_SAT_F32 F32:$src)>; |
| 104 | def : Pat<(int_wasm_trunc_saturate_signed F64:$src), |
| 105 | (I32_TRUNC_S_SAT_F64 F64:$src)>; |
| 106 | def : Pat<(int_wasm_trunc_saturate_unsigned F64:$src), |
| 107 | (I32_TRUNC_U_SAT_F64 F64:$src)>; |
| 108 | def : Pat<(int_wasm_trunc_saturate_signed F32:$src), |
| 109 | (I64_TRUNC_S_SAT_F32 F32:$src)>; |
| 110 | def : Pat<(int_wasm_trunc_saturate_unsigned F32:$src), |
| 111 | (I64_TRUNC_U_SAT_F32 F32:$src)>; |
| 112 | def : Pat<(int_wasm_trunc_saturate_signed F64:$src), |
| 113 | (I64_TRUNC_S_SAT_F64 F64:$src)>; |
| 114 | def : Pat<(int_wasm_trunc_saturate_unsigned F64:$src), |
| 115 | (I64_TRUNC_U_SAT_F64 F64:$src)>; |
| 116 | |
Dan Gohman | cdd48b8 | 2017-11-28 01:13:40 +0000 | [diff] [blame] | 117 | // Conversion from floating point to integer pseudo-instructions which don't |
| 118 | // trap on overflow or invalid. |
| 119 | let usesCustomInserter = 1, isCodeGenOnly = 1 in { |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 120 | defm FP_TO_SINT_I32_F32 : I<(outs I32:$dst), (ins F32:$src), (outs), (ins), |
| 121 | [(set I32:$dst, (fp_to_sint F32:$src))], "", "", 0>, |
| 122 | Requires<[NotHasNontrappingFPToInt]>; |
| 123 | defm FP_TO_UINT_I32_F32 : I<(outs I32:$dst), (ins F32:$src), (outs), (ins), |
| 124 | [(set I32:$dst, (fp_to_uint F32:$src))], "", "", 0>, |
| 125 | Requires<[NotHasNontrappingFPToInt]>; |
| 126 | defm FP_TO_SINT_I64_F32 : I<(outs I64:$dst), (ins F32:$src), (outs), (ins), |
| 127 | [(set I64:$dst, (fp_to_sint F32:$src))], "", "", 0>, |
| 128 | Requires<[NotHasNontrappingFPToInt]>; |
| 129 | defm FP_TO_UINT_I64_F32 : I<(outs I64:$dst), (ins F32:$src), (outs), (ins), |
| 130 | [(set I64:$dst, (fp_to_uint F32:$src))], "", "", 0>, |
| 131 | Requires<[NotHasNontrappingFPToInt]>; |
| 132 | defm FP_TO_SINT_I32_F64 : I<(outs I32:$dst), (ins F64:$src), (outs), (ins), |
| 133 | [(set I32:$dst, (fp_to_sint F64:$src))], "", "", 0>, |
| 134 | Requires<[NotHasNontrappingFPToInt]>; |
| 135 | defm FP_TO_UINT_I32_F64 : I<(outs I32:$dst), (ins F64:$src), (outs), (ins), |
| 136 | [(set I32:$dst, (fp_to_uint F64:$src))], "", "", 0>, |
| 137 | Requires<[NotHasNontrappingFPToInt]>; |
| 138 | defm FP_TO_SINT_I64_F64 : I<(outs I64:$dst), (ins F64:$src), (outs), (ins), |
| 139 | [(set I64:$dst, (fp_to_sint F64:$src))], "", "", 0>, |
| 140 | Requires<[NotHasNontrappingFPToInt]>; |
| 141 | defm FP_TO_UINT_I64_F64 : I<(outs I64:$dst), (ins F64:$src), (outs), (ins), |
| 142 | [(set I64:$dst, (fp_to_uint F64:$src))], "", "", 0>, |
| 143 | Requires<[NotHasNontrappingFPToInt]>; |
Dan Gohman | cdd48b8 | 2017-11-28 01:13:40 +0000 | [diff] [blame] | 144 | } // usesCustomInserter, isCodeGenOnly = 1 |
| 145 | |
Dan Gohman | 174b2d8 | 2015-11-29 22:59:19 +0000 | [diff] [blame] | 146 | // Conversion from floating point to integer traps on overflow and invalid. |
| 147 | let hasSideEffects = 1 in { |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 148 | defm I32_TRUNC_S_F32 : I<(outs I32:$dst), (ins F32:$src), (outs), (ins), |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 149 | [], "i32.trunc_f32_s\t$dst, $src", "i32.trunc_f32_s", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 150 | 0xa8>; |
| 151 | defm I32_TRUNC_U_F32 : I<(outs I32:$dst), (ins F32:$src), (outs), (ins), |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 152 | [], "i32.trunc_f32_u\t$dst, $src", "i32.trunc_f32_u", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 153 | 0xa9>; |
| 154 | defm I64_TRUNC_S_F32 : I<(outs I64:$dst), (ins F32:$src), (outs), (ins), |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 155 | [], "i64.trunc_f32_s\t$dst, $src", "i64.trunc_f32_s", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 156 | 0xae>; |
| 157 | defm I64_TRUNC_U_F32 : I<(outs I64:$dst), (ins F32:$src), (outs), (ins), |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 158 | [], "i64.trunc_f32_u\t$dst, $src", "i64.trunc_f32_u", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 159 | 0xaf>; |
| 160 | defm I32_TRUNC_S_F64 : I<(outs I32:$dst), (ins F64:$src), (outs), (ins), |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 161 | [], "i32.trunc_f64_s\t$dst, $src", "i32.trunc_f64_s", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 162 | 0xaa>; |
| 163 | defm I32_TRUNC_U_F64 : I<(outs I32:$dst), (ins F64:$src), (outs), (ins), |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 164 | [], "i32.trunc_f64_u\t$dst, $src", "i32.trunc_f64_u", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 165 | 0xab>; |
| 166 | defm I64_TRUNC_S_F64 : I<(outs I64:$dst), (ins F64:$src), (outs), (ins), |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 167 | [], "i64.trunc_f64_s\t$dst, $src", "i64.trunc_f64_s", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 168 | 0xb0>; |
| 169 | defm I64_TRUNC_U_F64 : I<(outs I64:$dst), (ins F64:$src), (outs), (ins), |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 170 | [], "i64.trunc_f64_u\t$dst, $src", "i64.trunc_f64_u", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 171 | 0xb1>; |
Dan Gohman | 174b2d8 | 2015-11-29 22:59:19 +0000 | [diff] [blame] | 172 | } // hasSideEffects = 1 |
Dan Gohman | dc51b96 | 2015-10-03 02:10:28 +0000 | [diff] [blame] | 173 | |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 174 | defm F32_CONVERT_S_I32 : I<(outs F32:$dst), (ins I32:$src), (outs), (ins), |
| 175 | [(set F32:$dst, (sint_to_fp I32:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 176 | "f32.convert_i32_s\t$dst, $src", "f32.convert_i32_s", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 177 | 0xb2>; |
| 178 | defm F32_CONVERT_U_I32 : I<(outs F32:$dst), (ins I32:$src), (outs), (ins), |
| 179 | [(set F32:$dst, (uint_to_fp I32:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 180 | "f32.convert_i32_u\t$dst, $src", "f32.convert_i32_u", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 181 | 0xb3>; |
| 182 | defm F64_CONVERT_S_I32 : I<(outs F64:$dst), (ins I32:$src), (outs), (ins), |
| 183 | [(set F64:$dst, (sint_to_fp I32:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 184 | "f64.convert_i32_s\t$dst, $src", "f64.convert_i32_s", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 185 | 0xb7>; |
| 186 | defm F64_CONVERT_U_I32 : I<(outs F64:$dst), (ins I32:$src), (outs), (ins), |
| 187 | [(set F64:$dst, (uint_to_fp I32:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 188 | "f64.convert_i32_u\t$dst, $src", "f64.convert_i32_u", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 189 | 0xb8>; |
| 190 | defm F32_CONVERT_S_I64 : I<(outs F32:$dst), (ins I64:$src), (outs), (ins), |
| 191 | [(set F32:$dst, (sint_to_fp I64:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 192 | "f32.convert_i64_s\t$dst, $src", "f32.convert_i64_s", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 193 | 0xb4>; |
| 194 | defm F32_CONVERT_U_I64 : I<(outs F32:$dst), (ins I64:$src), (outs), (ins), |
| 195 | [(set F32:$dst, (uint_to_fp I64:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 196 | "f32.convert_i64_u\t$dst, $src", "f32.convert_i64_u", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 197 | 0xb5>; |
| 198 | defm F64_CONVERT_S_I64 : I<(outs F64:$dst), (ins I64:$src), (outs), (ins), |
| 199 | [(set F64:$dst, (sint_to_fp I64:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 200 | "f64.convert_i64_s\t$dst, $src", "f64.convert_i64_s", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 201 | 0xb9>; |
| 202 | defm F64_CONVERT_U_I64 : I<(outs F64:$dst), (ins I64:$src), (outs), (ins), |
| 203 | [(set F64:$dst, (uint_to_fp I64:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 204 | "f64.convert_i64_u\t$dst, $src", "f64.convert_i64_u", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 205 | 0xba>; |
Dan Gohman | dc51b96 | 2015-10-03 02:10:28 +0000 | [diff] [blame] | 206 | |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 207 | defm F64_PROMOTE_F32 : I<(outs F64:$dst), (ins F32:$src), (outs), (ins), |
| 208 | [(set F64:$dst, (fpextend F32:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 209 | "f64.promote_f32\t$dst, $src", "f64.promote_f32", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 210 | 0xbb>; |
| 211 | defm F32_DEMOTE_F64 : I<(outs F32:$dst), (ins F64:$src), (outs), (ins), |
| 212 | [(set F32:$dst, (fpround F64:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 213 | "f32.demote_f64\t$dst, $src", "f32.demote_f64", |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 214 | 0xb6>; |
Dan Gohman | dc51b96 | 2015-10-03 02:10:28 +0000 | [diff] [blame] | 215 | |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 216 | defm I32_REINTERPRET_F32 : I<(outs I32:$dst), (ins F32:$src), (outs), (ins), |
| 217 | [(set I32:$dst, (bitconvert F32:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 218 | "i32.reinterpret_f32\t$dst, $src", |
| 219 | "i32.reinterpret_f32", 0xbc>; |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 220 | defm F32_REINTERPRET_I32 : I<(outs F32:$dst), (ins I32:$src), (outs), (ins), |
| 221 | [(set F32:$dst, (bitconvert I32:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 222 | "f32.reinterpret_i32\t$dst, $src", |
| 223 | "f32.reinterpret_i32", 0xbe>; |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 224 | defm I64_REINTERPRET_F64 : I<(outs I64:$dst), (ins F64:$src), (outs), (ins), |
| 225 | [(set I64:$dst, (bitconvert F64:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 226 | "i64.reinterpret_f64\t$dst, $src", |
| 227 | "i64.reinterpret_f64", 0xbd>; |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 228 | defm F64_REINTERPRET_I64 : I<(outs F64:$dst), (ins I64:$src), (outs), (ins), |
| 229 | [(set F64:$dst, (bitconvert I64:$src))], |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 230 | "f64.reinterpret_i64\t$dst, $src", |
| 231 | "f64.reinterpret_i64", 0xbf>; |