From c4cea8e5f5253b62bef1f3fe98f83080c09b12de Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Thu, 9 Sep 2010 07:27:24 +0000 Subject: [PATCH] If the host does not support Neon, then don't accept Neon instructions on the guest-side. Related to #249775. git-svn-id: svn://svn.valgrind.org/vex/trunk@2032 --- VEX/priv/guest_arm_toIR.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/VEX/priv/guest_arm_toIR.c b/VEX/priv/guest_arm_toIR.c index 32daaf0d7b..3438a86ac7 100644 --- a/VEX/priv/guest_arm_toIR.c +++ b/VEX/priv/guest_arm_toIR.c @@ -11779,7 +11779,9 @@ static Bool decode_CP10_CP11_instruction ( Note that all NEON instructions (in ARM mode) are handled through here, since they are all in NV space. */ -static Bool decode_NV_instruction ( /*MOD*/DisResult* dres, UInt insn ) +static Bool decode_NV_instruction ( /*MOD*/DisResult* dres, + VexArchInfo* archinfo, + UInt insn ) { # define INSN(_bMax,_bMin) SLICE_UInt(insn, (_bMax), (_bMin)) # define INSN_COND SLICE_UInt(insn, 31, 28) @@ -11876,12 +11878,13 @@ static Bool decode_NV_instruction ( /*MOD*/DisResult* dres, UInt insn ) } /* ------------------- NEON ------------------- */ - { Bool ok_neon = decode_NEON_instruction( - dres, insn, IRTemp_INVALID/*unconditional*/, - False/*!isT*/ - ); - if (ok_neon) - return True; + if (archinfo->hwcaps & VEX_HWCAPS_ARM_NEON) { + Bool ok_neon = decode_NEON_instruction( + dres, insn, IRTemp_INVALID/*unconditional*/, + False/*!isT*/ + ); + if (ok_neon) + return True; } // unrecognised @@ -12028,7 +12031,7 @@ DisResult disInstr_ARM_WRK ( case ARMCondNV: { // Illegal instruction prior to v5 (see ARM ARM A3-5), but // some cases are acceptable - Bool ok = decode_NV_instruction(&dres, insn); + Bool ok = decode_NV_instruction(&dres, archinfo, insn); if (ok) goto decode_success; else @@ -17407,12 +17410,13 @@ DisResult disInstr_THUMB_WRK ( /* -- NEON instructions (in Thumb mode) -- */ /* ----------------------------------------------------------- */ - { UInt insn32 = (INSN0(15,0) << 16) | INSN1(15,0); - Bool ok_neon = decode_NEON_instruction( - &dres, insn32, condT, True/*isT*/ - ); - if (ok_neon) - goto decode_success; + if (archinfo->hwcaps & VEX_HWCAPS_ARM_NEON) { + UInt insn32 = (INSN0(15,0) << 16) | INSN1(15,0); + Bool ok_neon = decode_NEON_instruction( + &dres, insn32, condT, True/*isT*/ + ); + if (ok_neon) + goto decode_success; } /* ----------------------------------------------------------- */ -- 2.47.2