diff options
author | Jose E. Marchesi <jose.marchesi@oracle.com> | 2023-07-26 11:44:20 +0200 |
---|---|---|
committer | Jose E. Marchesi <jose.marchesi@oracle.com> | 2023-07-26 11:44:20 +0200 |
commit | 4200337219274445a17e16d18d3c113f555cc786 (patch) | |
tree | 2b0111b3400af2513d9d89736d58a1f7e5d9c2c1 /sim/testsuite/bpf | |
parent | 04896832b2e79c042ea1f510b0458ac342512152 (diff) | |
download | binutils-4200337219274445a17e16d18d3c113f555cc786.zip binutils-4200337219274445a17e16d18d3c113f555cc786.tar.gz binutils-4200337219274445a17e16d18d3c113f555cc786.tar.bz2 |
bpf: fix neg and neg32 BPF instructions in simulator
This patch fixes the semantics of the neg and neg32 BPF instructions
in the simulator, and also updates the corresponding tests
accordingly.
Tested in target bpf-unknown-none.
Diffstat (limited to 'sim/testsuite/bpf')
-rw-r--r-- | sim/testsuite/bpf/alu.s | 4 | ||||
-rw-r--r-- | sim/testsuite/bpf/alu32.s | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sim/testsuite/bpf/alu.s b/sim/testsuite/bpf/alu.s index c073f67..4dc37b1 100644 --- a/sim/testsuite/bpf/alu.s +++ b/sim/testsuite/bpf/alu.s @@ -112,10 +112,10 @@ main: fail_ne %r1, 0 ;; neg - neg %r2, %r2 + neg %r2 fail_ne %r2, -5 mov %r1, -1025 - neg %r1, %r1 + neg %r1 fail_ne %r1, 1025 pass diff --git a/sim/testsuite/bpf/alu32.s b/sim/testsuite/bpf/alu32.s index d797122..e8d5062 100644 --- a/sim/testsuite/bpf/alu32.s +++ b/sim/testsuite/bpf/alu32.s @@ -100,11 +100,11 @@ main: ;; neg mov32 %r1, -1 mov32 %r2, 0x7fffffff - neg32 %r1, %r1 - neg32 %r2, %r2 + neg32 %r1 + neg32 %r2 fail_ne32 %r1, 1 fail_ne %r2, 0x80000001 ; Note: check for (bad) sign-extend - neg32 %r2, %r2 + neg32 %r2 fail_ne32 %r2, 0x7fffffff pass |