summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2018-09-25 03:39:28 +0000
committerThomas Lively <tlively@google.com>2018-09-25 03:39:28 +0000
commit12da0f9c3d9a5a1ec91f339f45c99dd8f27eb869 (patch)
tree10f85f913c2bcb8836e05f3071a1972a6e821902 /llvm/test/CodeGen/WebAssembly
parent6da5366ea9f92c1318a8b360062668c8e25a08e8 (diff)
downloadbcm5719-llvm-12da0f9c3d9a5a1ec91f339f45c99dd8f27eb869.tar.gz
bcm5719-llvm-12da0f9c3d9a5a1ec91f339f45c99dd8f27eb869.zip
[WebAssembly] SIMD sqrt
Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D52387 llvm-svn: 342937
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly')
-rw-r--r--llvm/test/CodeGen/WebAssembly/simd-arith.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/simd-arith.ll b/llvm/test/CodeGen/WebAssembly/simd-arith.ll
index 4f26b89a66f..f20dc82a21b 100644
--- a/llvm/test/CodeGen/WebAssembly/simd-arith.ll
+++ b/llvm/test/CodeGen/WebAssembly/simd-arith.ll
@@ -723,6 +723,18 @@ define <4 x float> @mul_v4f32(<4 x float> %x, <4 x float> %y) {
ret <4 x float> %a
}
+; CHECK-LABEL: sqrt_v4f32:
+; NO-SIMD128-NOT: f32x4
+; SIMD128-NEXT: .param v128{{$}}
+; SIMD128-NEXT: .result v128{{$}}
+; SIMD128-NEXT: f32x4.sqrt $push[[R:[0-9]+]]=, $0{{$}}
+; SIMD128-NEXT: return $pop[[R]]{{$}}
+declare <4 x float> @llvm.sqrt.v4f32(<4 x float> %x)
+define <4 x float> @sqrt_v4f32(<4 x float> %x) {
+ %a = call <4 x float> @llvm.sqrt.v4f32(<4 x float> %x)
+ ret <4 x float> %a
+}
+
; ==============================================================================
; 2 x double
; ==============================================================================
@@ -797,3 +809,15 @@ define <2 x double> @mul_v2f64(<2 x double> %x, <2 x double> %y) {
%a = fmul <2 x double> %x, %y
ret <2 x double> %a
}
+
+; CHECK-LABEL: sqrt_v2f64:
+; NO-SIMD128-NOT: f64x2
+; SIMD128-NEXT: .param v128{{$}}
+; SIMD128-NEXT: .result v128{{$}}
+; SIMD128-NEXT: f64x2.sqrt $push[[R:[0-9]+]]=, $0{{$}}
+; SIMD128-NEXT: return $pop[[R]]{{$}}
+declare <2 x double> @llvm.sqrt.v2f64(<2 x double> %x)
+define <2 x double> @sqrt_v2f64(<2 x double> %x) {
+ %a = call <2 x double> @llvm.sqrt.v2f64(<2 x double> %x)
+ ret <2 x double> %a
+}
OpenPOWER on IntegriCloud