Source-Changes-HG archive

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

[src/trunk]: src/sys/lib/libkern/arch/m68k Don't use %d2 (violates the ABI si...



details:   https://anonhg.NetBSD.org/src/rev/c44b7c2bf15b
branches:  trunk
changeset: 788688:c44b7c2bf15b
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Jul 18 12:16:40 2013 +0000

description:
Don't use %d2 (violates the ABI since it wasn't saved), use %a0 instead.
Use a pcrelative access for the local data avoiding the GOT.

diffstat:

 sys/lib/libkern/arch/m68k/random.S |  18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diffs (36 lines):

diff -r b8234022dc31 -r c44b7c2bf15b sys/lib/libkern/arch/m68k/random.S
--- a/sys/lib/libkern/arch/m68k/random.S        Thu Jul 18 12:15:15 2013 +0000
+++ b/sys/lib/libkern/arch/m68k/random.S        Thu Jul 18 12:16:40 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: random.S,v 1.4 2009/01/06 01:24:56 pooka Exp $ */
+/*     $NetBSD: random.S,v 1.5 2013/07/18 12:16:40 matt Exp $  */
 
 /*
  * Copyright (c) 1990,1993 The Regents of the University of California.
@@ -48,22 +48,14 @@
 
 ENTRY(random)
        movl    #16807, %d0
-#ifdef PIC
-       lea     %pc@(_GLOBAL_OFFSET_TABLE_@GOTPC), %a0
-       movl    _ASM_LABEL(randseed)@GOT(%a0), %d2
-       mulsl   (%d2), %d1:%d0
-#else
-       mulsl   _ASM_LABEL(randseed), %d1:%d0
-#endif
+       LEA_LCL(_ASM_LABEL(randseed),%a0)
+       mulsl   (%a0), %d1:%d0
        lsll    #1, %d0
        roxll   #2, %d1
        addl    %d1, %d0
        moveql  #1, %d1
        addxl   %d1, %d0
        lsrl    #1, %d0
-#ifdef PIC
-       movl    %d0, (%d2)
-#else
-       movl    %d0, _ASM_LABEL(randseed)
-#endif
+       movl    %d0, (%a0)
        rts
+END(random)



Home | Main Index | Thread Index | Old Index