mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
tint: Add operator support to intrinsic-gen
Adapt the builtin parsing and resolving to also support operators. Will be used to generate intrinsic table entries for operators. This will simplify maintenance of the operators, and will greatly simplify the [AbstractInt -> i32|u32] [AbstractFloat -> f32|f16] logic. Bug: tint:1504 Change-Id: Id75735ea24e501877418812185796f3fba88a521 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89026 Commit-Queue: Ben Clayton <bclayton@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
d84daed72c
commit
e6e96def66
@@ -15,7 +15,7 @@ See:
|
||||
namespace tint::sem {
|
||||
|
||||
BuiltinType ParseBuiltinType(const std::string& name) {
|
||||
{{- range .Sem.Functions }}
|
||||
{{- range .Sem.Builtins }}
|
||||
if (name == "{{.Name}}") {
|
||||
return BuiltinType::k{{Title .Name}};
|
||||
}
|
||||
@@ -27,7 +27,7 @@ const char* str(BuiltinType i) {
|
||||
switch (i) {
|
||||
case BuiltinType::kNone:
|
||||
return "<none>";
|
||||
{{- range .Sem.Functions }}
|
||||
{{- range .Sem.Builtins }}
|
||||
case BuiltinType::k{{Title .Name}}:
|
||||
return "{{.Name}}";
|
||||
{{- end }}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace tint::sem {
|
||||
/// Enumerator of all builtin functions
|
||||
enum class BuiltinType {
|
||||
kNone = -1,
|
||||
{{- range .Sem.Functions }}
|
||||
{{- range .Sem.Builtins }}
|
||||
k{{Title .Name}},
|
||||
{{- end }}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user