SPIR-V requires OpLogicalOr/And/NotEqual for boolean operands, but the codegen was emitting OpBitwiseOr/And/Xor unconditionally. This caused validation failures in safety checks (e.g., division overflow check computes (a != MIN) | (b != -1) on booleans).
Add airBitwiseOp() that selects the appropriate opcode based on operand type:
- bool: OpLogicalAnd, OpLogicalOr, OpLogicalNotEqual
- integer: OpBitwiseAnd, OpBitwiseOr, OpBitwiseXor
SPIR-V requires OpLogicalOr/And/NotEqual for boolean operands, but the codegen was emitting OpBitwiseOr/And/Xor unconditionally. This caused validation failures in safety checks (e.g., division overflow check computes `(a != MIN) | (b != -1)` on booleans).
Add airBitwiseOp() that selects the appropriate opcode based on operand type:
- bool: OpLogicalAnd, OpLogicalOr, OpLogicalNotEqual
- integer: OpBitwiseAnd, OpBitwiseOr, OpBitwiseXor