mirror of
https://git.proxmox.com/git/llvm-toolchain
synced 2025-06-14 16:31:43 +00:00
patches/disable-float16.diff: Rebase of the patch
This commit is contained in:
parent
edaa9d6e2b
commit
1d2587dbe0
23
debian/changelog
vendored
23
debian/changelog
vendored
@ -1,10 +1,11 @@
|
||||
llvm-toolchain-snapshot (1:14~++20211113111058+6a40854ce507-1~exp2) experimental; urgency=medium
|
||||
llvm-toolchain-snapshot (1:14~++20211123014438+e7026aba0049-1~exp1) UNRELEASED; urgency=medium
|
||||
|
||||
* New snapshot release
|
||||
* Revert 6623c02d70c3732dbea59c6d79c69501baf9627b in disable-float16.diff
|
||||
for breaking the CI:
|
||||
https://reviews.llvm.org/D114099
|
||||
|
||||
-- Sylvestre Ledru <sylvestre@debian.org> Tue, 23 Nov 2021 13:44:07 +0100
|
||||
-- Sylvestre Ledru <sylvestre@debian.org> Tue, 23 Nov 2021 13:51:51 +0100
|
||||
|
||||
llvm-toolchain-snapshot (1:14~++20211113111058+6a40854ce507-1~exp1) experimental; urgency=medium
|
||||
|
||||
@ -397,7 +398,19 @@ llvm-toolchain-snapshot (1:13~++20210715093511+afc760ef3527-1~exp1) experimental
|
||||
|
||||
-- Sylvestre Ledru <sylvestre@debian.org> Thu, 15 Jul 2021 21:46:58 +0200
|
||||
|
||||
llvm-toolchain-snapshot (1:13~++20210619101720+e1adf90826a5-1~exp1) experimental; urgency=medium
|
||||
llvm-toolchain-snapshot (1:13~++20210622112436+600074980410-1~exp1) UNRELEASED; urgency=medium
|
||||
|
||||
* Refresh the lib of symbols in libomp
|
||||
* As scan-build-py is installed by default ( https://reviews.llvm.org/D104138 )
|
||||
update of the code
|
||||
* Fix the path to analyze-{cc,c++} for scan-build-py with
|
||||
--intercept-first (scan-build-py-fix-analyze-path.diff)
|
||||
* experimental New snapshot release
|
||||
* experimental New snapshot release
|
||||
|
||||
-- Sylvestre Ledru <sylvestre@debian.org> Tue, 22 Jun 2021 23:28:47 +0200
|
||||
|
||||
llvm-toolchain-snapshot (1:13~++20210620054946+4c44b02d87bc-1~exp1) experimental; urgency=medium
|
||||
|
||||
* Enable lld on s390x
|
||||
* remove libomptarget from openmp. done by upstream
|
||||
@ -440,7 +453,7 @@ llvm-toolchain-snapshot (1:13~++20210129063721+010b176cdefb-1~exp2) experimental
|
||||
|
||||
-- Sylvestre Ledru <sylvestre@debian.org> Mon, 01 Feb 2021 09:04:16 +0100
|
||||
|
||||
llvm-toolchain-snapshot (1:13~++20210129063721+010b176cdefb-1~exp1) experimental; urgency=medium
|
||||
llvm-toolchain-snapshot (1:13~++20201124100523+245052ac3080-1~exp1) experimental; urgency=medium
|
||||
|
||||
[ Sylvestre Ledru ]
|
||||
* New branch (12 => 13)
|
||||
@ -452,7 +465,7 @@ llvm-toolchain-snapshot (1:13~++20210129063721+010b176cdefb-1~exp1) experimental
|
||||
[ Gianfranco Costamagna ]
|
||||
* Add upstream patch D92052 to fix a gcn offload compiler issue with gcc (Closes: #975692)
|
||||
|
||||
-- Sylvestre Ledru <sylvestre@debian.org> Sat, 30 Jan 2021 17:31:15 +0100
|
||||
-- Sylvestre Ledru <sylvestre@debian.org> Wed, 27 Jan 2021 16:02:16 +0100
|
||||
|
||||
llvm-toolchain-12 (1:12.0.1-16) unstable; urgency=medium
|
||||
|
||||
|
850
debian/patches/disable-float16.diff
vendored
850
debian/patches/disable-float16.diff
vendored
@ -8,10 +8,10 @@ Date: Wed Nov 17 11:53:36 2021 -0500
|
||||
-max512fp16 flag. The final goal being, perform _Float16 emulation for
|
||||
all arithmetic expressions.
|
||||
|
||||
diff --git b/clang/docs/LanguageExtensions.rst a/clang/docs/LanguageExtensions.rst
|
||||
index dfdb01b8ff54..60b1ed383a1f 100644
|
||||
--- b/clang/docs/LanguageExtensions.rst
|
||||
+++ a/clang/docs/LanguageExtensions.rst
|
||||
Index: llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/docs/LanguageExtensions.rst
|
||||
===================================================================
|
||||
--- llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049.orig/clang/docs/LanguageExtensions.rst
|
||||
+++ llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/docs/LanguageExtensions.rst
|
||||
@@ -673,7 +673,7 @@ targets pending ABI standardization:
|
||||
* 64-bit ARM (AArch64)
|
||||
* AMDGPU
|
||||
@ -21,10 +21,10 @@ index dfdb01b8ff54..60b1ed383a1f 100644
|
||||
|
||||
``_Float16`` will be supported on more targets as they define ABIs for it.
|
||||
|
||||
diff --git b/clang/docs/ReleaseNotes.rst a/clang/docs/ReleaseNotes.rst
|
||||
index d2fa7ff05a16..104d2e908d80 100644
|
||||
--- b/clang/docs/ReleaseNotes.rst
|
||||
+++ a/clang/docs/ReleaseNotes.rst
|
||||
Index: llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/docs/ReleaseNotes.rst
|
||||
===================================================================
|
||||
--- llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049.orig/clang/docs/ReleaseNotes.rst
|
||||
+++ llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/docs/ReleaseNotes.rst
|
||||
@@ -187,7 +187,6 @@ X86 Support in Clang
|
||||
--------------------
|
||||
|
||||
@ -33,11 +33,11 @@ index d2fa7ff05a16..104d2e908d80 100644
|
||||
|
||||
Arm and AArch64 Support in Clang
|
||||
--------------------------------
|
||||
diff --git b/clang/lib/Basic/Targets/X86.cpp a/clang/lib/Basic/Targets/X86.cpp
|
||||
index 5e3686893719..454a7743dded 100644
|
||||
--- b/clang/lib/Basic/Targets/X86.cpp
|
||||
+++ a/clang/lib/Basic/Targets/X86.cpp
|
||||
@@ -239,9 +239,9 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
|
||||
Index: llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/lib/Basic/Targets/X86.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049.orig/clang/lib/Basic/Targets/X86.cpp
|
||||
+++ llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/lib/Basic/Targets/X86.cpp
|
||||
@@ -239,9 +239,9 @@ bool X86TargetInfo::handleTargetFeatures
|
||||
HasAVX512ER = true;
|
||||
} else if (Feature == "+avx512fp16") {
|
||||
HasAVX512FP16 = true;
|
||||
@ -48,7 +48,7 @@ index 5e3686893719..454a7743dded 100644
|
||||
} else if (Feature == "+avx512dq") {
|
||||
HasAVX512DQ = true;
|
||||
} else if (Feature == "+avx512bitalg") {
|
||||
@@ -369,8 +369,6 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
|
||||
@@ -369,8 +369,6 @@ bool X86TargetInfo::handleTargetFeatures
|
||||
.Default(NoXOP);
|
||||
XOPLevel = std::max(XOPLevel, XLevel);
|
||||
}
|
||||
@ -57,10 +57,9 @@ index 5e3686893719..454a7743dded 100644
|
||||
|
||||
// LLVM doesn't have a separate switch for fpmath, so only accept it if it
|
||||
// matches the selected sse level.
|
||||
diff --git b/clang/test/CodeGen/X86/Float16-arithmetic.c a/clang/test/CodeGen/X86/Float16-arithmetic.c
|
||||
deleted file mode 100644
|
||||
index 7f7b3ff59442..000000000000
|
||||
--- b/clang/test/CodeGen/X86/Float16-arithmetic.c
|
||||
Index: llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/test/CodeGen/X86/Float16-arithmetic.c
|
||||
===================================================================
|
||||
--- llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049.orig/clang/test/CodeGen/X86/Float16-arithmetic.c
|
||||
+++ /dev/null
|
||||
@@ -1,73 +0,0 @@
|
||||
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm \
|
||||
@ -136,38 +135,779 @@ index 7f7b3ff59442..000000000000
|
||||
-}
|
||||
-
|
||||
-
|
||||
diff --git b/clang/test/CodeGen/X86/fp16-abi.c a/clang/test/CodeGen/X86/avx512fp16-abi.c
|
||||
similarity index 94%
|
||||
rename from clang/test/CodeGen/X86/fp16-abi.c
|
||||
rename to clang/test/CodeGen/X86/avx512fp16-abi.c
|
||||
index 62a914f878c7..114427428055 100644
|
||||
--- b/clang/test/CodeGen/X86/fp16-abi.c
|
||||
+++ a/clang/test/CodeGen/X86/avx512fp16-abi.c
|
||||
@@ -1,7 +1,5 @@
|
||||
// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -target-feature +avx512fp16 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-C
|
||||
Index: llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/test/CodeGen/X86/fp16-abi.c
|
||||
===================================================================
|
||||
--- llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049.orig/clang/test/CodeGen/X86/fp16-abi.c
|
||||
+++ /dev/null
|
||||
@@ -1,242 +0,0 @@
|
||||
-// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -target-feature +avx512fp16 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-C
|
||||
-// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm < %s | FileCheck %s --check-prefixes=CHECK,CHECK-C
|
||||
// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -target-feature +avx512fp16 -x c++ -std=c++11 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-CPP
|
||||
-// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -target-feature +avx512fp16 -x c++ -std=c++11 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-CPP
|
||||
-// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -x c++ -std=c++11 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-CPP
|
||||
|
||||
struct half1 {
|
||||
_Float16 a;
|
||||
diff --git b/clang/test/CodeGen/X86/fp16-complex.c a/clang/test/CodeGen/X86/avx512fp16-complex.c
|
||||
similarity index 96%
|
||||
rename from clang/test/CodeGen/X86/fp16-complex.c
|
||||
rename to clang/test/CodeGen/X86/avx512fp16-complex.c
|
||||
index ebb290c976e7..8a6b50eb0056 100644
|
||||
--- b/clang/test/CodeGen/X86/fp16-complex.c
|
||||
+++ a/clang/test/CodeGen/X86/avx512fp16-complex.c
|
||||
@@ -1,5 +1,4 @@
|
||||
// RUN: %clang_cc1 %s -O0 -emit-llvm -triple x86_64-unknown-unknown -target-feature +avx512fp16 -o - | FileCheck %s --check-prefix=X86
|
||||
-
|
||||
-struct half1 {
|
||||
- _Float16 a;
|
||||
-};
|
||||
-
|
||||
-struct half1 h1(_Float16 a) {
|
||||
- // CHECK: define{{.*}}half @
|
||||
- struct half1 x;
|
||||
- x.a = a;
|
||||
- return x;
|
||||
-}
|
||||
-
|
||||
-struct half2 {
|
||||
- _Float16 a;
|
||||
- _Float16 b;
|
||||
-};
|
||||
-
|
||||
-struct half2 h2(_Float16 a, _Float16 b) {
|
||||
- // CHECK: define{{.*}}<2 x half> @
|
||||
- struct half2 x;
|
||||
- x.a = a;
|
||||
- x.b = b;
|
||||
- return x;
|
||||
-}
|
||||
-
|
||||
-struct half3 {
|
||||
- _Float16 a;
|
||||
- _Float16 b;
|
||||
- _Float16 c;
|
||||
-};
|
||||
-
|
||||
-struct half3 h3(_Float16 a, _Float16 b, _Float16 c) {
|
||||
- // CHECK: define{{.*}}<4 x half> @
|
||||
- struct half3 x;
|
||||
- x.a = a;
|
||||
- x.b = b;
|
||||
- x.c = c;
|
||||
- return x;
|
||||
-}
|
||||
-
|
||||
-struct half4 {
|
||||
- _Float16 a;
|
||||
- _Float16 b;
|
||||
- _Float16 c;
|
||||
- _Float16 d;
|
||||
-};
|
||||
-
|
||||
-struct half4 h4(_Float16 a, _Float16 b, _Float16 c, _Float16 d) {
|
||||
- // CHECK: define{{.*}}<4 x half> @
|
||||
- struct half4 x;
|
||||
- x.a = a;
|
||||
- x.b = b;
|
||||
- x.c = c;
|
||||
- x.d = d;
|
||||
- return x;
|
||||
-}
|
||||
-
|
||||
-struct floathalf {
|
||||
- float a;
|
||||
- _Float16 b;
|
||||
-};
|
||||
-
|
||||
-struct floathalf fh(float a, _Float16 b) {
|
||||
- // CHECK: define{{.*}}<4 x half> @
|
||||
- struct floathalf x;
|
||||
- x.a = a;
|
||||
- x.b = b;
|
||||
- return x;
|
||||
-}
|
||||
-
|
||||
-struct floathalf2 {
|
||||
- float a;
|
||||
- _Float16 b;
|
||||
- _Float16 c;
|
||||
-};
|
||||
-
|
||||
-struct floathalf2 fh2(float a, _Float16 b, _Float16 c) {
|
||||
- // CHECK: define{{.*}}<4 x half> @
|
||||
- struct floathalf2 x;
|
||||
- x.a = a;
|
||||
- x.b = b;
|
||||
- x.c = c;
|
||||
- return x;
|
||||
-}
|
||||
-
|
||||
-struct halffloat {
|
||||
- _Float16 a;
|
||||
- float b;
|
||||
-};
|
||||
-
|
||||
-struct halffloat hf(_Float16 a, float b) {
|
||||
- // CHECK: define{{.*}}<4 x half> @
|
||||
- struct halffloat x;
|
||||
- x.a = a;
|
||||
- x.b = b;
|
||||
- return x;
|
||||
-}
|
||||
-
|
||||
-struct half2float {
|
||||
- _Float16 a;
|
||||
- _Float16 b;
|
||||
- float c;
|
||||
-};
|
||||
-
|
||||
-struct half2float h2f(_Float16 a, _Float16 b, float c) {
|
||||
- // CHECK: define{{.*}}<4 x half> @
|
||||
- struct half2float x;
|
||||
- x.a = a;
|
||||
- x.b = b;
|
||||
- x.c = c;
|
||||
- return x;
|
||||
-}
|
||||
-
|
||||
-struct floathalf3 {
|
||||
- float a;
|
||||
- _Float16 b;
|
||||
- _Float16 c;
|
||||
- _Float16 d;
|
||||
-};
|
||||
-
|
||||
-struct floathalf3 fh3(float a, _Float16 b, _Float16 c, _Float16 d) {
|
||||
- // CHECK: define{{.*}}{ <4 x half>, half } @
|
||||
- struct floathalf3 x;
|
||||
- x.a = a;
|
||||
- x.b = b;
|
||||
- x.c = c;
|
||||
- x.d = d;
|
||||
- return x;
|
||||
-}
|
||||
-
|
||||
-struct half5 {
|
||||
- _Float16 a;
|
||||
- _Float16 b;
|
||||
- _Float16 c;
|
||||
- _Float16 d;
|
||||
- _Float16 e;
|
||||
-};
|
||||
-
|
||||
-struct half5 h5(_Float16 a, _Float16 b, _Float16 c, _Float16 d, _Float16 e) {
|
||||
- // CHECK: define{{.*}}{ <4 x half>, half } @
|
||||
- struct half5 x;
|
||||
- x.a = a;
|
||||
- x.b = b;
|
||||
- x.c = c;
|
||||
- x.d = d;
|
||||
- x.e = e;
|
||||
- return x;
|
||||
-}
|
||||
-
|
||||
-struct float2 {
|
||||
- struct {} s;
|
||||
- float a;
|
||||
- float b;
|
||||
-};
|
||||
-
|
||||
-float pr51813(struct float2 s) {
|
||||
- // CHECK-C: define{{.*}} @pr51813(<2 x float>
|
||||
- // CHECK-CPP: define{{.*}} @_Z7pr518136float2(double {{.*}}, float
|
||||
- return s.a;
|
||||
-}
|
||||
-
|
||||
-struct float3 {
|
||||
- float a;
|
||||
- struct {} s;
|
||||
- float b;
|
||||
-};
|
||||
-
|
||||
-float pr51813_2(struct float3 s) {
|
||||
- // CHECK-C: define{{.*}} @pr51813_2(<2 x float>
|
||||
- // CHECK-CPP: define{{.*}} @_Z9pr51813_26float3(double {{.*}}, float
|
||||
- return s.a;
|
||||
-}
|
||||
-
|
||||
-struct shalf2 {
|
||||
- struct {} s;
|
||||
- _Float16 a;
|
||||
- _Float16 b;
|
||||
-};
|
||||
-
|
||||
-_Float16 sf2(struct shalf2 s) {
|
||||
- // CHECK-C: define{{.*}} @sf2(<2 x half>
|
||||
- // CHECK-CPP: define{{.*}} @_Z3sf26shalf2(double {{.*}}
|
||||
- return s.a;
|
||||
-};
|
||||
-
|
||||
-struct halfs2 {
|
||||
- _Float16 a;
|
||||
- struct {} s1;
|
||||
- _Float16 b;
|
||||
- struct {} s2;
|
||||
-};
|
||||
-
|
||||
-_Float16 fs2(struct shalf2 s) {
|
||||
- // CHECK-C: define{{.*}} @fs2(<2 x half>
|
||||
- // CHECK-CPP: define{{.*}} @_Z3fs26shalf2(double {{.*}}
|
||||
- return s.a;
|
||||
-};
|
||||
-
|
||||
-struct fsd {
|
||||
- float a;
|
||||
- struct {};
|
||||
- double b;
|
||||
-};
|
||||
-
|
||||
-struct fsd pr52011() {
|
||||
- // CHECK: define{{.*}} { float, double } @
|
||||
-}
|
||||
-
|
||||
-struct hsd {
|
||||
- _Float16 a;
|
||||
- struct {};
|
||||
- double b;
|
||||
-};
|
||||
-
|
||||
-struct hsd pr52011_2() {
|
||||
- // CHECK: define{{.*}} { half, double } @
|
||||
-}
|
||||
-
|
||||
-struct hsf {
|
||||
- _Float16 a;
|
||||
- struct {};
|
||||
- float b;
|
||||
-};
|
||||
-
|
||||
-struct hsf pr52011_3() {
|
||||
- // CHECK: define{{.*}} <4 x half> @
|
||||
-}
|
||||
-
|
||||
-struct fds {
|
||||
- float a;
|
||||
- double b;
|
||||
- struct {};
|
||||
-};
|
||||
-
|
||||
-struct fds pr52011_4() {
|
||||
- // CHECK-C: define{{.*}} { float, double } @pr52011_4
|
||||
- // CHECK-CPP: define{{.*}} void @_Z9pr52011_4v({{.*}} sret
|
||||
-}
|
||||
Index: llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/test/CodeGen/X86/avx512fp16-abi.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/test/CodeGen/X86/avx512fp16-abi.c
|
||||
@@ -0,0 +1,240 @@
|
||||
+// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -target-feature +avx512fp16 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-C
|
||||
+// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -target-feature +avx512fp16 -x c++ -std=c++11 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-CPP
|
||||
+
|
||||
+struct half1 {
|
||||
+ _Float16 a;
|
||||
+};
|
||||
+
|
||||
+struct half1 h1(_Float16 a) {
|
||||
+ // CHECK: define{{.*}}half @
|
||||
+ struct half1 x;
|
||||
+ x.a = a;
|
||||
+ return x;
|
||||
+}
|
||||
+
|
||||
+struct half2 {
|
||||
+ _Float16 a;
|
||||
+ _Float16 b;
|
||||
+};
|
||||
+
|
||||
+struct half2 h2(_Float16 a, _Float16 b) {
|
||||
+ // CHECK: define{{.*}}<2 x half> @
|
||||
+ struct half2 x;
|
||||
+ x.a = a;
|
||||
+ x.b = b;
|
||||
+ return x;
|
||||
+}
|
||||
+
|
||||
+struct half3 {
|
||||
+ _Float16 a;
|
||||
+ _Float16 b;
|
||||
+ _Float16 c;
|
||||
+};
|
||||
+
|
||||
+struct half3 h3(_Float16 a, _Float16 b, _Float16 c) {
|
||||
+ // CHECK: define{{.*}}<4 x half> @
|
||||
+ struct half3 x;
|
||||
+ x.a = a;
|
||||
+ x.b = b;
|
||||
+ x.c = c;
|
||||
+ return x;
|
||||
+}
|
||||
+
|
||||
+struct half4 {
|
||||
+ _Float16 a;
|
||||
+ _Float16 b;
|
||||
+ _Float16 c;
|
||||
+ _Float16 d;
|
||||
+};
|
||||
+
|
||||
+struct half4 h4(_Float16 a, _Float16 b, _Float16 c, _Float16 d) {
|
||||
+ // CHECK: define{{.*}}<4 x half> @
|
||||
+ struct half4 x;
|
||||
+ x.a = a;
|
||||
+ x.b = b;
|
||||
+ x.c = c;
|
||||
+ x.d = d;
|
||||
+ return x;
|
||||
+}
|
||||
+
|
||||
+struct floathalf {
|
||||
+ float a;
|
||||
+ _Float16 b;
|
||||
+};
|
||||
+
|
||||
+struct floathalf fh(float a, _Float16 b) {
|
||||
+ // CHECK: define{{.*}}<4 x half> @
|
||||
+ struct floathalf x;
|
||||
+ x.a = a;
|
||||
+ x.b = b;
|
||||
+ return x;
|
||||
+}
|
||||
+
|
||||
+struct floathalf2 {
|
||||
+ float a;
|
||||
+ _Float16 b;
|
||||
+ _Float16 c;
|
||||
+};
|
||||
+
|
||||
+struct floathalf2 fh2(float a, _Float16 b, _Float16 c) {
|
||||
+ // CHECK: define{{.*}}<4 x half> @
|
||||
+ struct floathalf2 x;
|
||||
+ x.a = a;
|
||||
+ x.b = b;
|
||||
+ x.c = c;
|
||||
+ return x;
|
||||
+}
|
||||
+
|
||||
+struct halffloat {
|
||||
+ _Float16 a;
|
||||
+ float b;
|
||||
+};
|
||||
+
|
||||
+struct halffloat hf(_Float16 a, float b) {
|
||||
+ // CHECK: define{{.*}}<4 x half> @
|
||||
+ struct halffloat x;
|
||||
+ x.a = a;
|
||||
+ x.b = b;
|
||||
+ return x;
|
||||
+}
|
||||
+
|
||||
+struct half2float {
|
||||
+ _Float16 a;
|
||||
+ _Float16 b;
|
||||
+ float c;
|
||||
+};
|
||||
+
|
||||
+struct half2float h2f(_Float16 a, _Float16 b, float c) {
|
||||
+ // CHECK: define{{.*}}<4 x half> @
|
||||
+ struct half2float x;
|
||||
+ x.a = a;
|
||||
+ x.b = b;
|
||||
+ x.c = c;
|
||||
+ return x;
|
||||
+}
|
||||
+
|
||||
+struct floathalf3 {
|
||||
+ float a;
|
||||
+ _Float16 b;
|
||||
+ _Float16 c;
|
||||
+ _Float16 d;
|
||||
+};
|
||||
+
|
||||
+struct floathalf3 fh3(float a, _Float16 b, _Float16 c, _Float16 d) {
|
||||
+ // CHECK: define{{.*}}{ <4 x half>, half } @
|
||||
+ struct floathalf3 x;
|
||||
+ x.a = a;
|
||||
+ x.b = b;
|
||||
+ x.c = c;
|
||||
+ x.d = d;
|
||||
+ return x;
|
||||
+}
|
||||
+
|
||||
+struct half5 {
|
||||
+ _Float16 a;
|
||||
+ _Float16 b;
|
||||
+ _Float16 c;
|
||||
+ _Float16 d;
|
||||
+ _Float16 e;
|
||||
+};
|
||||
+
|
||||
+struct half5 h5(_Float16 a, _Float16 b, _Float16 c, _Float16 d, _Float16 e) {
|
||||
+ // CHECK: define{{.*}}{ <4 x half>, half } @
|
||||
+ struct half5 x;
|
||||
+ x.a = a;
|
||||
+ x.b = b;
|
||||
+ x.c = c;
|
||||
+ x.d = d;
|
||||
+ x.e = e;
|
||||
+ return x;
|
||||
+}
|
||||
+
|
||||
+struct float2 {
|
||||
+ struct {} s;
|
||||
+ float a;
|
||||
+ float b;
|
||||
+};
|
||||
+
|
||||
+float pr51813(struct float2 s) {
|
||||
+ // CHECK-C: define{{.*}} @pr51813(<2 x float>
|
||||
+ // CHECK-CPP: define{{.*}} @_Z7pr518136float2(double {{.*}}, float
|
||||
+ return s.a;
|
||||
+}
|
||||
+
|
||||
+struct float3 {
|
||||
+ float a;
|
||||
+ struct {} s;
|
||||
+ float b;
|
||||
+};
|
||||
+
|
||||
+float pr51813_2(struct float3 s) {
|
||||
+ // CHECK-C: define{{.*}} @pr51813_2(<2 x float>
|
||||
+ // CHECK-CPP: define{{.*}} @_Z9pr51813_26float3(double {{.*}}, float
|
||||
+ return s.a;
|
||||
+}
|
||||
+
|
||||
+struct shalf2 {
|
||||
+ struct {} s;
|
||||
+ _Float16 a;
|
||||
+ _Float16 b;
|
||||
+};
|
||||
+
|
||||
+_Float16 sf2(struct shalf2 s) {
|
||||
+ // CHECK-C: define{{.*}} @sf2(<2 x half>
|
||||
+ // CHECK-CPP: define{{.*}} @_Z3sf26shalf2(double {{.*}}
|
||||
+ return s.a;
|
||||
+};
|
||||
+
|
||||
+struct halfs2 {
|
||||
+ _Float16 a;
|
||||
+ struct {} s1;
|
||||
+ _Float16 b;
|
||||
+ struct {} s2;
|
||||
+};
|
||||
+
|
||||
+_Float16 fs2(struct shalf2 s) {
|
||||
+ // CHECK-C: define{{.*}} @fs2(<2 x half>
|
||||
+ // CHECK-CPP: define{{.*}} @_Z3fs26shalf2(double {{.*}}
|
||||
+ return s.a;
|
||||
+};
|
||||
+
|
||||
+struct fsd {
|
||||
+ float a;
|
||||
+ struct {};
|
||||
+ double b;
|
||||
+};
|
||||
+
|
||||
+struct fsd pr52011() {
|
||||
+ // CHECK: define{{.*}} { float, double } @
|
||||
+}
|
||||
+
|
||||
+struct hsd {
|
||||
+ _Float16 a;
|
||||
+ struct {};
|
||||
+ double b;
|
||||
+};
|
||||
+
|
||||
+struct hsd pr52011_2() {
|
||||
+ // CHECK: define{{.*}} { half, double } @
|
||||
+}
|
||||
+
|
||||
+struct hsf {
|
||||
+ _Float16 a;
|
||||
+ struct {};
|
||||
+ float b;
|
||||
+};
|
||||
+
|
||||
+struct hsf pr52011_3() {
|
||||
+ // CHECK: define{{.*}} <4 x half> @
|
||||
+}
|
||||
+
|
||||
+struct fds {
|
||||
+ float a;
|
||||
+ double b;
|
||||
+ struct {};
|
||||
+};
|
||||
+
|
||||
+struct fds pr52011_4() {
|
||||
+ // CHECK-C: define{{.*}} { float, double } @pr52011_4
|
||||
+ // CHECK-CPP: define{{.*}} void @_Z9pr52011_4v({{.*}} sret
|
||||
+}
|
||||
Index: llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/test/CodeGen/X86/fp16-complex.c
|
||||
===================================================================
|
||||
--- llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049.orig/clang/test/CodeGen/X86/fp16-complex.c
|
||||
+++ /dev/null
|
||||
@@ -1,134 +0,0 @@
|
||||
-// RUN: %clang_cc1 %s -O0 -emit-llvm -triple x86_64-unknown-unknown -target-feature +avx512fp16 -o - | FileCheck %s --check-prefix=X86
|
||||
-// RUN: %clang_cc1 %s -O0 -emit-llvm -triple x86_64-unknown-unknown -o - | FileCheck %s --check-prefix=X86
|
||||
|
||||
_Float16 _Complex add_half_rr(_Float16 a, _Float16 b) {
|
||||
// X86-LABEL: @add_half_rr(
|
||||
diff --git b/clang/test/Sema/Float16.c a/clang/test/Sema/Float16.c
|
||||
index 34f0af71c791..ff0bf9043a67 100644
|
||||
--- b/clang/test/Sema/Float16.c
|
||||
+++ a/clang/test/Sema/Float16.c
|
||||
-
|
||||
-_Float16 _Complex add_half_rr(_Float16 a, _Float16 b) {
|
||||
- // X86-LABEL: @add_half_rr(
|
||||
- // X86: fadd
|
||||
- // X86-NOT: fadd
|
||||
- // X86: ret
|
||||
- return a + b;
|
||||
-}
|
||||
-_Float16 _Complex add_half_cr(_Float16 _Complex a, _Float16 b) {
|
||||
- // X86-LABEL: @add_half_cr(
|
||||
- // X86: fadd
|
||||
- // X86-NOT: fadd
|
||||
- // X86: ret
|
||||
- return a + b;
|
||||
-}
|
||||
-_Float16 _Complex add_half_rc(_Float16 a, _Float16 _Complex b) {
|
||||
- // X86-LABEL: @add_half_rc(
|
||||
- // X86: fadd
|
||||
- // X86-NOT: fadd
|
||||
- // X86: ret
|
||||
- return a + b;
|
||||
-}
|
||||
-_Float16 _Complex add_half_cc(_Float16 _Complex a, _Float16 _Complex b) {
|
||||
- // X86-LABEL: @add_half_cc(
|
||||
- // X86: fadd
|
||||
- // X86: fadd
|
||||
- // X86-NOT: fadd
|
||||
- // X86: ret
|
||||
- return a + b;
|
||||
-}
|
||||
-
|
||||
-_Float16 _Complex sub_half_rr(_Float16 a, _Float16 b) {
|
||||
- // X86-LABEL: @sub_half_rr(
|
||||
- // X86: fsub
|
||||
- // X86-NOT: fsub
|
||||
- // X86: ret
|
||||
- return a - b;
|
||||
-}
|
||||
-_Float16 _Complex sub_half_cr(_Float16 _Complex a, _Float16 b) {
|
||||
- // X86-LABEL: @sub_half_cr(
|
||||
- // X86: fsub
|
||||
- // X86-NOT: fsub
|
||||
- // X86: ret
|
||||
- return a - b;
|
||||
-}
|
||||
-_Float16 _Complex sub_half_rc(_Float16 a, _Float16 _Complex b) {
|
||||
- // X86-LABEL: @sub_half_rc(
|
||||
- // X86: fsub
|
||||
- // X86: fneg
|
||||
- // X86-NOT: fsub
|
||||
- // X86: ret
|
||||
- return a - b;
|
||||
-}
|
||||
-_Float16 _Complex sub_half_cc(_Float16 _Complex a, _Float16 _Complex b) {
|
||||
- // X86-LABEL: @sub_half_cc(
|
||||
- // X86: fsub
|
||||
- // X86: fsub
|
||||
- // X86-NOT: fsub
|
||||
- // X86: ret
|
||||
- return a - b;
|
||||
-}
|
||||
-
|
||||
-_Float16 _Complex mul_half_rr(_Float16 a, _Float16 b) {
|
||||
- // X86-LABEL: @mul_half_rr(
|
||||
- // X86: fmul
|
||||
- // X86-NOT: fmul
|
||||
- // X86: ret
|
||||
- return a * b;
|
||||
-}
|
||||
-_Float16 _Complex mul_half_cr(_Float16 _Complex a, _Float16 b) {
|
||||
- // X86-LABEL: @mul_half_cr(
|
||||
- // X86: fmul
|
||||
- // X86: fmul
|
||||
- // X86-NOT: fmul
|
||||
- // X86: ret
|
||||
- return a * b;
|
||||
-}
|
||||
-_Float16 _Complex mul_half_rc(_Float16 a, _Float16 _Complex b) {
|
||||
- // X86-LABEL: @mul_half_rc(
|
||||
- // X86: fmul
|
||||
- // X86: fmul
|
||||
- // X86-NOT: fmul
|
||||
- // X86: ret
|
||||
- return a * b;
|
||||
-}
|
||||
-_Float16 _Complex mul_half_cc(_Float16 _Complex a, _Float16 _Complex b) {
|
||||
- // X86-LABEL: @mul_half_cc(
|
||||
- // X86: %[[AC:[^ ]+]] = fmul
|
||||
- // X86: %[[BD:[^ ]+]] = fmul
|
||||
- // X86: %[[AD:[^ ]+]] = fmul
|
||||
- // X86: %[[BC:[^ ]+]] = fmul
|
||||
- // X86: %[[RR:[^ ]+]] = fsub half %[[AC]], %[[BD]]
|
||||
- // X86: %[[RI:[^ ]+]] = fadd half
|
||||
- // X86-DAG: %[[AD]]
|
||||
- // X86-DAG: ,
|
||||
- // X86-DAG: %[[BC]]
|
||||
- // X86: fcmp uno half %[[RR]]
|
||||
- // X86: fcmp uno half %[[RI]]
|
||||
- // X86: call {{.*}} @__mulhc3(
|
||||
- // X86: ret
|
||||
- return a * b;
|
||||
-}
|
||||
-
|
||||
-_Float16 _Complex div_half_rr(_Float16 a, _Float16 b) {
|
||||
- // X86-LABEL: @div_half_rr(
|
||||
- // X86: fdiv
|
||||
- // X86-NOT: fdiv
|
||||
- // X86: ret
|
||||
- return a / b;
|
||||
-}
|
||||
-_Float16 _Complex div_half_cr(_Float16 _Complex a, _Float16 b) {
|
||||
- // X86-LABEL: @div_half_cr(
|
||||
- // X86: fdiv
|
||||
- // X86: fdiv
|
||||
- // X86-NOT: fdiv
|
||||
- // X86: ret
|
||||
- return a / b;
|
||||
-}
|
||||
-_Float16 _Complex div_half_rc(_Float16 a, _Float16 _Complex b) {
|
||||
- // X86-LABEL: @div_half_rc(
|
||||
- // X86-NOT: fdiv
|
||||
- // X86: call {{.*}} @__divhc3(
|
||||
- // X86: ret
|
||||
- return a / b;
|
||||
-}
|
||||
-_Float16 _Complex div_half_cc(_Float16 _Complex a, _Float16 _Complex b) {
|
||||
- // X86-LABEL: @div_half_cc(
|
||||
- // X86-NOT: fdiv
|
||||
- // X86: call {{.*}} @__divhc3(
|
||||
- // X86: ret
|
||||
- return a / b;
|
||||
-}
|
||||
Index: llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/test/CodeGen/X86/avx512fp16-complex.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/test/CodeGen/X86/avx512fp16-complex.c
|
||||
@@ -0,0 +1,133 @@
|
||||
+// RUN: %clang_cc1 %s -O0 -emit-llvm -triple x86_64-unknown-unknown -target-feature +avx512fp16 -o - | FileCheck %s --check-prefix=X86
|
||||
+
|
||||
+_Float16 _Complex add_half_rr(_Float16 a, _Float16 b) {
|
||||
+ // X86-LABEL: @add_half_rr(
|
||||
+ // X86: fadd
|
||||
+ // X86-NOT: fadd
|
||||
+ // X86: ret
|
||||
+ return a + b;
|
||||
+}
|
||||
+_Float16 _Complex add_half_cr(_Float16 _Complex a, _Float16 b) {
|
||||
+ // X86-LABEL: @add_half_cr(
|
||||
+ // X86: fadd
|
||||
+ // X86-NOT: fadd
|
||||
+ // X86: ret
|
||||
+ return a + b;
|
||||
+}
|
||||
+_Float16 _Complex add_half_rc(_Float16 a, _Float16 _Complex b) {
|
||||
+ // X86-LABEL: @add_half_rc(
|
||||
+ // X86: fadd
|
||||
+ // X86-NOT: fadd
|
||||
+ // X86: ret
|
||||
+ return a + b;
|
||||
+}
|
||||
+_Float16 _Complex add_half_cc(_Float16 _Complex a, _Float16 _Complex b) {
|
||||
+ // X86-LABEL: @add_half_cc(
|
||||
+ // X86: fadd
|
||||
+ // X86: fadd
|
||||
+ // X86-NOT: fadd
|
||||
+ // X86: ret
|
||||
+ return a + b;
|
||||
+}
|
||||
+
|
||||
+_Float16 _Complex sub_half_rr(_Float16 a, _Float16 b) {
|
||||
+ // X86-LABEL: @sub_half_rr(
|
||||
+ // X86: fsub
|
||||
+ // X86-NOT: fsub
|
||||
+ // X86: ret
|
||||
+ return a - b;
|
||||
+}
|
||||
+_Float16 _Complex sub_half_cr(_Float16 _Complex a, _Float16 b) {
|
||||
+ // X86-LABEL: @sub_half_cr(
|
||||
+ // X86: fsub
|
||||
+ // X86-NOT: fsub
|
||||
+ // X86: ret
|
||||
+ return a - b;
|
||||
+}
|
||||
+_Float16 _Complex sub_half_rc(_Float16 a, _Float16 _Complex b) {
|
||||
+ // X86-LABEL: @sub_half_rc(
|
||||
+ // X86: fsub
|
||||
+ // X86: fneg
|
||||
+ // X86-NOT: fsub
|
||||
+ // X86: ret
|
||||
+ return a - b;
|
||||
+}
|
||||
+_Float16 _Complex sub_half_cc(_Float16 _Complex a, _Float16 _Complex b) {
|
||||
+ // X86-LABEL: @sub_half_cc(
|
||||
+ // X86: fsub
|
||||
+ // X86: fsub
|
||||
+ // X86-NOT: fsub
|
||||
+ // X86: ret
|
||||
+ return a - b;
|
||||
+}
|
||||
+
|
||||
+_Float16 _Complex mul_half_rr(_Float16 a, _Float16 b) {
|
||||
+ // X86-LABEL: @mul_half_rr(
|
||||
+ // X86: fmul
|
||||
+ // X86-NOT: fmul
|
||||
+ // X86: ret
|
||||
+ return a * b;
|
||||
+}
|
||||
+_Float16 _Complex mul_half_cr(_Float16 _Complex a, _Float16 b) {
|
||||
+ // X86-LABEL: @mul_half_cr(
|
||||
+ // X86: fmul
|
||||
+ // X86: fmul
|
||||
+ // X86-NOT: fmul
|
||||
+ // X86: ret
|
||||
+ return a * b;
|
||||
+}
|
||||
+_Float16 _Complex mul_half_rc(_Float16 a, _Float16 _Complex b) {
|
||||
+ // X86-LABEL: @mul_half_rc(
|
||||
+ // X86: fmul
|
||||
+ // X86: fmul
|
||||
+ // X86-NOT: fmul
|
||||
+ // X86: ret
|
||||
+ return a * b;
|
||||
+}
|
||||
+_Float16 _Complex mul_half_cc(_Float16 _Complex a, _Float16 _Complex b) {
|
||||
+ // X86-LABEL: @mul_half_cc(
|
||||
+ // X86: %[[AC:[^ ]+]] = fmul
|
||||
+ // X86: %[[BD:[^ ]+]] = fmul
|
||||
+ // X86: %[[AD:[^ ]+]] = fmul
|
||||
+ // X86: %[[BC:[^ ]+]] = fmul
|
||||
+ // X86: %[[RR:[^ ]+]] = fsub half %[[AC]], %[[BD]]
|
||||
+ // X86: %[[RI:[^ ]+]] = fadd half
|
||||
+ // X86-DAG: %[[AD]]
|
||||
+ // X86-DAG: ,
|
||||
+ // X86-DAG: %[[BC]]
|
||||
+ // X86: fcmp uno half %[[RR]]
|
||||
+ // X86: fcmp uno half %[[RI]]
|
||||
+ // X86: call {{.*}} @__mulhc3(
|
||||
+ // X86: ret
|
||||
+ return a * b;
|
||||
+}
|
||||
+
|
||||
+_Float16 _Complex div_half_rr(_Float16 a, _Float16 b) {
|
||||
+ // X86-LABEL: @div_half_rr(
|
||||
+ // X86: fdiv
|
||||
+ // X86-NOT: fdiv
|
||||
+ // X86: ret
|
||||
+ return a / b;
|
||||
+}
|
||||
+_Float16 _Complex div_half_cr(_Float16 _Complex a, _Float16 b) {
|
||||
+ // X86-LABEL: @div_half_cr(
|
||||
+ // X86: fdiv
|
||||
+ // X86: fdiv
|
||||
+ // X86-NOT: fdiv
|
||||
+ // X86: ret
|
||||
+ return a / b;
|
||||
+}
|
||||
+_Float16 _Complex div_half_rc(_Float16 a, _Float16 _Complex b) {
|
||||
+ // X86-LABEL: @div_half_rc(
|
||||
+ // X86-NOT: fdiv
|
||||
+ // X86: call {{.*}} @__divhc3(
|
||||
+ // X86: ret
|
||||
+ return a / b;
|
||||
+}
|
||||
+_Float16 _Complex div_half_cc(_Float16 _Complex a, _Float16 _Complex b) {
|
||||
+ // X86-LABEL: @div_half_cc(
|
||||
+ // X86-NOT: fdiv
|
||||
+ // X86: call {{.*}} @__divhc3(
|
||||
+ // X86: ret
|
||||
+ return a / b;
|
||||
+}
|
||||
Index: llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/test/Sema/Float16.c
|
||||
===================================================================
|
||||
--- llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049.orig/clang/test/Sema/Float16.c
|
||||
+++ llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/test/Sema/Float16.c
|
||||
@@ -1,9 +1,8 @@
|
||||
-// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-linux-pc %s -DHAVE
|
||||
+// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-linux-pc %s
|
||||
@ -179,10 +919,10 @@ index 34f0af71c791..ff0bf9043a67 100644
|
||||
|
||||
#ifndef HAVE
|
||||
// expected-error@+2{{_Float16 is not supported on this target}}
|
||||
diff --git b/clang/test/Sema/conversion-target-dep.c a/clang/test/Sema/conversion-target-dep.c
|
||||
index 6c14750c4d20..e16685fa0674 100644
|
||||
--- b/clang/test/Sema/conversion-target-dep.c
|
||||
+++ a/clang/test/Sema/conversion-target-dep.c
|
||||
Index: llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/test/Sema/conversion-target-dep.c
|
||||
===================================================================
|
||||
--- llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049.orig/clang/test/Sema/conversion-target-dep.c
|
||||
+++ llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/test/Sema/conversion-target-dep.c
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
long double ld;
|
||||
@ -192,10 +932,10 @@ index 6c14750c4d20..e16685fa0674 100644
|
||||
|
||||
int main() {
|
||||
ld = d; // x86-warning {{implicit conversion increases floating-point precision: 'double' to 'long double'}}
|
||||
diff --git b/clang/test/SemaCXX/Float16.cpp a/clang/test/SemaCXX/Float16.cpp
|
||||
index c5fdc7af58a3..f27c3839854e 100644
|
||||
--- b/clang/test/SemaCXX/Float16.cpp
|
||||
+++ a/clang/test/SemaCXX/Float16.cpp
|
||||
Index: llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/test/SemaCXX/Float16.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049.orig/clang/test/SemaCXX/Float16.cpp
|
||||
+++ llvm-toolchain-snapshot_14~++20211123014438+e7026aba0049/clang/test/SemaCXX/Float16.cpp
|
||||
@@ -1,8 +1,7 @@
|
||||
-// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-linux-pc %s -DHAVE
|
||||
+// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-linux-pc %s
|
||||
|
Loading…
Reference in New Issue
Block a user