@@ -15,13 +15,26 @@ def UnsignedShortAccumType : NamedType<"unsigned short accum">;
1515def UnsignedAccumType : NamedType<"unsigned accum">;
1616def UnsignedLongAccumType : NamedType<"unsigned long accum">;
1717
18+ def IntHrT : NamedType <"int_hr_t">;
19+ def IntRT : NamedTypes<"int_r_t">;
20+ def IntLrT : NamedType<"int_lr_t">;
21+ def IntHkT : NamedType<"int_hk_t">;
22+ def IntKT : NamedType<"int_k_t">;
23+ def IntLkT : NamedType<"int_lk_t">;
24+ def UIntUhrT : NamedType<"uint_uhr_t">;
25+ def UIntUrT : NamedType<"uint_ur_t">;
26+ def UIntUlrT : NamedType<"uint_ulr_t">;
27+ def UIntUhkT : NamedType<"uint_uhk_t">;
28+ def UIntUkT : NamedType<"uint_uk_t">;
29+ def UIntUlkT : NamedType<"uint_ulk_t">;
30+
1831def StdcExt : StandardSpec<"stdc_ext"> {
1932 // From ISO/IEC TR 18037:2008 standard:
2033 // https://standards.iso.org/ittf/PubliclyAvailableStandards/c051126_ISO_IEC_TR_18037_2008.zip
2134 HeaderSpec StdFix = HeaderSpec<
2235 "stdfix.h",
2336 [], // macros
24- [], // types
37+ [IntHrT,IntRT, IntLrT, IntHkT, IntKT, IntLkT, UIntUhrT, UIntUrT, UIntUlrT, UIntUhkT, UIntUkT, UIntUlkT ], // types
2538 [], // enums
2639 [ // functions
2740 GuardedFunctionSpec<"abshr", RetValSpec<ShortFractType>, [ArgSpec<ShortFractType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
@@ -47,6 +60,19 @@ def StdcExt : StandardSpec<"stdc_ext"> {
4760 GuardedFunctionSpec<"rounduhk", RetValSpec<UnsignedShortAccumType>, [ArgSpec<UnsignedShortAccumType>, ArgSpec<IntType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
4861 GuardedFunctionSpec<"rounduk", RetValSpec<UnsignedAccumType>, [ArgSpec<UnsignedAccumType>, ArgSpec<IntType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
4962 GuardedFunctionSpec<"roundulk", RetValSpec<UnsignedLongAccumType>, [ArgSpec<UnsignedLongAccumType>, ArgSpec<IntType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
63+
64+ GuardedFunctionSpec<"hrbits", RetValSpec<ShortFractType>, [ArgSpec<IntHrT>], "LIBC_COMPILER_HAS_FIXED_POINT">,
65+ GuardedFunctionSpec<"rbits", RetValSpec<FractType>, [ArgSpec<IntRT>], "LIBC_COMPILER_HAS_FIXED_POINT">,
66+ GuardedFunctionSpec<"lrbits", RetValSpec<LongFractType>, [ArgSpec<IntLrT>], "LIBC_COMPILER_HAS_FIXED_POINT">,
67+ GuardedFunctionSpec<"hkbits", RetValSpec<ShortAccumType>, [ArgSpec<IntHkT>], "LIBC_COMPILER_HAS_FIXED_POINT">,
68+ GuardedFunctionSpec<"kbits", RetValSpec<AccumType>, [ArgSpec<IntKT>], "LIBC_COMPILER_HAS_FIXED_POINT">,
69+ GuardedFunctionSpec<"lkbits", RetValSpec<LongAccumType>, [ArgSpec<IntLkT>], "LIBC_COMPILER_HAS_FIXED_POINT">,
70+ GuardedFunctionSpec<"uhrbits", RetValSpec<UnsignedShortFractType>, [ArgSpec<UIntUhrT>], "LIBC_COMPILER_HAS_FIXED_POINT">,
71+ GuardedFunctionSpec<"urbits", RetValSpec<UnsignedFractType>, [ArgSpec<UIntUrT>], "LIBC_COMPILER_HAS_FIXED_POINT">,
72+ GuardedFunctionSpec<"ukbits", RetValSpec<UnsignedAccumType>, [ArgSpec<UIntUkT>], "LIBC_COMPILER_HAS_FIXED_POINT">
73+ GuardedFunctionSpec<"ulrbits", RetValSpec<UnsignedLongFractType>, [ArgSpec<UIntUlrT>], "LIBC_COMPILER_HAS_FIXED_POINT">,
74+ GuardedFunctionSpec<"uhkbits", RetValSpec<UnsignedShortAccumType>, [ArgSpec<UIntUhkT>], "LIBC_COMPILER_HAS_FIXED_POINT">
75+ GuardedFunctionSpec<"ulkbits", RetValSpec<UnsignedLongAccumType>, [ArgSpec<UIntUlkT>], "LIBC_COMPILER_HAS_FIXED_POINT">
5076 ]
5177 >;
5278
0 commit comments