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

TOMOYO Linux Cross Reference
Linux/arch/alpha/lib/strrchr.S

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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 ] ~

Diff markup

Differences between /arch/alpha/lib/strrchr.S (Version linux-6.11.5) and /arch/ppc/lib/strrchr.S (Version linux-5.17.15)


  1 /* SPDX-License-Identifier: GPL-2.0 */            
  2 /*                                                
  3  * arch/alpha/lib/strrchr.S                       
  4  * Contributed by Richard Henderson (rth@tamu.    
  5  *                                                
  6  * Return the address of the last occurrence o    
  7  * within a null-terminated string, or null if    
  8  */                                               
  9 #include <linux/export.h>                         
 10 #include <asm/regdef.h>                           
 11                                                   
 12         .set noreorder                            
 13         .set noat                                 
 14                                                   
 15         .align 3                                  
 16         .ent strrchr                              
 17         .globl strrchr                            
 18 strrchr:                                          
 19         .frame sp, 0, ra                          
 20         .prologue 0                               
 21                                                   
 22         zapnot  a1, 1, a1       # e0    : zero    
 23         mov     zero, t6        # .. e1 : t6 i    
 24         sll     a1, 8, t5       # e0    : repl    
 25         mov     zero, t8        # .. e1 : t8 i    
 26         or      t5, a1, a1      # e0    :         
 27         ldq_u   t0, 0(a0)       # .. e1 : load    
 28         sll     a1, 16, t5      # e0    :         
 29         andnot  a0, 7, v0       # .. e1 : alig    
 30         or      t5, a1, a1      # e0    :         
 31         lda     t4, -1          # .. e1 : buil    
 32         sll     a1, 32, t5      # e0    :         
 33         cmpbge  zero, t0, t1    # .. e1 : bits    
 34         mskqh   t4, a0, t4      # e0    :         
 35         or      t5, a1, a1      # .. e1 : char    
 36         xor     t0, a1, t2      # e0    : make    
 37         cmpbge  zero, t4, t4    # .. e1 : bits    
 38         cmpbge  zero, t2, t3    # e0    : bits    
 39         andnot  t1, t4, t1      # .. e1 : clea    
 40         andnot  t3, t4, t3      # e0    : clea    
 41         bne     t1, $eos        # .. e1 : did     
 42                                                   
 43         /* Character search main loop */          
 44 $loop:                                            
 45         ldq     t0, 8(v0)       # e0    : load    
 46         cmovne  t3, v0, t6      # .. e1 : save    
 47         cmovne  t3, t3, t8      # e0    :         
 48         addq    v0, 8, v0       # .. e1 :         
 49         xor     t0, a1, t2      # e0    :         
 50         cmpbge  zero, t0, t1    # .. e1 : bits    
 51         cmpbge  zero, t2, t3    # e0    : bits    
 52         beq     t1, $loop       # .. e1 : if w    
 53                                                   
 54         /* Mask out character matches after te    
 55 $eos:                                             
 56         negq    t1, t4          # e0    : isol    
 57         and     t1, t4, t4      # e1    :         
 58         subq    t4, 1, t5       # e0    : buil    
 59         or      t4, t5, t4      # e1    : ...     
 60                                                   
 61         and     t3, t4, t3      # e0    : mask    
 62         cmovne  t3, t3, t8      # .. e1 : save    
 63         cmovne  t3, v0, t6      # e0    :         
 64                                                   
 65         /* Locate the address of the last matc    
 66                                                   
 67         /* Retain the early exit for the ev4 -    
 68            is 5 cycles -- the same as just fal    
 69         beq     t8, $retnull    # .. e1 :         
 70                                                   
 71         and     t8, 0xf0, t2    # e0    : bina    
 72         cmovne  t2, t2, t8      # .. e1 (zdb)     
 73         cmovne  t2, 4, t2       # e0    :         
 74         and     t8, 0xcc, t1    # .. e1 :         
 75         cmovne  t1, t1, t8      # e0    :         
 76         cmovne  t1, 2, t1       # .. e1 :         
 77         and     t8, 0xaa, t0    # e0    :         
 78         cmovne  t0, 1, t0       # .. e1 (zdb)     
 79         addq    t2, t1, t1      # e0    :         
 80         addq    t6, t0, v0      # .. e1 : add     
 81         addq    v0, t1, v0      # e0    :         
 82         ret                     # .. e1 :         
 83                                                   
 84 $retnull:                                         
 85         mov     zero, v0        # e0    :         
 86         ret                     # .. e1 :         
 87                                                   
 88         .end strrchr                              
 89         EXPORT_SYMBOL(strrchr)                    
                                                      

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