summaryrefslogtreecommitdiff
path: root/common.sml
diff options
context:
space:
mode:
authorVladimir Azarov <avm@intermediate-node.net>2025-08-12 02:07:26 +0200
committerVladimir Azarov <avm@intermediate-node.net>2025-08-12 02:07:26 +0200
commit5d15afc926aeb38eb36676bb72d11022b2cda412 (patch)
tree9d291fa29003115c9878e849c9cb972a715ad41c /common.sml
parentaad6f4f80e3196b052e96176ff412ddb7ceb7ef6 (diff)
rbp register utilization by register allocator
Diffstat (limited to 'common.sml')
-rw-r--r--common.sml12
1 files changed, 11 insertions, 1 deletions
diff --git a/common.sml b/common.sml
index 5f4eaae..1c7ec29 100644
--- a/common.sml
+++ b/common.sml
@@ -194,7 +194,17 @@ fun bindWith2str to = bind A1 (fn v => fn (output, _) => output $ to v)
fun F z = bind A0 (fn (_, mf) => mf ()) z
-val I = fn z => bindWith2str Int.toString z
+val I = fn z =>
+let
+ fun f v out =
+ if v >= 0 then
+ Printf out `(Int.toString v) %
+ else
+ Printf out `"-" `(Int.toString $ ~v) %
+in
+ bind A1 f
+end z
+
fun i v out = Printf out I v %
val Ip = fn z =>