~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/x86/math-emu/fpu_arith.c

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 /*---------------------------------------------------------------------------+
  3  |  fpu_arith.c                                                              |
  4  |                                                                           |
  5  | Code to implement the FPU register/register arithmetic instructions       |
  6  |                                                                           |
  7  | Copyright (C) 1992,1993,1997                                              |
  8  |                  W. Metzenthen, 22 Parker St, Ormond, Vic 3163, Australia |
  9  |                  E-mail   billm@suburbia.net                              |
 10  |                                                                           |
 11  |                                                                           |
 12  +---------------------------------------------------------------------------*/
 13 
 14 #include "fpu_system.h"
 15 #include "fpu_emu.h"
 16 #include "control_w.h"
 17 #include "status_w.h"
 18 
 19 void fadd__(void)
 20 {
 21         /* fadd st,st(i) */
 22         int i = FPU_rm;
 23         clear_C1();
 24         FPU_add(&st(i), FPU_gettagi(i), 0, control_word);
 25 }
 26 
 27 void fmul__(void)
 28 {
 29         /* fmul st,st(i) */
 30         int i = FPU_rm;
 31         clear_C1();
 32         FPU_mul(&st(i), FPU_gettagi(i), 0, control_word);
 33 }
 34 
 35 void fsub__(void)
 36 {
 37         /* fsub st,st(i) */
 38         clear_C1();
 39         FPU_sub(0, FPU_rm, control_word);
 40 }
 41 
 42 void fsubr_(void)
 43 {
 44         /* fsubr st,st(i) */
 45         clear_C1();
 46         FPU_sub(REV, FPU_rm, control_word);
 47 }
 48 
 49 void fdiv__(void)
 50 {
 51         /* fdiv st,st(i) */
 52         clear_C1();
 53         FPU_div(0, FPU_rm, control_word);
 54 }
 55 
 56 void fdivr_(void)
 57 {
 58         /* fdivr st,st(i) */
 59         clear_C1();
 60         FPU_div(REV, FPU_rm, control_word);
 61 }
 62 
 63 void fadd_i(void)
 64 {
 65         /* fadd st(i),st */
 66         int i = FPU_rm;
 67         clear_C1();
 68         FPU_add(&st(i), FPU_gettagi(i), i, control_word);
 69 }
 70 
 71 void fmul_i(void)
 72 {
 73         /* fmul st(i),st */
 74         clear_C1();
 75         FPU_mul(&st(0), FPU_gettag0(), FPU_rm, control_word);
 76 }
 77 
 78 void fsubri(void)
 79 {
 80         /* fsubr st(i),st */
 81         clear_C1();
 82         FPU_sub(DEST_RM, FPU_rm, control_word);
 83 }
 84 
 85 void fsub_i(void)
 86 {
 87         /* fsub st(i),st */
 88         clear_C1();
 89         FPU_sub(REV | DEST_RM, FPU_rm, control_word);
 90 }
 91 
 92 void fdivri(void)
 93 {
 94         /* fdivr st(i),st */
 95         clear_C1();
 96         FPU_div(DEST_RM, FPU_rm, control_word);
 97 }
 98 
 99 void fdiv_i(void)
100 {
101         /* fdiv st(i),st */
102         clear_C1();
103         FPU_div(REV | DEST_RM, FPU_rm, control_word);
104 }
105 
106 void faddp_(void)
107 {
108         /* faddp st(i),st */
109         int i = FPU_rm;
110         clear_C1();
111         if (FPU_add(&st(i), FPU_gettagi(i), i, control_word) >= 0)
112                 FPU_pop();
113 }
114 
115 void fmulp_(void)
116 {
117         /* fmulp st(i),st */
118         clear_C1();
119         if (FPU_mul(&st(0), FPU_gettag0(), FPU_rm, control_word) >= 0)
120                 FPU_pop();
121 }
122 
123 void fsubrp(void)
124 {
125         /* fsubrp st(i),st */
126         clear_C1();
127         if (FPU_sub(DEST_RM, FPU_rm, control_word) >= 0)
128                 FPU_pop();
129 }
130 
131 void fsubp_(void)
132 {
133         /* fsubp st(i),st */
134         clear_C1();
135         if (FPU_sub(REV | DEST_RM, FPU_rm, control_word) >= 0)
136                 FPU_pop();
137 }
138 
139 void fdivrp(void)
140 {
141         /* fdivrp st(i),st */
142         clear_C1();
143         if (FPU_div(DEST_RM, FPU_rm, control_word) >= 0)
144                 FPU_pop();
145 }
146 
147 void fdivp_(void)
148 {
149         /* fdivp st(i),st */
150         clear_C1();
151         if (FPU_div(REV | DEST_RM, FPU_rm, control_word) >= 0)
152                 FPU_pop();
153 }
154 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php