Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sh3/sh3 cksum128mod: Prepare jump address by 'mova'...



details:   https://anonhg.NetBSD.org/src/rev/aab8cf3aed0f
branches:  trunk
changeset: 1023608:aab8cf3aed0f
user:      rin <rin%NetBSD.org@localhost>
date:      Sat Sep 18 06:31:46 2021 +0000

description:
cksum128mod: Prepare jump address by 'mova', instead of 'mov.l'.

Since both this 'mova' and 'and #imm' above must be used against r0,
we need extra 'mov r0, r3'. However, this should still be good both for
sh3 and sh4:

- For sh3, 'mov.l' at odd half-word address is removed; pipeline hazard
  due to instruction fetch is resolved.

- For sh4, data cache line is no longer assigned for this 'mov.l'.

Also:

- Upcoming __PIC__ support (in order to avoid text relocations when built
  in tests/net/in_cksum) becomes simpler; no need CALL_DATUM_LOCAL() for
  cksum128_tail.

- Shave off 4 bytes from text.

No regression is observed for sh3 (hpcsh) and sh4 (landisk).

diffstat:

 sys/arch/sh3/sh3/cpu_in_cksum.S |  16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diffs (41 lines):

diff -r 51159cf19d98 -r aab8cf3aed0f sys/arch/sh3/sh3/cpu_in_cksum.S
--- a/sys/arch/sh3/sh3/cpu_in_cksum.S   Sat Sep 18 03:05:19 2021 +0000
+++ b/sys/arch/sh3/sh3/cpu_in_cksum.S   Sat Sep 18 06:31:46 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_in_cksum.S,v 1.5 2015/01/06 17:43:16 christos Exp $        */
+/*     $NetBSD: cpu_in_cksum.S,v 1.6 2021/09/18 06:31:46 rin Exp $     */
 
 /*-
  * Copyright (c) 2000 SHIMIZU Ryo <ryo%misakimix.org@localhost>
@@ -34,7 +34,7 @@
 #include <machine/asm.h>
 #include "assym.h"
 
-__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.5 2015/01/06 17:43:16 christos Exp $")
+__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.6 2021/09/18 06:31:46 rin Exp $")
 
 
 #define        reg_tmp0                r0
@@ -255,18 +255,14 @@
        mov     reg_mlen,reg_tmp0
        and     #124,reg_tmp0
        sub     reg_tmp0,reg_mlen
+       mov     reg_tmp0,reg_tmp3
 
-       mov.l   .L_cksum128_tail_p,reg_tmp3
-       sub     reg_tmp0,reg_tmp3
-       jmp     @reg_tmp3
+       mova    cksum128_tail,reg_tmp0
+       sub     reg_tmp3,reg_tmp0
+       jmp     @reg_tmp0
         clrt
 
        .align  2
-.L_cksum128_tail_p:
-       .long   cksum128_tail
-
-
-       .align  2
 cksum128:
        add     #-128,reg_mlen
        clrt



Home | Main Index | Thread Index | Old Index