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