[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2024-11-20 Thread Trevor Gross via cfe-commits
@@ -255,4 +255,9 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) { } setLibcallName(RTLIB::MULO_I128, nullptr); } + + if (TT.isSystemZ()) { +setLibcallName(RTLIB::FPROUND_F32_F16, "__truncsfhf2"); +setLibcallName(RTLIB::FPEXT_F16_F32, "__extendhfs

[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2024-11-19 Thread Trevor Gross via cfe-commits
@@ -513,11 +514,37 @@ SystemZTargetLowering::SystemZTargetLowering(const TargetMachine &TM, } // Handle floating-point types. + // Promote all f16 operations to float, with some exceptions below. + for (unsigned Opc = 0; Opc < ISD::BUILTIN_OP_END; ++Opc) +setOperati

[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2024-11-19 Thread Trevor Gross via cfe-commits
@@ -255,4 +255,9 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) { } setLibcallName(RTLIB::MULO_I128, nullptr); } + + if (TT.isSystemZ()) { +setLibcallName(RTLIB::FPROUND_F32_F16, "__truncsfhf2"); +setLibcallName(RTLIB::FPEXT_F16_F32, "__extendhfs

[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2024-11-19 Thread Trevor Gross via cfe-commits
@@ -255,4 +255,9 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) { } setLibcallName(RTLIB::MULO_I128, nullptr); } + + if (TT.isSystemZ()) { +setLibcallName(RTLIB::FPROUND_F32_F16, "__truncsfhf2"); +setLibcallName(RTLIB::FPEXT_F16_F32, "__extendhfs

[clang] [clang] Always pass fp128 arguments indirectly on Windows (PR #115052)

2024-11-05 Thread Trevor Gross via cfe-commits
tgross35 wrote: It seems like arguments aren't actually getting passed indirectly to libcalls. Simple test program ```c #include #include union ty128 { struct { uint64_t hi, lo; } u64x2; __float128 f128; }; void f128_add(__float128 a, __float128 b) { union ty128 cvt; cvt.f128 =

[clang] [clang] Always pass fp128 arguments indirectly on Windows (PR #115052)

2024-11-05 Thread Trevor Gross via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -triple x86_64-windows-gnu -emit-llvm -o - %s \ +// RUN:| FileCheck %s --check-prefix=GNU64 +// __float128 is unsupported on MSVC + +__float128 fp128_ret(void) { return 0; } +// GNU64: define dso_local void @fp128_ret(ptr dead_on_unwind noa

[clang] [clang] Always pass fp128 arguments indirectly on Windows (PR #115052)

2024-11-05 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/115052 >From 432e8a66156f08d45ad691017255364cfb0fd947 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Tue, 5 Nov 2024 07:00:35 -0500 Subject: [PATCH 1/2] [clang] Add fp128 ABI tests for MinGW (NFC) Duplicate `win64

[clang] [clang] Always pass fp128 arguments indirectly on Windows (PR #115052)

2024-11-05 Thread Trevor Gross via cfe-commits
tgross35 wrote: Cc @beetrees and @wesleywiser https://github.com/llvm/llvm-project/pull/115052 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Always pass fp128 arguments indirectly on Windows (PR #115052)

2024-11-05 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 created https://github.com/llvm/llvm-project/pull/115052 Clang currently passes and returns `__float128` in vector registers on MinGW targets. However, the Windows x86-64 calling convention [1] states the following: > __m128 types, arrays, and strings are never pas

[clang] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2024-10-23 Thread Trevor Gross via cfe-commits
tgross35 wrote: > From what I can see in the libgcc sources, `__gnu_h2f_ieee`/`__gnu_f2h_ieee` > is indeed always `i32`<->`i16`, but it is only present on 32-bit ARM, no > other platforms. On AArch64, GCC will always use inline instructions to > perform the conversion. On 32-bit and 64-bit Int

[clang] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2024-10-23 Thread Trevor Gross via cfe-commits
tgross35 wrote: > With this version, the fp16 values are passed to conversion functions as > integer, which seems to be the default. It is however a bit tricky to do this > and at the same time pass half values in FP registers. > > At this point I wonder for one thing if it would be better to p

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2024-01-21 Thread Trevor Gross via cfe-commits
tgross35 wrote: I'm struggling a bit with how to handle ABI information since that affects layout (e.g. ARM aapcs), which I think explains most of the errors in https://buildkite.com/llvm-project/github-pull-requests/builds/31198#018d26e2-fd17-4e15-a1eb-08580c189056. This needs to be available

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2024-01-20 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From e869ad1bc601d95b6364dc5619e79a06e8b0fc82 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/5] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[llvm] [clang] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2024-01-20 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From e869ad1bc601d95b6364dc5619e79a06e8b0fc82 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[llvm] [clang] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2024-01-20 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From e869ad1bc601d95b6364dc5619e79a06e8b0fc82 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2024-01-20 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From e869ad1bc601d95b6364dc5619e79a06e8b0fc82 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2024-01-20 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 90a465d0a7e9744a4a8043152016e500927a0d95 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2024-01-13 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 90a465d0a7e9744a4a8043152016e500927a0d95 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[llvm] [clang] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2024-01-13 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 90a465d0a7e9744a4a8043152016e500927a0d95 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2024-01-13 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 90a465d0a7e9744a4a8043152016e500927a0d95 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2024-01-13 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 946581e0c6a06be92b16d74199b58a72be4b76f3 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2024-01-13 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 590f4920ceb1a80d711d39624b0249cd9ff774d2 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[llvm] [clang] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2023-12-29 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 590f4920ceb1a80d711d39624b0249cd9ff774d2 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[llvm] [clang] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2023-12-29 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 590f4920ceb1a80d711d39624b0249cd9ff774d2 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2023-12-29 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 590f4920ceb1a80d711d39624b0249cd9ff774d2 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2023-12-29 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 590f4920ceb1a80d711d39624b0249cd9ff774d2 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2023-12-29 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 590f4920ceb1a80d711d39624b0249cd9ff774d2 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2023-12-29 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 590f4920ceb1a80d711d39624b0249cd9ff774d2 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2023-12-29 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 590f4920ceb1a80d711d39624b0249cd9ff774d2 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2023-12-29 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From 7df4ef93989b1913d9200fbc29d6d04f9e59d51a Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/4] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2023-12-29 Thread Trevor Gross via cfe-commits
tgross35 wrote: @efriedma-quic was looking at this on phabricator https://github.com/llvm/llvm-project/pull/76558 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2023-12-29 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 created https://github.com/llvm/llvm-project/pull/76558 Currently `fp128` math intrinsics are lowered to functions expecting `long double`, which is a problem when `long double` and `f128` do not have the same layout (e.g. `long double` on x86 is `f80`). This patch