Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to GCC register names #252

Merged
merged 5 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion external/bpf_conformance
Submodule bpf_conformance updated 154 files
2 changes: 1 addition & 1 deletion test_framework/test_elf.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def add(name, value):

# return sqrti(42*42)
asm = """
mov r1, 1764
mov %r1, 1764
call 0xffffffff
exit
"""
Expand Down
8 changes: 4 additions & 4 deletions tests/add.data
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- asm
mov32 r0, 0
mov32 r1, 2
add32 r0, 1
add32 r0, r1
mov32 %r0, 0
mov32 %r1, 2
add32 %r0, 1
add32 %r0, %r1
exit
-- result
0x3
4 changes: 2 additions & 2 deletions tests/add64.data
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- asm
mov r0, 1
add r0, -1
mov %r0, 1
add %r0, -1
exit
-- result
0x0
46 changes: 23 additions & 23 deletions tests/alu-arith.data
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
-- asm
mov32 r0, 0
mov32 r1, 1
mov32 r2, 2
mov32 r3, 3
mov32 r4, 4
mov32 r5, 5
mov32 r6, 6
mov32 r7, 7
mov32 r8, 8
mov32 r9, 9
# r0 == 0
mov32 %r0, 0
mov32 %r1, 1
mov32 %r2, 2
mov32 %r3, 3
mov32 %r4, 4
mov32 %r5, 5
mov32 %r6, 6
mov32 %r7, 7
mov32 %r8, 8
mov32 %r9, 9
# %r0 == 0

add32 r0, 23
add32 r0, r7
# r0 == 30
add32 %r0, 23
add32 %r0, %r7
# %r0 == 30

sub32 r0, 13
sub32 r0, r1
# r0 == 16
sub32 %r0, 13
sub32 %r0, %r1
# %r0 == 16

mul32 r0, 7
mul32 r0, r3
# r0 == 336
mul32 %r0, 7
mul32 %r0, %r3
# %r0 == 336

div32 r0, 2
div32 r0, r4
# r0 == 42
div32 %r0, 2
div32 %r0, %r4
# %r0 == 42

exit
-- result
Expand Down
52 changes: 26 additions & 26 deletions tests/alu-bit.data
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
-- asm
mov32 r0, 0
mov32 r1, 1
mov32 r2, 2
mov32 r3, 3
mov32 r4, 4
mov32 r5, 5
mov32 r6, 6
mov32 r7, 7
mov32 r8, 8
# r0 == 0
mov32 %r0, 0
mov32 %r1, 1
mov32 %r2, 2
mov32 %r3, 3
mov32 %r4, 4
mov32 %r5, 5
mov32 %r6, 6
mov32 %r7, 7
mov32 %r8, 8
# %r0 == 0

or32 r0, r5
or32 r0, 0xa0
# r0 == 0xa5
or32 %r0, %r5
or32 %r0, 0xa0
# %r0 == 0xa5

and32 r0, 0xa3
mov32 r9, 0x91
and32 r0, r9
# r0 == 0x21
and32 %r0, 0xa3
mov32 %r9, 0x91
and32 %r0, %r9
# %r0 == 0x21

lsh32 r0, 22
lsh32 r0, r8
# r0 == 0x40000000
lsh32 %r0, 22
lsh32 %r0, %r8
# %r0 == 0x40000000

rsh32 r0, 19
rsh32 r0, r7
# r0 == 0x10
rsh32 %r0, 19
rsh32 %r0, %r7
# %r0 == 0x10

xor32 r0, 0x03
xor32 r0, r2
# r0 == 0x11
xor32 %r0, 0x03
xor32 %r0, %r2
# %r0 == 0x11

exit
-- result
Expand Down
42 changes: 21 additions & 21 deletions tests/alu.data
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
-- asm
add32 r1, 0x2
add32 r9, 0xffffffff
add32 r1, r2
sub32 r1, r2
mul32 r1, r2
div32 r1, r2
or32 r1, r2
and32 r1, r2
lsh32 r1, r2
rsh32 r1, r2
neg32 r1
mod32 r1, r2
xor32 r1, r2
mov32 r1, r2
arsh32 r1, r2
le16 r1
le32 r1
le64 r1
be16 r1
be32 r1
be64 r1
add32 %r1, 0x2
add32 %r9, 0xffffffff
add32 %r1, %r2
sub32 %r1, %r2
mul32 %r1, %r2
div32 %r1, %r2
or32 %r1, %r2
and32 %r1, %r2
lsh32 %r1, %r2
rsh32 %r1, %r2
neg32 %r1
mod32 %r1, %r2
xor32 %r1, %r2
mov32 %r1, %r2
arsh32 %r1, %r2
le16 %r1
le32 %r1
le64 %r1
be16 %r1
be32 %r1
be64 %r1
-- raw
0x0000000200000104
0xffffffff00000904
Expand Down
46 changes: 23 additions & 23 deletions tests/alu64-arith.data
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
-- asm
mov r0, 0
mov r1, 1
mov r2, 2
mov r3, 3
mov r4, 4
mov r5, 5
mov r6, 6
mov r7, 7
mov r8, 8
mov r9, 9
# r0 == 0
mov %r0, 0
mov %r1, 1
mov %r2, 2
mov %r3, 3
mov %r4, 4
mov %r5, 5
mov %r6, 6
mov %r7, 7
mov %r8, 8
mov %r9, 9
# %r0 == 0

