am 1eaa1d60: am 14d4abff: Merge "Add support for ARM mode smmla instructions."
* commit '1eaa1d6006bf9aa6ecb16deab052224c817a5669':
Add support for ARM mode smmla instructions.
diff --git a/main/Android.mk b/main/Android.mk
index 3c6925b..8ac1d80 100644
--- a/main/Android.mk
+++ b/main/Android.mk
@@ -49,12 +49,13 @@
else ifeq ($(TARGET_BOOTLOADER_BOARD_NAME),MAKO)
ANDROID_HARDWARE := ANDROID_HARDWARE_nexus_4
endif
-common_cflags += -D$(ANDROID_HARDWARE)
else
tool_ldflags := -static -Wl,-Ttext=0x38000000 -nodefaultlibs -nostartfiles -u _start -e_start
endif
+common_cflags += -D$(ANDROID_HARDWARE)
+
preload_ldflags := -nodefaultlibs -Wl,-z,interpose,-z,initfirst
# Remove this when the all toolchains are GCC 4.4
ifeq ($(TARGET_ARCH),arm)
@@ -257,7 +258,9 @@
LOCAL_LDFLAGS := $(vex_ldflags)
+# TODO: split asflags out from cflags.
LOCAL_CFLAGS := $(common_cflags)
+LOCAL_ASFLAGS := $(common_cflags)
include $(BUILD_STATIC_LIBRARY)
diff --git a/main/VEX/priv/guest_arm_toIR.c b/main/VEX/priv/guest_arm_toIR.c
index 4c5cb96..372c927 100644
--- a/main/VEX/priv/guest_arm_toIR.c
+++ b/main/VEX/priv/guest_arm_toIR.c
@@ -18826,6 +18826,30 @@
}
}
+ /* ------------------- (T1) SMMLA{R} ------------------ */
+ if (INSN0(15,7) == BITS9(1,1,1,1,1,0,1,1,0)
+ && INSN0(6,4) == BITS3(1,0,1)
+ && INSN1(7,5) == BITS3(0,0,0)) {
+ UInt bitR = INSN1(4,4);
+ UInt rA = INSN1(15,12);
+ UInt rD = INSN1(11,8);
+ UInt rM = INSN1(3,0);
+ UInt rN = INSN0(3,0);
+ if (!isBadRegT(rD) && !isBadRegT(rN) && !isBadRegT(rM) && (rA != 13)) {
+ IRExpr* res
+ = unop(Iop_64HIto32,
+ binop(Iop_Add64,
+ binop(Iop_Add64,
+ binop(Iop_32HLto64, getIRegT(rA), mkU32(0)),
+ binop(Iop_MullS32, getIRegT(rN), getIRegT(rM))),
+ mkU64(bitR ? 0x80000000ULL : 0ULL)));
+ putIRegT(rD, res, condT);
+ DIP("smmla%s r%u, r%u, r%u, r%u\n",
+ bitR ? "r" : "", rD, rN, rM, rA);
+ goto decode_success;
+ }
+ }
+
/* ----------------------------------------------------------- */
/* -- VFP (CP 10, CP 11) instructions (in Thumb mode) -- */
/* ----------------------------------------------------------- */