File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -1856,7 +1856,27 @@ impl State<'_> {
18561856 }
18571857}
18581858
1859- fn inflate_fast_help ( state : & mut State , _start : usize ) {
1859+ fn inflate_fast_help ( state : & mut State , start : usize ) {
1860+ #[ cfg( any( target_arch = "x86_64" , target_arch = "x86" ) ) ]
1861+ if crate :: cpu_features:: is_enabled_avx2 ( ) {
1862+ // SAFETY: we've verified the target features
1863+ return unsafe { inflate_fast_help_avx2 ( state, start) } ;
1864+ }
1865+
1866+ inflate_fast_help_vanilla ( state, start) ;
1867+ }
1868+
1869+ #[ target_feature( enable = "avx2" ) ]
1870+ unsafe fn inflate_fast_help_avx2 ( state : & mut State , start : usize ) {
1871+ inflate_fast_help_impl ( state, start) ;
1872+ }
1873+
1874+ fn inflate_fast_help_vanilla ( state : & mut State , start : usize ) {
1875+ inflate_fast_help_impl ( state, start) ;
1876+ }
1877+
1878+ #[ inline( always) ]
1879+ fn inflate_fast_help_impl ( state : & mut State , _start : usize ) {
18601880 let mut bit_reader = BitReader :: new ( & [ ] ) ;
18611881 core:: mem:: swap ( & mut bit_reader, & mut state. bit_reader ) ;
18621882
You can’t perform that action at this time.
0 commit comments