Skip to content

Commit

Permalink
Merge branch 'main' into no-movsx-imm
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan-Jowett authored Jan 22, 2024
2 parents fb5ae89 + a2799c0 commit 52a8e78
Show file tree
Hide file tree
Showing 22 changed files with 70 additions and 6 deletions.
2 changes: 2 additions & 0 deletions tests/add.data
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ mov32 %r0, 0
mov32 %r1, 2
add32 %r0, 1
add32 %r0, %r1
add32 %r0, %r0
add32 %r0, -3
exit
-- result
0x3
10 changes: 7 additions & 3 deletions tests/add64.data
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Copyright (c) Big Switch Networks, Inc
# SPDX-License-Identifier: Apache-2.0
-- asm
mov %r0, 1
add %r0, -1
mov %r0, 0
mov %r1, 2
add %r0, 1
add %r0, %r1
add %r0, %r0
add %r0, -3
exit
-- result
0
0x3
3 changes: 2 additions & 1 deletion tests/alu-arith.data
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Copyright (c) Big Switch Networks, Inc
# SPDX-License-Identifier: Apache-2.0
-- asm
mov32 %r0, 0
mov32 %r0, 10
sub32 %r0, %r0
mov32 %r1, 1
mov32 %r2, 2
mov32 %r3, 3
Expand Down
2 changes: 2 additions & 0 deletions tests/alu-bit.data
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ jne %r0, 0, exit

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

and32 %r0, 0xa3
mov32 %r9, 0x91
and32 %r0, %r9
and32 %r0, %r0
# %r0 == 0x81
jne %r0, 0x81, exit

Expand Down
3 changes: 2 additions & 1 deletion tests/alu64-arith.data
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Copyright (c) Big Switch Networks, Inc
# SPDX-License-Identifier: Apache-2.0
-- asm
mov %r0, 0
mov %r0, 10
sub %r0, %r0
mov %r1, 1
mov %r2, 2
mov %r3, 3
Expand Down
2 changes: 2 additions & 0 deletions tests/alu64-bit.data
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ jne %r0, 0, exit

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

and %r0, 0xa3
mov %r9, 0x91
and %r0, %r9
and %r0, %r0
# %r0 == 0x81
jne %r0, 0x81, exit

Expand Down
2 changes: 2 additions & 0 deletions tests/jeq-reg.data
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ mov32 %r0, 0
mov32 %r1, 0xa
mov32 %r2, 0xb
jeq %r1, %r2, exit # Not taken
jeq %r1, %r1, +1 # Taken
exit

mov32 %r0, 1
mov32 %r1, 0xb
Expand Down
2 changes: 2 additions & 0 deletions tests/jeq32-reg.data
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ mov32 %r0, 0
mov32 %r1, 0xa
mov32 %r2, 0xb
jeq32 %r1, %r2, exit # Not taken
jeq32 %r1, %r1, +1 # Taken
exit

mov32 %r0, 1
mov32 %r1, 0xb
Expand Down
18 changes: 18 additions & 0 deletions tests/jge-reg.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) Big Switch Networks, Inc
# SPDX-License-Identifier: Apache-2.0
-- asm
mov32 %r0, 0
mov32 %r1, 0xa
mov32 %r2, 0x0b
jge %r1, %r2, exit # Not taken
jge %r1, %r1, +1 # Taken
exit

mov32 %r0, 1
mov32 %r1, 0xc
jge %r1, %r2, exit # Taken

mov32 %r0, 2 # Skipped
exit
-- result
0x1
2 changes: 2 additions & 0 deletions tests/jge32-reg.data
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ mov32 %r0, 0
mov32 %r1, 0xa
mov32 %r2, 0xb
jge32 %r1, %r2, exit # Not taken
jge32 %r1, %r1, +1 # Taken
exit

mov32 %r0, 1
# set %r1 to 0x10000000c
Expand Down
1 change: 1 addition & 0 deletions tests/jne-reg.data
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mov32 %r0, 0
mov32 %r1, 0xb
mov32 %r2, 0xb
jne %r1, %r2, exit # Not taken
jne %r1, %r1, exit # Not taken

