From 1b3b75ee681b1fe83ccf1240bf5d1afa174c6421 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 2 Jun 2010 12:58:15 -0500 Subject: ARM: Implement the version of VCVT float to int that rounds towards zero. --- src/arch/arm/isa/formats/fp.isa | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) (limited to 'src/arch/arm/isa/formats/fp.isa') diff --git a/src/arch/arm/isa/formats/fp.isa b/src/arch/arm/isa/formats/fp.isa index 3d40caf9e..2b999f751 100644 --- a/src/arch/arm/isa/formats/fp.isa +++ b/src/arch/arm/isa/formats/fp.isa @@ -725,20 +725,40 @@ let {{ } } case 0xc: - if (single) { - return new VcvtFpUIntS(machInst, vd, vm); + if (bits(machInst, 7) == 0) { + if (single) { + return new VcvtFpUIntSR(machInst, vd, vm); + } else { + vd = (IntRegIndex)(bits(machInst, 22) | + (bits(machInst, 15, 12) << 1)); + return new VcvtFpUIntDR(machInst, vd, vm); + } } else { - vd = (IntRegIndex)(bits(machInst, 22) | - (bits(machInst, 15, 12) << 1)); - return new VcvtFpUIntD(machInst, vd, vm); + if (single) { + return new VcvtFpUIntS(machInst, vd, vm); + } else { + vd = (IntRegIndex)(bits(machInst, 22) | + (bits(machInst, 15, 12) << 1)); + return new VcvtFpUIntD(machInst, vd, vm); + } } case 0xd: - if (single) { - return new VcvtFpSIntS(machInst, vd, vm); + if (bits(machInst, 7) == 0) { + if (single) { + return new VcvtFpSIntSR(machInst, vd, vm); + } else { + vd = (IntRegIndex)(bits(machInst, 22) | + (bits(machInst, 15, 12) << 1)); + return new VcvtFpSIntDR(machInst, vd, vm); + } } else { - vd = (IntRegIndex)(bits(machInst, 22) | - (bits(machInst, 15, 12) << 1)); - return new VcvtFpSIntD(machInst, vd, vm); + if (single) { + return new VcvtFpSIntS(machInst, vd, vm); + } else { + vd = (IntRegIndex)(bits(machInst, 22) | + (bits(machInst, 15, 12) << 1)); + return new VcvtFpSIntD(machInst, vd, vm); + } } case 0xe: { -- cgit v1.2.3