Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown register name 'q0' in asm

I'm trying to build ios project for $(ARCHS_STANDARD_32_BIT) architecture - armv7 for the latest iOS (iOS 7.0) and I've got the following error:

Unknown register name 'q0' in asm

in function

static void neon_asm_mat4_vec4_mul(const float* __restrict m, const int* __restrict v, int* __restrict output)
      {
        asm volatile
        (
         // Store m & v - avoiding q4-q7 which need to be preserved - q0 = result
         "vldmia %1, { q8-q11 } \n\t"   // q8-q11 = m
         "vldmia %2, { q1 }     \n\t"   // q1     = v

         // Convert v to floats
         "vcvt.f32.s32 q1, q1 \n\t"

         // result = first column of A x V.x
         "vmul.f32 q0, q8, d2[0] \n\t"

         // result += second column of A x V.y
         "vmla.f32 q0, q9, d2[1] \n\t"

         // result += third column of A x V.z
         "vmla.f32 q0, q10, d3[0] \n\t"

         // result += last column of A x V.w
         "vmla.f32 q0, q11, d3[1] \n\t"

         // convert to integer
         "vcvt.s32.f32 q0, q0 \n\t"

         // output = result registers
         "vstmia %0, { q0 }  \n\t"

         : // no output
         : "r" (output), "r" (m), "r" (v)      // input - note *value* of pointer doesn't change
         : "memory", "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11" //clobber
         );
      }

Could you please help me to either update my code so it can be built for the latest hardware or simply configure build settings differently. I'm new to iOS development, so I'm kind of lost...

like image 335
Pavel Podlipensky Avatar asked Feb 02 '14 11:02

Pavel Podlipensky


2 Answers

Those who are using Cocos2d 2.1 , modification(#if defined(ARM_NEON) ->#if defined(_ARM_ARCH_7)) is needed in two macros

  1. neon_matrix_impl.c and
  2. mat4.c at line number 218

enter image description here

Actually ARM NEON was used as multimedia rendering engine in iOS devices but now with iOS 7.0 and onwards new rendering engines(ARM ARCH 64 bit) are used.

More details can be obtained from here.

But it was really confusing for me that my Xcode project was perfectly compiled and successfully executed on my iPod Touch (5th generation) with out these modifications.Modification was needed only when i tried to archive my project to submit it on AppStore.

like image 36
Sauvik Dolui Avatar answered Oct 28 '22 00:10

Sauvik Dolui


try changing in neon_matrix_impl.c and mat4.c
#if defined(ARM_NEON)
to
#if defined(_ARM_ARCH_7)

like image 54
caraie Avatar answered Oct 28 '22 00:10

caraie