mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-15 08:41:59 +00:00
- Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory
did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. SVN r3242 (trunk)
This commit is contained in:
parent
4b78b07aca
commit
4032b4c307
1 changed files with 3 additions and 4 deletions
|
@ -279,12 +279,11 @@ MAKECONSTDivScale(31)
|
|||
|
||||
static inline SDWORD DivScale32 (SDWORD a, SDWORD b)
|
||||
{
|
||||
SDWORD result, dummy;
|
||||
SDWORD result = 0, dummy;
|
||||
|
||||
asm volatile
|
||||
("xor %%eax,%%eax\n\t"
|
||||
"idivl %3"
|
||||
:"=&a,a" (result),
|
||||
("idivl %3"
|
||||
:"+a,a" (result),
|
||||
"=d,d" (dummy)
|
||||
: "d,d" (a),
|
||||
"r,m" (b)
|
||||
|
|
Loading…
Reference in a new issue