| ... | ... | @@ -134,28 +134,24 @@ pub const Inst = struct { |
| 134 | 134 | /// Uses the `bin_op` field. |
| 135 | 135 | min, |
| 136 | 136 | /// Integer addition with overflow. Both operands are guaranteed to be the same type, |
| 137 | | /// and the result is bool. The wrapped value is written to the pointer given by the in |
| 138 | | /// operand of the `pl_op` field. Payload is `Bin` with `lhs` and `rhs` the relevant types |
| 139 | | /// of the operation. |
| 140 | | /// Uses the `pl_op` field with payload `Bin`. |
| 137 | /// and the result is a tuple with .{res, ov}. The wrapped value is written to res |
| 138 | /// and if an overflow happens, ov is 1. Otherwise ov is 0. |
| 139 | /// Uses the `ty_pl` field. Payload is `Bin`. |
| 141 | 140 | add_with_overflow, |
| 142 | 141 | /// Integer subtraction with overflow. Both operands are guaranteed to be the same type, |
| 143 | | /// and the result is bool. The wrapped value is written to the pointer given by the in |
| 144 | | /// operand of the `pl_op` field. Payload is `Bin` with `lhs` and `rhs` the relevant types |
| 145 | | /// of the operation. |
| 146 | | /// Uses the `pl_op` field with payload `Bin`. |
| 142 | /// and the result is a tuple with .{res, ov}. The wrapped value is written to res |
| 143 | /// and if an overflow happens, ov is 1. Otherwise ov is 0. |
| 144 | /// Uses the `ty_pl` field. Payload is `Bin`. |
| 147 | 145 | sub_with_overflow, |
| 148 | 146 | /// Integer multiplication with overflow. Both operands are guaranteed to be the same type, |
| 149 | | /// and the result is bool. The wrapped value is written to the pointer given by the in |
| 150 | | /// operand of the `pl_op` field. Payload is `Bin` with `lhs` and `rhs` the relevant types |
| 151 | | /// of the operation. |
| 152 | | /// Uses the `pl_op` field with payload `Bin`. |
| 147 | /// and the result is a tuple with .{res, ov}. The wrapped value is written to res |
| 148 | /// and if an overflow happens, ov is 1. Otherwise ov is 0. |
| 149 | /// Uses the `ty_pl` field. Payload is `Bin`. |
| 153 | 150 | mul_with_overflow, |
| 154 | 151 | /// Integer left-shift with overflow. Both operands are guaranteed to be the same type, |
| 155 | | /// and the result is bool. The wrapped value is written to the pointer given by the in |
| 156 | | /// operand of the `pl_op` field. Payload is `Bin` with `lhs` and `rhs` the relevant types |
| 157 | | /// of the operation. |
| 158 | | /// Uses the `pl_op` field with payload `Bin`. |
| 152 | /// and the result is a tuple with .{res, ov}. The wrapped value is written to res |
| 153 | /// and if an overflow happens, ov is 1. Otherwise ov is 0. |
| 154 | /// Uses the `ty_pl` field. Payload is `Bin`. |
| 159 | 155 | shl_with_overflow, |
| 160 | 156 | /// Allocates stack local memory. |
| 161 | 157 | /// Uses the `ty` field. |
| ... | ... | @@ -964,6 +960,10 @@ pub fn typeOfIndex(air: Air, inst: Air.Inst.Index) Type { |
| 964 | 960 | .union_init, |
| 965 | 961 | .field_parent_ptr, |
| 966 | 962 | .cmp_vector, |
| 963 | .add_with_overflow, |
| 964 | .sub_with_overflow, |
| 965 | .mul_with_overflow, |
| 966 | .shl_with_overflow, |
| 967 | 967 | => return air.getRefType(datas[inst].ty_pl.ty), |
| 968 | 968 | |
| 969 | 969 | .not, |
| ... | ... | @@ -1074,12 +1074,6 @@ pub fn typeOfIndex(air: Air, inst: Air.Inst.Index) Type { |
| 1074 | 1074 | const extra = air.extraData(Air.Bin, datas[inst].pl_op.payload).data; |
| 1075 | 1075 | return air.typeOf(extra.lhs); |
| 1076 | 1076 | }, |
| 1077 | | |
| 1078 | | .add_with_overflow, |
| 1079 | | .sub_with_overflow, |
| 1080 | | .mul_with_overflow, |
| 1081 | | .shl_with_overflow, |
| 1082 | | => return Type.bool, |
| 1083 | 1077 | } |
| 1084 | 1078 | } |
| 1085 | 1079 | |