2018-05-11 00:16:44 +02:00
|
|
|
# RUN: llvm-mc --disassemble %s -triple=wasm32-unknown-unknown | FileCheck %s
|
|
|
|
|
|
|
|
# CHECK: .text
|
|
|
|
|
|
|
|
# CHECK: nop
|
|
|
|
0x01
|
|
|
|
|
2018-06-18 23:22:44 +02:00
|
|
|
# CHECK: i32.add
|
2018-05-11 00:16:44 +02:00
|
|
|
0x6a
|
|
|
|
|
2018-06-18 23:22:44 +02:00
|
|
|
# CHECK: i64.const -1
|
2018-05-11 00:16:44 +02:00
|
|
|
0x42 0x7F
|
|
|
|
|
2018-08-27 17:45:51 +02:00
|
|
|
# CHECK: i64.load32_u 16:p2align=1
|
2018-05-11 00:16:44 +02:00
|
|
|
0x35 0x01 0x10
|
|
|
|
|
2019-01-03 00:23:51 +01:00
|
|
|
# CHECK: block f64
|
|
|
|
0x02 0x7C
|
2018-05-11 00:16:44 +02:00
|
|
|
|
|
|
|
# CHECK: call_indirect
|
|
|
|
# $0=, 128, 0
|
|
|
|
# FIXME: WebAssemblyInstPrinter does not print immediates.
|
|
|
|
0x11 0x80 0x01 0x00
|
|
|
|
|
[WebAssembly] Make disassembler always emit most canonical name.
Summary:
There are a few instructions that all map to the same opcode, so
when disassembling, we have to pick one. That was just the first one
before (the except_ref variant in the case of "call"), now it is the
one marked as IsCanonical in tablegen, or failing that, the shortest
name (which is typically the "canonical" one).
Also introduced a canonical "end" instruction for this purpose.
Reviewers: dschuff, tlively
Subscribers: sbc100, jgravelle-google, aheejin, llvm-commits, sunfish
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57713
llvm-svn: 353131
2019-02-05 02:19:45 +01:00
|
|
|
# CHECK: call 0
|
|
|
|
0x10 0x00
|
|
|
|
|
2019-01-08 07:25:55 +01:00
|
|
|
# CHECK: local.get 128
|
2018-05-11 00:16:44 +02:00
|
|
|
0x20 0x80 0x01
|
|
|
|
|
|
|
|
# Prefix byte example:
|
2019-01-08 07:25:55 +01:00
|
|
|
# CHECK: i64.trunc_sat_f64_u
|
2018-05-11 00:16:44 +02:00
|
|
|
0xFC 0x07
|
2018-08-21 23:03:18 +02:00
|
|
|
|
2019-02-08 02:43:23 +01:00
|
|
|
# CHECK: v128.const 50462976, 117835012, 185207048, 252579084
|
2020-05-01 03:11:15 +02:00
|
|
|
0xFD 0x0C 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F
|
2018-09-07 23:54:46 +02:00
|
|
|
|
2020-12-22 23:29:06 +01:00
|
|
|
# CHECK: i8x16.shuffle 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
2020-05-01 03:11:15 +02:00
|
|
|
0xFD 0x0D 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F
|
2018-11-09 02:57:00 +01:00
|
|
|
|
|
|
|
# Check LEB128 encoding of SIMD instructions
|
2020-05-01 03:11:15 +02:00
|
|
|
# CHECK: i16x8.all_true
|
|
|
|
0xFD 0x83 0x01
|
2018-11-09 02:57:00 +01:00
|
|
|
|
|
|
|
# Including non-canonical LEB128 encodings
|
2021-04-11 20:13:16 +02:00
|
|
|
# CHECK: i16x8.q15mulr_sat_s
|
2020-05-01 03:11:15 +02:00
|
|
|
0xFD 0x82 0x81 0x80 0x80 0x80 0x80 0x00
|
2019-01-04 00:01:30 +01:00
|
|
|
|
|
|
|
# Check br_table, which has its own operand type.
|
|
|
|
# CHECK: br_table {0, 1, 2}
|
|
|
|
0x0E 0x02 0x00 0x01 0x02
|
[WebAssembly] Make disassembler always emit most canonical name.
Summary:
There are a few instructions that all map to the same opcode, so
when disassembling, we have to pick one. That was just the first one
before (the except_ref variant in the case of "call"), now it is the
one marked as IsCanonical in tablegen, or failing that, the shortest
name (which is typically the "canonical" one).
Also introduced a canonical "end" instruction for this purpose.
Reviewers: dschuff, tlively
Subscribers: sbc100, jgravelle-google, aheejin, llvm-commits, sunfish
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57713
llvm-svn: 353131
2019-02-05 02:19:45 +01:00
|
|
|
|
|
|
|
# This can mean end_block/end_loop/end_if/end_function/end_try..
|
|
|
|
# CHECK: end
|
|
|
|
0x0B
|