summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/SystemZ/vec-round-01.ll
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2015-05-05 19:26:48 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2015-05-05 19:26:48 +0000
commitcd808237b24c7d6d0bb7ddf577dba37c31a06a50 (patch)
tree3e15e263edd31135f4279f6cb05b48dac89ad513 /llvm/test/CodeGen/SystemZ/vec-round-01.ll
parentce4c10958502b8f852dd88496272d262345a2513 (diff)
downloadbcm5719-llvm-cd808237b24c7d6d0bb7ddf577dba37c31a06a50.tar.gz
bcm5719-llvm-cd808237b24c7d6d0bb7ddf577dba37c31a06a50.zip
[SystemZ] Add CodeGen support for v2f64
This adds ABI and CodeGen support for the v2f64 type, which is natively supported by z13 instructions. Based on a patch by Richard Sandiford. llvm-svn: 236522
Diffstat (limited to 'llvm/test/CodeGen/SystemZ/vec-round-01.ll')
-rw-r--r--llvm/test/CodeGen/SystemZ/vec-round-01.ll58
1 files changed, 58 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/SystemZ/vec-round-01.ll b/llvm/test/CodeGen/SystemZ/vec-round-01.ll
new file mode 100644
index 00000000000..284b83e96f7
--- /dev/null
+++ b/llvm/test/CodeGen/SystemZ/vec-round-01.ll
@@ -0,0 +1,58 @@
+; Test v2f64 rounding.
+;
+; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
+
+declare <2 x double> @llvm.rint.v2f64(<2 x double>)
+declare <2 x double> @llvm.nearbyint.v2f64(<2 x double>)
+declare <2 x double> @llvm.floor.v2f64(<2 x double>)
+declare <2 x double> @llvm.ceil.v2f64(<2 x double>)
+declare <2 x double> @llvm.trunc.v2f64(<2 x double>)
+declare <2 x double> @llvm.round.v2f64(<2 x double>)
+
+define <2 x double> @f1(<2 x double> %val) {
+; CHECK-LABEL: f1:
+; CHECK: vfidb %v24, %v24, 0, 0
+; CHECK: br %r14
+ %res = call <2 x double> @llvm.rint.v2f64(<2 x double> %val)
+ ret <2 x double> %res
+}
+
+define <2 x double> @f2(<2 x double> %val) {
+; CHECK-LABEL: f2:
+; CHECK: vfidb %v24, %v24, 4, 0
+; CHECK: br %r14
+ %res = call <2 x double> @llvm.nearbyint.v2f64(<2 x double> %val)
+ ret <2 x double> %res
+}
+
+define <2 x double> @f3(<2 x double> %val) {
+; CHECK-LABEL: f3:
+; CHECK: vfidb %v24, %v24, 4, 7
+; CHECK: br %r14
+ %res = call <2 x double> @llvm.floor.v2f64(<2 x double> %val)
+ ret <2 x double> %res
+}
+
+define <2 x double> @f4(<2 x double> %val) {
+; CHECK-LABEL: f4:
+; CHECK: vfidb %v24, %v24, 4, 6
+; CHECK: br %r14
+ %res = call <2 x double> @llvm.ceil.v2f64(<2 x double> %val)
+ ret <2 x double> %res
+}
+
+define <2 x double> @f5(<2 x double> %val) {
+; CHECK-LABEL: f5:
+; CHECK: vfidb %v24, %v24, 4, 5
+; CHECK: br %r14
+ %res = call <2 x double> @llvm.trunc.v2f64(<2 x double> %val)
+ ret <2 x double> %res
+}
+
+define <2 x double> @f6(<2 x double> %val) {
+; CHECK-LABEL: f6:
+; CHECK: vfidb %v24, %v24, 4, 1
+; CHECK: br %r14
+ %res = call <2 x double> @llvm.round.v2f64(<2 x double> %val)
+ ret <2 x double> %res
+}
OpenPOWER on IntegriCloud