Skip to content

Commit 82cc2a6

Browse files
authored
[libc] Include stdfix.h in baremetal targets (llvm#83900)
Fixed-point arithmetic support is targeted towards baremetal targets.
1 parent db3bbe0 commit 82cc2a6

File tree

5 files changed

+63
-1
lines changed

5 files changed

+63
-1
lines changed

libc/config/baremetal/api.td

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

33
include "spec/stdc.td"
4+
include "spec/stdc_ext.td"
45

56
def AssertMacro : MacroDef<"assert"> {
67
let Defn = [{

libc/config/baremetal/arm/entrypoints.txt

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ set(TARGET_LIBC_ENTRYPOINTS
7676
libc.src.stdio.vsprintf
7777
libc.src.stdio.vsnprintf
7878

79-
8079
# stdbit.h entrypoints
8180
libc.src.stdbit.stdc_leading_zeros_uc
8281
libc.src.stdbit.stdc_leading_zeros_us
@@ -280,6 +279,36 @@ set(TARGET_LIBM_ENTRYPOINTS
280279
libc.src.math.truncl
281280
)
282281

282+
if(LIBC_COMPILER_HAS_FIXED_POINT)
283+
list(APPEND TARGET_LIBM_ENTRYPOINTS
284+
# stdfix.h _Fract and _Accum entrypoints
285+
libc.src.stdfix.abshk
286+
libc.src.stdfix.abshr
287+
libc.src.stdfix.absk
288+
libc.src.stdfix.absr
289+
libc.src.stdfix.abslk
290+
libc.src.stdfix.abslr
291+
libc.src.stdfix.roundhk
292+
libc.src.stdfix.roundhr
293+
libc.src.stdfix.roundk
294+
libc.src.stdfix.roundr
295+
libc.src.stdfix.roundlk
296+
libc.src.stdfix.roundlr
297+
libc.src.stdfix.rounduhk
298+
libc.src.stdfix.rounduhr
299+
libc.src.stdfix.rounduk
300+
libc.src.stdfix.roundur
301+
libc.src.stdfix.roundulk
302+
libc.src.stdfix.roundulr
303+
libc.src.stdfix.sqrtuhk
304+
libc.src.stdfix.sqrtuhr
305+
libc.src.stdfix.sqrtuk
306+
libc.src.stdfix.sqrtur
307+
# libc.src.stdfix.sqrtulk
308+
libc.src.stdfix.sqrtulr
309+
)
310+
endif()
311+
283312
set(TARGET_LLVMLIBC_ENTRYPOINTS
284313
${TARGET_LIBC_ENTRYPOINTS}
285314
${TARGET_LIBM_ENTRYPOINTS}

libc/config/baremetal/arm/headers.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set(TARGET_PUBLIC_HEADERS
77
libc.include.stdint
88
libc.include.inttypes
99
libc.include.math
10+
libc.include.stdfix
1011
libc.include.stdio
1112
libc.include.stdlib
1213
libc.include.string

libc/config/baremetal/riscv/entrypoints.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,36 @@ set(TARGET_LIBM_ENTRYPOINTS
279279
libc.src.math.truncl
280280
)
281281

282+
if(LIBC_COMPILER_HAS_FIXED_POINT)
283+
list(APPEND TARGET_LIBM_ENTRYPOINTS
284+
# stdfix.h _Fract and _Accum entrypoints
285+
libc.src.stdfix.abshk
286+
libc.src.stdfix.abshr
287+
libc.src.stdfix.absk
288+
libc.src.stdfix.absr
289+
libc.src.stdfix.abslk
290+
libc.src.stdfix.abslr
291+
libc.src.stdfix.roundhk
292+
libc.src.stdfix.roundhr
293+
libc.src.stdfix.roundk
294+
libc.src.stdfix.roundr
295+
libc.src.stdfix.roundlk
296+
libc.src.stdfix.roundlr
297+
libc.src.stdfix.rounduhk
298+
libc.src.stdfix.rounduhr
299+
libc.src.stdfix.rounduk
300+
libc.src.stdfix.roundur
301+
libc.src.stdfix.roundulk
302+
libc.src.stdfix.roundulr
303+
libc.src.stdfix.sqrtuhk
304+
libc.src.stdfix.sqrtuhr
305+
libc.src.stdfix.sqrtuk
306+
libc.src.stdfix.sqrtur
307+
# libc.src.stdfix.sqrtulk
308+
libc.src.stdfix.sqrtulr
309+
)
310+
endif()
311+
282312
set(TARGET_LLVMLIBC_ENTRYPOINTS
283313
${TARGET_LIBC_ENTRYPOINTS}
284314
${TARGET_LIBM_ENTRYPOINTS}

libc/config/baremetal/riscv/headers.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set(TARGET_PUBLIC_HEADERS
77
libc.include.stdint
88
libc.include.inttypes
99
libc.include.math
10+
libc.include.stdfix
1011
libc.include.stdio
1112
libc.include.stdlib
1213
libc.include.string

0 commit comments

Comments
 (0)