Subject: m68k/random.s
To: None <current-users@NetBSD.ORG>
From: Torsten Duwe (Emacs) <duwe@immd4.informatik.uni-erlangen.de>
List: current-users
Date: 01/15/1995 20:50:06
That file looks like the one in i386 with only the registers renamed. Here is
a more elegant version which runs slightly faster on the '030. Could you
people with 680{4,6}0s please try it and measure the speedup ?  Credits for
this code go to Michael Schr"oder (Umlaut in there) mlschroe@uni-erlangen.de

enjoy,
	Torsten

--- src/sys/arch/m68k/m68k/random.s	Wed Oct 26 08:51:16 1994
+++ ~mlschroe/random.s			Sun Jan 15 20:09:34 1995
@@ -49,18 +49,11 @@
 ENTRY(random)
 	movl	#16807, d0
 	mulsl	randseed, d1:d0
-	lsll	#1, d1
-	movl	d0, a0
-	roll	#1, d0
-	andil	#1, d0
-	orl	d0, d1
-	movl	a0, d0
-	andil	#0x7fffffff, d0
+	lsll	#1, d0
+	roxll	#2, d1
 	addl	d1, d0
-	bmi	L1
-	movl	d0, randseed
-	rts
-L1:
-	subil	#0x7fffffff, d0
+	moveql	#1, d1
+	addxl	d1, d0
+	lsrl	#1, d0
 	movl	d0, randseed
 	rts