From a34adc8e005447e7fa44ca3b71db35ceb7facb4c Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Fri, 24 Jun 2022 18:55:21 +0200 Subject: Expand "j_s symb" to "jump symb, x31" assembly pseudo-instruction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As suggested by Léo Gourdin in #437. The previous expansion as a plain "j" instruction fails when the jump offset is too large to be represented (issue #436). Fixes: #436 Closes: #437 --- riscV/TargetPrinter.ml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'riscV/TargetPrinter.ml') diff --git a/riscV/TargetPrinter.ml b/riscV/TargetPrinter.ml index d8137f84..366dc02e 100644 --- a/riscV/TargetPrinter.ml +++ b/riscV/TargetPrinter.ml @@ -315,12 +315,10 @@ module Target : TARGET = fprintf oc " sra %a, %a, %a\n" ireg rd ireg0 rs1 ireg0 rs2 (* Unconditional jumps. Links are always to X1/RA. *) - (* TODO: fix up arguments for calls to variadics, to move *) - (* floating point arguments to integer registers. How? *) | Pj_l(l) -> fprintf oc " j %a\n" print_label l | Pj_s(s, sg) -> - fprintf oc " j %a\n" symbol s + fprintf oc " jump %a, x31\n" symbol s | Pj_r(r, sg) -> fprintf oc " jr %a\n" ireg r | Pjal_s(s, sg) -> -- cgit