qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] cvttps2dq, movdq2q, movq2dq incorrect behaviour


From: malc
Subject: Re: [Qemu-devel] cvttps2dq, movdq2q, movq2dq incorrect behaviour
Date: Tue, 20 Jun 2006 15:29:10 +0400 (MSD)

On Tue, 20 Jun 2006, Julian Seward wrote:


The SSE2 instructions cvttps2dq, movdq2q, movq2dq do not behave
correctly, as shown by the attached program.  It should print

 cvttps2dq_1 ... ok
 cvttps2dq_2 ... ok
 movdq2q_1 ... ok
 movq2dq_1 ... ok

but instead produces

 cvttps2dq_1 ... ok
 cvttps2dq_2 ... not ok
   result0.sd[0] = 12 (expected 12)
   result0.sd[1] = 3 (expected 56)
   result0.sd[2] = -2147483648 (expected 43)
   result0.sd[3] = 3 (expected 87)
 movdq2q_1 ... not ok
   result0.uq[0] = 1302123111658042420 (expected 5124095577148911)
 movq2dq_1 ... not ok
   result0.uq[0] = 1302123111658042420 (expected 5124095577148911)
   result0.uq[1] = 6221254864647256184 (expected 0)

I looked at QEMU's instruction decoders for these, and compared them
to Valgrind's, but could not see what the problem was.  The decode
logic looks OK.  Maybe the problem is elsewhere.

The signature of movdq2q is Pq, VRq and for movq2dq - Vo, PRq it appears
that translate.c gets it backwards, attached patch should deal with it.

As for cvttps2dq i ran it with interpreter which uses outdated(i.e. non
soft-float) conversion routines and it passed, so my guess would be that
this is float32_to_int32_round_to_zero vs (int32_t) cast issue.

--
mailto:address@hidden

Attachment: sse-movq.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]