summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2018-09-20 22:04:44 +0000
committerThomas Lively <tlively@google.com>2018-09-20 22:04:44 +0000
commit6f21a136755e5bce0c58a8f0fab56612821390ba (patch)
treede10d36095130a539991be29371ede750981c958 /llvm/test
parentb320ca264216cb09d70927792f6f3d04bca7f58b (diff)
downloadbcm5719-llvm-6f21a136755e5bce0c58a8f0fab56612821390ba.tar.gz
bcm5719-llvm-6f21a136755e5bce0c58a8f0fab56612821390ba.zip
[WebAssembly] Add V128 value type to binary format
Summary: Adds the necessary support to lib/ObjectYAML and fixes SIMD calls to allow the tests to work. Also removes some dead code that would otherwise have to have been updated. Reviewers: aheejin, dschuff, sbc100 Subscribers: jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D52105 llvm-svn: 342689
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/WebAssembly/call.ll25
-rw-r--r--llvm/test/MC/WebAssembly/types.ll52
2 files changed, 75 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/call.ll b/llvm/test/CodeGen/WebAssembly/call.ll
index 87bcc8aabe0..9ed434128e7 100644
--- a/llvm/test/CodeGen/WebAssembly/call.ll
+++ b/llvm/test/CodeGen/WebAssembly/call.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -wasm-temporary-workarounds=false | FileCheck %s
-; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -fast-isel -fast-isel-abort=1 -wasm-temporary-workarounds=false | FileCheck %s
+; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -wasm-temporary-workarounds=false -mattr=+sign-ext,+simd128 | FileCheck %s
+; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -fast-isel -fast-isel-abort=1 -wasm-temporary-workarounds=false -mattr=+sign-ext,+simd128 | FileCheck %s
; Test that basic call operations assemble as expected.
@@ -12,6 +12,7 @@ declare i32 @i32_binary(i32, i32)
declare i64 @i64_nullary()
declare float @float_nullary()
declare double @double_nullary()
+declare <16 x i8> @v128_nullary()
declare void @void_nullary()
; CHECK-LABEL: call_i32_nullary:
@@ -50,6 +51,15 @@ define double @call_double_nullary() {
ret double %r
}
+; CHECK-LABEL: call_v128_nullary:
+; CHECK-NEXT: .result v128{{$}}
+; CHECK-NEXT: {{^}} v128.call $push[[NUM:[0-9]+]]=, v128_nullary@FUNCTION{{$}}
+; CHECK-NEXT: return $pop[[NUM]]{{$}}
+define <16 x i8> @call_v128_nullary() {
+ %r = call <16 x i8> @v128_nullary()
+ ret <16 x i8> %r
+}
+
; CHECK-LABEL: call_void_nullary:
; CHECK-NEXT: {{^}} call void_nullary@FUNCTION{{$}}
; CHECK-NEXT: return{{$}}
@@ -102,6 +112,17 @@ define i32 @call_indirect_i32(i32 ()* %callee) {
ret i32 %t
}
+; CHECK-LABEL: call_indirect_v128:
+; CHECK-NEXT: .param i32{{$}}
+; CHECK-NEXT: .result v128{{$}}
+; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
+; CHECK-NEXT: {{^}} v128.call_indirect $push[[NUM:[0-9]+]]=, $pop[[L0]]{{$}}
+; CHECK-NEXT: return $pop[[NUM]]{{$}}
+define <16 x i8> @call_indirect_v128(<16 x i8> ()* %callee) {
+ %t = call <16 x i8> %callee()
+ ret <16 x i8> %t
+}
+
; CHECK-LABEL: call_indirect_arg:
; CHECK-NEXT: .param i32, i32{{$}}
; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 1{{$}}
diff --git a/llvm/test/MC/WebAssembly/types.ll b/llvm/test/MC/WebAssembly/types.ll
new file mode 100644
index 00000000000..1f85f85695a
--- /dev/null
+++ b/llvm/test/MC/WebAssembly/types.ll
@@ -0,0 +1,52 @@
+; RUN: llc -wasm-enable-unimplemented-simd -mattr=+sign-ext,+simd128 -filetype=obj %s -o - | obj2yaml | FileCheck %s
+
+target triple = "wasm32-unknown-unknown"
+
+declare i32 @i32()
+declare i64 @i64()
+declare float @f32()
+declare double @f64()
+declare <16 x i8> @v16i8()
+declare <8 x i16> @v8i16()
+declare <4 x i32> @v4i32()
+declare <2 x i64> @v2i64()
+declare <4 x float> @v4f32()
+declare <2 x double> @v2f64()
+
+define void @f1() {
+entry:
+ %tmp1 = call i32 @i32()
+ %tmp2 = call i64 @i64()
+ %tmp3 = call float @f32()
+ %tmp4 = call double @f64()
+ %tmp5 = call <16 x i8> @v16i8()
+ %tmp6 = call <8 x i16> @v8i16()
+ %tmp7 = call <4 x i32> @v4i32()
+ %tmp8 = call <2 x i64> @v2i64()
+ %tmp9 = call <4 x float> @v4f32()
+ %tmp10 = call <2 x double> @v2f64()
+ ret void
+}
+
+; CHECK-LABEL: - Type: TYPE
+; CHECK-NEXT: Signatures:
+; CHECK-NEXT: - Index: 0
+; CHECK-NEXT: ReturnType: NORESULT
+; CHECK-NEXT: ParamTypes:
+; CHECK-NEXT: - Index: 1
+; CHECK-NEXT: ReturnType: I32
+; CHECK-NEXT: ParamTypes:
+; CHECK-NEXT: - Index: 2
+; CHECK-NEXT: ReturnType: I64
+; CHECK-NEXT: ParamTypes:
+; CHECK-NEXT: - Index: 3
+; CHECK-NEXT: ReturnType: F32
+; CHECK-NEXT: ParamTypes:
+; CHECK-NEXT: - Index: 4
+; CHECK-NEXT: ReturnType: F64
+; CHECK-NEXT: ParamTypes:
+; CHECK-NEXT: - Index: 5
+; CHECK-NEXT: ReturnType: V128
+; CHECK-NEXT: ParamTypes:
+; should be no additional types
+; CHECK-NOT: ReturnType
OpenPOWER on IntegriCloud