No need for a separate function here.
authorTaylor R Campbell <campbell@mumble.net>
Fri, 25 Jan 2019 04:35:12 +0000 (04:35 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Wed, 21 Aug 2019 21:34:06 +0000 (21:34 +0000)
src/microcode/cmpintmd/aarch64.c

index af2c6f3b5caed0a1a6574e667e612bcaae7797e2..2baebfe3d013d4f1a0739f095cd583ca851aa0af 100644 (file)
@@ -244,11 +244,26 @@ read_uuo_target_no_reloc (SCHEME_OBJECT * saddr)
   return (read_uuo_target (saddr));
 }
 
-static void
-write_uuo_insns (insn_t * target, insn_t * iaddr, int pcrel)
+void
+write_uuo_target (insn_t * target, SCHEME_OBJECT * saddr)
 {
-  /* ldr x1, pc-pcrel */
-  (iaddr[0]) = (0x58000001UL | ((((unsigned) pcrel) & 0x7ffff) << 5));
+  insn_t * iaddr;
+  int ioff;
+
+  /* Set the target.  */
+  (saddr[0]) = ((SCHEME_OBJECT) target);
+
+  /* Determine where the instructions start relative where we store the
+     target.  */
+#ifdef WORDS_BIGENDIAN
+  ioff = 2;
+#else
+  ioff = 3;
+#endif
+  iaddr = (((insn_t *) saddr) + ioff);
+
+  /* ldr x1, PC-ioff */
+  (iaddr[0]) = (0x58000001UL | ((((unsigned) ioff) & 0x7ffff) << 5));
 
   /* If the target PC is right after the target offset, then the PC
      requires no further relocation and we can jump to a fixed address.
@@ -305,23 +320,6 @@ write_uuo_insns (insn_t * target, insn_t * iaddr, int pcrel)
       (iaddr[4]) = 0xd61f0220UL; /* br x17 */
     }
 }
-
-void
-write_uuo_target (insn_t * target, SCHEME_OBJECT * saddr)
-{
-  insn_t * iaddr;
-  int ioff;
-
-#ifdef WORDS_BIGENDIAN
-  ioff = 2;
-#else
-  ioff = 3;
-#endif
-
-  (saddr[0]) = ((SCHEME_OBJECT) target);
-  iaddr = (((insn_t *) saddr) + ioff);
-  write_uuo_insns (target, iaddr, -ioff);
-}
 \f
 #define TRAMPOLINE_ENTRY_PADDING_SIZE 1
 #define OBJECTS_PER_TRAMPOLINE_ENTRY 4