From 5d15afc926aeb38eb36676bb72d11022b2cda412 Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 12 Aug 2025 02:07:26 +0200 Subject: rbp register utilization by register allocator --- common.sml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'common.sml') 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 => -- cgit v1.2.3