Added ecx in clobber list of instruction cpuid. #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From the x86_64 specification Vol. 2A 3-191, instruction cpuid will override register ecx when eax=01h, but in the source code of
source/blender/blenlib/intern/system.c
, ecx wasn't declared in clobber list. Declaring it will improve the runtime stability to some extent, for the reason that undeclared side effect may be miscompiled by compilers.For example:
Compile the above code with
gcc -O2 -m32 cpuid.c func.c -o cpuid
and run it will produce output0:7ffafbff
, where the ecx is not the initial value assigned byfunc()
;