Sun 15 Jun 2008 01:16:21 AM UTC, comment #2:
The patch gave me the compiler error "error: can't find a register in class `DREG' while reloading `asm'". gcc does not seem to allow putting the same register as both an input and a clobber. I think it needs to be an output operand.
Actually now that I have looked at the code again, I see that the same issue exists for EAX. This does not affect ft_recompute_scaled_metrics but it maybe could cause problems elsewhere.
Here is some test code to demonstrate. (Put the FT_MulFix code in the same file, so that gcc can inline it)
FT_Long x = FT_MulFix(2000, 1000);
FT_Long y = FT_MulFix(3000, 1000); // gcc thinks EDX is still 1000
printf("%d %d ", x, y);
x = FT_MulFix(1000, 2000);
y = FT_MulFix(1000, 3000); // gcc thinks EAX is still 1000
printf("%d %d ", x, y);
Compile with -O3, to enable automatic inlining, and it prints out 31 0 31 1, rather than the expected 31 46 31 46.
I changed the constraints to:
: "=a"(result), "+d"(b)
: "a"(a)
: "%ecx"
and that fixes it.
|