Joel Michael boosted Brian Swetland @swetland@chaos.social · activity timestamp 7 days ago Writing some tests... #compiler #assembler #projects #preprocessor Read more Read less alt #define TESTxLI(name, v) \ name: ;\ jal x31, @2 ;\ .word v ;\ ldw x20, (x31) ;\ li x21, v ;\ beq x20, x21, @2 ;\ j fail TESTxLI(li00, 0); TESTxLI(li01, 42); TESTxLI(li02, 0x80000000) TESTxLI(li03, 0xa7a5a3a1) TESTxLI(li04, 0x00008000) TESTxLI(li05, 0x12340000) TESTxLI(li06, 0x87654321) TESTxLI(li07, 0xffffffff) TESTxLI(li08, 0xfcffffff) #define TESTxLI(name, v) \ name: ;\ jal x31, @2 ;\ .word v ;\ ldw x20, (x31) ;\ li x21, v ;\ beq x20, x21, @2 ;\ j fail TESTxLI(li00, 0); TESTxLI(li01, 42); TESTxLI(li02, 0x80000000) TESTxLI(li03, 0xa7a5a3a1) TESTxLI(li04, 0x00008000) TESTxLI(li05, 0x12340000) TESTxLI(li06, 0x87654321) TESTxLI(li07, 0xffffffff) TESTxLI(li08, 0xfcffffff) Reply Boost Like More actions Copy link Flag this post Block
alt #define TESTxLI(name, v) \ name: ;\ jal x31, @2 ;\ .word v ;\ ldw x20, (x31) ;\ li x21, v ;\ beq x20, x21, @2 ;\ j fail TESTxLI(li00, 0); TESTxLI(li01, 42); TESTxLI(li02, 0x80000000) TESTxLI(li03, 0xa7a5a3a1) TESTxLI(li04, 0x00008000) TESTxLI(li05, 0x12340000) TESTxLI(li06, 0x87654321) TESTxLI(li07, 0xffffffff) TESTxLI(li08, 0xfcffffff) #define TESTxLI(name, v) \ name: ;\ jal x31, @2 ;\ .word v ;\ ldw x20, (x31) ;\ li x21, v ;\ beq x20, x21, @2 ;\ j fail TESTxLI(li00, 0); TESTxLI(li01, 42); TESTxLI(li02, 0x80000000) TESTxLI(li03, 0xa7a5a3a1) TESTxLI(li04, 0x00008000) TESTxLI(li05, 0x12340000) TESTxLI(li06, 0x87654321) TESTxLI(li07, 0xffffffff) TESTxLI(li08, 0xfcffffff)