aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorDavid Faust <david.faust@oracle.com>2020-04-16 09:52:57 +0200
committerJose E. Marchesi <jose.marchesi@oracle.com>2020-04-16 09:52:57 +0200
commitc54a9b56696e584c2b8c7146caac337c063f5516 (patch)
tree33205ceeca676265c2b2d4f5c049ec762d29fadd /gas
parentd191d716f38b41720c4955823fe6c178cf0786f0 (diff)
downloadgdb-c54a9b56696e584c2b8c7146caac337c063f5516.zip
gdb-c54a9b56696e584c2b8c7146caac337c063f5516.tar.gz
gdb-c54a9b56696e584c2b8c7146caac337c063f5516.tar.bz2
cpu,gas,opcodes: support for eBPF JMP32 instruction class
Add support for the JMP32 class of eBPF instructions. cpu/ChangeLog * bpf.cpu (define-cond-jump-insn): Renamed from djci. (dcji) New version with support for JMP32 gas/ChangeLog * testsuite/gas/bpf/bpf.exp: Run jump32 tests. * testsuite/gas/bpf/jump32.s: New file. * testsuite/gas/bpf/jump32.d: Likewise. opcodes/ChangeLog * bpf-desc.c: Regenerate. * bpf-desc.h: Likewise. * bpf-opc.c: Regenerate. * bpf-opc.h: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/testsuite/gas/bpf/bpf.exp1
-rw-r--r--gas/testsuite/gas/bpf/jump32.d31
-rw-r--r--gas/testsuite/gas/bpf/jump32.s25
4 files changed, 63 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ecc3b98..09ad599 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2020-02-16 David Faust <david.faust@oracle.com>
+
+ * testsuite/gas/bpf/bpf.exp: Run jump32 tests.
+ * testsuite/gas/bpf/jump32.s: New file.
+ * testsuite/gas/bpf/jump32.d: Likewise.
+
2020-04-08 H.J. Lu <hongjiu.lu@intel.com>
* doc/c-i386.texi: Correct -mlfence-before-indirect-branch=
diff --git a/gas/testsuite/gas/bpf/bpf.exp b/gas/testsuite/gas/bpf/bpf.exp
index 1c111e1..6225d0b 100644
--- a/gas/testsuite/gas/bpf/bpf.exp
+++ b/gas/testsuite/gas/bpf/bpf.exp
@@ -23,6 +23,7 @@ if {[istarget bpf*-*-*]} {
run_dump_test alu32
run_dump_test mem
run_dump_test jump
+ run_dump_test jump32
run_dump_test call
run_dump_test exit
run_dump_test atomic
diff --git a/gas/testsuite/gas/bpf/jump32.d b/gas/testsuite/gas/bpf/jump32.d
new file mode 100644
index 0000000..4f5ae2c
--- /dev/null
+++ b/gas/testsuite/gas/bpf/jump32.d
@@ -0,0 +1,31 @@
+#as: --EL
+#objdump: -dr
+#name: eBPF JUMP32 instructions
+
+.*: +file format .*bpf.*
+
+Disassembly of section .text:
+
+0+ <.text>:
+ 0: 05 00 03 00 00 00 00 00 ja 3
+ 8: 0f 11 00 00 00 00 00 00 add %r1,%r1
+ 10: 16 03 01 00 03 00 00 00 jeq32 %r3,3,1
+ 18: 1e 43 00 00 00 00 00 00 jeq32 %r3,%r4,0
+ 20: 36 03 fd ff 03 00 00 00 jge32 %r3,3,-3
+ 28: 3e 43 fc ff 00 00 00 00 jge32 %r3,%r4,-4
+ 30: a6 03 01 00 03 00 00 00 jlt32 %r3,3,1
+ 38: ae 43 00 00 00 00 00 00 jlt32 %r3,%r4,0
+ 40: b6 03 01 00 03 00 00 00 jle32 %r3,3,1
+ 48: be 43 00 00 00 00 00 00 jle32 %r3,%r4,0
+ 50: 46 03 01 00 03 00 00 00 jset32 %r3,3,1
+ 58: 4e 43 00 00 00 00 00 00 jset32 %r3,%r4,0
+ 60: 56 03 01 00 03 00 00 00 jne32 %r3,3,1
+ 68: 5e 43 00 00 00 00 00 00 jne32 %r3,%r4,0
+ 70: 66 03 01 00 03 00 00 00 jsgt32 %r3,3,1
+ 78: 6e 43 00 00 00 00 00 00 jsgt32 %r3,%r4,0
+ 80: 76 03 01 00 03 00 00 00 jsge32 %r3,3,1
+ 88: 7e 43 00 00 00 00 00 00 jsge32 %r3,%r4,0
+ 90: c6 03 01 00 03 00 00 00 jslt32 %r3,3,1
+ 98: ce 43 00 00 00 00 00 00 jslt32 %r3,%r4,0
+ a0: d6 03 01 00 03 00 00 00 jsle32 %r3,3,1
+ a8: de 43 00 00 00 00 00 00 jsle32 %r3,%r4,0
diff --git a/gas/testsuite/gas/bpf/jump32.s b/gas/testsuite/gas/bpf/jump32.s
new file mode 100644
index 0000000..ffcf4ba
--- /dev/null
+++ b/gas/testsuite/gas/bpf/jump32.s
@@ -0,0 +1,25 @@
+# Tests for the eBPF JUMP32 instructions
+ .text
+ ja 2f
+ add %r1,%r1
+1: jeq32 %r3,3,2f
+ jeq32 %r3,%r4,2f
+2: jge32 %r3,3,1b
+ jge32 %r3,%r4,1b
+1: jlt32 %r3,3,1f
+ jlt32 %r3,%r4,1f
+1: jle32 %r3,3,1f
+ jle32 %r3,%r4,1f
+1: jset32 %r3,3,1f
+ jset32 %r3,%r4,1f
+1: jne32 %r3,3,1f
+ jne32 %r3,%r4,1f
+1: jsgt32 %r3,3,1f
+ jsgt32 %r3,%r4,1f
+1: jsge32 %r3,3,1f
+ jsge32 %r3,%r4,1f
+1: jslt32 %r3,3,1f
+ jslt32 %r3,%r4,1f
+1: jsle32 %r3,3,1f
+ jsle32 %r3,%r4,1f
+1: