Re: x86 emulator bug

Tim Roberts <[email protected]>
Newsgroups gmane.comp.xfree86.devel
Organization Providenza & Boekelheide, Inc.
Message-ID <[email protected]>
Charles Dobson wrote:

>I am not sure if I should post this here or on bugzilla.
>
>While trying to get a Silicon Motion SM722 video controller
>working with Solaris, I have discovered a problem with the
>emulation of the SHLD and SHRD (double precision shift)
>instructions of the x86 emulator.
>According to the Intel Pentium User Guide Vol 3, these
>instructions can shift upto 31 bits with both 16 and 32
>bit operands. The emulator code will only work with shifts
>of upto 15 bits for 16 bit operands.
>  
>

The pseudo-code for those instructions in that same document also say 
that, when the shift count is greater than or equal to the operand size, 
the contents of the destination register and the flags are undefined.  
Thus, there is technically nothing wrong with the emulator code as-is.  
Your patch is right, but the existing code is also right.

-- 
- Tim Roberts, [email protected]
  Providenza & Boekelheide, Inc.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.