Implement opt Q for fixed-point precision, and q literals (e.g. 12.34q8) (#958)

Fixes #957

Co-authored-by: ISSOtm <eldredhabert0@gmail.com>
This commit is contained in:
Rangi
2022-09-04 18:47:32 -04:00
committed by GitHub
parent 889302a9e2
commit 98a6dffbca
20 changed files with 253 additions and 56 deletions

18
test/asm/opt-Q.asm Normal file
View File

@@ -0,0 +1,18 @@
MACRO test
PUSHO
OPT Q\1
print STRFMT("Q%4s", "\1")
def n = 1.14159
println STRFMT(" -> %032b", n)
POPO
ENDM
for x, 1, 32
if x < 16
test .{d:x}
else
test {d:x}
endc
endr
test .0 ; error
test 32 ; error