-1

I got error when i tried to compile inline assembly with qadd command.

Error: cannot honor width suffix -- `qadd r7,r7,r1'

I know that qadd is supported in ARMv5TE

These ARM instructions are available in ARMv6 and above, and E variants of ARMv5T.

C/asm code:

inline int __qadd(int a, int b) {
    __asm__ (
            "qadd %0, %1, %2" : "=r" (a) : "r" (a), "r" (b));
    return a;
}

My cpu features is:

LOGI("__ARM_ARCH__='%d'", __ARM_ARCH__);
LOGI("__ARM_HAVE_5TE='%d'", __ARM_HAVE_5TE);

Output:

__ARM_ARCH__='5'
__ARM_HAVE_5TE='1'

I have next compiler flags:

LOCAL_CFLAGS += -std=c99 -ffast-math -march=armv5te

Besides i have tried replace add instead of qadd - nicely works but with qadd code not compiles.

What i'm doing wrong? Who can provide worked example of qadd command in assembly?

testCoder
  • 7,155
  • 13
  • 56
  • 75
  • Try the extra compiler switches - `-mtune=arm1136jf-s -mfloat-abi=softfp -mfpu=vfp`? – t0mm13b Jan 04 '13 at 22:58
  • @t0mm13b In android.mk `EXTRA_CFLAGS += -mtune=arm1136jf-s -mfloat-abi=softfp -mfpu=vfp`, but no luck, still occurs error. – testCoder Jan 04 '13 at 23:11

1 Answers1

0

Solution here No qsort_r for Android (or how to disable force Thumb to use CLZ in Android ARM code)

In your Android.mk file, add ".arm" to the filenames and they will get compiled as ARM mode instead of Thumb mode (e.g. sort.c.arm). I've had mixed Thumb/ARM code in an Android native library and it worked fine.

Question is closed.

Community
  • 1
  • 1
testCoder
  • 7,155
  • 13
  • 56
  • 75