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

via libc-commits libc-commits at lists.llvm.org
Mon Nov 11 17:43:05 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: William Tran-Viet (smallp-o-p)

<details>
<summary>Changes</summary>

- 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?

---
Full diff: https://github.com/llvm/llvm-project/pull/115799.diff


2 Files Affected:

- (modified) libc/config/linux/riscv/entrypoints.txt (+2-2) 
- (modified) libc/include/llvm-libc-types/stdfix-types.h (+2-2) 


``````````diff
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

``````````

</details>


https://github.com/llvm/llvm-project/pull/115799


More information about the libc-commits mailing list