Compare commits

..
2 Commits
Author SHA1 Message Date
ShatteredMINT 70def24a5d remove non standard instructions do testing outside of repo 2026-08-30 18:25:13 +02:00
ShatteredMINT 8460c0ff47 add integer multiply 2026-08-30 18:24:53 +02:00
3 changed files with 19 additions and 12 deletions
+1 -11
View File
@@ -1,13 +1,3 @@
mov r1, 0
qcall clz
add zr, zr, zr
mov r1, 0x1
qcall clz
add zr, zr, zr
add r1, zr, 0xAAAA
lsl r1, r1, 6
qcall popc
pub rotate_left:
; (r1 >> r2) | (r1 << (32 - r2))
sub r3, zr, r2
@@ -79,4 +69,4 @@ pub popc:
lsr r2, r4, 16
add r4, r4, r2
and r1, r4, 0xFF ; mask out end result in lowest byte
jmp r13
jmp r13
+16
View File
@@ -0,0 +1,16 @@
pub mul_low:
mov r3, 0 ; result
mov r4, 31 ; loop counter
mull_loop:
asr r5, r2, 31
and r5, r5, r1
lsl r5, r5, r4
add r3, r3, r5
lsl r2, r2, 1
sub r4, r4, 1
cmp r4, 0
jge mull_loop
mov r1, r3
jmp r13
+2 -1
View File
@@ -27,4 +27,5 @@
; ===== TYPES =====
pub include bit
pub include bit
pub include imath