fpu.S (4b4193256c8d3bc3a5397b5cd9494c2ad386317d) fpu.S (2da37761671b5bdedbe04e6469cfa57cd6b6ae45)
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * FPU helper code to use FPU operations from inside the kernel
4 *
5 * Copyright (C) 2010 Alexander Graf (agraf@suse.de)
6 */
7
8#include <linux/pgtable.h>
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * FPU helper code to use FPU operations from inside the kernel
4 *
5 * Copyright (C) 2010 Alexander Graf (agraf@suse.de)
6 */
7
8#include <linux/pgtable.h>
9#include <linux/linkage.h>
10
9#include <asm/reg.h>
10#include <asm/page.h>
11#include <asm/mmu.h>
12#include <asm/cputable.h>
13#include <asm/cache.h>
14#include <asm/thread_info.h>
15#include <asm/ppc_asm.h>
16#include <asm/asm-offsets.h>

--- 88 unchanged lines hidden (view full) ---

105 * R3 = (double*)&fpscr
106 * R4 = (u32*)&cr
107 * R5 = (double*)&result
108 * R6 = (double*)&param1
109 * R7 = (double*)&param2 [load_two]
110 * R8 = (double*)&param3 [load_three]
111 * LR = instruction call function
112 */
11#include <asm/reg.h>
12#include <asm/page.h>
13#include <asm/mmu.h>
14#include <asm/cputable.h>
15#include <asm/cache.h>
16#include <asm/thread_info.h>
17#include <asm/ppc_asm.h>
18#include <asm/asm-offsets.h>

--- 88 unchanged lines hidden (view full) ---

107 * R3 = (double*)&fpscr
108 * R4 = (u32*)&cr
109 * R5 = (double*)&result
110 * R6 = (double*)&param1
111 * R7 = (double*)&param2 [load_two]
112 * R8 = (double*)&param3 [load_three]
113 * LR = instruction call function
114 */
113fpd_load_three:
115SYM_FUNC_START_LOCAL(fpd_load_three)
114 lfd 2,0(r8) /* load param3 */
116 lfd 2,0(r8) /* load param3 */
115fpd_load_two:
117SYM_FUNC_START_LOCAL(fpd_load_two)
116 lfd 1,0(r7) /* load param2 */
118 lfd 1,0(r7) /* load param2 */
117fpd_load_one:
119SYM_FUNC_START_LOCAL(fpd_load_one)
118 lfd 0,0(r6) /* load param1 */
120 lfd 0,0(r6) /* load param1 */
119fpd_load_none:
121SYM_FUNC_START_LOCAL(fpd_load_none)
120 lfd 3,0(r3) /* load up fpscr value */
121 MTFSF_L(3)
122 lwz r6, 0(r4) /* load cr */
123 mtcr r6
124 blr
122 lfd 3,0(r3) /* load up fpscr value */
123 MTFSF_L(3)
124 lwz r6, 0(r4) /* load cr */
125 mtcr r6
126 blr
127SYM_FUNC_END(fpd_load_none)
128SYM_FUNC_END(fpd_load_one)
129SYM_FUNC_END(fpd_load_two)
130SYM_FUNC_END(fpd_load_three)
125
126/*
127 * End of double instruction processing
128 *
129 * R3 = (double*)&fpscr
130 * R4 = (u32*)&cr
131 * R5 = (double*)&result
132 * LR = caller of instruction call function
133 */
131
132/*
133 * End of double instruction processing
134 *
135 * R3 = (double*)&fpscr
136 * R4 = (u32*)&cr
137 * R5 = (double*)&result
138 * LR = caller of instruction call function
139 */
134fpd_return:
140SYM_FUNC_START_LOCAL(fpd_return)
135 mfcr r6
136 stfd 0,0(r5) /* save result */
137 mffs 0
138 stfd 0,0(r3) /* save new fpscr value */
139 stw r6,0(r4) /* save new cr value */
140 blr
141 mfcr r6
142 stfd 0,0(r5) /* save result */
143 mffs 0
144 stfd 0,0(r3) /* save new fpscr value */
145 stw r6,0(r4) /* save new cr value */
146 blr
147SYM_FUNC_END(fpd_return)
141
142/*
143 * Double operation with no input operand
144 *
145 * R3 = (double*)&fpscr
146 * R4 = (u32*)&cr
147 * R5 = (double*)&result
148 */

--- 130 unchanged lines hidden ---
148
149/*
150 * Double operation with no input operand
151 *
152 * R3 = (double*)&fpscr
153 * R4 = (u32*)&cr
154 * R5 = (double*)&result
155 */

--- 130 unchanged lines hidden ---