From ad6467099ac7147040c59c022635e61370168568 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Wed, 24 Aug 2022 19:06:46 +0200 Subject: Refactor emitting of constants. The function was the same for nearly all backends and also the way 32 bit literals are printed so we moved it to PrintAsm. The 64 bit literals however are still target specific. --- riscV/TargetPrinter.ml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'riscV') diff --git a/riscV/TargetPrinter.ml b/riscV/TargetPrinter.ml index f86664e9..52a6853a 100644 --- a/riscV/TargetPrinter.ml +++ b/riscV/TargetPrinter.ml @@ -132,22 +132,8 @@ module Target : TARGET = (* Associate labels to floating-point constants and to symbols. *) - let emit_constants oc lit = - if Hashtbl.length literal64_labels > 0 then begin - section oc (Sections.with_size 8 lit); - fprintf oc " .align 3\n"; - Hashtbl.iter - (fun bf lbl -> fprintf oc "%a: .quad 0x%Lx\n" label lbl bf) - literal64_labels - end; - if Hashtbl.length literal32_labels > 0 then begin - section oc (Sections.with_size 4 lit); - fprintf oc " .align 2\n"; - Hashtbl.iter - (fun bf lbl -> fprintf oc "%a: .long 0x%lx\n" label lbl bf) - literal32_labels - end; - reset_literals () + let print_literal64 oc n lbl = + fprintf oc "%a: .quad 0x%Lx\n" label lbl n (* Generate code to load the address of id + ofs in register r *) -- cgit