[libc-commits] [libc] [LoongArch][MC] Handle more PseudoLA* instructions with la-global-with-abs feature (PR #113665)

Roland McGrath via libc-commits libc-commits at lists.llvm.org
Fri Oct 25 02:38:56 PDT 2024


https://github.com/frobtech created https://github.com/llvm/llvm-project/pull/113665

This is to align with GAS. Additionally, there are some minor changes:
the definition and expansion process of the TLS_DESC pseudo-instruction
were modified in the same style.

Reviewed By: heiher

Pull Request: https://github.com/llvm/llvm-project/pull/112858


>From d9eaa1351db5bf48bf4c724e6abd5039bfc2a5b9 Mon Sep 17 00:00:00 2001
From: Roland McGrath <mcgrathr at google.com>
Date: Fri, 25 Oct 2024 02:30:10 -0700
Subject: [PATCH] [libc] Fix fexcept_t type to match canonical ABI and API

In glibc and musl, fexcept_t is unsigned short int on x86 and
unsigned int on other machines that llvm-libc supports.  Match
that ABI (only different from before on x86) and API (different
everywhere as it was previously signed).
---
 libc/include/llvm-libc-types/fexcept_t.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libc/include/llvm-libc-types/fexcept_t.h b/libc/include/llvm-libc-types/fexcept_t.h
index 60687bd1318aa4..5aa09fbbaffc77 100644
--- a/libc/include/llvm-libc-types/fexcept_t.h
+++ b/libc/include/llvm-libc-types/fexcept_t.h
@@ -9,6 +9,10 @@
 #ifndef LLVM_LIBC_TYPES_FEXCEPT_T_H
 #define LLVM_LIBC_TYPES_FEXCEPT_T_H
 
-typedef int fexcept_t;
+#if defined(__x86_64__) || defined(__i386__)
+typedef unsigned short int fexcept_t;
+#else
+typedef unsigned int fexcept_t;
+#endif
 
 #endif // LLVM_LIBC_TYPES_FEXCEPT_T_H



More information about the libc-commits mailing list