summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/PowerPC/vsx-elementary-arith.ll120
-rw-r--r--llvm/test/CodeGen/PowerPC/vsx-recip-est.ll62
-rw-r--r--llvm/test/MC/Disassembler/PowerPC/vsx.txt21
-rw-r--r--llvm/test/MC/PowerPC/vsx.s21
4 files changed, 224 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/vsx-elementary-arith.ll b/llvm/test/CodeGen/PowerPC/vsx-elementary-arith.ll
new file mode 100644
index 00000000000..d8f76bb989e
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/vsx-elementary-arith.ll
@@ -0,0 +1,120 @@
+; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 | FileCheck %s
+; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 | FileCheck %s
+@a = global float 3.000000e+00, align 4
+@b = global float 4.000000e+00, align 4
+@c = global double 3.000000e+00, align 8
+@d = global double 4.000000e+00, align 8
+
+; Function Attrs: nounwind
+define float @emit_xsaddsp() {
+entry:
+ %0 = load float, float* @a, align 4
+ %1 = load float, float* @b, align 4
+ %add = fadd float %0, %1
+ ret float %add
+; CHECK-LABEL: @emit_xsaddsp
+; CHECK: xsaddsp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind
+define float @emit_xssubsp() {
+entry:
+ %0 = load float, float* @a, align 4
+ %1 = load float, float* @b, align 4
+ %sub = fsub float %0, %1
+ ret float %sub
+; CHECK-LABEL: @emit_xssubsp
+; CHECK: xssubsp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind
+define float @emit_xsdivsp() {
+entry:
+ %0 = load float, float* @a, align 4
+ %1 = load float, float* @b, align 4
+ %div = fdiv float %0, %1
+ ret float %div
+; CHECK-LABEL: @emit_xsdivsp
+; CHECK: xsdivsp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind
+define float @emit_xsmulsp() {
+entry:
+ %0 = load float, float* @a, align 4
+ %1 = load float, float* @b, align 4
+ %mul = fmul float %0, %1
+ ret float %mul
+; CHECK-LABEL: @emit_xsmulsp
+; CHECK: xsmulsp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind
+define float @emit_xssqrtsp() {
+entry:
+ %0 = load float, float* @b, align 4
+ %call = call float @sqrtf(float %0)
+ ret float %call
+; CHECK-LABEL: @emit_xssqrtsp
+; CHECK: xssqrtsp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind
+declare float @sqrtf(float)
+
+; Function Attrs: nounwind
+define double @emit_xsadddp() {
+entry:
+ %0 = load double, double* @c, align 8
+ %1 = load double, double* @d, align 8
+ %add = fadd double %0, %1
+ ret double %add
+; CHECK-LABEL: @emit_xsadddp
+; CHECK: xsadddp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind
+define double @emit_xssubdp() {
+entry:
+ %0 = load double, double* @c, align 8
+ %1 = load double, double* @d, align 8
+ %sub = fsub double %0, %1
+ ret double %sub
+; CHECK-LABEL: @emit_xssubdp
+; CHECK: xssubdp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind
+define double @emit_xsdivdp() {
+entry:
+ %0 = load double, double* @c, align 8
+ %1 = load double, double* @d, align 8
+ %div = fdiv double %0, %1
+ ret double %div
+; CHECK-LABEL: @emit_xsdivdp
+; CHECK: xsdivdp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind
+define double @emit_xsmuldp() {
+entry:
+ %0 = load double, double* @c, align 8
+ %1 = load double, double* @d, align 8
+ %mul = fmul double %0, %1
+ ret double %mul
+; CHECK-LABEL: @emit_xsmuldp
+; CHECK: xsmuldp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind
+define double @emit_xssqrtdp() {
+entry:
+ %0 = load double, double* @d, align 8
+ %call = call double @sqrt(double %0)
+ ret double %call
+; CHECK-LABEL: @emit_xssqrtdp
+; CHECK: xssqrtdp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind
+declare double @sqrt(double)
diff --git a/llvm/test/CodeGen/PowerPC/vsx-recip-est.ll b/llvm/test/CodeGen/PowerPC/vsx-recip-est.ll
new file mode 100644
index 00000000000..f589c6c103e
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/vsx-recip-est.ll
@@ -0,0 +1,62 @@
+; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 -enable-unsafe-fp-math | FileCheck %s
+; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 -enable-unsafe-fp-math | FileCheck %s
+@a = global float 3.000000e+00, align 4
+@b = global float 4.000000e+00, align 4
+@c = global double 3.000000e+00, align 8
+@d = global double 4.000000e+00, align 8
+
+; Function Attrs: nounwind
+define float @emit_xsresp() {
+entry:
+ %0 = load float, float* @a, align 4
+ %1 = load float, float* @b, align 4
+ %div = fdiv fast float %0, %1
+ ret float %div
+; CHECK-LABEL: @emit_xsresp
+; CHECK: xsresp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind
+define float @emit_xsrsqrtesp(float %f) {
+entry:
+ %f.addr = alloca float, align 4
+ store float %f, float* %f.addr, align 4
+ %0 = load float, float* %f.addr, align 4
+ %1 = load float, float* @b, align 4
+ %2 = call float @llvm.sqrt.f32(float %1)
+ %div = fdiv fast float %0, %2
+ ret float %div
+; CHECK-LABEL: @emit_xsrsqrtesp
+; CHECK: xsrsqrtesp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind readnone
+declare float @llvm.sqrt.f32(float)
+
+; Function Attrs: nounwind
+define double @emit_xsredp() {
+entry:
+ %0 = load double, double* @c, align 8
+ %1 = load double, double* @d, align 8
+ %div = fdiv fast double %0, %1
+ ret double %div
+; CHECK-LABEL: @emit_xsredp
+; CHECK: xsredp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind
+define double @emit_xsrsqrtedp(double %f) {
+entry:
+ %f.addr = alloca double, align 8
+ store double %f, double* %f.addr, align 8
+ %0 = load double, double* %f.addr, align 8
+ %1 = load double, double* @d, align 8
+ %2 = call double @llvm.sqrt.f64(double %1)
+ %div = fdiv fast double %0, %2
+ ret double %div
+; CHECK-LABEL: @emit_xsrsqrtedp
+; CHECK: xsrsqrtedp {{[0-9]+}}
+}
+
+; Function Attrs: nounwind readnone
+declare double @llvm.sqrt.f64(double) #1
diff --git a/llvm/test/MC/Disassembler/PowerPC/vsx.txt b/llvm/test/MC/Disassembler/PowerPC/vsx.txt
index 417efd0fe17..04b2eeb0dd2 100644
--- a/llvm/test/MC/Disassembler/PowerPC/vsx.txt
+++ b/llvm/test/MC/Disassembler/PowerPC/vsx.txt
@@ -39,6 +39,9 @@
# CHECK: xsabsdp 7, 27
0xf0 0xe0 0xdd 0x64
+# CHECK: xsaddsp 7, 63, 27
+0xf0 0xff 0xd8 0x04
+
# CHECK: xsadddp 7, 63, 27
0xf0 0xff 0xd9 0x04
@@ -75,6 +78,9 @@
# CHECK: xscvuxddp 7, 27
0xf0 0xe0 0xdd 0xa0
+# CHECK: xsdivsp 7, 63, 27
+0xf0 0xff 0xd8 0xc4
+
# CHECK: xsdivdp 7, 63, 27
0xf0 0xff 0xd9 0xc4
@@ -96,6 +102,9 @@
# CHECK: xsmsubmdp 7, 63, 27
0xf0 0xff 0xd9 0xcc
+# CHECK: xsmulsp 7, 63, 27
+0xf0 0xff 0xd8 0x84
+
# CHECK: xsmuldp 7, 63, 27
0xf0 0xff 0xd9 0x84
@@ -132,15 +141,27 @@
# CHECK: xsrdpiz 7, 27
0xf0 0xe0 0xd9 0x64
+# CHECK: xsresp 7, 27
+0xf0 0xe0 0xd8 0x68
+
# CHECK: xsredp 7, 27
0xf0 0xe0 0xd9 0x68
+# CHECK: xsrsqrtesp 7, 27
+0xf0 0xe0 0xd8 0x28
+
# CHECK: xsrsqrtedp 7, 27
0xf0 0xe0 0xd9 0x28
+# CHECK: xssqrtsp 7, 27
+0xf0 0xe0 0xd8 0x2c
+
# CHECK: xssqrtdp 7, 27
0xf0 0xe0 0xd9 0x2c
+# CHECK: xssubsp 7, 63, 27
+0xf0 0xff 0xd8 0x44
+
# CHECK: xssubdp 7, 63, 27
0xf0 0xff 0xd9 0x44
diff --git a/llvm/test/MC/PowerPC/vsx.s b/llvm/test/MC/PowerPC/vsx.s
index 75c934f78c1..773fc9eef6d 100644
--- a/llvm/test/MC/PowerPC/vsx.s
+++ b/llvm/test/MC/PowerPC/vsx.s
@@ -44,6 +44,9 @@
# CHECK-BE: xsabsdp 7, 27 # encoding: [0xf0,0xe0,0xdd,0x64]
# CHECK-LE: xsabsdp 7, 27 # encoding: [0x64,0xdd,0xe0,0xf0]
xsabsdp 7, 27
+# CHECK-BE: xsaddsp 7, 63, 27 # encoding: [0xf0,0xff,0xd8,0x04]
+# CHECK-LE: xsaddsp 7, 63, 27 # encoding: [0x04,0xd8,0xff,0xf0]
+ xsaddsp 7, 63, 27
# CHECK-BE: xsadddp 7, 63, 27 # encoding: [0xf0,0xff,0xd9,0x04]
# CHECK-LE: xsadddp 7, 63, 27 # encoding: [0x04,0xd9,0xff,0xf0]
xsadddp 7, 63, 27
@@ -80,6 +83,9 @@
# CHECK-BE: xscvuxddp 7, 27 # encoding: [0xf0,0xe0,0xdd,0xa0]
# CHECK-LE: xscvuxddp 7, 27 # encoding: [0xa0,0xdd,0xe0,0xf0]
xscvuxddp 7, 27
+# CHECK-BE: xsdivsp 7, 63, 27 # encoding: [0xf0,0xff,0xd8,0xc4]
+# CHECK-LE: xsdivsp 7, 63, 27 # encoding: [0xc4,0xd8,0xff,0xf0]
+ xsdivsp 7, 63, 27
# CHECK-BE: xsdivdp 7, 63, 27 # encoding: [0xf0,0xff,0xd9,0xc4]
# CHECK-LE: xsdivdp 7, 63, 27 # encoding: [0xc4,0xd9,0xff,0xf0]
xsdivdp 7, 63, 27
@@ -101,6 +107,9 @@
# CHECK-BE: xsmsubmdp 7, 63, 27 # encoding: [0xf0,0xff,0xd9,0xcc]
# CHECK-LE: xsmsubmdp 7, 63, 27 # encoding: [0xcc,0xd9,0xff,0xf0]
xsmsubmdp 7, 63, 27
+# CHECK-BE: xsmulsp 7, 63, 27 # encoding: [0xf0,0xff,0xd8,0x84]
+# CHECK-LE: xsmulsp 7, 63, 27 # encoding: [0x84,0xd8,0xff,0xf0]
+ xsmulsp 7, 63, 27
# CHECK-BE: xsmuldp 7, 63, 27 # encoding: [0xf0,0xff,0xd9,0x84]
# CHECK-LE: xsmuldp 7, 63, 27 # encoding: [0x84,0xd9,0xff,0xf0]
xsmuldp 7, 63, 27
@@ -137,15 +146,27 @@
# CHECK-BE: xsrdpiz 7, 27 # encoding: [0xf0,0xe0,0xd9,0x64]
# CHECK-LE: xsrdpiz 7, 27 # encoding: [0x64,0xd9,0xe0,0xf0]
xsrdpiz 7, 27
+# CHECK-BE: xsresp 7, 27 # encoding: [0xf0,0xe0,0xd8,0x68]
+# CHECK-LE: xsresp 7, 27 # encoding: [0x68,0xd8,0xe0,0xf0]
+ xsresp 7, 27
# CHECK-BE: xsredp 7, 27 # encoding: [0xf0,0xe0,0xd9,0x68]
# CHECK-LE: xsredp 7, 27 # encoding: [0x68,0xd9,0xe0,0xf0]
xsredp 7, 27
+# CHECK-BE: xsrsqrtesp 7, 27 # encoding: [0xf0,0xe0,0xd8,0x28]
+# CHECK-LE: xsrsqrtesp 7, 27 # encoding: [0x28,0xd8,0xe0,0xf0]
+ xsrsqrtesp 7, 27
# CHECK-BE: xsrsqrtedp 7, 27 # encoding: [0xf0,0xe0,0xd9,0x28]
# CHECK-LE: xsrsqrtedp 7, 27 # encoding: [0x28,0xd9,0xe0,0xf0]
xsrsqrtedp 7, 27
+# CHECK-BE: xssqrtsp 7, 27 # encoding: [0xf0,0xe0,0xd8,0x2c]
+# CHECK-LE: xssqrtsp 7, 27 # encoding: [0x2c,0xd8,0xe0,0xf0]
+ xssqrtsp 7, 27
# CHECK-BE: xssqrtdp 7, 27 # encoding: [0xf0,0xe0,0xd9,0x2c]
# CHECK-LE: xssqrtdp 7, 27 # encoding: [0x2c,0xd9,0xe0,0xf0]
xssqrtdp 7, 27
+# CHECK-BE: xssubsp 7, 63, 27 # encoding: [0xf0,0xff,0xd8,0x44]
+# CHECK-LE: xssubsp 7, 63, 27 # encoding: [0x44,0xd8,0xff,0xf0]
+ xssubsp 7, 63, 27
# CHECK-BE: xssubdp 7, 63, 27 # encoding: [0xf0,0xff,0xd9,0x44]
# CHECK-LE: xssubdp 7, 63, 27 # encoding: [0x44,0xd9,0xff,0xf0]
xssubdp 7, 63, 27
OpenPOWER on IntegriCloud