mov32 %r0, 1
mov32 %r1, 0xa
Expand Down
3 changes: 2 additions & 1 deletion tests/jne32-reg.data
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ mov32 %r1, 0xb
# set %r1 to 0x10000000b
or %r1, %r9
mov32 %r2, 0xb
jne32 %r1, %r2, +4 # Not taken
jne32 %r1, %r2, +5 # Not taken
jne32 %r1, %r1, +4 # Not taken

mov32 %r0, 1
mov32 %r1, 0xa
Expand Down
2 changes: 2 additions & 0 deletions tests/jset-reg.data
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ mov32 %r0, 0
mov32 %r1, 0x7
mov32 %r2, 0x8
jset %r1, %r2, exit # Not taken
jset %r1, %r1, +1 # Taken
exit

mov32 %r0, 1
mov32 %r1, 0x9
Expand Down
2 changes: 2 additions & 0 deletions tests/jset32-reg.data
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ mov32 %r1, 0x7
or %r1, %r9
mov32 %r2, 0x8
jset32 %r1, %r2, exit # Not taken
jset32 %r1, %r1, +1 # Taken
exit

mov32 %r0, 1
mov32 %r1, 0x9
Expand Down
2 changes: 2 additions & 0 deletions tests/jsge-reg.data
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ mov %r2, 0xffffffff
mov32 %r3, 0
jsge %r1, %r2, exit # Not taken
jsge %r1, %r3, exit # Not taken
jsge %r1, %r1, +1 # Taken
exit

mov32 %r0, 1
mov %r1, %r2
Expand Down
2 changes: 2 additions & 0 deletions tests/jsge32-reg.data
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ mov %r2, 0xffffffff
mov32 %r3, 0
jsge32 %r1, %r2, exit # Not taken
jsge32 %r1, %r3, exit # Not taken
jsge32 %r1, %r1, +1 # Taken
exit

mov32 %r0, 1
mov %r1, %r2
Expand Down
1 change: 1 addition & 0 deletions tests/jsgt-reg.data
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mov32 %r0, 0
mov %r1, 0xfffffffe
mov %r2, 0xffffffff
jsgt %r1, %r2, exit # Not taken
jsgt %r1, %r1, exit # Not taken

mov32 %r0, 1
mov32 %r1, 0
Expand Down
1 change: 1 addition & 0 deletions tests/jsgt32-reg.data
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mov32 %r1, 0xfffffffe
or %r1, %r9
mov %r2, 0xffffffff
jsgt32 %r1, %r2, exit # Not taken
jsgt32 %r1, %r1, exit # Not taken

mov32 %r0, 1
mov32 %r1, 0
Expand Down
3 changes: 3 additions & 0 deletions tests/jsle-reg.data
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ mov32 %r3, 0
jsle %r1, %r2, exit # Not taken
jsle %r1, %r3, +1 # Taken
exit
jsle %r1, %r1, +1 # Taken
exit

mov32 %r0, 1
mov %r1, %r2
jsle %r1, %r2, +1 # Taken
Expand Down
3 changes: 3 additions & 0 deletions tests/jsle32-reg.data
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ mov32 %r3, 0
jsle32 %r1, %r2, exit # Not taken
jsle32 %r1, %r3, +1 # Taken
exit
jsle32 %r1, %r1, +1 # Taken
exit

mov32 %r0, 1
mov %r1, %r2
jsle32 %r1, %r2, +1 # Taken
Expand Down
1 change: 1 addition & 0 deletions tests/mov.data
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- asm
mov32 %r1, 1
mov32 %r0, %r1
mov32 %r0, %r0
exit
-- result
0x1
9 changes: 9 additions & 0 deletions tests/mov64.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) Big Switch Networks, Inc
# SPDX-License-Identifier: Apache-2.0
-- asm
mov %r1, 1
mov %r0, %r1
mov %r0, %r0
exit
-- result
0x1

0 comments on commit 52a8e78

Please sign in to comment.