Module Name: src
Committed By: rin
Date: Sat Sep 18 06:31:46 UTC 2021
Modified Files:
src/sys/arch/sh3/sh3: cpu_in_cksum.S
Log Message:
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).
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sh3/sh3/cpu_in_cksum.S
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sh3/sh3/cpu_in_cksum.S
diff -u src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.5 src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.6
--- src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.5 Tue Jan 6 17:43:16 2015
+++ src/sys/arch/sh3/sh3/cpu_in_cksum.S Sat Sep 18 06:31:46 2021
@@ -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 <[email protected]>
@@ -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 @@ cksum128mod:
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