spirv: implement arithmeticTypeInfo for Enum (@intToEnum)

This commit is contained in:
Ali Chraghi
2023-05-15 14:22:40 +03:30
parent 9c550721e4
commit f8de4db873
3 changed files with 11 additions and 6 deletions

View File

@@ -369,6 +369,17 @@ pub const DeclGen = struct {
.composite_integer,
};
},
.Enum => blk: {
var buffer: Type.Payload.Bits = undefined;
const int_ty = ty.intTagType(&buffer);
const int_info = int_ty.intInfo(target);
break :blk ArithmeticTypeInfo{
.bits = int_info.bits,
.is_vector = false,
.signedness = int_info.signedness,
.class = .integer,
};
},
// As of yet, there is no vector support in the self-hosted compiler.
.Vector => self.todo("implement arithmeticTypeInfo for Vector", .{}),
// TODO: For which types is this the case?