On Mar 25, 2010, at 12:27, ext Dmitry Zhurikhin wrote: > juha.riihim...@nokia.com wrote: >> - vqdmlsl yields different results for some specific input values, however I >> think QEMU is producing correct results. For example, >> 1431655765-(2*-32768*-32768)=-715827883 but your reference hardware results >> say it should be -715827882. > From what I understand hardware gets such result because saturation occurs on > the (2*-32768*-32768) step. The result is not 0x80000000 as expected but > because of overflow is set as the largest 32-bit signed integer 0x7FFFFFFF. > It > seems that QEMU just doesn't perform saturation (in this particular case at > least).
Yes I see, I overlooked the fact that -32768*-32768 changes the sign and so doubling the result of that overflows the signed 32-bit integer even if the result still fits in 32 bits. Thanks, I'll fix that as well. Regards, Juha