diff options
author | Wouter van Oortmerssen <aardappel@gmail.com> | 2018-11-19 17:10:36 +0000 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2018-11-19 17:10:36 +0000 |
commit | 49482f824a0d92f8f97121aaa6e82f409ff23d58 (patch) | |
tree | b6619cb3dddaca091bf225cbeadfc1fa224c0904 /llvm/test/CodeGen/WebAssembly/i32.ll | |
parent | b25adf5edba0bfb487828600f4294702e695fdba (diff) | |
download | bcm5719-llvm-49482f824a0d92f8f97121aaa6e82f409ff23d58.tar.gz bcm5719-llvm-49482f824a0d92f8f97121aaa6e82f409ff23d58.zip |
[WebAssembly] replaced .param/.result by .functype
Summary:
This makes it easier/cleaner to generate a single signature from
this directive. Also:
- Adds the symbol name, such that we don't depend on the location
of this directive anymore.
- Actually constructs the signature in the assembler, and make the
assembler own it.
- Refactor the use of MVT vs ValType in the streamer and assembler
to require less conversions overall.
- Changed 700 or so tests to use it.
Reviewers: sbc100, dschuff
Subscribers: jgravelle-google, eraman, aheejin, sunfish, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D54652
llvm-svn: 347228
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly/i32.ll')
-rw-r--r-- | llvm/test/CodeGen/WebAssembly/i32.ll | 69 |
1 files changed, 23 insertions, 46 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/i32.ll b/llvm/test/CodeGen/WebAssembly/i32.ll index 45c9a94bee7..35271377964 100644 --- a/llvm/test/CodeGen/WebAssembly/i32.ll +++ b/llvm/test/CodeGen/WebAssembly/i32.ll @@ -10,8 +10,7 @@ declare i32 @llvm.cttz.i32(i32, i1) declare i32 @llvm.ctpop.i32(i32) ; CHECK-LABEL: add32: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype add32 (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.add $push0=, $pop[[L0]], $pop[[L1]]{{$}} @@ -22,8 +21,7 @@ define i32 @add32(i32 %x, i32 %y) { } ; CHECK-LABEL: sub32: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype sub32 (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.sub $push0=, $pop[[L0]], $pop[[L1]]{{$}} @@ -34,8 +32,7 @@ define i32 @sub32(i32 %x, i32 %y) { } ; CHECK-LABEL: mul32: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype mul32 (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.mul $push0=, $pop[[L0]], $pop[[L1]]{{$}} @@ -46,8 +43,7 @@ define i32 @mul32(i32 %x, i32 %y) { } ; CHECK-LABEL: sdiv32: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype sdiv32 (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.div_s $push0=, $pop[[L0]], $pop[[L1]]{{$}} @@ -58,8 +54,7 @@ define i32 @sdiv32(i32 %x, i32 %y) { } ; CHECK-LABEL: udiv32: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype udiv32 (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.div_u $push0=, $pop[[L0]], $pop[[L1]]{{$}} @@ -70,8 +65,7 @@ define i32 @udiv32(i32 %x, i32 %y) { } ; CHECK-LABEL: srem32: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype srem32 (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.rem_s $push0=, $pop[[L0]], $pop[[L1]]{{$}} @@ -82,8 +76,7 @@ define i32 @srem32(i32 %x, i32 %y) { } ; CHECK-LABEL: urem32: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype urem32 (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.rem_u $push0=, $pop[[L0]], $pop[[L1]]{{$}} @@ -94,8 +87,7 @@ define i32 @urem32(i32 %x, i32 %y) { } ; CHECK-LABEL: and32: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype and32 (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.and $push0=, $pop[[L0]], $pop[[L1]]{{$}} @@ -106,8 +98,7 @@ define i32 @and32(i32 %x, i32 %y) { } ; CHECK-LABEL: or32: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype or32 (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.or $push0=, $pop[[L0]], $pop[[L1]]{{$}} @@ -118,8 +109,7 @@ define i32 @or32(i32 %x, i32 %y) { } ; CHECK-LABEL: xor32: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype xor32 (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.xor $push0=, $pop[[L0]], $pop[[L1]]{{$}} @@ -130,8 +120,7 @@ define i32 @xor32(i32 %x, i32 %y) { } ; CHECK-LABEL: shl32: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype shl32 (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.shl $push0=, $pop[[L0]], $pop[[L1]]{{$}} @@ -142,8 +131,7 @@ define i32 @shl32(i32 %x, i32 %y) { } ; CHECK-LABEL: shr32: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype shr32 (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.shr_u $push0=, $pop[[L0]], $pop[[L1]]{{$}} @@ -154,8 +142,7 @@ define i32 @shr32(i32 %x, i32 %y) { } ; CHECK-LABEL: sar32: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype sar32 (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.shr_s $push0=, $pop[[L0]], $pop[[L1]]{{$}} @@ -166,8 +153,7 @@ define i32 @sar32(i32 %x, i32 %y) { } ; CHECK-LABEL: clz32: -; CHECK-NEXT: .param i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype clz32 (i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: i32.clz $push0=, $pop[[L0]]{{$}} ; CHECK-NEXT: return $pop0{{$}} @@ -177,8 +163,7 @@ define i32 @clz32(i32 %x) { } ; CHECK-LABEL: clz32_zero_undef: -; CHECK-NEXT: .param i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype clz32_zero_undef (i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: i32.clz $push0=, $pop[[L0]]{{$}} ; CHECK-NEXT: return $pop0{{$}} @@ -188,8 +173,7 @@ define i32 @clz32_zero_undef(i32 %x) { } ; CHECK-LABEL: ctz32: -; CHECK-NEXT: .param i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype ctz32 (i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: i32.ctz $push0=, $pop[[L0]]{{$}} ; CHECK-NEXT: return $pop0{{$}} @@ -199,8 +183,7 @@ define i32 @ctz32(i32 %x) { } ; CHECK-LABEL: ctz32_zero_undef: -; CHECK-NEXT: .param i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype ctz32_zero_undef (i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: i32.ctz $push0=, $pop[[L0]]{{$}} ; CHECK-NEXT: return $pop0{{$}} @@ -210,8 +193,7 @@ define i32 @ctz32_zero_undef(i32 %x) { } ; CHECK-LABEL: popcnt32: -; CHECK-NEXT: .param i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype popcnt32 (i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: i32.popcnt $push0=, $pop[[L0]]{{$}} ; CHECK-NEXT: return $pop0{{$}} @@ -221,8 +203,7 @@ define i32 @popcnt32(i32 %x) { } ; CHECK-LABEL: eqz32: -; CHECK-NEXT: .param i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype eqz32 (i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: i32.eqz $push0=, $pop[[L0]]{{$}} ; CHECK-NEXT: return $pop0{{$}} @@ -233,8 +214,7 @@ define i32 @eqz32(i32 %x) { } ; CHECK-LABEL: rotl: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype rotl (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.rotl $push0=, $pop[[L0]], $pop[[L1]] @@ -248,8 +228,7 @@ define i32 @rotl(i32 %x, i32 %y) { } ; CHECK-LABEL: masked_rotl: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype masked_rotl (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.rotl $push0=, $pop[[L0]], $pop[[L1]] @@ -264,8 +243,7 @@ define i32 @masked_rotl(i32 %x, i32 %y) { } ; CHECK-LABEL: rotr: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype rotr (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.rotr $push0=, $pop[[L0]], $pop[[L1]] @@ -279,8 +257,7 @@ define i32 @rotr(i32 %x, i32 %y) { } ; CHECK-LABEL: masked_rotr: -; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: .result i32{{$}} +; CHECK-NEXT: .functype masked_rotr (i32, i32) -> (i32){{$}} ; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} ; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} ; CHECK-NEXT: i32.rotr $push0=, $pop[[L0]], $pop[[L1]] |