|
From: <sv...@va...> - 2010-09-09 07:27:36
|
Author: sewardj
Date: 2010-09-09 08:27:24 +0100 (Thu, 09 Sep 2010)
New Revision: 2032
Log:
If the host does not support Neon, then don't accept Neon instructions
on the guest-side. Related to #249775.
Modified:
trunk/priv/guest_arm_toIR.c
Modified: trunk/priv/guest_arm_toIR.c
===================================================================
--- trunk/priv/guest_arm_toIR.c 2010-09-09 07:14:31 UTC (rev 2031)
+++ trunk/priv/guest_arm_toIR.c 2010-09-09 07:27:24 UTC (rev 2032)
@@ -11779,7 +11779,9 @@
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 @@
}
/* ------------------- 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 @@
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 @@
/* -- 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;
}
/* ----------------------------------------------------------- */
|