diff options
author | Oneric <oneric@oneric.stub> | 2022-03-15 23:00:05 +0100 |
---|---|---|
committer | Oneric <oneric@oneric.stub> | 2022-03-27 22:28:59 +0200 |
commit | 725da4729b99c98ee94ffe49a253650450a64f4d (patch) | |
tree | da00de4821a99ca1ab0c8ccbf902ff3c91f54dac /test | |
parent | 9608c8c838e1046601c27f6473e23654fedf1716 (diff) | |
download | libass-725da4729b99c98ee94ffe49a253650450a64f4d.tar.bz2 libass-725da4729b99c98ee94ffe49a253650450a64f4d.tar.xz |
asm/x86: check if cpuid is available before usage
The cpuid instruction was only introduced after i486, meaning
there are ix86 CPUs on which our default configuration will
build but crash during runtime when cpuid is executed.
To avoid this, check for the instructions availability by
testing if bit 21 of EFLAGS is writable as documented by
AMD, Cyrix, Intel and NexGen.
AMD, p.165:
https://www.amd.com/system/files/TechDocs/24594.pdf
Cyrix, p.10:
https://www.ardent-tool.com/CPU/docs/Cyrix/MII/94329_2.pdf
Intel, ch.3 p.190:
https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
NexGen:
https://www.ardent-tool.com/CPU/docs/NexGen/cpuid.pdf
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions