[clang] [llvm] [ARM64EC] Implement `-mlong-double-{64,80,128}` options (PR #237057)

LIU Hao via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 5 22:49:11 PST 2026


================
@@ -0,0 +1,129 @@
+; RUN: llc < %s -mtriple=arm64ec-pc-windows-msvc -o - | FileCheck %s
+;
+;; The 80-bit x87 `long double` occupies a 16-byte slot, but the ARM64EC side
+;; passes and returns it as a pair of integer registers holding the 80-bit
+;; image, while the x64 side passes it in memory (by reference) and returns it
+;; through a hidden pointer.  The thunks convert between the two, moving only
+;; the ten bytes that make up the value and leaving the padding alone.
+;;
+;;   entry thunk: x64 memory slot -> ARM64EC register pair
+;;   exit thunk:  ARM64EC register pair -> x64 memory slot
+
+target triple = "arm64ec-pc-windows-msvc"
+
+declare x86_fp80 @ext_ret()
+declare void @ext_take(x86_fp80)
+
+; The value is an i128 in an even-aligned register pair, so having a 32-bit
+; argument in x0 puts it in x2:x3, and it is returned in x1:x0.
+define dso_local x86_fp80 @use_f80(i32 %x, x86_fp80 %v) {
----------------
lhmouse wrote:

fixed in 426e79429f1d6e865b37439e7b820b2632e65bd3

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


More information about the cfe-commits mailing list