Add ibranch test.

This commit is contained in:
Denis Drakhnia 2020-11-25 22:19:06 +02:00
parent 476feace08
commit 4e000a284f
3 changed files with 41 additions and 0 deletions

2
src/ibranch.gdb Normal file
View File

@ -0,0 +1,2 @@
c
info registers r0 r1 r2 r3

9
src/ibranch.log Normal file
View File

@ -0,0 +1,9 @@
Breakpoint 1 at 0x10078
Breakpoint 2 at 0x100c8
0x0000000000010078 in _start ()
Breakpoint 2, 0x00000000000100c8 in _stop ()
r0 <00> 0x0 0
r1 <00> 0x1 1
r2 <00> 0x2 2
r3 <00> 0x3 3

30
src/ibranch.s Normal file
View File

@ -0,0 +1,30 @@
.global _start
.global _stop
_start:
{
ibranch 3f
}
0:
{
addd %r0, 1, %r1
ibranch 2f
}
1:
{
addd %r2, 1, %r3
ibranch _stop
}
2:
{
addd %r1, 1, %r2
ibranch 1b
}
3:
{
addd 0, 0, %r0
ibranch 0b
}
_stop:
udivs 0, 0, %empty