Skip to content

Commit 13ced90

Browse files
authored
[libc] {u}lkbits broken on riscv32 (#115799)
- Re-enabled ulkbits and lkbits for Risc-V - Bumped `int_lk_t` to a `signed long long` and a `uint_ulk_t` to an `unsigned long long` to guarantee they both fit in 8 bytes, which `long _Accum` and `unsigned long _Accum` are defaulted to on 32bit architectures. This is probably inconvenient on systems that have a word size larger than 64 bits? #115778
1 parent a93cbd4 commit 13ced90

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libc/config/linux/riscv/entrypoints.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,8 @@ if(LIBC_COMPILER_HAS_FIXED_POINT)
728728
libc.src.stdfix.kbits
729729
libc.src.stdfix.ukbits
730730
# TODO: https://github.com/llvm/llvm-project/issues/115778
731-
# libc.src.stdfix.lkbits
732-
# libc.src.stdfix.ulkbits
731+
libc.src.stdfix.lkbits
732+
libc.src.stdfix.ulkbits
733733
)
734734
endif()
735735

libc/include/llvm-libc-types/stdfix-types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ typedef signed short int int_r_t;
1414
typedef signed int int_lr_t;
1515
typedef signed short int_hk_t;
1616
typedef signed int int_k_t;
17-
typedef signed long int_lk_t;
17+
typedef signed long long int_lk_t;
1818
typedef unsigned char uint_uhr_t;
1919
typedef unsigned short int uint_ur_t;
2020
typedef unsigned int uint_ulr_t;
2121
typedef unsigned short int uint_uhk_t;
2222
typedef unsigned int uint_uk_t;
23-
typedef unsigned long uint_ulk_t;
23+
typedef unsigned long long uint_ulk_t;
2424

2525
#endif // LLVM_LIBC_TYPES_STDFIX_TYPES_H

0 commit comments

Comments
 (0)