From 09cc401848a7ee4540639ab8a05b40a4e1a7ee0a Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 2 Jun 2010 12:58:08 -0500 Subject: [PATCH] ARM: Implement the ubfx and sbfx instructions. --- src/arch/arm/isa/insts/misc.isa | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/arch/arm/isa/insts/misc.isa b/src/arch/arm/isa/insts/misc.isa index d7fa310b7..e3c3132d9 100644 --- a/src/arch/arm/isa/insts/misc.isa +++ b/src/arch/arm/isa/insts/misc.isa @@ -458,4 +458,25 @@ let {{ header_output += BasicDeclare.subst(nopIop) decoder_output += BasicConstructor.subst(nopIop) exec_output += BasicExecute.subst(nopIop) + + ubfxCode = ''' + Dest = bits(Op1, imm2, imm1); + ''' + ubfxIop = InstObjParams("ubfx", "Ubfx", "RegRegImmImmOp", + { "code": ubfxCode, + "predicate_test": predicateTest }, []) + header_output += RegRegImmImmOpDeclare.subst(ubfxIop) + decoder_output += RegRegImmImmOpConstructor.subst(ubfxIop) + exec_output += PredOpExecute.subst(ubfxIop) + + sbfxCode = ''' + int32_t resTemp = bits(Op1, imm2, imm1); + Dest = resTemp | -(resTemp & (1 << (imm2 - imm1))); + ''' + sbfxIop = InstObjParams("sbfx", "Sbfx", "RegRegImmImmOp", + { "code": sbfxCode, + "predicate_test": predicateTest }, []) + header_output += RegRegImmImmOpDeclare.subst(sbfxIop) + decoder_output += RegRegImmImmOpConstructor.subst(sbfxIop) + exec_output += PredOpExecute.subst(sbfxIop) }}; -- 2.30.2