diff options
| author | gingerBill <bill@gingerbill.org> | 2021-12-31 22:54:12 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-12-31 22:54:12 +0000 |
| commit | bdf66bb1e1096690be66eda90b35c6cfdc8a5cf0 (patch) | |
| tree | 9860325658cd5a80b1b09a681dcd1c4fa02509fc /src/types.cpp | |
| parent | 9b5cfe2677be92b0455af1d8e517821b28b7c7c8 (diff) | |
Correct `abs` type behaviour for quaternions
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp index 2b7ea93dc..f621d4346 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -1253,6 +1253,13 @@ bool is_type_quaternion(Type *t) { } return false; } +bool is_type_complex_or_quaternion(Type *t) { + t = core_type(t); + if (t->kind == Type_Basic) { + return (t->Basic.flags & (BasicFlag_Complex|BasicFlag_Quaternion)) != 0; + } + return false; +} bool is_type_f16(Type *t) { t = core_type(t); if (t->kind == Type_Basic) { |