Commit 2d8fef5680

William Sengir <william@sengir.com>
2022-03-20 08:06:23
stage2: make bool binop AIR return types based on operand type
This allows vector-of-bools operands to return a vector-of-bools.
1 parent 4e35715
Changed files (1)
src/Air.zig
@@ -904,6 +904,8 @@ pub fn typeOfIndex(air: Air, inst: Air.Inst.Index) Type {
         .shl_sat,
         .min,
         .max,
+        .bool_and,
+        .bool_or,
         => return air.typeOf(datas[inst].bin_op.lhs),
 
         .sqrt,
@@ -935,8 +937,6 @@ pub fn typeOfIndex(air: Air, inst: Air.Inst.Index) Type {
         .is_non_err,
         .is_err_ptr,
         .is_non_err_ptr,
-        .bool_and,
-        .bool_or,
         => return Type.initTag(.bool),
 
         .const_ty => return Type.initTag(.type),