Skip to content

Commit d0b7022

Browse files
authored
[libc] Refactor stdfix extension from llvm_libc_ext.td to llvm_libc_stdfix_ext.td. (#84365)
This fixes runtime build for armv6 baremetal targets: #83959 (comment)
1 parent 292a28d commit d0b7022

File tree

4 files changed

+26
-21
lines changed

4 files changed

+26
-21
lines changed

libc/config/baremetal/api.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ include "config/public_api.td"
22

33
include "spec/stdc.td"
44
include "spec/stdc_ext.td"
5-
include "spec/llvm_libc_ext.td"
5+
include "spec/llvm_libc_stdfix_ext.td"
66

77
def AssertMacro : MacroDef<"assert"> {
88
let Defn = [{

libc/config/linux/api.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ include "spec/gnu_ext.td"
77
include "spec/bsd_ext.td"
88
include "spec/stdc_ext.td"
99
include "spec/llvm_libc_ext.td"
10+
include "spec/llvm_libc_stdfix_ext.td"
1011

1112
def AssertMacro : MacroDef<"assert"> {
1213
let Defn = [{

libc/spec/llvm_libc_ext.td

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,29 +51,9 @@ def LLVMLibcExt : StandardSpec<"llvm_libc_ext"> {
5151
]
5252
>;
5353

54-
HeaderSpec StdFix = HeaderSpec<
55-
"stdfix.h",
56-
[], // macros
57-
[], // types
58-
[], // enums
59-
[ // functions
60-
GuardedFunctionSpec<"sqrtuhr", RetValSpec<UnsignedShortFractType>, [ArgSpec<UnsignedShortFractType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
61-
GuardedFunctionSpec<"sqrtur", RetValSpec<UnsignedFractType>, [ArgSpec<UnsignedFractType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
62-
GuardedFunctionSpec<"sqrtulr", RetValSpec<UnsignedLongFractType>, [ArgSpec<UnsignedLongFractType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
63-
64-
GuardedFunctionSpec<"sqrtuhk", RetValSpec<UnsignedShortAccumType>, [ArgSpec<UnsignedShortAccumType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
65-
GuardedFunctionSpec<"sqrtuk", RetValSpec<UnsignedAccumType>, [ArgSpec<UnsignedAccumType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
66-
GuardedFunctionSpec<"sqrtulk", RetValSpec<UnsignedLongAccumType>, [ArgSpec<UnsignedLongAccumType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
67-
68-
GuardedFunctionSpec<"uhksqrtus", RetValSpec<UnsignedShortAccumType>, [ArgSpec<UnsignedShortType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
69-
GuardedFunctionSpec<"uksqrtui", RetValSpec<UnsignedAccumType>, [ArgSpec<UnsignedIntType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
70-
]
71-
>;
72-
7354
let Headers = [
7455
Assert,
7556
Sched,
76-
StdFix,
7757
Strings,
7858
];
7959
}

libc/spec/llvm_libc_stdfix_ext.td

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
def LLVMLibcStdfixExt : StandardSpec<"llvm_libc_stdfix_ext"> {
2+
HeaderSpec StdFix = HeaderSpec<
3+
"stdfix.h",
4+
[], // macros
5+
[], // types
6+
[], // enums
7+
[ // functions
8+
GuardedFunctionSpec<"sqrtuhr", RetValSpec<UnsignedShortFractType>, [ArgSpec<UnsignedShortFractType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
9+
GuardedFunctionSpec<"sqrtur", RetValSpec<UnsignedFractType>, [ArgSpec<UnsignedFractType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
10+
GuardedFunctionSpec<"sqrtulr", RetValSpec<UnsignedLongFractType>, [ArgSpec<UnsignedLongFractType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
11+
12+
GuardedFunctionSpec<"sqrtuhk", RetValSpec<UnsignedShortAccumType>, [ArgSpec<UnsignedShortAccumType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
13+
GuardedFunctionSpec<"sqrtuk", RetValSpec<UnsignedAccumType>, [ArgSpec<UnsignedAccumType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
14+
GuardedFunctionSpec<"sqrtulk", RetValSpec<UnsignedLongAccumType>, [ArgSpec<UnsignedLongAccumType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
15+
16+
GuardedFunctionSpec<"uhksqrtus", RetValSpec<UnsignedShortAccumType>, [ArgSpec<UnsignedShortType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
17+
GuardedFunctionSpec<"uksqrtui", RetValSpec<UnsignedAccumType>, [ArgSpec<UnsignedIntType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
18+
]
19+
>;
20+
21+
let Headers = [
22+
StdFix,
23+
];
24+
}

0 commit comments

Comments
 (0)