diff options
author | Guillermo E. Martinez <guillermo.e.martinez@oracle.com> | 2023-04-20 16:43:03 +0200 |
---|---|---|
committer | Jose E. Marchesi <jose.marchesi@oracle.com> | 2023-04-26 19:28:06 +0200 |
commit | bba4624d035002ad90970ac06a9976c006872258 (patch) | |
tree | f308e535073a4a975854a3909f8e154821a642cb | |
parent | ff5a51b377212532a0cf2acea37c6a5672893d8f (diff) | |
download | binutils-gdb-bba4624d035002ad90970ac06a9976c006872258.tar.gz |
gas: BPF pseudo-c syntax tests
This patch expands the GAS BPF testsuite in order to also test the
alternative pseudo-C syntax used in BPF assembly.
This includes three main changes:
- Some general GAS tests involving assignment and equality operands in
expressions (such as = and ==) are disabled in bpf-* targets,
because the syntax collides with the pseudo-C BPF assembly syntax.
- New tests are added to the BPF GAS testsuite that test the pseudo-c
syntax. Tests for all BPF instructions are included.
- New tests are added to the BPF GAS testsuite that test the support
for both syntaxes in the same source.
gas/ChangeLog:
2023-04-20 Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
PR gas/29728
* testsuite/gas/all/assign-bad-recursive.d: Skip test in bpf-*
targets.
* testsuite/gas/all/eqv-dot.d: Likewise.
* testsuite/gas/all/gas.exp: Skip other assignment tests in bpf-*.
* testsuite/gas/bpf/alu-pseudoc.s: New file.
* testsuite/gas/bpf/pseudoc-normal.s: Likewise.
* testsuite/gas/bpf/pseudoc-normal.d: Likewise.
* testsuite/gas/bpf/pseudoc-normal-be.d: Likewise.
* testsuite/gas/bpf/mem-pseudoc.s: Likewise.
* testsuite/gas/bpf/lddw-pseudoc.s: Likewise.
* testsuite/gas/bpf/jump32-pseudoc.s: Likewise.
* testsuite/gas/bpf/jump-pseudoc.s: Likewise.
* testsuite/gas/bpf/indcall-1-pseudoc.s: Likewise.
* testsuite/gas/bpf/atomic-pseudoc.s: Likewise.
* testsuite/gas/bpf/alu32-pseudoc.s: Likewise.
* testsuite/gas/bpf/*.d: Add -pseudoc variants of the tests.
31 files changed, 880 insertions, 5 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index e1cfcec4abf..88a9d2eff95 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,6 +1,26 @@ 2023-04-20 Guillermo E. Martinez <guillermo.e.martinez@oracle.com> PR gas/29728 + * testsuite/gas/all/assign-bad-recursive.d: Skip test in bpf-* + targets. + * testsuite/gas/all/eqv-dot.d: Likewise. + * testsuite/gas/all/gas.exp: Skip other assignment tests in bpf-*. + * testsuite/gas/bpf/alu-pseudoc.s: New file. + * testsuite/gas/bpf/pseudoc-normal.s: Likewise. + * testsuite/gas/bpf/pseudoc-normal.d: Likewise. + * testsuite/gas/bpf/pseudoc-normal-be.d: Likewise. + * testsuite/gas/bpf/mem-pseudoc.s: Likewise. + * testsuite/gas/bpf/lddw-pseudoc.s: Likewise. + * testsuite/gas/bpf/jump32-pseudoc.s: Likewise. + * testsuite/gas/bpf/jump-pseudoc.s: Likewise. + * testsuite/gas/bpf/indcall-1-pseudoc.s: Likewise. + * testsuite/gas/bpf/atomic-pseudoc.s: Likewise. + * testsuite/gas/bpf/alu32-pseudoc.s: Likewise. + * testsuite/gas/bpf/*.d: Add -pseudoc variants of the tests. + +2023-04-20 Guillermo E. Martinez <guillermo.e.martinez@oracle.com> + + PR gas/29728 * config/tc-bpf.h (TC_EQUAL_IN_INSN): Define. * config/tc-bpf.c (LEX_IS_SYMBOL_COMPONENT): Define. (LEX_IS_WHITESPACE): Likewise. diff --git a/gas/testsuite/gas/all/assign-bad-recursive.d b/gas/testsuite/gas/all/assign-bad-recursive.d index aeec5d55f8a..678be3e7c9f 100644 --- a/gas/testsuite/gas/all/assign-bad-recursive.d +++ b/gas/testsuite/gas/all/assign-bad-recursive.d @@ -1,4 +1,5 @@ #name: bad recursive assignments #source: assign-bad-recursive.s #xfail: bfin-*-* +#notarget: *bpf-*-* #error_output: assign-bad-recursive.l diff --git a/gas/testsuite/gas/all/eqv-dot.d b/gas/testsuite/gas/all/eqv-dot.d index fc40b09f217..d97db14995e 100644 --- a/gas/testsuite/gas/all/eqv-dot.d +++ b/gas/testsuite/gas/all/eqv-dot.d @@ -2,7 +2,7 @@ #name: eqv involving dot # bfin doesn't support 'symbol = expression' # tic30 and tic4x have 4 octets per byte, tic54x has 2 octets per byte -#notarget: bfin-*-* *c30-*-* *c4x-*-* *c54x-*-* +#notarget: bfin-*-* *c30-*-* *c4x-*-* *c54x-*-* *bpf-*-* # linkrelax targets don't handle equivalence expressions well (nor any # other forward expression). mep uses complex relocs #xfail: am33_2.0-*-* crx-*-* h8300-*-* mn10200-*-* mn10300-*-* mep-*-* diff --git a/gas/testsuite/gas/all/gas.exp b/gas/testsuite/gas/all/gas.exp index 734634f78d3..53d825310e2 100644 --- a/gas/testsuite/gas/all/gas.exp +++ b/gas/testsuite/gas/all/gas.exp @@ -105,7 +105,7 @@ if { [istarget "pdp11-*-*"] } then { run_dump_test eqv-dot } -if { ![istarget "bfin-*-*"] } then { +if { ![istarget "bfin-*-*"] && ![istarget "bpf-*-*"] } then { gas_test "assign-ok.s" "" "" "== assignment support" } gas_test_error "assign-bad.s" "" "== assignment for symbol already set" @@ -403,7 +403,8 @@ if { ([istarget "i*86-*-*pe*"] && ![istarget "i*86-*-openbsd*"]) \ gas_test "fastcall.s" "" "" "fastcall labels" } -if { ![istarget "bfin-*-*"] && ![istarget "nds32*-*-*"] } then { +if { ![istarget "bfin-*-*"] && ![istarget "nds32*-*-*"] \ + && ![istarget "bpf-*-*"] } then { run_dump_test assign } run_dump_test sleb128 diff --git a/gas/testsuite/gas/bpf/alu-be.d b/gas/testsuite/gas/bpf/alu-be.d index c4ddbad7d18..d42d33bc3cb 100644 --- a/gas/testsuite/gas/bpf/alu-be.d +++ b/gas/testsuite/gas/bpf/alu-be.d @@ -1,5 +1,6 @@ #as: --EB #source: alu.s +#source: alu-pseudoc.s #objdump: -dr #name: eBPF ALU64 instructions, big endian diff --git a/gas/testsuite/gas/bpf/alu-pseudoc.s b/gas/testsuite/gas/bpf/alu-pseudoc.s new file mode 100644 index 00000000000..0f79929ea0d --- /dev/null +++ b/gas/testsuite/gas/bpf/alu-pseudoc.s @@ -0,0 +1,51 @@ +# Tests for the ALU64 eBPF pseudo-C instructions + .text + r2 += 666 + r3 += -666 + r4 += 2125315823 + r5 += r6 + r2 -= 666 + r3 -= -666 + r4 -= 2125315823 + r5 -= r6 + r2 *= 666 + r3 *= -666 + r4 *= 2125315823 + r5 *= r6 + r2 /= 666 + r3 /= -666 + r4 /= 2125315823 + r5 /= r6 + r2 |= 666 + r3 |= -666 + r4 |= 2125315823 + r5 |= r6 + r2 &= 666 + r3 &= -666 + r4 &= 2125315823 + r5 &= r6 + r2 <<= 666 + r3 <<= -666 + r4 <<= 2125315823 + r5 <<= r6 + r2 >>= 666 + r3 >>= -666 + r4 >>= 2125315823 + r5 >>= r6 + r2 %= 0x29a + r3 %= -666 + r4 %= 0x7eadbeef + r5 %= r6 + r2 ^= 666 + r3 ^= -666 + r4 ^= 2125315823 + r5 ^= r6 + r2 = 666 + r3 = -666 + r4 = 2125315823 + r5 = r6 + r2 s>>= 666 + r3 s>>= -666 + r4 s>>= 2125315823 + r5 s>>= r6 + r2 = -r2 diff --git a/gas/testsuite/gas/bpf/alu32-be.d b/gas/testsuite/gas/bpf/alu32-be.d index 2c753e2261d..2ad744dc84c 100644 --- a/gas/testsuite/gas/bpf/alu32-be.d +++ b/gas/testsuite/gas/bpf/alu32-be.d @@ -1,5 +1,6 @@ #as: --EB #source: alu32.s +#source: alu32-pseudoc.s #objdump: -dr #name: eBPF ALU instructions, big-endian diff --git a/gas/testsuite/gas/bpf/alu32-pseudoc.s b/gas/testsuite/gas/bpf/alu32-pseudoc.s new file mode 100644 index 00000000000..a29f6ea0336 --- /dev/null +++ b/gas/testsuite/gas/bpf/alu32-pseudoc.s @@ -0,0 +1,57 @@ +# Tests for the ALU eBPF pseudo-C instructions + .text + W2 += 666 + W3 += -666 + W4 += 2125315823 + W5 += w6 + W2 -= 666 + W3 -= -666 + W4 -= 2125315823 + W5 -= w6 + W2 *= 666 + W3 *= -666 + W4 *= 2125315823 + w5 *= w6 + w2 /= 666 + w3 /= -666 + w4 /= 2125315823 + w5 /= w6 + w2 |= 666 + w3 |= -666 + w4 |= 2125315823 + w5 |= w6 + w2 &= 666 + w3 &= -666 + w4 &= 2125315823 + w5 &= w6 + w2 <<= 666 + w3 <<= -666 + w4 <<= 2125315823 + w5 <<= w6 + w2 >>= 666 + w3 >>= -666 + w4 >>= 2125315823 + w5 >>= w6 + w2 %= 666 + w3 %= -666 + w4 %= 0x7eadbeef + w5 %= w6 + w2 ^= 666 + w3 ^= -666 + w4 ^= 2125315823 + w5 ^= w6 + w2 = 666 + w3 = -666 + w4 = 2125315823 + w5 = w6 + w2 s>>= 666 + w3 s>>= -666 + w4 s>>= 2125315823 + w5 s>>= w6 + w2 = -w2 + r9 = le16 r9 + r8 = le32 r8 + r7 = le64 r7 + r6 = be16 r6 + r5 = be32 r5 + r4 = be64 r4 diff --git a/gas/testsuite/gas/bpf/alu32.d b/gas/testsuite/gas/bpf/alu32.d index d2260fffeb6..ac5c8341e52 100644 --- a/gas/testsuite/gas/bpf/alu32.d +++ b/gas/testsuite/gas/bpf/alu32.d @@ -1,5 +1,7 @@ #as: --EL #objdump: -dr +#source: alu32.s +#source: alu32-pseudoc.s #name: eBPF ALU instructions .*: +file format .*bpf.* diff --git a/gas/testsuite/gas/bpf/atomic-be.d b/gas/testsuite/gas/bpf/atomic-be.d index 04161e08aca..b252571e5fd 100644 --- a/gas/testsuite/gas/bpf/atomic-be.d +++ b/gas/testsuite/gas/bpf/atomic-be.d @@ -1,5 +1,6 @@ #as: --EB #source: atomic.s +#source: atomic-pseudoc.s #objdump: -dr #name: eBPF atomic instructions, big endian diff --git a/gas/testsuite/gas/bpf/atomic-pseudoc.s b/gas/testsuite/gas/bpf/atomic-pseudoc.s new file mode 100644 index 00000000000..1a4f218ccb7 --- /dev/null +++ b/gas/testsuite/gas/bpf/atomic-pseudoc.s @@ -0,0 +1,4 @@ + # Test for eBPF ADDW and ADDDW pseudo-C instructions + .text + lock *(u64 *)(r1 + 7919) += r2 + lock *(u32 *)(r1 + 7919) += r2 diff --git a/gas/testsuite/gas/bpf/atomic.d b/gas/testsuite/gas/bpf/atomic.d index 1c83cb582ab..e22d54283de 100644 --- a/gas/testsuite/gas/bpf/atomic.d +++ b/gas/testsuite/gas/bpf/atomic.d @@ -1,5 +1,7 @@ #as: --EL #objdump: -dr +#source: atomic.s +#source: atomic-pseudoc.s #name: eBPF atomic instructions .*: +file format .*bpf.* diff --git a/gas/testsuite/gas/bpf/bpf.exp b/gas/testsuite/gas/bpf/bpf.exp index b0c49a9e23a..1cdaf6dcc08 100644 --- a/gas/testsuite/gas/bpf/bpf.exp +++ b/gas/testsuite/gas/bpf/bpf.exp @@ -28,6 +28,7 @@ if {[istarget bpf*-*-*]} { run_dump_test exit run_dump_test atomic run_dump_test data + run_dump_test pseudoc-normal run_dump_test lddw-be run_dump_test alu-be @@ -38,6 +39,7 @@ if {[istarget bpf*-*-*]} { run_dump_test exit-be run_dump_test atomic-be run_dump_test data-be + run_dump_test pseudoc-normal-be run_dump_test indcall-1 run_list_test indcall-bad-1 diff --git a/gas/testsuite/gas/bpf/indcall-1-pseudoc.s b/gas/testsuite/gas/bpf/indcall-1-pseudoc.s new file mode 100644 index 00000000000..ede3eac58ef --- /dev/null +++ b/gas/testsuite/gas/bpf/indcall-1-pseudoc.s @@ -0,0 +1,13 @@ + + .text + .align 4 +main: + r0 = 1 + r1 = 1 + r2 = 2 + r6 = 56 ll + callx r6 + exit +bar: + r0 = 0 + exit diff --git a/gas/testsuite/gas/bpf/indcall-1.d b/gas/testsuite/gas/bpf/indcall-1.d index b26e8f8853f..158c75438d7 100644 --- a/gas/testsuite/gas/bpf/indcall-1.d +++ b/gas/testsuite/gas/bpf/indcall-1.d @@ -1,5 +1,7 @@ #as: -mxbpf --EL #objdump: -mxbpf -dr +#source: indcall-1.s +#source: indcall-1-pseudoc.s #name: BPF indirect call 1 .*: +file format .*bpf.* diff --git a/gas/testsuite/gas/bpf/indcall-bad-1.l b/gas/testsuite/gas/bpf/indcall-bad-1.l index 510ec6eabf2..8386736ee78 100644 --- a/gas/testsuite/gas/bpf/indcall-bad-1.l +++ b/gas/testsuite/gas/bpf/indcall-bad-1.l @@ -1,3 +1,5 @@ .*: Assembler messages: +.* Error: bad expression .* Error: illegal operand `call %r6' +.* Error: unexpected token: '%r6' #pass diff --git a/gas/testsuite/gas/bpf/jump-be.d b/gas/testsuite/gas/bpf/jump-be.d index 65632e0813b..7e235e69551 100644 --- a/gas/testsuite/gas/bpf/jump-be.d +++ b/gas/testsuite/gas/bpf/jump-be.d @@ -1,5 +1,6 @@ #as: --EB #source: jump.s +#source: jump-pseudoc.s #objdump: -dr #name: eBPF JUMP instructions, big endian diff --git a/gas/testsuite/gas/bpf/jump-pseudoc.s b/gas/testsuite/gas/bpf/jump-pseudoc.s new file mode 100644 index 00000000000..1331bdad307 --- /dev/null +++ b/gas/testsuite/gas/bpf/jump-pseudoc.s @@ -0,0 +1,25 @@ +# Tests for the JUMP pseudo-C instructions + .text + goto 2f + r1 += r1 +1: if r3 == 3 goto 2f + if r3 == r4 goto 2f +2: if r3 >= 3 goto 1b + if r3 >= r4 goto 1b +1: if r3 < 3 goto 1f + if r3 < r4 goto 1f +1: if r3 <= 3 goto 1f + if r3 <= r4 goto 1f +1: if r3 & 3 goto 1f + if r3 & r4 goto 1f +1: if r3 != 3 goto 1f + if r3 != r4 goto 1f +1: if r3 s> 3 goto 1f + if r3 s> r4 goto 1f +1: if r3 s>= 3 goto 1f + if r3 s>= r4 goto 1f +1: if r3 s< 3 goto 1f + if r3 s< r4 goto 1f +1: if r3 s<= 3 goto 1f + if r3 s<= r4 goto 1f +1: diff --git a/gas/testsuite/gas/bpf/jump.d b/gas/testsuite/gas/bpf/jump.d index ca600f602ba..903f70e8043 100644 --- a/gas/testsuite/gas/bpf/jump.d +++ b/gas/testsuite/gas/bpf/jump.d @@ -1,5 +1,7 @@ #as: --EL #objdump: -dr +#source: jump.s +#source: jump-pseudoc.s #name: eBPF JUMP instructions .*: +file format .*bpf.* @@ -28,4 +30,4 @@ Disassembly of section .text: 90: c5 03 01 00 03 00 00 00 jslt %r3,3,1 98: cd 43 00 00 00 00 00 00 jslt %r3,%r4,0 a0: d5 03 01 00 03 00 00 00 jsle %r3,3,1 - a8: dd 43 00 00 00 00 00 00 jsle %r3,%r4,0
\ No newline at end of file + a8: dd 43 00 00 00 00 00 00 jsle %r3,%r4,0 diff --git a/gas/testsuite/gas/bpf/jump32-pseudoc.s b/gas/testsuite/gas/bpf/jump32-pseudoc.s new file mode 100644 index 00000000000..07311657ebe --- /dev/null +++ b/gas/testsuite/gas/bpf/jump32-pseudoc.s @@ -0,0 +1,25 @@ +# Tests for the eBPF JUMP32 pseudo-C instructions + .text + goto 2f + r1 += r1 +1: if w3 == 3 goto 2f + if w3 == w4 goto 2f +2: if w3 >= 3 goto 1b + if w3 >= w4 goto 1b +1: if w3 < 3 goto 1f + if w3 < w4 goto 1f +1: if w3 <= 3 goto 1f + if w3 <= w4 goto 1f +1: if w3 & 3 goto 1f + if w3 & w4 goto 1f +1: if w3 != 3 goto 1f + if w3 != w4 goto 1f +1: if w3 s> 3 goto 1f + if w3 s> w4 goto 1f +1: if w3 s>= 3 goto 1f + if w3 s>= w4 goto 1f +1: if w3 s< 3 goto 1f + if w3 s< w4 goto 1f +1: if w3 s<= 3 goto 1f + if w3 s<= w4 goto 1f +1: diff --git a/gas/testsuite/gas/bpf/jump32.d b/gas/testsuite/gas/bpf/jump32.d index 4f5ae2c5aa3..ae8683dd69b 100644 --- a/gas/testsuite/gas/bpf/jump32.d +++ b/gas/testsuite/gas/bpf/jump32.d @@ -1,5 +1,7 @@ #as: --EL #objdump: -dr +#source: jump32.s +#source: jump32-pseudoc.s #name: eBPF JUMP32 instructions .*: +file format .*bpf.* diff --git a/gas/testsuite/gas/bpf/lddw-be.d b/gas/testsuite/gas/bpf/lddw-be.d index dc69d3a64d5..b9e60457cde 100644 --- a/gas/testsuite/gas/bpf/lddw-be.d +++ b/gas/testsuite/gas/bpf/lddw-be.d @@ -1,5 +1,6 @@ #as: --EB #source: lddw.s +#source: lddw-pseudoc.s #objdump: -dr #name: eBPF LDDW, big-endian diff --git a/gas/testsuite/gas/bpf/lddw-pseudoc.s b/gas/testsuite/gas/bpf/lddw-pseudoc.s new file mode 100644 index 00000000000..9968c5d8e78 --- /dev/null +++ b/gas/testsuite/gas/bpf/lddw-pseudoc.s @@ -0,0 +1,6 @@ +# Tests for the LDDW pseudo-C instruction + .text + r3 = 1 ll + r4 = 0xdeadbeef ll + r5 = 0x1122334455667788 ll + r6 = -2 ll diff --git a/gas/testsuite/gas/bpf/lddw.d b/gas/testsuite/gas/bpf/lddw.d index f44e7724353..042e4dead30 100644 --- a/gas/testsuite/gas/bpf/lddw.d +++ b/gas/testsuite/gas/bpf/lddw.d @@ -1,5 +1,7 @@ #as: --EL #objdump: -dr +#source: lddw.s +#source: lddw-pseudoc.s #name: eBPF LDDW .*: +file format .*bpf.* diff --git a/gas/testsuite/gas/bpf/mem-be.d b/gas/testsuite/gas/bpf/mem-be.d index b3dba80c2b6..148c55a3491 100644 --- a/gas/testsuite/gas/bpf/mem-be.d +++ b/gas/testsuite/gas/bpf/mem-be.d @@ -1,5 +1,6 @@ #as: --EB #source: mem.s +#source: mem-pseudoc.s #objdump: -dr #name: eBPF MEM instructions, modulus lddw, big endian @@ -27,4 +28,4 @@ Disassembly of section .text: 80: 72 10 7e ef 11 22 33 44 stb \[%r1\+0x7eef\],0x11223344 88: 6a 10 7e ef 11 22 33 44 sth \[%r1\+0x7eef\],0x11223344 90: 62 10 7e ef 11 22 33 44 stw \[%r1\+0x7eef\],0x11223344 - 98: 7a 10 ff fe 11 22 33 44 stdw \[%r1\+-2\],0x11223344
\ No newline at end of file + 98: 7a 10 ff fe 11 22 33 44 stdw \[%r1\+-2\],0x11223344 diff --git a/gas/testsuite/gas/bpf/mem-pseudoc.s b/gas/testsuite/gas/bpf/mem-pseudoc.s new file mode 100644 index 00000000000..06c2cfcdde9 --- /dev/null +++ b/gas/testsuite/gas/bpf/mem-pseudoc.s @@ -0,0 +1,23 @@ +# eBPF tests for MEM pseudo-C instructions, modulus lddw. + + .text + r0 = *(u32 *)skb[48879] + r0 = *(u16 *)skb[48879] + r0 = *(u8 *)skb[48879] + r0 = *(u64 *)skb[48879] + r0 = *(u32 *)skb[r3 + 0xbeef] + r0 = *(u16 *)skb[r5 + 0xbeef] + r0 = *(u8 *)skb[r7 + 0xbeef] + r0 = *(u64 *)skb[r9 + 0xbeef] + r2 = *(u32 *)(r1 + 32495) + r2 = *(u16 *)(r1 + 32495) + r2 = *(u8 *)(r1 + 32495) + r2 = *(u64 *)(r1 - 2) + *(u32 *)(r1 + 32495) = r2 + *(u16 *)(r1 + 32495) = r2 + *(u8 *)(r1 + 32495) = r2 + *(u64 *)(r1 - 2) = r2 + stb [%r1+0x7eef], 0x11223344 + sth [%r1+0x7eef], 0x11223344 + stw [%r1+0x7eef], 0x11223344 + stdw [%r1+-2], 0x11223344 diff --git a/gas/testsuite/gas/bpf/mem.d b/gas/testsuite/gas/bpf/mem.d index 0e0b498ea91..5f257317057 100644 --- a/gas/testsuite/gas/bpf/mem.d +++ b/gas/testsuite/gas/bpf/mem.d @@ -1,5 +1,7 @@ #as: --EL #objdump: -dr +#source: mem.s +#source: mem-pseudoc.s #name: eBPF MEM instructions, modulus lddw .*: +file format .*bpf.* diff --git a/gas/testsuite/gas/bpf/pseudoc-normal-be.d b/gas/testsuite/gas/bpf/pseudoc-normal-be.d new file mode 100644 index 00000000000..7a577edbe4c --- /dev/null +++ b/gas/testsuite/gas/bpf/pseudoc-normal-be.d @@ -0,0 +1,214 @@ +#as: --EB +#objdump: -dr +#source: pseudoc-normal.s +#name: eBPF clang (pseudo-C)/gas (normal) instructions + +.*: +file format .*bpf.* + +Disassembly of section .text: + +0+ <beg>: + 0: 07 10 00 00 00 00 00 aa add %r1,0xaa + 8: 07 10 00 00 00 00 00 aa add %r1,0xaa + 10: 0f 12 00 00 00 00 00 00 add %r1,%r2 + 18: 0f 12 00 00 00 00 00 00 add %r1,%r2 + 20: 17 10 00 00 00 00 00 aa sub %r1,0xaa + 28: 17 10 00 00 00 00 00 aa sub %r1,0xaa + 30: 1f 12 00 00 00 00 00 00 sub %r1,%r2 + 38: 1f 12 00 00 00 00 00 00 sub %r1,%r2 + 40: 27 10 00 00 00 00 00 aa mul %r1,0xaa + 48: 27 10 00 00 00 00 00 aa mul %r1,0xaa + 50: 2f 12 00 00 00 00 00 00 mul %r1,%r2 + 58: 2f 12 00 00 00 00 00 00 mul %r1,%r2 + 60: 37 10 00 00 00 00 00 aa div %r1,0xaa + 68: 37 10 00 00 00 00 00 aa div %r1,0xaa + 70: 3f 12 00 00 00 00 00 00 div %r1,%r2 + 78: 3f 12 00 00 00 00 00 00 div %r1,%r2 + 80: 47 10 00 00 00 00 00 aa or %r1,0xaa + 88: 47 10 00 00 00 00 00 aa or %r1,0xaa + 90: 4f 12 00 00 00 00 00 00 or %r1,%r2 + 98: 4f 12 00 00 00 00 00 00 or %r1,%r2 + a0: 57 10 00 00 00 00 00 aa and %r1,0xaa + a8: 57 10 00 00 00 00 00 aa and %r1,0xaa + b0: 5f 12 00 00 00 00 00 00 and %r1,%r2 + b8: 5f 12 00 00 00 00 00 00 and %r1,%r2 + c0: 67 10 00 00 00 00 00 aa lsh %r1,0xaa + c8: 67 10 00 00 00 00 00 aa lsh %r1,0xaa + d0: 6f 12 00 00 00 00 00 00 lsh %r1,%r2 + d8: 6f 12 00 00 00 00 00 00 lsh %r1,%r2 + e0: 77 10 00 00 00 00 00 aa rsh %r1,0xaa + e8: 77 10 00 00 00 00 00 aa rsh %r1,0xaa + f0: 7f 12 00 00 00 00 00 00 rsh %r1,%r2 + f8: 7f 12 00 00 00 00 00 00 rsh %r1,%r2 + 100: a7 10 00 00 00 00 00 aa xor %r1,0xaa + 108: a7 10 00 00 00 00 00 aa xor %r1,0xaa + 110: af 12 00 00 00 00 00 00 xor %r1,%r2 + 118: af 12 00 00 00 00 00 00 xor %r1,%r2 + 120: b7 10 00 00 00 00 00 aa mov %r1,0xaa + 128: b7 10 00 00 00 00 00 aa mov %r1,0xaa + 130: bf 12 00 00 00 00 00 00 mov %r1,%r2 + 138: bf 12 00 00 00 00 00 00 mov %r1,%r2 + 140: c7 10 00 00 00 00 00 aa arsh %r1,0xaa + 148: c7 10 00 00 00 00 00 aa arsh %r1,0xaa + 150: cf 12 00 00 00 00 00 00 arsh %r1,%r2 + 158: cf 12 00 00 00 00 00 00 arsh %r1,%r2 + 160: 87 10 00 00 00 00 00 00 neg %r1 + 168: 87 10 00 00 00 00 00 00 neg %r1 + 170: 04 10 00 00 00 00 00 aa add32 %r1,0xaa + 178: 04 10 00 00 00 00 00 aa add32 %r1,0xaa + 180: 0c 12 00 00 00 00 00 00 add32 %r1,%r2 + 188: 0c 12 00 00 00 00 00 00 add32 %r1,%r2 + 190: 14 10 00 00 00 00 00 aa sub32 %r1,0xaa + 198: 14 10 00 00 00 00 00 aa sub32 %r1,0xaa + 1a0: 1c 12 00 00 00 00 00 00 sub32 %r1,%r2 + 1a8: 1c 12 00 00 00 00 00 00 sub32 %r1,%r2 + 1b0: 24 10 00 00 00 00 00 aa mul32 %r1,0xaa + 1b8: 24 10 00 00 00 00 00 aa mul32 %r1,0xaa + 1c0: 2c 12 00 00 00 00 00 00 mul32 %r1,%r2 + 1c8: 2c 12 00 00 00 00 00 00 mul32 %r1,%r2 + 1d0: 34 10 00 00 00 00 00 aa div32 %r1,0xaa + 1d8: 34 10 00 00 00 00 00 aa div32 %r1,0xaa + 1e0: 3c 12 00 00 00 00 00 00 div32 %r1,%r2 + 1e8: 3c 12 00 00 00 00 00 00 div32 %r1,%r2 + 1f0: 44 10 00 00 00 00 00 aa or32 %r1,0xaa + 1f8: 44 10 00 00 00 00 00 aa or32 %r1,0xaa + 200: 4c 12 00 00 00 00 00 00 or32 %r1,%r2 + 208: 4c 12 00 00 00 00 00 00 or32 %r1,%r2 + 210: 54 10 00 00 00 00 00 aa and32 %r1,0xaa + 218: 54 10 00 00 00 00 00 aa and32 %r1,0xaa + 220: 5c 12 00 00 00 00 00 00 and32 %r1,%r2 + 228: 5c 12 00 00 00 00 00 00 and32 %r1,%r2 + 230: 64 10 00 00 00 00 00 aa lsh32 %r1,0xaa + 238: 64 10 00 00 00 00 00 aa lsh32 %r1,0xaa + 240: 6c 12 00 00 00 00 00 00 lsh32 %r1,%r2 + 248: 6c 12 00 00 00 00 00 00 lsh32 %r1,%r2 + 250: 74 10 00 00 00 00 00 aa rsh32 %r1,0xaa + 258: 74 10 00 00 00 00 00 aa rsh32 %r1,0xaa + 260: 7c 12 00 00 00 00 00 00 rsh32 %r1,%r2 + 268: 7c 12 00 00 00 00 00 00 rsh32 %r1,%r2 + 270: a4 10 00 00 00 00 00 aa xor32 %r1,0xaa + 278: a4 10 00 00 00 00 00 aa xor32 %r1,0xaa + 280: ac 12 00 00 00 00 00 00 xor32 %r1,%r2 + 288: ac 12 00 00 00 00 00 00 xor32 %r1,%r2 + 290: b4 10 00 00 00 00 00 aa mov32 %r1,0xaa + 298: b4 10 00 00 00 00 00 aa mov32 %r1,0xaa + 2a0: bc 12 00 00 00 00 00 00 mov32 %r1,%r2 + 2a8: bc 12 00 00 00 00 00 00 mov32 %r1,%r2 + 2b0: c4 10 00 00 00 00 00 aa arsh32 %r1,0xaa + 2b8: c4 10 00 00 00 00 00 aa arsh32 %r1,0xaa + 2c0: cc 12 00 00 00 00 00 00 arsh32 %r1,%r2 + 2c8: cc 12 00 00 00 00 00 00 arsh32 %r1,%r2 + 2d0: 84 10 00 00 00 00 00 00 neg32 %r1 + 2d8: 84 10 00 00 00 00 00 00 neg32 %r1 + 2e0: d4 10 00 00 00 00 00 10 endle %r1,16 + 2e8: d4 10 00 00 00 00 00 10 endle %r1,16 + 2f0: d4 10 00 00 00 00 00 20 endle %r1,32 + 2f8: d4 10 00 00 00 00 00 20 endle %r1,32 + 300: d4 10 00 00 00 00 00 40 endle %r1,64 + 308: d4 10 00 00 00 00 00 40 endle %r1,64 + 310: dc 10 00 00 00 00 00 10 endbe %r1,16 + 318: dc 10 00 00 00 00 00 10 endbe %r1,16 + 320: dc 10 00 00 00 00 00 20 endbe %r1,32 + 328: dc 10 00 00 00 00 00 20 endbe %r1,32 + 330: dc 10 00 00 00 00 00 40 endbe %r1,64 + 338: dc 10 00 00 00 00 00 40 endbe %r1,64 + 340: 71 12 00 aa 00 00 00 00 ldxb %r1,\[%r2\+0xaa\] + 348: 71 12 00 aa 00 00 00 00 ldxb %r1,\[%r2\+0xaa\] + 350: 69 12 00 aa 00 00 00 00 ldxh %r1,\[%r2\+0xaa\] + 358: 69 12 00 aa 00 00 00 00 ldxh %r1,\[%r2\+0xaa\] + 360: 61 12 00 aa 00 00 00 00 ldxw %r1,\[%r2\+0xaa\] + 368: 61 12 00 aa 00 00 00 00 ldxw %r1,\[%r2\+0xaa\] + 370: 79 12 00 aa 00 00 00 00 ldxdw %r1,\[%r2\+0xaa\] + 378: 79 12 00 aa 00 00 00 00 ldxdw %r1,\[%r2\+0xaa\] + 380: 73 12 00 aa 00 00 00 00 stxb \[%r1\+0xaa\],%r2 + 388: 73 12 00 aa 00 00 00 00 stxb \[%r1\+0xaa\],%r2 + 390: 6b 12 00 aa 00 00 00 00 stxh \[%r1\+0xaa\],%r2 + 398: 6b 12 00 aa 00 00 00 00 stxh \[%r1\+0xaa\],%r2 + 3a0: 63 12 00 aa 00 00 00 00 stxw \[%r1\+0xaa\],%r2 + 3a8: 63 12 00 aa 00 00 00 00 stxw \[%r1\+0xaa\],%r2 + 3b0: 7b 12 00 aa 00 00 00 00 stxdw \[%r1\+0xaa\],%r2 + 3b8: 7b 12 00 aa 00 00 00 00 stxdw \[%r1\+0xaa\],%r2 + 3c0: 05 00 00 bb 00 00 00 00 ja 187 + 3c8: 05 00 00 bb 00 00 00 00 ja 187 + 3d0: 15 10 00 bb 00 00 00 aa jeq %r1,0xaa,187 + 3d8: 15 10 00 bb 00 00 00 aa jeq %r1,0xaa,187 + 3e0: 1d 12 00 bb 00 00 00 00 jeq %r1,%r2,187 + 3e8: 1d 12 00 bb 00 00 00 00 jeq %r1,%r2,187 + 3f0: 25 10 00 bb 00 00 00 aa jgt %r1,0xaa,187 + 3f8: 25 10 00 bb 00 00 00 aa jgt %r1,0xaa,187 + 400: 2d 12 00 bb 00 00 00 00 jgt %r1,%r2,187 + 408: 2d 12 00 bb 00 00 00 00 jgt %r1,%r2,187 + 410: 35 10 00 bb 00 00 00 aa jge %r1,0xaa,187 + 418: 35 10 00 bb 00 00 00 aa jge %r1,0xaa,187 + 420: 3d 12 00 bb 00 00 00 00 jge %r1,%r2,187 + 428: 3d 12 00 bb 00 00 00 00 jge %r1,%r2,187 + 430: a5 10 00 bb 00 00 00 aa jlt %r1,0xaa,187 + 438: a5 10 00 bb 00 00 00 aa jlt %r1,0xaa,187 + 440: ad 12 00 bb 00 00 00 00 jlt %r1,%r2,187 + 448: ad 12 00 bb 00 00 00 00 jlt %r1,%r2,187 + 450: b5 10 00 bb 00 00 00 aa jle %r1,0xaa,187 + 458: b5 10 00 bb 00 00 00 aa jle %r1,0xaa,187 + 460: bd 12 00 bb 00 00 00 00 jle %r1,%r2,187 + 468: bd 12 00 bb 00 00 00 00 jle %r1,%r2,187 + 470: 45 10 00 bb 00 00 00 aa jset %r1,0xaa,187 + 478: 45 10 00 bb 00 00 00 aa jset %r1,0xaa,187 + 480: 4d 12 00 bb 00 00 00 00 jset %r1,%r2,187 + 488: 4d 12 00 bb 00 00 00 00 jset %r1,%r2,187 + 490: 55 10 00 bb 00 00 00 aa jne %r1,0xaa,187 + 498: 55 10 00 bb 00 00 00 aa jne %r1,0xaa,187 + 4a0: 5d 12 00 bb 00 00 00 00 jne %r1,%r2,187 + 4a8: 5d 12 00 bb 00 00 00 00 jne %r1,%r2,187 + 4b0: 65 10 00 bb 00 00 00 aa jsgt %r1,0xaa,187 + 4b8: 65 10 00 bb 00 00 00 aa jsgt %r1,0xaa,187 + 4c0: 6d 12 00 bb 00 00 00 00 jsgt %r1,%r2,187 + 4c8: 6d 12 00 bb 00 00 00 00 jsgt %r1,%r2,187 + 4d0: 75 10 00 bb 00 00 00 aa jsge %r1,0xaa,187 + 4d8: 75 10 00 bb 00 00 00 aa jsge %r1,0xaa,187 + 4e0: 7d 12 00 bb 00 00 00 00 jsge %r1,%r2,187 + 4e8: 7d 12 00 bb 00 00 00 00 jsge %r1,%r2,187 + 4f0: c5 10 00 bb 00 00 00 aa jslt %r1,0xaa,187 + 4f8: c5 10 00 bb 00 00 00 aa jslt %r1,0xaa,187 + 500: cd 12 00 bb 00 00 00 00 jslt %r1,%r2,187 + 508: cd 12 00 bb 00 00 00 00 jslt %r1,%r2,187 + 510: d5 10 00 bb 00 00 00 aa jsle %r1,0xaa,187 + 518: d5 10 00 bb 00 00 00 aa jsle %r1,0xaa,187 + 520: dd 12 00 bb 00 00 00 00 jsle %r1,%r2,187 + 528: dd 12 00 bb 00 00 00 00 jsle %r1,%r2,187 + 530: 85 00 00 00 00 00 00 aa call 170 + 538: 85 00 00 00 00 00 00 aa call 170 + 540: 95 00 00 00 00 00 00 00 exit + 548: 95 00 00 00 00 00 00 00 exit + 550: b7 60 00 00 00 00 06 20 mov %r6,0x620 + 558: 95 00 00 00 00 00 00 00 exit + 560: 20 00 00 00 00 00 00 aa ldabsw 0xaa + 568: 20 00 00 00 00 00 00 aa ldabsw 0xaa + 570: 50 07 00 00 00 00 00 aa ldindb %r7,0xaa + 578: 50 07 00 00 00 00 00 aa ldindb %r7,0xaa + 580: 20 00 00 00 00 00 00 aa ldabsw 0xaa + 588: 20 00 00 00 00 00 00 aa ldabsw 0xaa + 590: 50 07 00 00 00 00 00 aa ldindb %r7,0xaa + 598: 50 07 00 00 00 00 00 aa ldindb %r7,0xaa + 5a0: 18 30 00 00 00 00 00 01 lddw %r3,1 + 5a8: 00 00 00 00 00 00 00 00 + 5b0: 18 30 00 00 00 00 00 01 lddw %r3,1 + 5b8: 00 00 00 00 00 00 00 00 + 5c0: 18 40 00 00 ee ff 77 88 lddw %r4,-6144092013047351416 + 5c8: 00 00 00 00 aa bb cc dd + 5d0: 18 40 00 00 ee ff 77 88 lddw %r4,-6144092013047351416 + 5d8: 00 00 00 00 aa bb cc dd + 5e0: 18 50 00 00 55 66 77 88 lddw %r5,0x1122334455667788 + 5e8: 00 00 00 00 11 22 33 44 + 5f0: 18 50 00 00 55 66 77 88 lddw %r5,0x1122334455667788 + 5f8: 00 00 00 00 11 22 33 44 + 600: 18 60 00 00 00 00 06 20 lddw %r6,0x620 + 608: 00 00 00 00 00 00 00 00 + 600: R_BPF_64_64 .text + 610: 18 60 00 00 00 00 06 20 lddw %r6,0x620 + 618: 00 00 00 00 00 00 00 00 + 610: R_BPF_64_64 .text + +0000000000000620 <main>: + 620: c3 12 00 aa 00 00 00 00 xaddw \[%r1\+0xaa\],%r2 + 628: c3 12 00 aa 00 00 00 00 xaddw \[%r1\+0xaa\],%r2 + 630: db 12 00 aa 00 00 00 00 xadddw \[%r1\+0xaa\],%r2 + 638: db 12 00 aa 00 00 00 00 xadddw \[%r1\+0xaa\],%r2 diff --git a/gas/testsuite/gas/bpf/pseudoc-normal.d b/gas/testsuite/gas/bpf/pseudoc-normal.d new file mode 100644 index 00000000000..5bece2a085a --- /dev/null +++ b/gas/testsuite/gas/bpf/pseudoc-normal.d @@ -0,0 +1,214 @@ +#as: --EL +#objdump: -dr +#source: pseudoc-normal.s +#name: eBPF clang (pseudo-C)/gas (normal) instructions + +.*: +file format .*bpf.* + +Disassembly of section .text: + +0+ <beg>: + 0: 07 01 00 00 aa 00 00 00 add %r1,0xaa + 8: 07 01 00 00 aa 00 00 00 add %r1,0xaa + 10: 0f 21 00 00 00 00 00 00 add %r1,%r2 + 18: 0f 21 00 00 00 00 00 00 add %r1,%r2 + 20: 17 01 00 00 aa 00 00 00 sub %r1,0xaa + 28: 17 01 00 00 aa 00 00 00 sub %r1,0xaa + 30: 1f 21 00 00 00 00 00 00 sub %r1,%r2 + 38: 1f 21 00 00 00 00 00 00 sub %r1,%r2 + 40: 27 01 00 00 aa 00 00 00 mul %r1,0xaa + 48: 27 01 00 00 aa 00 00 00 mul %r1,0xaa + 50: 2f 21 00 00 00 00 00 00 mul %r1,%r2 + 58: 2f 21 00 00 00 00 00 00 mul %r1,%r2 + 60: 37 01 00 00 aa 00 00 00 div %r1,0xaa + 68: 37 01 00 00 aa 00 00 00 div %r1,0xaa + 70: 3f 21 00 00 00 00 00 00 div %r1,%r2 + 78: 3f 21 00 00 00 00 00 00 div %r1,%r2 + 80: 47 01 00 00 aa 00 00 00 or %r1,0xaa + 88: 47 01 00 00 aa 00 00 00 or %r1,0xaa + 90: 4f 21 00 00 00 00 00 00 or %r1,%r2 + 98: 4f 21 00 00 00 00 00 00 or %r1,%r2 + a0: 57 01 00 00 aa 00 00 00 and %r1,0xaa + a8: 57 01 00 00 aa 00 00 00 and %r1,0xaa + b0: 5f 21 00 00 00 00 00 00 and %r1,%r2 + b8: 5f 21 00 00 00 00 00 00 and %r1,%r2 + c0: 67 01 00 00 aa 00 00 00 lsh %r1,0xaa + c8: 67 01 00 00 aa 00 00 00 lsh %r1,0xaa + d0: 6f 21 00 00 00 00 00 00 lsh %r1,%r2 + d8: 6f 21 00 00 00 00 00 00 lsh %r1,%r2 + e0: 77 01 00 00 aa 00 00 00 rsh %r1,0xaa + e8: 77 01 00 00 aa 00 00 00 rsh %r1,0xaa + f0: 7f 21 00 00 00 00 00 00 rsh %r1,%r2 + f8: 7f 21 00 00 00 00 00 00 rsh %r1,%r2 + 100: a7 01 00 00 aa 00 00 00 xor %r1,0xaa + 108: a7 01 00 00 aa 00 00 00 xor %r1,0xaa + 110: af 21 00 00 00 00 00 00 xor %r1,%r2 + 118: af 21 00 00 00 00 00 00 xor %r1,%r2 + 120: b7 01 00 00 aa 00 00 00 mov %r1,0xaa + 128: b7 01 00 00 aa 00 00 00 mov %r1,0xaa + 130: bf 21 00 00 00 00 00 00 mov %r1,%r2 + 138: bf 21 00 00 00 00 00 00 mov %r1,%r2 + 140: c7 01 00 00 aa 00 00 00 arsh %r1,0xaa + 148: c7 01 00 00 aa 00 00 00 arsh %r1,0xaa + 150: cf 21 00 00 00 00 00 00 arsh %r1,%r2 + 158: cf 21 00 00 00 00 00 00 arsh %r1,%r2 + 160: 87 01 00 00 00 00 00 00 neg %r1 + 168: 87 01 00 00 00 00 00 00 neg %r1 + 170: 04 01 00 00 aa 00 00 00 add32 %r1,0xaa + 178: 04 01 00 00 aa 00 00 00 add32 %r1,0xaa + 180: 0c 21 00 00 00 00 00 00 add32 %r1,%r2 + 188: 0c 21 00 00 00 00 00 00 add32 %r1,%r2 + 190: 14 01 00 00 aa 00 00 00 sub32 %r1,0xaa + 198: 14 01 00 00 aa 00 00 00 sub32 %r1,0xaa + 1a0: 1c 21 00 00 00 00 00 00 sub32 %r1,%r2 + 1a8: 1c 21 00 00 00 00 00 00 sub32 %r1,%r2 + 1b0: 24 01 00 00 aa 00 00 00 mul32 %r1,0xaa + 1b8: 24 01 00 00 aa 00 00 00 mul32 %r1,0xaa + 1c0: 2c 21 00 00 00 00 00 00 mul32 %r1,%r2 + 1c8: 2c 21 00 00 00 00 00 00 mul32 %r1,%r2 + 1d0: 34 01 00 00 aa 00 00 00 div32 %r1,0xaa + 1d8: 34 01 00 00 aa 00 00 00 div32 %r1,0xaa + 1e0: 3c 21 00 00 00 00 00 00 div32 %r1,%r2 + 1e8: 3c 21 00 00 00 00 00 00 div32 %r1,%r2 + 1f0: 44 01 00 00 aa 00 00 00 or32 %r1,0xaa + 1f8: 44 01 00 00 aa 00 00 00 or32 %r1,0xaa + 200: 4c 21 00 00 00 00 00 00 or32 %r1,%r2 + 208: 4c 21 00 00 00 00 00 00 or32 %r1,%r2 + 210: 54 01 00 00 aa 00 00 00 and32 %r1,0xaa + 218: 54 01 00 00 aa 00 00 00 and32 %r1,0xaa + 220: 5c 21 00 00 00 00 00 00 and32 %r1,%r2 + 228: 5c 21 00 00 00 00 00 00 and32 %r1,%r2 + 230: 64 01 00 00 aa 00 00 00 lsh32 %r1,0xaa + 238: 64 01 00 00 aa 00 00 00 lsh32 %r1,0xaa + 240: 6c 21 00 00 00 00 00 00 lsh32 %r1,%r2 + 248: 6c 21 00 00 00 00 00 00 lsh32 %r1,%r2 + 250: 74 01 00 00 aa 00 00 00 rsh32 %r1,0xaa + 258: 74 01 00 00 aa 00 00 00 rsh32 %r1,0xaa + 260: 7c 21 00 00 00 00 00 00 rsh32 %r1,%r2 + 268: 7c 21 00 00 00 00 00 00 rsh32 %r1,%r2 + 270: a4 01 00 00 aa 00 00 00 xor32 %r1,0xaa + 278: a4 01 00 00 aa 00 00 00 xor32 %r1,0xaa + 280: ac 21 00 00 00 00 00 00 xor32 %r1,%r2 + 288: ac 21 00 00 00 00 00 00 xor32 %r1,%r2 + 290: b4 01 00 00 aa 00 00 00 mov32 %r1,0xaa + 298: b4 01 00 00 aa 00 00 00 mov32 %r1,0xaa + 2a0: bc 21 00 00 00 00 00 00 mov32 %r1,%r2 + 2a8: bc 21 00 00 00 00 00 00 mov32 %r1,%r2 + 2b0: c4 01 00 00 aa 00 00 00 arsh32 %r1,0xaa + 2b8: c4 01 00 00 aa 00 00 00 arsh32 %r1,0xaa + 2c0: cc 21 00 00 00 00 00 00 arsh32 %r1,%r2 + 2c8: cc 21 00 00 00 00 00 00 arsh32 %r1,%r2 + 2d0: 84 01 00 00 00 00 00 00 neg32 %r1 + 2d8: 84 01 00 00 00 00 00 00 neg32 %r1 + 2e0: d4 01 00 00 10 00 00 00 endle %r1,16 + 2e8: d4 01 00 00 10 00 00 00 endle %r1,16 + 2f0: d4 01 00 00 20 00 00 00 endle %r1,32 + 2f8: d4 01 00 00 20 00 00 00 endle %r1,32 + 300: d4 01 00 00 40 00 00 00 endle %r1,64 + 308: d4 01 00 00 40 00 00 00 endle %r1,64 + 310: dc 01 00 00 10 00 00 00 endbe %r1,16 + 318: dc 01 00 00 10 00 00 00 endbe %r1,16 + 320: dc 01 00 00 20 00 00 00 endbe %r1,32 + 328: dc 01 00 00 20 00 00 00 endbe %r1,32 + 330: dc 01 00 00 40 00 00 00 endbe %r1,64 + 338: dc 01 00 00 40 00 00 00 endbe %r1,64 + 340: 71 21 aa 00 00 00 00 00 ldxb %r1,\[%r2\+0xaa\] + 348: 71 21 aa 00 00 00 00 00 ldxb %r1,\[%r2\+0xaa\] + 350: 69 21 aa 00 00 00 00 00 ldxh %r1,\[%r2\+0xaa\] + 358: 69 21 aa 00 00 00 00 00 ldxh %r1,\[%r2\+0xaa\] + 360: 61 21 aa 00 00 00 00 00 ldxw %r1,\[%r2\+0xaa\] + 368: 61 21 aa 00 00 00 00 00 ldxw %r1,\[%r2\+0xaa\] + 370: 79 21 aa 00 00 00 00 00 ldxdw %r1,\[%r2\+0xaa\] + 378: 79 21 aa 00 00 00 00 00 ldxdw %r1,\[%r2\+0xaa\] + 380: 73 21 aa 00 00 00 00 00 stxb \[%r1\+0xaa\],%r2 + 388: 73 21 aa 00 00 00 00 00 stxb \[%r1\+0xaa\],%r2 + 390: 6b 21 aa 00 00 00 00 00 stxh \[%r1\+0xaa\],%r2 + 398: 6b 21 aa 00 00 00 00 00 stxh \[%r1\+0xaa\],%r2 + 3a0: 63 21 aa 00 00 00 00 00 stxw \[%r1\+0xaa\],%r2 + 3a8: 63 21 aa 00 00 00 00 00 stxw \[%r1\+0xaa\],%r2 + 3b0: 7b 21 aa 00 00 00 00 00 stxdw \[%r1\+0xaa\],%r2 + 3b8: 7b 21 aa 00 00 00 00 00 stxdw \[%r1\+0xaa\],%r2 + 3c0: 05 00 bb 00 00 00 00 00 ja 187 + 3c8: 05 00 bb 00 00 00 00 00 ja 187 + 3d0: 15 01 bb 00 aa 00 00 00 jeq %r1,0xaa,187 + 3d8: 15 01 bb 00 aa 00 00 00 jeq %r1,0xaa,187 + 3e0: 1d 21 bb 00 00 00 00 00 jeq %r1,%r2,187 + 3e8: 1d 21 bb 00 00 00 00 00 jeq %r1,%r2,187 + 3f0: 25 01 bb 00 aa 00 00 00 jgt %r1,0xaa,187 + 3f8: 25 01 bb 00 aa 00 00 00 jgt %r1,0xaa,187 + 400: 2d 21 bb 00 00 00 00 00 jgt %r1,%r2,187 + 408: 2d 21 bb 00 00 00 00 00 jgt %r1,%r2,187 + 410: 35 01 bb 00 aa 00 00 00 jge %r1,0xaa,187 + 418: 35 01 bb 00 aa 00 00 00 jge %r1,0xaa,187 + 420: 3d 21 bb 00 00 00 00 00 jge %r1,%r2,187 + 428: 3d 21 bb 00 00 00 00 00 jge %r1,%r2,187 + 430: a5 01 bb 00 aa 00 00 00 jlt %r1,0xaa,187 + 438: a5 01 bb 00 aa 00 00 00 jlt %r1,0xaa,187 + 440: ad 21 bb 00 00 00 00 00 jlt %r1,%r2,187 + 448: ad 21 bb 00 00 00 00 00 jlt %r1,%r2,187 + 450: b5 01 bb 00 aa 00 00 00 jle %r1,0xaa,187 + 458: b5 01 bb 00 aa 00 00 00 jle %r1,0xaa,187 + 460: bd 21 bb 00 00 00 00 00 jle %r1,%r2,187 + 468: bd 21 bb 00 00 00 00 00 jle %r1,%r2,187 + 470: 45 01 bb 00 aa 00 00 00 jset %r1,0xaa,187 + 478: 45 01 bb 00 aa 00 00 00 jset %r1,0xaa,187 + 480: 4d 21 bb 00 00 00 00 00 jset %r1,%r2,187 + 488: 4d 21 bb 00 00 00 00 00 jset %r1,%r2,187 + 490: 55 01 bb 00 aa 00 00 00 jne %r1,0xaa,187 + 498: 55 01 bb 00 aa 00 00 00 jne %r1,0xaa,187 + 4a0: 5d 21 bb 00 00 00 00 00 jne %r1,%r2,187 + 4a8: 5d 21 bb 00 00 00 00 00 jne %r1,%r2,187 + 4b0: 65 01 bb 00 aa 00 00 00 jsgt %r1,0xaa,187 + 4b8: 65 01 bb 00 aa 00 00 00 jsgt %r1,0xaa,187 + 4c0: 6d 21 bb 00 00 00 00 00 jsgt %r1,%r2,187 + 4c8: 6d 21 bb 00 00 00 00 00 jsgt %r1,%r2,187 + 4d0: 75 01 bb 00 aa 00 00 00 jsge %r1,0xaa,187 + 4d8: 75 01 bb 00 aa 00 00 00 jsge %r1,0xaa,187 + 4e0: 7d 21 bb 00 00 00 00 00 jsge %r1,%r2,187 + 4e8: 7d 21 bb 00 00 00 00 00 jsge %r1,%r2,187 + 4f0: c5 01 bb 00 aa 00 00 00 jslt %r1,0xaa,187 + 4f8: c5 01 bb 00 aa 00 00 00 jslt %r1,0xaa,187 + 500: cd 21 bb 00 00 00 00 00 jslt %r1,%r2,187 + 508: cd 21 bb 00 00 00 00 00 jslt %r1,%r2,187 + 510: d5 01 bb 00 aa 00 00 00 jsle %r1,0xaa,187 + 518: d5 01 bb 00 aa 00 00 00 jsle %r1,0xaa,187 + 520: dd 21 bb 00 00 00 00 00 jsle %r1,%r2,187 + 528: dd 21 bb 00 00 00 00 00 jsle %r1,%r2,187 + 530: 85 00 00 00 aa 00 00 00 call 170 + 538: 85 00 00 00 aa 00 00 00 call 170 + 540: 95 00 00 00 00 00 00 00 exit + 548: 95 00 00 00 00 00 00 00 exit + 550: b7 06 00 00 20 06 00 00 mov %r6,0x620 + 558: 95 00 00 00 00 00 00 00 exit + 560: 20 00 00 00 aa 00 00 00 ldabsw 0xaa + 568: 20 00 00 00 aa 00 00 00 ldabsw 0xaa + 570: 50 70 00 00 aa 00 00 00 ldindb %r7,0xaa + 578: 50 70 00 00 aa 00 00 00 ldindb %r7,0xaa + 580: 20 00 00 00 aa 00 00 00 ldabsw 0xaa + 588: 20 00 00 00 aa 00 00 00 ldabsw 0xaa + 590: 50 70 00 00 aa 00 00 00 ldindb %r7,0xaa + 598: 50 70 00 00 aa 00 00 00 ldindb %r7,0xaa + 5a0: 18 03 00 00 01 00 00 00 lddw %r3,1 + 5a8: 00 00 00 00 00 00 00 00 + 5b0: 18 03 00 00 01 00 00 00 lddw %r3,1 + 5b8: 00 00 00 00 00 00 00 00 + 5c0: 18 04 00 00 88 77 ff ee lddw %r4,-6144092013047351416 + 5c8: 00 00 00 00 dd cc bb aa + 5d0: 18 04 00 00 88 77 ff ee lddw %r4,-6144092013047351416 + 5d8: 00 00 00 00 dd cc bb aa + 5e0: 18 05 00 00 88 77 66 55 lddw %r5,0x1122334455667788 + 5e8: 00 00 00 00 44 33 22 11 + 5f0: 18 05 00 00 88 77 66 55 lddw %r5,0x1122334455667788 + 5f8: 00 00 00 00 44 33 22 11 + 600: 18 06 00 00 20 06 00 00 lddw %r6,0x620 + 608: 00 00 00 00 00 00 00 00 + 600: R_BPF_64_64 .text + 610: 18 06 00 00 20 06 00 00 lddw %r6,0x620 + 618: 00 00 00 00 00 00 00 00 + 610: R_BPF_64_64 .text + +0000000000000620 <main>: + 620: c3 21 aa 00 00 00 00 00 xaddw \[%r1\+0xaa\],%r2 + 628: c3 21 aa 00 00 00 00 00 xaddw \[%r1\+0xaa\],%r2 + 630: db 21 aa 00 00 00 00 00 xadddw \[%r1\+0xaa\],%r2 + 638: db 21 aa 00 00 00 00 00 xadddw \[%r1\+0xaa\],%r2 diff --git a/gas/testsuite/gas/bpf/pseudoc-normal.s b/gas/testsuite/gas/bpf/pseudoc-normal.s new file mode 100644 index 00000000000..b3467d12219 --- /dev/null +++ b/gas/testsuite/gas/bpf/pseudoc-normal.s @@ -0,0 +1,196 @@ +# Tests for mixing pseudo-C and normal eBPF instructions +beg: + .text + add %r1,0xaa + r1 += 0xaa + add %r1,%r2 + r1 += r2 + sub %r1,0xaa + r1 -= 0xaa + sub %r1,%r2 + r1 -= r2 + mul %r1,0xaa + r1 *= 0xaa + mul %r1,%r2 + r1 *= r2 + div %r1,0xaa + r1 /= 0xaa + div %r1,%r2 + r1 /= r2 + or %r1,0xaa + r1 |= 0xaa + or %r1,%r2 + r1 |= r2 + and %r1,0xaa + r1 &= 0xaa + and %r1,%r2 + r1 &= r2 + lsh %r1,0xaa + r1 <<= 0xaa + lsh %r1,%r2 + r1 <<= r2 + rsh %r1,0xaa + r1 >>= 0xaa + rsh %r1,%r2 + r1 >>= r2 + xor %r1,0xaa + r1 ^= 0xaa + xor %r1,%r2 + r1 ^= r2 + mov %r1,0xaa + r1 = 0xaa + mov %r1,%r2 + r1 = r2 + arsh %r1,0xaa + r1 s>>= 0xaa + arsh %r1,%r2 + r1 s>>= r2 + neg %r1 + r1 = -r1 + add32 %r1,0xaa + w1 += 0xaa + add32 %r1,%r2 + w1 += w2 + sub32 %r1,0xaa + w1 -= 0xaa + sub32 %r1,%r2 + w1 -= w2 + mul32 %r1,0xaa + w1 *= 0xaa + mul32 %r1,%r2 + w1 *= w2 + div32 %r1,0xaa + w1 /= 0xaa + div32 %r1,%r2 + w1 /= w2 + or32 %r1,0xaa + w1 |= 0xaa + or32 %r1,%r2 + w1 |= w2 + and32 %r1,0xaa + w1 &= 0xaa + and32 %r1,%r2 + w1 &= w2 + lsh32 %r1,0xaa + w1 <<= 0xaa + lsh32 %r1,%r2 + w1 <<= w2 + rsh32 %r1,0xaa + w1 >>= 0xaa + rsh32 %r1,%r2 + w1 >>= w2 + xor32 %r1,0xaa + w1 ^= 0xaa + xor32 %r1,%r2 + w1 ^= w2 + mov32 %r1,0xaa + w1 = 0xaa + mov32 %r1,%r2 + w1 = w2 + arsh32 %r1,0xaa + w1 s>>= 0xaa + arsh32 %r1,%r2 + w1 s>>= w2 + neg32 %r1 + w1 = -w1 + endle %r1,16 + r1 = le16 r1 + endle %r1,32 + r1 = le32 r1 + endle %r1,64 + r1 = le64 r1 + endbe %r1,16 + r1 = be16 r1 + endbe %r1,32 + r1 = be32 r1 + endbe %r1,64 + r1 = be64 r1 + ldxb %r1,[%r2+0xaa] + r1 = *(u8 *)(r2 + 0xaa) + ldxh %r1,[%r2+0xaa] + r1 = *(u16 *)(r2 + 0xaa) + ldxw %r1,[%r2+0xaa] + r1 = *(u32 *)(r2 + 0xaa) + ldxdw %r1,[%r2+0xaa] + r1 = *(u64 *)(r2 + 0xaa) + stxb [%r1+0xaa],%r2 + *(u8 *)(r1 + 0xaa) = r2 + stxh [%r1+0xaa],%r2 + *(u16 *)(r1 + 0xaa) = r2 + stxw [%r1+0xaa],%r2 + *(u32 *)(r1 + 0xaa) = r2 + stxdw [%r1+0xaa],%r2 + *(u64 *)(r1 + 0xaa) = r2 + ja 187 + goto 0xbb + jeq %r1,0xaa,187 + if r1 == 0xaa goto 0xbb + jeq %r1,%r2,187 + if r1 == r2 goto 0xbb + jgt %r1,0xaa,187 + if r1 > 0xaa goto 0xbb + jgt %r1,%r2,187 + if r1 > r2 goto 0xbb + jge %r1,0xaa,187 + if r1 >= 0xaa goto 0xbb + jge %r1,%r2,187 + if r1 >= r2 goto 0xbb + jlt %r1,0xaa,187 + if r1 < 0xaa goto 0xbb + jlt %r1,%r2,187 + if r1 < r2 goto 0xbb + jle %r1,0xaa,187 + if r1 <= 0xaa goto 0xbb + jle %r1,%r2,187 + if r1 <= r2 goto 0xbb + jset %r1,0xaa,187 + if r1 & 0xaa goto 0xbb + jset %r1,%r2,187 + if r1 & r2 goto 0xbb + jne %r1,0xaa,187 + if r1 != 0xaa goto 0xbb + jne %r1,%r2,187 + if r1 != r2 goto 0xbb + jsgt %r1,0xaa,187 + if r1 s> 0xaa goto 0xbb + jsgt %r1,%r2,187 + if r1 s> r2 goto 0xbb + jsge %r1,0xaa,187 + if r1 s>= 0xaa goto 0xbb + jsge %r1,%r2,187 + if r1 s>= r2 goto 0xbb + jslt %r1,0xaa,187 + if r1 s< 0xaa goto 0xbb + jslt %r1,%r2,187 + if r1 s< r2 goto 0xbb + jsle %r1,0xaa,187 + if r1 s<= 0xaa goto 0xbb + jsle %r1,%r2,187 + if r1 s<= r2 goto 0xbb + call 170 + call 0xaa + exit + exit + mov %r6,main - beg + exit + ldabsw 0xaa + r0 = *(u32 *)skb[0xaa] + ldindb %r7,0xaa + r0 = *(u8 *)skb[r7 + 0xaa] + ldabsw 0xaa + r0 = *(u32 *)skb[0xaa] + ldindb %r7,0xaa + r0 = *(u8 *)skb[r7 + 0xaa] + lddw %r3,1 + r3 = 1 ll + lddw %r4,0xaabbccddeeff7788 + r4 = 0xaabbccddeeff7788 ll + r5 = 0x1122334455667788 ll + lddw %r5,0x1122334455667788 + lddw %r6,main + r6 = main ll + main: + lock *(u32 *)(r1 + 0xaa) += r2 + xaddw [%r1+0xaa],%r2 + lock *(u64 *)(r1 + 0xaa) += r2 + xadddw [%r1+0xaa],%r2 diff --git a/gas/testsuite/gas/macros/macros.exp b/gas/testsuite/gas/macros/macros.exp index e217b2b14ae..811ef7d835c 100644 --- a/gas/testsuite/gas/macros/macros.exp +++ b/gas/testsuite/gas/macros/macros.exp @@ -82,6 +82,7 @@ switch -glob $target_triplet { rl78-*-* { } rx-*-* { } vax-*-* { } + bpf-*-* { } default { run_list_test dot "-alm" } } run_list_test end "" |