From 031dd9d93104468c7681ce3c72b1a3d1d33f6dea Mon Sep 17 00:00:00 2001 From: Zihao Yu Date: Mon, 19 Feb 2024 12:48:06 +0800 Subject: [PATCH] riscv,*.S: use pesudo instruction call * let the linker perform relaxation --- am/src/riscv/nemu/start.S | 2 +- am/src/riscv/nemu/trap.S | 2 +- am/src/riscv/npc/libgcc/div.S | 12 ++++++------ am/src/riscv/npc/start.S | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/am/src/riscv/nemu/start.S b/am/src/riscv/nemu/start.S index 635289b..87457a8 100644 --- a/am/src/riscv/nemu/start.S +++ b/am/src/riscv/nemu/start.S @@ -5,6 +5,6 @@ _start: mv s0, zero la sp, _stack_pointer - jal _trm_init + call _trm_init .size _start, . - _start diff --git a/am/src/riscv/nemu/trap.S b/am/src/riscv/nemu/trap.S index 05d4957..7202d89 100644 --- a/am/src/riscv/nemu/trap.S +++ b/am/src/riscv/nemu/trap.S @@ -58,7 +58,7 @@ __am_asm_trap: csrw mstatus, t1 mv a0, sp - jal __am_irq_handle + call __am_irq_handle LOAD t1, OFFSET_STATUS(sp) LOAD t2, OFFSET_EPC(sp) diff --git a/am/src/riscv/npc/libgcc/div.S b/am/src/riscv/npc/libgcc/div.S index d941a90..3838ee6 100644 --- a/am/src/riscv/npc/libgcc/div.S +++ b/am/src/riscv/npc/libgcc/div.S @@ -40,7 +40,7 @@ FUNC_BEGIN (__udivsi3) sll a0, a0, 32 sll a1, a1, 32 move t0, ra - jal HIDDEN_JUMPTARGET(__udivdi3) + call HIDDEN_JUMPTARGET(__udivdi3) sext.w a0, a0 jr t0 FUNC_END (__udivsi3) @@ -52,7 +52,7 @@ FUNC_BEGIN (__umodsi3) srl a0, a0, 32 srl a1, a1, 32 move t0, ra - jal HIDDEN_JUMPTARGET(__udivdi3) + call HIDDEN_JUMPTARGET(__udivdi3) sext.w a0, a1 jr t0 FUNC_END (__umodsi3) @@ -100,7 +100,7 @@ HIDDEN_DEF (__udivdi3) FUNC_BEGIN (__umoddi3) /* Call __udivdi3(a0, a1), then return the remainder, which is in a1. */ move t0, ra - jal HIDDEN_JUMPTARGET(__udivdi3) + call HIDDEN_JUMPTARGET(__udivdi3) move a0, a1 jr t0 FUNC_END (__umoddi3) @@ -117,7 +117,7 @@ FUNC_END (__umoddi3) neg a1, a1 .L12: move t0, ra - jal HIDDEN_JUMPTARGET(__udivdi3) + call HIDDEN_JUMPTARGET(__udivdi3) neg a0, a0 jr t0 FUNC_END (__divdi3) @@ -127,7 +127,7 @@ FUNC_BEGIN (__moddi3) bltz a1, .L31 bltz a0, .L32 .L30: - jal HIDDEN_JUMPTARGET(__udivdi3) /* The dividend is not negative. */ + call HIDDEN_JUMPTARGET(__udivdi3) /* The dividend is not negative. */ move a0, a1 jr t0 .L31: @@ -135,7 +135,7 @@ FUNC_BEGIN (__moddi3) bgez a0, .L30 .L32: neg a0, a0 - jal HIDDEN_JUMPTARGET(__udivdi3) /* The dividend is hella negative. */ + call HIDDEN_JUMPTARGET(__udivdi3) /* The dividend is hella negative. */ neg a0, a1 jr t0 FUNC_END (__moddi3) diff --git a/am/src/riscv/npc/start.S b/am/src/riscv/npc/start.S index 3e56e5c..78ed49b 100644 --- a/am/src/riscv/npc/start.S +++ b/am/src/riscv/npc/start.S @@ -5,4 +5,4 @@ _start: mv s0, zero la sp, _stack_pointer - jal _trm_init + call _trm_init