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) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *  FPU helper code to use FPU operations from inside the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *    Copyright (C) 2010 Alexander Graf (agraf@suse.de)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <linux/pgtable.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <asm/reg.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <asm/page.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <asm/mmu.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <asm/cputable.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <asm/cache.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <asm/thread_info.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <asm/ppc_asm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <asm/asm-offsets.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) /* Instructions operating on single parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * Single operation with one input operand
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  * R3 = (double*)&fpscr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  * R4 = (short*)&result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  * R5 = (short*)&param1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #define FPS_ONE_IN(name) 					\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) _GLOBAL(fps_ ## name);							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	lfd	0,0(r3);		/* load up fpscr value */	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	MTFSF_L(0);							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	lfs	0,0(r5);						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 									\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	name	0,0;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 									\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	stfs	0,0(r4);						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	mffs	0;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	stfd	0,0(r3);	/* save new fpscr value */	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	blr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)  * Single operation with two input operands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  * R3 = (double*)&fpscr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  * R4 = (short*)&result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  * R5 = (short*)&param1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)  * R6 = (short*)&param2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) #define FPS_TWO_IN(name) 					\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) _GLOBAL(fps_ ## name);							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	lfd	0,0(r3);		/* load up fpscr value */	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	MTFSF_L(0);							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	lfs	0,0(r5);						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	lfs	1,0(r6);						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 									\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	name	0,0,1;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 									\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	stfs	0,0(r4);						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	mffs	0;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	stfd	0,0(r3);		/* save new fpscr value */	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	blr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63)  * Single operation with three input operands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65)  * R3 = (double*)&fpscr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66)  * R4 = (short*)&result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67)  * R5 = (short*)&param1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)  * R6 = (short*)&param2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69)  * R7 = (short*)&param3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) #define FPS_THREE_IN(name) 					\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) _GLOBAL(fps_ ## name);							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	lfd	0,0(r3);		/* load up fpscr value */	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	MTFSF_L(0);							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	lfs	0,0(r5);						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	lfs	1,0(r6);						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	lfs	2,0(r7);						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 									\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	name	0,0,1,2;						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 									\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	stfs	0,0(r4);						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	mffs	0;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	stfd	0,0(r3);		/* save new fpscr value */	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	blr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) FPS_ONE_IN(fres)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) FPS_ONE_IN(frsqrte)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) FPS_ONE_IN(fsqrts)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) FPS_TWO_IN(fadds)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) FPS_TWO_IN(fdivs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) FPS_TWO_IN(fmuls)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) FPS_TWO_IN(fsubs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) FPS_THREE_IN(fmadds)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) FPS_THREE_IN(fmsubs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) FPS_THREE_IN(fnmadds)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) FPS_THREE_IN(fnmsubs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) FPS_THREE_IN(fsel)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) /* Instructions operating on double parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)  * Beginning of double instruction processing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)  * R3 = (double*)&fpscr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)  * R4 = (u32*)&cr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)  * R5 = (double*)&result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)  * R6 = (double*)&param1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)  * R7 = (double*)&param2 [load_two]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)  * R8 = (double*)&param3 [load_three]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)  * LR = instruction call function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) fpd_load_three:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	lfd	2,0(r8)			/* load param3 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) fpd_load_two:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	lfd	1,0(r7)			/* load param2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) fpd_load_one:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	lfd	0,0(r6)			/* load param1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) fpd_load_none:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	lfd	3,0(r3)			/* load up fpscr value */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	MTFSF_L(3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	lwz	r6, 0(r4)		/* load cr */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	mtcr	r6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	blr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)  * End of double instruction processing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)  * R3 = (double*)&fpscr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)  * R4 = (u32*)&cr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)  * R5 = (double*)&result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)  * LR = caller of instruction call function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) fpd_return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	mfcr	r6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	stfd	0,0(r5)			/* save result */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	mffs	0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	stfd	0,0(r3)			/* save new fpscr value */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	stw	r6,0(r4)		/* save new cr value */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	blr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)  * Double operation with no input operand
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)  * R3 = (double*)&fpscr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)  * R4 = (u32*)&cr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)  * R5 = (double*)&result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) #define FPD_NONE_IN(name) 						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) _GLOBAL(fpd_ ## name);							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	mflr	r12;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	bl	fpd_load_none;						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	mtlr	r12;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 									\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	name.	0;			/* call instruction */		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	b	fpd_return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)  * Double operation with one input operand
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)  * R3 = (double*)&fpscr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)  * R4 = (u32*)&cr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)  * R5 = (double*)&result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)  * R6 = (double*)&param1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) #define FPD_ONE_IN(name) 						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) _GLOBAL(fpd_ ## name);							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	mflr	r12;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	bl	fpd_load_one;						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	mtlr	r12;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 									\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	name.	0,0;			/* call instruction */		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	b	fpd_return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)  * Double operation with two input operands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)  * R3 = (double*)&fpscr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)  * R4 = (u32*)&cr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)  * R5 = (double*)&result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)  * R6 = (double*)&param1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)  * R7 = (double*)&param2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)  * R8 = (double*)&param3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) #define FPD_TWO_IN(name) 						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) _GLOBAL(fpd_ ## name);							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	mflr	r12;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	bl	fpd_load_two;						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	mtlr	r12;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 									\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	name.	0,0,1;			/* call instruction */		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	b	fpd_return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)  * CR Double operation with two input operands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)  * R3 = (double*)&fpscr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)  * R4 = (u32*)&cr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)  * R5 = (double*)&param1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)  * R6 = (double*)&param2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)  * R7 = (double*)&param3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) #define FPD_TWO_IN_CR(name)						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) _GLOBAL(fpd_ ## name);							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	lfd	1,0(r6);		/* load param2 */		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	lfd	0,0(r5);		/* load param1 */		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	lfd	3,0(r3);		/* load up fpscr value */	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	MTFSF_L(3);							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	lwz	r6, 0(r4);		/* load cr */			\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	mtcr	r6;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 									\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	name	0,0,1;			/* call instruction */		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	mfcr	r6;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	mffs	0;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	stfd	0,0(r3);		/* save new fpscr value */	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	stw	r6,0(r4);		/* save new cr value */		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	blr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)  * Double operation with three input operands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)  * R3 = (double*)&fpscr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)  * R4 = (u32*)&cr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)  * R5 = (double*)&result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)  * R6 = (double*)&param1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)  * R7 = (double*)&param2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)  * R8 = (double*)&param3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) #define FPD_THREE_IN(name) 						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) _GLOBAL(fpd_ ## name);							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	mflr	r12;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	bl	fpd_load_three;						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	mtlr	r12;							\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 									\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	name.	0,0,1,2;		/* call instruction */		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	b	fpd_return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) FPD_ONE_IN(fsqrts)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) FPD_ONE_IN(frsqrtes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) FPD_ONE_IN(fres)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) FPD_ONE_IN(frsp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) FPD_ONE_IN(fctiw)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) FPD_ONE_IN(fctiwz)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) FPD_ONE_IN(fsqrt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) FPD_ONE_IN(fre)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) FPD_ONE_IN(frsqrte)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) FPD_ONE_IN(fneg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) FPD_ONE_IN(fabs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) FPD_TWO_IN(fadds)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) FPD_TWO_IN(fsubs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) FPD_TWO_IN(fdivs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) FPD_TWO_IN(fmuls)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) FPD_TWO_IN_CR(fcmpu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) FPD_TWO_IN(fcpsgn)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) FPD_TWO_IN(fdiv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) FPD_TWO_IN(fadd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) FPD_TWO_IN(fmul)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) FPD_TWO_IN_CR(fcmpo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) FPD_TWO_IN(fsub)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) FPD_THREE_IN(fmsubs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) FPD_THREE_IN(fmadds)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) FPD_THREE_IN(fnmsubs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) FPD_THREE_IN(fnmadds)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) FPD_THREE_IN(fsel)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) FPD_THREE_IN(fmsub)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) FPD_THREE_IN(fmadd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) FPD_THREE_IN(fnmsub)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) FPD_THREE_IN(fnmadd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) _GLOBAL(kvm_cvt_fd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 	lfs	0,0(r3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 	stfd	0,0(r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 	blr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) _GLOBAL(kvm_cvt_df)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 	lfd	0,0(r3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 	stfs	0,0(r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 	blr