From e06fcb91abf5ec8403ccf03ba09a6e5ec7d11b8b Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 18 Jun 2023 21:33:53 +0200 Subject: Add automated tests --- snug-clean/src/MIPS/MIPS32.icl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'snug-clean/src/MIPS') diff --git a/snug-clean/src/MIPS/MIPS32.icl b/snug-clean/src/MIPS/MIPS32.icl index 655219d..e8053e3 100644 --- a/snug-clean/src/MIPS/MIPS32.icl +++ b/snug-clean/src/MIPS/MIPS32.icl @@ -153,13 +153,13 @@ checkOffset offset = abort ("offset " +++ toString offset +++ " out of bounds\n") checkImmediate :: !Signedness !Immediate -> Immediate -checkImmediate Signed (Immediate imm) +checkImmediate Signed i=:(Immediate imm) | 0 <= imm && imm <= 0x7fff - = Immediate imm + = i | imm >= -0x8000 - = Immediate (imm bitand 0xffff) + = i = abort ("signed immediate " +++ toString imm +++ " out of bounds\n") -checkImmediate Unsigned (Immediate imm) +checkImmediate Unsigned i=:(Immediate imm) | 0 <= imm && imm <= 0xffff - = Immediate imm + = i = abort ("unsigned immediate " +++ toString imm +++ " out of bounds\n") -- cgit v1.2.3