From bd0c2d5b0bf512aa5c172fe5676e151913e5e97d Mon Sep 17 00:00:00 2001 From: Mitch Hayenga Date: Thu, 13 Oct 2016 19:22:10 +0100 Subject: isa,arm: Add missing AArch32 FP instructions This commit adds missing non-predicated, scalar floating point instructions. Specifically VRINT* floating point integer rounding instructions and VSEL* floating point conditional selects. Change-Id: I23cbd1389f151389ac8beb28a7d18d5f93d000e7 Reviewed-by: Andreas Sandberg Reviewed-by: Nathanael Premillieu --- src/arch/arm/isa/insts/fp.isa | 62 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) (limited to 'src/arch/arm/isa/insts') diff --git a/src/arch/arm/isa/insts/fp.isa b/src/arch/arm/isa/insts/fp.isa index 34dff5139..0f10a05af 100644 --- a/src/arch/arm/isa/insts/fp.isa +++ b/src/arch/arm/isa/insts/fp.isa @@ -1,6 +1,6 @@ // -*- mode:c++ -*- -// Copyright (c) 2010-2013 ARM Limited +// Copyright (c) 2010-2013,2016 ARM Limited // All rights reserved // // The license below extends only to copyright in the software and shall @@ -642,6 +642,26 @@ let {{ "-FpOp1", "-dbl(FpOp1P0_uw, FpOp1P1_uw)") buildSimpleUnaryFpOp("vabs", "Vabs", "FpRegRegOp", "SimdFloatMiscOp", "fabsf(FpOp1)", "fabs(dbl(FpOp1P0_uw, FpOp1P1_uw))") + buildSimpleUnaryFpOp("vrintp", "VRIntP", "FpRegRegOp", "SimdFloatMiscOp", + "fplibRoundInt(FpOp1, FPRounding_POSINF, false, fpscr)", + "fplibRoundInt(dbl(FpOp1P0_uw, FpOp1P1_uw), " \ + "FPRounding_POSINF, false, fpscr)" + ) + buildSimpleUnaryFpOp("vrintm", "VRIntM", "FpRegRegOp", "SimdFloatMiscOp", + "fplibRoundInt(FpOp1, FPRounding_NEGINF, false, fpscr)", + "fplibRoundInt(dbl(FpOp1P0_uw, FpOp1P1_uw), " \ + "FPRounding_NEGINF, false, fpscr)" + ) + buildSimpleUnaryFpOp("vrinta", "VRIntA", "FpRegRegOp", "SimdFloatMiscOp", + "fplibRoundInt(FpOp1, FPRounding_TIEAWAY, false, fpscr)", + "fplibRoundInt(dbl(FpOp1P0_uw, FpOp1P1_uw), " \ + "FPRounding_TIEAWAY, false, fpscr)" + ) + buildSimpleUnaryFpOp("vrintn", "VRIntN", "FpRegRegOp", "SimdFloatMiscOp", + "fplibRoundInt(FpOp1, FPRounding_TIEEVEN, false, fpscr)", + "fplibRoundInt(dbl(FpOp1P0_uw, FpOp1P1_uw), " \ + "FPRounding_TIEEVEN, false, fpscr)" + ) }}; let {{ @@ -1402,6 +1422,46 @@ let {{ exec_output += PredOpExecute.subst(vcmpeZeroDIop); }}; +let {{ + + header_output = "" + decoder_output = "" + exec_output = "" + + vselSCode = vfpEnabledCheckCode + ''' + if (testPredicate(CondCodesNZ, CondCodesC, CondCodesV, cond)) { + FpDest = FpOp1; + } else { + FpDest = FpOp2; + } ''' + + vselSIop = InstObjParams("vsels", "VselS", "FpRegRegRegCondOp", + { "code" : vselSCode, + "predicate_test" : predicateTest, + "op_class" : "SimdFloatCmpOp" }, [] ) + header_output += FpRegRegRegCondOpDeclare.subst(vselSIop); + decoder_output += FpRegRegRegCondOpConstructor.subst(vselSIop); + exec_output += PredOpExecute.subst(vselSIop); + + vselDCode = vfpEnabledCheckCode + ''' + if (testPredicate(CondCodesNZ, CondCodesC, CondCodesV, cond)) { + FpDestP0_uw = FpOp1P0_uw; + FpDestP1_uw = FpOp1P1_uw; + } else { + FpDestP0_uw = FpOp2P0_uw; + FpDestP1_uw = FpOp2P1_uw; + } ''' + + vselDIop = InstObjParams("vseld", "VselD", "FpRegRegRegCondOp", + { "code" : vselDCode, + "predicate_test" : predicateTest, + "op_class" : "SimdFloatCmpOp" }, [] ) + header_output += FpRegRegRegCondOpDeclare.subst(vselDIop); + decoder_output += FpRegRegRegCondOpConstructor.subst(vselDIop); + exec_output += PredOpExecute.subst(vselDIop); +}}; + + let {{ header_output = "" -- cgit v1.2.3