aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2024-02-15 10:37:52 +0100
committerJacob Young <jacobly0@users.noreply.github.com>2024-02-25 11:22:10 +0100
commit2fcb2f597549edd0b1241cebf98c11efe2f25884 (patch)
treeebf6aca8e0c1d5c77874c2c05b0cccd0967d080f /src/type.zig
parent2fdc9e6ae8b6f1ec86050011e1170d639d8c9c2c (diff)
downloadzig-2fcb2f597549edd0b1241cebf98c11efe2f25884.tar.gz
zig-2fcb2f597549edd0b1241cebf98c11efe2f25884.zip
Sema: implement vector coercions
These used to be lowered elementwise in air, and now are a single air instruction that can be lowered elementwise in the backend if necessary.
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/type.zig b/src/type.zig
index f27e157c31..7e570e3bdf 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -2134,7 +2134,8 @@ pub const Type = struct {
/// Returns true if and only if the type is a fixed-width integer.
pub fn isInt(self: Type, mod: *const Module) bool {
- return self.isSignedInt(mod) or self.isUnsignedInt(mod);
+ return self.toIntern() != .comptime_int_type and
+ mod.intern_pool.isIntegerType(self.toIntern());
}
/// Returns true if and only if the type is a fixed-width, signed integer.