1 /* NG4fls.S: SPARC optimized fls and __fls for 1 /* NG4fls.S: SPARC optimized fls and __fls for T4 and above. 2 * 2 * 3 * Copyright (c) 2017, Oracle and/or its affil 3 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 4 */ 4 */ 5 5 6 #include <linux/linkage.h> 6 #include <linux/linkage.h> 7 7 8 #define LZCNT_O0_G2 \ 8 #define LZCNT_O0_G2 \ 9 .word 0x85b002e8 9 .word 0x85b002e8 10 10 11 .text 11 .text 12 .register %g2, #scratch 12 .register %g2, #scratch 13 .register %g3, #scratch 13 .register %g3, #scratch 14 14 15 ENTRY(NG4fls) 15 ENTRY(NG4fls) 16 LZCNT_O0_G2 !lzcnt %o0, %g2 16 LZCNT_O0_G2 !lzcnt %o0, %g2 17 mov 64, %g3 17 mov 64, %g3 18 retl 18 retl 19 sub %g3, %g2, %o0 19 sub %g3, %g2, %o0 20 ENDPROC(NG4fls) 20 ENDPROC(NG4fls) 21 21 22 ENTRY(__NG4fls) 22 ENTRY(__NG4fls) 23 brz,pn %o0, 1f 23 brz,pn %o0, 1f 24 LZCNT_O0_G2 !lzcnt %o0, %g2 24 LZCNT_O0_G2 !lzcnt %o0, %g2 25 mov 63, %g3 25 mov 63, %g3 26 sub %g3, %g2, %o0 26 sub %g3, %g2, %o0 27 1: 27 1: 28 retl 28 retl 29 nop 29 nop 30 ENDPROC(__NG4fls) 30 ENDPROC(__NG4fls)
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.