This repository was archived by the owner on Jul 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Bug 1520760 - Fix AVX2 detection to ensure we have all required CPU parameters.
2+
3+ diff --git simd/i386/jsimdcpu.asm simd/i386/jsimdcpu.asm
4+ --- simd/i386/jsimdcpu.asm
5+ +++ simd/i386/jsimdcpu.asm
6+ @@ -87,8 +87,10 @@ EXTN(jpeg_simd_cpu_support):
7+ mov eax, 1
8+ xor ecx, ecx
9+ cpuid
10+ - test ecx, 1<<27
11+ + test ecx, 1<<26
12+ jz short .no_avx2 ; O/S does not support XSAVE
13+ + test ecx, 1<<27
14+ + jz short .no_avx2 ; O/S does not support OSXSAVE
15+ test ecx, 1<<28
16+ jz short .no_avx2 ; CPU does not support AVX2
17+
18+ diff --git simd/x86_64/jsimdcpu.asm simd/x86_64/jsimdcpu.asm
19+ --- simd/x86_64/jsimdcpu.asm
20+ +++ simd/x86_64/jsimdcpu.asm
21+ @@ -53,8 +53,10 @@ EXTN(jpeg_simd_cpu_support):
22+ mov rax, 1
23+ xor rcx, rcx
24+ cpuid
25+ - test rcx, 1<<27
26+ + test rcx, 1<<26
27+ jz short .return ; O/S does not support XSAVE
28+ + test rcx, 1<<27
29+ + jz short .return ; O/S does not support OSXSAVE
30+ test rcx, 1<<28
31+ jz short .return ; CPU does not support AVX2
32+
Original file line number Diff line number Diff line change @@ -87,8 +87,10 @@ EXTN(jpeg_simd_cpu_support):
8787 mov eax , 1
8888 xor ecx , ecx
8989 cpuid
90- test ecx , 1 << 27
90+ test ecx , 1 << 26
9191 jz short .no_avx2 ; O/S does not support XSAVE
92+ test ecx , 1 << 27
93+ jz short .no_avx2 ; O/S does not support OSXSAVE
9294 test ecx , 1 << 28
9395 jz short .no_avx2 ; CPU does not support AVX2
9496
Original file line number Diff line number Diff line change @@ -53,8 +53,10 @@ EXTN(jpeg_simd_cpu_support):
5353 mov rax , 1
5454 xor rcx , rcx
5555 cpuid
56- test rcx , 1 << 27
56+ test rcx , 1 << 26
5757 jz short .return ; O/S does not support XSAVE
58+ test rcx , 1 << 27
59+ jz short .return ; O/S does not support OSXSAVE
5860 test rcx , 1 << 28
5961 jz short .return ; CPU does not support AVX2
6062
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ tag=${2-HEAD}
1919cd $srcdir /libjpeg
2020cp win/jsimdcfg.inc simd/
2121
22- revert_files=" 1050342.diff assembly-tables.diff externalize-table.diff jconfig.h jconfigint.h jpeg_nbits_table.c moz.build MOZCHANGES mozilla.diff simd/jsimdcfg.inc"
22+ revert_files=" 1050342.diff assembly-tables.diff externalize-table.diff 1520760-avx2-detection.diff jconfig.h jconfigint.h jpeg_nbits_table.c moz.build MOZCHANGES mozilla.diff simd/jsimdcfg.inc"
2323if test -d ${topsrcdir} /.hg; then
2424 hg revert --no-backup $revert_files
2525elif test -d ${topsrcdir} /.git; then
@@ -30,3 +30,4 @@ patch -p0 -i mozilla.diff
3030patch -p0 -i 1050342.diff
3131patch -p3 -i externalize-table.diff
3232patch -p3 -i assembly-tables.diff
33+ patch -p0 -i 1520760-avx2-detection.diff
You can’t perform that action at this time.
0 commit comments