Would you be able to use srcSizeBits instead of srcSignIndex? This is
defined as the number of bits in a source operand, so you might need to
subtract one to get the right index. If you substitute and simplify your
expression for srcSignIndex (which the compiler is hopefully doing
already), I think that's actually what it comes down to.
Gabe
Vince Weaver wrote:
> This problem appears when two packed 32-bit values are converted to two
> floats. When doing sign extension of the top value, the 32-bit value is
> shifted down before bit 63 is checked, thus packed integers in the top of
> a 64-bit value aren't detected as negative properly.
>
> This patch fixes things, but there must be a better way of doing it
> without introducing a new variable.
>
> This problem appears with the qemu test-x86_64 program.
>
> Vince
>
>
> diff -r a2a79fe9655d src/arch/x86/isa/microops/mediaop.isa
> --- a/src/arch/x86/isa/microops/mediaop.isa Wed Nov 11 17:49:09 2009 -0500
> +++ b/src/arch/x86/isa/microops/mediaop.isa Fri Nov 13 21:31:12 2009 -0500
> @@ -1288,9 +1288,10 @@
> for (int i = 0; i < items; i++) {
> int srcHiIndex = srcStart + (i + 1) * srcSizeBits - 1;
> int srcLoIndex = srcStart + (i + 0) * srcSizeBits;
> + int srcSignIndex = ((srcHiIndex+1)-srcLoIndex)-1;
> uint64_t argBits = bits(FpSrcReg1.uqw, srcHiIndex,
> srcLoIndex);
>
> - int64_t sArg = argBits | (0 - (argBits & (ULL(1) <<
> srcHiIndex)));
> + int64_t sArg = argBits | (0 - (argBits & (ULL(1) <<
> srcSignIndex)));
> double arg = sArg;
>
> if (destSize == 4) {
> _______________________________________________
> m5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/m5-dev
>
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev