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

TOMOYO Linux Cross Reference
Linux/arch/arm/nwfpe/fpa11.c

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/arm/nwfpe/fpa11.c (Version linux-6.12-rc7) and /arch/m68k/nwfpe/fpa11.c (Version linux-6.1.114)


** Warning: Cannot open xref database.

  1 // SPDX-License-Identifier: GPL-2.0-or-later        1 
  2 /*                                                
  3     NetWinder Floating Point Emulator             
  4     (c) Rebel.COM, 1998,1999                      
  5     (c) Philip Blundell, 2001                     
  6                                                   
  7     Direct questions, comments to Scott Bambro    
  8                                                   
  9 */                                                
 10                                                   
 11 #include "fpa11.h"                                
 12 #include "fpopcode.h"                             
 13                                                   
 14 #include "fpmodule.h"                             
 15 #include "fpmodule.inl"                           
 16                                                   
 17 #include <linux/compiler.h>                       
 18 #include <linux/string.h>                         
 19                                                   
 20 /* Reset the FPA11 chip.  Called to initialize    
 21 static void resetFPA11(void)                      
 22 {                                                 
 23         int i;                                    
 24         FPA11 *fpa11 = GET_FPA11();               
 25                                                   
 26         /* initialize the register type array     
 27         for (i = 0; i <= 7; i++) {                
 28                 fpa11->fType[i] = typeNone;       
 29         }                                         
 30                                                   
 31         /* FPSR: set system id to FP_EMULATOR,    
 32         fpa11->fpsr = FP_EMULATOR | BIT_AC;       
 33 }                                                 
 34                                                   
 35 int8 SetRoundingMode(const unsigned int opcode    
 36 {                                                 
 37         switch (opcode & MASK_ROUNDING_MODE) {    
 38         default:                                  
 39         case ROUND_TO_NEAREST:                    
 40                 return float_round_nearest_eve    
 41                                                   
 42         case ROUND_TO_PLUS_INFINITY:              
 43                 return float_round_up;            
 44                                                   
 45         case ROUND_TO_MINUS_INFINITY:             
 46                 return float_round_down;          
 47                                                   
 48         case ROUND_TO_ZERO:                       
 49                 return float_round_to_zero;       
 50         }                                         
 51 }                                                 
 52                                                   
 53 int8 SetRoundingPrecision(const unsigned int o    
 54 {                                                 
 55 #ifdef CONFIG_FPE_NWFPE_XP                        
 56         switch (opcode & MASK_ROUNDING_PRECISI    
 57         case ROUND_SINGLE:                        
 58                 return 32;                        
 59                                                   
 60         case ROUND_DOUBLE:                        
 61                 return 64;                        
 62                                                   
 63         case ROUND_EXTENDED:                      
 64                 return 80;                        
 65                                                   
 66         default:                                  
 67                 return 80;                        
 68         }                                         
 69 #endif                                            
 70         return 80;                                
 71 }                                                 
 72                                                   
 73 void nwfpe_init_fpa(union fp_state *fp)           
 74 {                                                 
 75         FPA11 *fpa11 = (FPA11 *)fp;               
 76 #ifdef NWFPE_DEBUG                                
 77         printk("NWFPE: setting up state.\n");     
 78 #endif                                            
 79         memset(fpa11, 0, sizeof(FPA11));          
 80         resetFPA11();                             
 81         fpa11->initflag = 1;                      
 82 }                                                 
 83                                                   
 84 /* Emulate the instruction in the opcode. */      
 85 unsigned int EmulateAll(unsigned int opcode)      
 86 {                                                 
 87         unsigned int code;                        
 88                                                   
 89 #ifdef NWFPE_DEBUG                                
 90         printk("NWFPE: emulating opcode %08x\n    
 91 #endif                                            
 92         code = opcode & 0x00000f00;               
 93         if (code == 0x00000100 || code == 0x00    
 94                 /* For coprocessor 1 or 2 (FPA    
 95                 code = opcode & 0x0e000000;       
 96                 if (code == 0x0e000000) {         
 97                         if (opcode & 0x0000001    
 98                                 /* Emulate con    
 99                                 /* Emulate reg    
100                                 /* Emulate com    
101                                 return Emulate    
102                         } else {                  
103                                 /* Emulate mon    
104                                 /* Emulate dya    
105                                 return Emulate    
106                         }                         
107                 } else if (code == 0x0c000000)    
108                         /* Emulate load/store     
109                         /* Emulate load/store     
110                         return EmulateCPDT(opc    
111                 }                                 
112         }                                         
113                                                   
114         /* Invalid instruction detected.  Retu    
115         return 0;                                 
116 }                                                 
117                                                   

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