add r0, 23
add r0, r7
# r0 == 30
add %r0, 23
add %r0, %r7
# %r0 == 30

sub r0, 13
sub r0, r1
# r0 == 16
sub %r0, 13
sub %r0, %r1
# %r0 == 16

mul r0, 7
mul r0, r3
# r0 == 336
mul %r0, 7
mul %r0, %r3
# %r0 == 336

div r0, 2
div r0, r4
# r0 == 42
div %r0, 2
div %r0, %r4
# %r0 == 42

exit
-- result
Expand Down
56 changes: 28 additions & 28 deletions tests/alu64-bit.data
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
-- asm
mov r0, 0
mov r1, 1
mov r2, 2
mov r3, 3
mov r4, 4
mov r5, 5
mov r6, 6
mov r7, 7
mov r8, 8
# r0 == 0
mov %r0, 0
mov %r1, 1
mov %r2, 2
mov %r3, 3
mov %r4, 4
mov %r5, 5
mov %r6, 6
mov %r7, 7
mov %r8, 8
# %r0 == 0

or r0, r5
or r0, 0xa0
# r0 == 0xa5
or %r0, %r5
or %r0, 0xa0
# %r0 == 0xa5

and r0, 0xa3
mov r9, 0x91
and r0, r9
# r0 == 0x21
and %r0, 0xa3
mov %r9, 0x91
and %r0, %r9
# %r0 == 0x21

lsh r0, 32
lsh r0, 22
lsh r0, r8
# r0 == 0x40000000
lsh %r0, 32
lsh %r0, 22
lsh %r0, %r8
# %r0 == 0x40000000

rsh r0, 32
rsh r0, 19
rsh r0, r7
# r0 == 0x10
rsh %r0, 32
rsh %r0, 19
rsh %r0, %r7
# %r0 == 0x10

xor r0, 0x03
xor r0, r2
# r0 == 0x11
xor %r0, 0x03
xor %r0, %r2
# %r0 == 0x11

exit
-- result
Expand Down
32 changes: 16 additions & 16 deletions tests/alu64.data
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
-- asm
add r1, 0x2
add r9, 0xffffffff
add r1, r2
sub r1, r2
mul r1, r2
div r1, r2
or r1, r2
and r1, r2
lsh r1, r2
rsh r1, r2
neg r1
mod r1, r2
xor r1, r2
mov r1, r2
arsh r1, r2
-- raw
add %r1, 0x2
add %r9, 0xffffffff
add %r1, %r2
sub %r1, %r2
mul %r1, %r2
div %r1, %r2
or %r1, %r2
and %r1, %r2
lsh %r1, %r2
rsh %r1, %r2
neg %r1
mod %r1, %r2
xor %r1, %r2
mov %r1, %r2
arsh %r1, %r2
-- raw
0x0000000200000107
0xffffffff00000907
0x000000000000210f
Expand Down
10 changes: 5 additions & 5 deletions tests/arsh-reg.data
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-- asm
mov32 r0, 0xf8
mov32 r1, 16
lsh32 r0, 28
# r0 == 0x80000000
arsh32 r0, r1
mov32 %r0, 0xf8
mov32 %r1, 16
lsh32 %r0, 28
# %r0 == 0x80000000
arsh32 %r0, %r1
exit
-- result
0xffff8000
8 changes: 4 additions & 4 deletions tests/arsh.data
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- asm
mov32 r0, 0xf8
lsh32 r0, 28
# r0 == 0x80000000
arsh32 r0, 16
mov32 %r0, 0xf8
lsh32 %r0, 28
# %r0 == 0x80000000
arsh32 %r0, 16
exit
-- result
0xffff8000
Expand Down
6 changes: 3 additions & 3 deletions tests/arsh32-high-shift.data
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- asm
mov r0, 8
lddw r1, 0x100000001
arsh32 r0, r1
mov %r0, 8
lddw %r1, 0x100000001
arsh32 %r0, %r1
exit
-- result
0x4
Loading