Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) |	scosh.sa 3.1 12/10/90
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) |	The entry point sCosh computes the hyperbolic cosine of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) |	an input argument; sCoshd does the same except for denormalized
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) |	input.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) |	Input: Double-extended number X in location pointed to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) |		by address register a0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) |	Output: The value cosh(X) returned in floating-point register Fp0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) |	Accuracy and Monotonicity: The returned result is within 3 ulps in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) |		64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) |		result is subsequently rounded to double precision. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) |		result is provably monotonic in double precision.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) |	Speed: The program sCOSH takes approximately 250 cycles.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) |	Algorithm:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) |	COSH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) |	1. If |X| > 16380 log2, go to 3.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) |	2. (|X| <= 16380 log2) Cosh(X) is obtained by the formulae
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) |		y = |X|, z = exp(Y), and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) |		cosh(X) = (1/2)*( z + 1/z ).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) |		Exit.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) |	3. (|X| > 16380 log2). If |X| > 16480 log2, go to 5.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) |	4. (16380 log2 < |X| <= 16480 log2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) |		cosh(X) = sign(X) * exp(|X|)/2.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) |		However, invoking exp(|X|) may cause premature overflow.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) |		Thus, we calculate sinh(X) as follows:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) |		Y	:= |X|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) |		Fact	:=	2**(16380)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) |		Y'	:= Y - 16381 log2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) |		cosh(X) := Fact * exp(Y').
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) |		Exit.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) |	5. (|X| > 16480 log2) sinh(X) must overflow. Return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) |		Huge*Huge to generate overflow and an infinity with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) |		the appropriate sign. Huge is the largest finite number in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) |		extended format. Exit.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) |		Copyright (C) Motorola, Inc. 1990
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) |			All Rights Reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) |       For details on the license for this file, please see the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) |       file, README, in this same directory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) |SCOSH	idnt	2,1 | Motorola 040 Floating Point Software Package
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	|section	8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	|xref	t_ovfl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	|xref	t_frcinx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	|xref	setox
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) T1:	.long 0x40C62D38,0xD3D64634 | ... 16381 LOG2 LEAD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) T2:	.long 0x3D6F90AE,0xB1E75CC7 | ... 16381 LOG2 TRAIL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) TWO16380: .long 0x7FFB0000,0x80000000,0x00000000,0x00000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	.global	scoshd
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) scoshd:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) |--COSH(X) = 1 FOR DENORMALIZED X
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	fmoves		#0x3F800000,%fp0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	fmovel		%d1,%FPCR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	fadds		#0x00800000,%fp0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	bra		t_frcinx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	.global	scosh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) scosh:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	fmovex		(%a0),%fp0	| ...LOAD INPUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	movel		(%a0),%d0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	movew		4(%a0),%d0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	andil		#0x7FFFFFFF,%d0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	cmpil		#0x400CB167,%d0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	bgts		COSHBIG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) |--THIS IS THE USUAL CASE, |X| < 16380 LOG2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) |--COSH(X) = (1/2) * ( EXP(X) + 1/EXP(X) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	fabsx		%fp0		| ...|X|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	movel		%d1,-(%sp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	clrl		%d1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	fmovemx	%fp0-%fp0,(%a0)	|pass parameter to setox
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	bsr		setox		| ...FP0 IS EXP(|X|)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	fmuls		#0x3F000000,%fp0	| ...(1/2)EXP(|X|)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	movel		(%sp)+,%d1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	fmoves		#0x3E800000,%fp1	| ...(1/4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	fdivx		%fp0,%fp1		| ...1/(2 EXP(|X|))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	fmovel		%d1,%FPCR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	faddx		%fp1,%fp0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	bra		t_frcinx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) COSHBIG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	cmpil		#0x400CB2B3,%d0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	bgts		COSHHUGE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	fabsx		%fp0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	fsubd		T1(%pc),%fp0		| ...(|X|-16381LOG2_LEAD)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	fsubd		T2(%pc),%fp0		| ...|X| - 16381 LOG2, ACCURATE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	movel		%d1,-(%sp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	clrl		%d1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	fmovemx	%fp0-%fp0,(%a0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	bsr		setox
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	fmovel		(%sp)+,%fpcr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	fmulx		TWO16380(%pc),%fp0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	bra		t_frcinx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) COSHHUGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	fmovel		#0,%fpsr		|clr N bit if set by source
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	bclrb		#7,(%a0)		|always return positive value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	fmovemx	(%a0),%fp0-%fp0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	bra		t_ovfl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	|end