From dcb23d1e42caeddc1ff5c1f75e77b31be2bfd60f Mon Sep 17 00:00:00 2001 From: Michael Mohr Date: Tue, 28 Dec 2010 13:23:34 -0800 Subject: [PATCH] TFM_ARM must be defined for other parts of the code --- Android.mk | 10 ++++++---- src/mont/fp_montgomery_reduce.c | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Android.mk b/Android.mk index 585e47b..e9f691d 100644 --- a/Android.mk +++ b/Android.mk @@ -94,17 +94,19 @@ LOCAL_SRC_FILES := \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/src/headers +LOCAL_CFLAGS += -DTFM_ARM + ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) # Possible optimizations: # -ftree-vectorize: have GCC attempt to automatically vectorize loops # -ftree-vectorizer-verbose=2: verbose output during compile -# Note: not all V7a targets support NEON! -# LOCAL_ARM_NEON := true -LOCAL_CFLAGS += -DTFM_ARM_V7A +# Note: not all V7-a targets support NEON! +LOCAL_ARM_NEON := true +LOCAL_CFLAGS += -DTFM_ARM_V7A -ftree-vectorize else ifeq ($(TARGET_ARCH_ABI),armeabi) LOCAL_CFLAGS += -DTFM_ARM_V5TE else -LOCAL_CFLAGS += -DTFM_ARM +LOCAL_CFLAGS += -DTFM_ARM_V4M endif include $(BUILD_STATIC_LIBRARY) diff --git a/src/mont/fp_montgomery_reduce.c b/src/mont/fp_montgomery_reduce.c index 63a3db6..8ed733b 100644 --- a/src/mont/fp_montgomery_reduce.c +++ b/src/mont/fp_montgomery_reduce.c @@ -283,10 +283,10 @@ asm( \ : "%eax", "%cc") /******************************************************************/ -#elif defined(TFM_ARM) - /* ARMv4 code */ +#elif defined(TFM_ARM_V4M) + /* generic ARMv4 or higher with M */ -#define MONT_START +#define MONT_START #define MONT_FINI #define LOOP_END #define LOOP_START \ @@ -325,7 +325,7 @@ asm( \ asm( \ " LDR r0,%1 \n\t" \ " ADDS r0,r0,%0 \n\t" \ - " ITE CS \n\t" \ + " ITE CS \n\t" \ " MOVCS %0,#1 \n\t" \ " MOVCC %0,#0 \n\t" \ " UMLAL r0,%0,%3,%4 \n\t" \