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

TOMOYO Linux Cross Reference
Linux/arch/x86/math-emu/poly.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/x86/math-emu/poly.h (Version linux-6.12-rc7) and /arch/sparc/math-emu/poly.h (Version linux-4.15.18)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 /*--------------------------------------------    
  3  |  poly.h                                        
  4  |                                                
  5  |  Header file for the FPU-emu poly*.c source    
  6  |                                                
  7  | Copyright (C) 1994,1999                        
  8  |                       W. Metzenthen, 22 Par    
  9  |                       Australia.  E-mail       
 10  |                                                
 11  | Declarations and definitions for functions     
 12  | extended-significand) quantities.              
 13  |                                                
 14  +--------------------------------------------    
 15                                                   
 16 #ifndef _POLY_H                                   
 17 #define _POLY_H                                   
 18                                                   
 19 /* This 12-byte structure is used to improve t    
 20    of transcendental functions.                   
 21    Intended to be used to get results better t    
 22    allows. 9-byte would probably be sufficient    
 23    */                                             
 24 typedef struct {                                  
 25         unsigned long lsw;                        
 26         unsigned long midw;                       
 27         unsigned long msw;                        
 28 } Xsig;                                           
 29                                                   
 30 asmlinkage void mul64(unsigned long long const    
 31                       unsigned long long *resu    
 32 asmlinkage void polynomial_Xsig(Xsig *, const     
 33                                 const unsigned    
 34                                                   
 35 asmlinkage void mul32_Xsig(Xsig *, const unsig    
 36 asmlinkage void mul64_Xsig(Xsig *, const unsig    
 37 asmlinkage void mul_Xsig_Xsig(Xsig *dest, cons    
 38                                                   
 39 asmlinkage void shr_Xsig(Xsig *, const int n);    
 40 asmlinkage int round_Xsig(Xsig *);                
 41 asmlinkage int norm_Xsig(Xsig *);                 
 42 asmlinkage void div_Xsig(Xsig *x1, const Xsig     
 43                                                   
 44 /* Macro to extract the most significant 32 bi    
 45 #define LL_MSW(x)     (((unsigned long *)&x)[1    
 46                                                   
 47 /* Macro to initialize an Xsig struct */          
 48 #define MK_XSIG(a,b,c)     { c, b, a }            
 49                                                   
 50 /* Macro to access the 8 ms bytes of an Xsig a    
 51 #define XSIG_LL(x)         (*(unsigned long lo    
 52                                                   
 53 /*                                                
 54    Need to run gcc with optimizations on to ge    
 55    actually be in-line.                           
 56    */                                             
 57                                                   
 58 /* Multiply two fixed-point 32 bit numbers, pr    
 59    The answer is the ms word of the product. *    
 60 /* Some versions of gcc make it difficult to s    
 61    Merely specifying that it is used doesn't w    
 62  */                                               
 63 static inline unsigned long mul_32_32(const un    
 64                                       const un    
 65 {                                                 
 66         int retval;                               
 67         asm volatile ("mull %2; movl %%edx,%%e    
 68                       :""(arg1), "g"(arg2)        
 69                       :"dx");                     
 70         return retval;                            
 71 }                                                 
 72                                                   
 73 /* Add the 12 byte Xsig x2 to Xsig dest, with     
 74 static inline void add_Xsig_Xsig(Xsig *dest, c    
 75 {                                                 
 76         asm volatile ("movl %1,%%edi; movl %2,    
 77                       "movl (%%esi),%%eax; add    
 78                       "movl 4(%%esi),%%eax; ad    
 79                       "movl 8(%%esi),%%eax; ad    
 80                       (*dest):"g"(dest), "g"(x    
 81                       :"ax", "si", "di");         
 82 }                                                 
 83                                                   
 84 /* Add the 12 byte Xsig x2 to Xsig dest, adjus    
 85 /* Note: the constraints in the asm statement     
 86    with gcc 2.5.8.  Changing from using edi to    
 87    problem, but keep fingers crossed! */          
 88 static inline void add_two_Xsig(Xsig *dest, co    
 89 {                                                 
 90         asm volatile ("movl %2,%%ecx; movl %3,    
 91                       "movl (%%esi),%%eax; add    
 92                       "movl 4(%%esi),%%eax; ad    
 93                       "movl 8(%%esi),%%eax; ad    
 94                       "jnc 0f;\n"                 
 95                       "rcrl 8(%%ecx); rcrl 4(%    
 96                       "movl %4,%%ecx; incl (%%    
 97                       "movl $1,%%eax; jmp 1f;\    
 98                       "0: xorl %%eax,%%eax;\n"    
 99                       :"g"(dest), "g"(x2), "g"    
100                       :"cx", "si", "ax");         
101 }                                                 
102                                                   
103 /* Negate (subtract from 1.0) the 12 byte Xsig    
104 /* This is faster in a loop on my 386 than usi    
105 static inline void negate_Xsig(Xsig *x)           
106 {                                                 
107         asm volatile ("movl %1,%%esi;\n"          
108                       "xorl %%ecx,%%ecx;\n"       
109                       "movl %%ecx,%%eax; subl     
110                       "movl %%ecx,%%eax; sbbl     
111                       "movl %%ecx,%%eax; sbbl     
112                       (*x):"g"(x):"si", "ax",     
113 }                                                 
114                                                   
115 #endif /* _POLY_H */                              
116                                                   

~ [ 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