[libc-commits] [libc] 13ced90 - [libc] {u}lkbits broken on riscv32 (#115799)

via libc-commits libc-commits at lists.llvm.org
Tue Nov 12 10:38:13 PST 2024


Author: William Tran-Viet
Date: 2024-11-12T10:38:08-08:00
New Revision: 13ced90b007fdab3d0ecbe032ead2650d3e7717e

URL: https://github.com/llvm/llvm-project/commit/13ced90b007fdab3d0ecbe032ead2650d3e7717e
DIFF: https://github.com/llvm/llvm-project/commit/13ced90b007fdab3d0ecbe032ead2650d3e7717e.diff

LOG: [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

Added: 
    

Modified: 
    libc/config/linux/riscv/entrypoints.txt
    libc/include/llvm-libc-types/stdfix-types.h

Removed: 
    


################################################################################
diff  --git a/libc/config/linux/riscv/entrypoints.txt b/libc/config/linux/riscv/entrypoints.txt
index 3758f0809960e5..5419462d4f5b3b 100644
--- a/libc/config/linux/riscv/entrypoints.txt
+++ b/libc/config/linux/riscv/entrypoints.txt
@@ -728,8 +728,8 @@ if(LIBC_COMPILER_HAS_FIXED_POINT)
     libc.src.stdfix.kbits
     libc.src.stdfix.ukbits
     # TODO: https://github.com/llvm/llvm-project/issues/115778
-    # libc.src.stdfix.lkbits
-    # libc.src.stdfix.ulkbits
+    libc.src.stdfix.lkbits
+    libc.src.stdfix.ulkbits
   )
 endif()
 

diff  --git a/libc/include/llvm-libc-types/stdfix-types.h b/libc/include/llvm-libc-types/stdfix-types.h
index 759e59251a5e87..542d45ea97e96f 100644
--- a/libc/include/llvm-libc-types/stdfix-types.h
+++ b/libc/include/llvm-libc-types/stdfix-types.h
@@ -14,12 +14,12 @@ typedef signed short int int_r_t;
 typedef signed int int_lr_t;
 typedef signed short int_hk_t;
 typedef signed int int_k_t;
-typedef signed long int_lk_t;
+typedef signed long long int_lk_t;
 typedef unsigned char uint_uhr_t;
 typedef unsigned short int uint_ur_t;
 typedef unsigned int uint_ulr_t;
 typedef unsigned short int uint_uhk_t;
 typedef unsigned int uint_uk_t;
-typedef unsigned long uint_ulk_t;
+typedef unsigned long long uint_ulk_t;
 
 #endif // LLVM_LIBC_TYPES_STDFIX_TYPES_H


        


More information about the libc-commits mailing list