File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -1856,7 +1856,28 @@ impl State<'_> {
1856
1856
}
1857
1857
}
1858
1858
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
+ #[ cfg( any( target_arch = "x86_64" , target_arch = "x86" ) ) ]
1870
+ #[ target_feature( enable = "avx2" ) ]
1871
+ unsafe fn inflate_fast_help_avx2 ( state : & mut State , start : usize ) {
1872
+ inflate_fast_help_impl ( state, start) ;
1873
+ }
1874
+
1875
+ fn inflate_fast_help_vanilla ( state : & mut State , start : usize ) {
1876
+ inflate_fast_help_impl ( state, start) ;
1877
+ }
1878
+
1879
+ #[ inline( always) ]
1880
+ fn inflate_fast_help_impl ( state : & mut State , _start : usize ) {
1860
1881
let mut bit_reader = BitReader :: new ( & [ ] ) ;
1861
1882
core:: mem:: swap ( & mut bit_reader, & mut state. bit_reader ) ;
1862
1883
You can’t perform that action at this time.
0 commit comments