Sam Clegg | 16c1682 | 2018-05-10 22:16:44 +0000 | [diff] [blame] | 1 | # RUN: llvm-mc --disassemble %s -triple=wasm32-unknown-unknown | FileCheck %s |
| 2 | |
| 3 | # CHECK: .text |
| 4 | |
| 5 | # CHECK: nop |
| 6 | 0x01 |
| 7 | |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 8 | # CHECK: i32.add |
Sam Clegg | 16c1682 | 2018-05-10 22:16:44 +0000 | [diff] [blame] | 9 | 0x6a |
| 10 | |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 11 | # CHECK: i64.const -1 |
Sam Clegg | 16c1682 | 2018-05-10 22:16:44 +0000 | [diff] [blame] | 12 | 0x42 0x7F |
| 13 | |
Wouter van Oortmerssen | 8a9cb24 | 2018-08-27 15:45:51 +0000 | [diff] [blame] | 14 | # CHECK: i64.load32_u 16:p2align=1 |
Sam Clegg | 16c1682 | 2018-05-10 22:16:44 +0000 | [diff] [blame] | 15 | 0x35 0x01 0x10 |
| 16 | |
Wouter van Oortmerssen | ad72f68 | 2019-01-02 23:23:51 +0000 | [diff] [blame] | 17 | # CHECK: block f64 |
| 18 | 0x02 0x7C |
Sam Clegg | 16c1682 | 2018-05-10 22:16:44 +0000 | [diff] [blame] | 19 | |
| 20 | # CHECK: call_indirect |
| 21 | # $0=, 128, 0 |
| 22 | # FIXME: WebAssemblyInstPrinter does not print immediates. |
| 23 | 0x11 0x80 0x01 0x00 |
| 24 | |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 25 | # CHECK: local.get 128 |
Sam Clegg | 16c1682 | 2018-05-10 22:16:44 +0000 | [diff] [blame] | 26 | 0x20 0x80 0x01 |
| 27 | |
| 28 | # Prefix byte example: |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 29 | # CHECK: i64.trunc_sat_f64_u |
Sam Clegg | 16c1682 | 2018-05-10 22:16:44 +0000 | [diff] [blame] | 30 | 0xFC 0x07 |
Thomas Lively | 2244292 | 2018-08-21 21:03:18 +0000 | [diff] [blame] | 31 | |
Wouter van Oortmerssen | a733d08 | 2018-08-30 15:40:53 +0000 | [diff] [blame] | 32 | # v128.const is arbitrarily disassembled as v16i8 |
| 33 | # CHECK: v128.const 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 |
Thomas Lively | 299d214 | 2018-11-09 01:45:56 +0000 | [diff] [blame] | 34 | 0xFD 0x02 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F |
Thomas Lively | a0d2581 | 2018-09-07 21:54:46 +0000 | [diff] [blame] | 35 | |
| 36 | # CHECK: v8x16.shuffle 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 |
Thomas Lively | 299d214 | 2018-11-09 01:45:56 +0000 | [diff] [blame] | 37 | 0xFD 0x03 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F |
Thomas Lively | 2faf079 | 2018-11-09 01:57:00 +0000 | [diff] [blame] | 38 | |
| 39 | # Check LEB128 encoding of SIMD instructions |
| 40 | # CHECK: i64x2.all_true |
| 41 | 0xFD 0x86 0x01 |
| 42 | |
| 43 | # Including non-canonical LEB128 encodings |
| 44 | # CHECK: i64x2.any_true |
| 45 | # CHECK-NOT: i64.div_u |
| 46 | 0xFD 0x85 0x81 0x80 0x80 0x80 0x80 0x00 |
Wouter van Oortmerssen | 820c626 | 2019-01-03 23:01:30 +0000 | [diff] [blame] | 47 | |
| 48 | # Check br_table, which has its own operand type. |
| 49 | # CHECK: br_table {0, 1, 2} |
| 50 | 0x0E 0x02 0x00 0x01 0x02 |