aboutsummaryrefslogtreecommitdiffstats
path: root/riscV
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2022-08-24 19:06:46 +0200
committerXavier Leroy <xavier.leroy@college-de-france.fr>2022-09-03 10:38:50 +0200
commitad6467099ac7147040c59c022635e61370168568 (patch)
treeec78577bf5c8bb8c3f96c05f82648d439f52ceaf /riscV
parent6f26a95f2debe76e1350eea97c2162e5bcd8cfad (diff)
downloadcompcert-ad6467099ac7147040c59c022635e61370168568.tar.gz
compcert-ad6467099ac7147040c59c022635e61370168568.zip
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.
Diffstat (limited to 'riscV')
-rw-r--r--riscV/TargetPrinter.ml18
1 files changed, 2 insertions, 16 deletions
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 *)