[ros-bugs] [Bug 3346] Font descender is always calculated as zero

ReactOS.Bugzilla at www.reactos.org ReactOS.Bugzilla at www.reactos.org
Tue Jun 17 21:31:37 CEST 2008


http://www.reactos.org/bugzilla/show_bug.cgi?id=3346





--- Comment #6 from Goplat <mrnobo1024 at yahoo.com>  2008-06-17 21:31:36 CET ---
The use of shrd is a good optimization, as is allowing the use of any register
or memory for the second input instead of limiting it to just EDX. ("g" is not
quite the right kind of constraint; it allows immediates but the IMUL
instruction does not.)

By Lone_Rifle's request, here is the function with those optimizations added
while still preserving the symmetry. I also moved EDX from clobbers to outputs,
because a clobber register can't be an input, but it is okay for the second
input to be EDX.

    __asm__ __volatile__ (
      "imull %3\n"
      "movl  %%edx, %%ecx\n"
      "sarl  $31, %%ecx\n"
      "addl  $0x8000, %%ecx\n"
      "addl  %%ecx, %%eax\n"
      "adcl  $0, %%edx\n"
      "shrd  $16, %%edx, %%eax\n"
      : "=a"(result), "=d"(b)
      : "a"(a), "rm"(b)
      : "ecx"
    );


-- 
Configure bugmail: http://www.reactos.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the Ros-bugs mailing list