diff options
| author | William Sengir <william@sengir.com> | 2022-03-19 23:44:55 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-03-21 16:54:19 -0700 |
| commit | 0f4830704171b734bb4a0235fc14809282457dc3 (patch) | |
| tree | f14d426793b2878db30315195c068e6d28ca608d /src/codegen/llvm.zig | |
| parent | 862e63f535ec8d65e33ed7ea67eb9cf03bfc7d6a (diff) | |
| download | zig-0f4830704171b734bb4a0235fc14809282457dc3.tar.gz zig-0f4830704171b734bb4a0235fc14809282457dc3.zip | |
stage2: add AIR instruction `cmp_vector`
The existing `cmp_*` instructions get their result type from `lhs`, but
vector comparison will always return a vector of bools with only the
length derived from its operands. This necessitates the creation of a
new AIR instruction.
Diffstat (limited to 'src/codegen/llvm.zig')
| -rw-r--r-- | src/codegen/llvm.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 139c1f25cb..edf8992c56 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -3375,6 +3375,7 @@ pub const FuncGen = struct { .cmp_lt => try self.airCmp(inst, .lt), .cmp_lte => try self.airCmp(inst, .lte), .cmp_neq => try self.airCmp(inst, .neq), + .cmp_vector => try self.airCmpVector(inst), .is_non_null => try self.airIsNonNull(inst, false, false, .NE), .is_non_null_ptr => try self.airIsNonNull(inst, true , false, .NE), @@ -3640,6 +3641,11 @@ pub const FuncGen = struct { return self.cmp(lhs, rhs, operand_ty, op); } + fn airCmpVector(self: *FuncGen, inst: Air.Inst.Index) !?*const llvm.Value { + _ = inst; + return self.todo("implement airCmpVector"); + } + fn cmp( self: *FuncGen, lhs: *const llvm.Value, |
