-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2900 from o1-labs/dw/xor-tests
o1vm/riscv32im: add tests for XOR
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.section .text | ||
.globl _start | ||
|
||
_start: | ||
|
||
# Simple XOR | ||
li t0, 0b1100 # t0 = 0b1100 | ||
li t1, 0b1010 # t1 = 0b1010 | ||
xor t2, t0, t1 # t2 = t0 ^ t1 (Expected: t2 = 0b0110) | ||
|
||
# XOR with zero (no change) | ||
li t3, 0b1010 # t3 = 0b1010 | ||
li t4, 0 # t4 = 0 | ||
xor t5, t3, t4 # t5 = t3 ^ t4 (Expected: t5 = 0b1010) | ||
|
||
# XOR of identical values (result 0) | ||
li t6, 0b1111 # t6 = 0b1111 | ||
li t0, 0b1111 # t0 = 0b1111 | ||
xor t1, t6, t0 # t1 = t6 ^ t0 (Expected: t1 = 0) | ||
|
||
# Custom exit syscall | ||
li a0, 0 | ||
li a1, 0 | ||
li a2, 0 | ||
li a3, 0 | ||
li a4, 0 | ||
li a5, 0 | ||
li a6, 0 | ||
li a7, 42 | ||
ecall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters