Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Unified Diff: tests_lit/llvm2ice_tests/vector-arith.ll

Issue 389653002: Lower vector floating point arithmetic operations. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Avoid _movp() trickery Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/IceTargetLoweringX8632.cpp ('K') | « src/IceTargetLoweringX8632.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/llvm2ice_tests/vector-arith.ll
diff --git a/tests_lit/llvm2ice_tests/vector-arith.ll b/tests_lit/llvm2ice_tests/vector-arith.ll
new file mode 100644
index 0000000000000000000000000000000000000000..dd8481207d169692ea7da4b0e43c722deb96e21c
--- /dev/null
+++ b/tests_lit/llvm2ice_tests/vector-arith.ll
@@ -0,0 +1,51 @@
+; This test checks support for vector arithmetic.
+
+; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s
+; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck %s
+; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s
+; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s
+; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \
+; RUN: | FileCheck --check-prefix=DUMP %s
+
+define <4 x float> @test_fadd(<4 x float> %arg0, <4 x float> %arg1) {
+entry:
+ %res = fadd <4 x float> %arg0, %arg1
+ ret <4 x float> %res
+; CHECK-LABEL: test_fadd:
+; CHECK: addps
+}
+
+define <4 x float> @test_fsub(<4 x float> %arg0, <4 x float> %arg1) {
+entry:
+ %res = fsub <4 x float> %arg0, %arg1
+ ret <4 x float> %res
+; CHECK-LABEL: test_fsub:
+; CHECK: subps
+}
+
+define <4 x float> @test_fmul(<4 x float> %arg0, <4 x float> %arg1) {
+entry:
+ %res = fmul <4 x float> %arg0, %arg1
+ ret <4 x float> %res
+; CHECK-LABEL: test_fmul:
+; CHECK: mulps
+}
+
+define <4 x float> @test_fdiv(<4 x float> %arg0, <4 x float> %arg1) {
+entry:
+ %res = fdiv <4 x float> %arg0, %arg1
+ ret <4 x float> %res
+; CHECK-LABEL: test_fdiv:
+; CHECK: divps
+}
+
+define <4 x float> @test_frem(<4 x float> %arg0, <4 x float> %arg1) {
+entry:
+ %res = frem <4 x float> %arg0, %arg1
+ ret <4 x float> %res
+; CHECK-LABEL: test_frem:
+; CHECK: __frem_v4f32
+}
+
+; ERRORS-NOT: ICE translation error
+; DUMP-NOT: SZ
« src/IceTargetLoweringX8632.cpp ('K') | « src/IceTargetLoweringX8632.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698