ARM NEON assembler error: “instruction cannot be conditional”

后端 未结 3 890
北恋
北恋 2021-01-22 20:13

According to the arm info center vadd can be executed condtitionally however when i try

vaddeq.f32 d0,d0,d1

Xcode returns

65:i         


        
相关标签:
3条回答
  • 2021-01-22 20:53

    Only instructions shared by NEON and VFP can be executed conditionally.

    (vldmia for example.)

    For me, there have been a few situations where conditional execution could have saved me from some minor headaches, but in general, you won't need it that badly.

    Take a careful look at the NEON logical and compare operations. They very well indicate how NEON is supposed to be programmed.

    cya.

    0 讨论(0)
  • 2021-01-22 20:56

    The ARM Architecture Reference Manual says:

     An ARM Advanced SIMD VADD instruction must be unconditional.
    

    I.e., if you're in ARM mode, those instructions are not conditional. You can use them conditionally in Thumb-2 if you put them in an IT block.

      .syntax unified
      .code 16
      .globl _foo
    _foo:
      cmp r0, #0
      it eq
      vaddeq.f32 d0, d0, d1
      bx lr
    
    0 讨论(0)
  • 2021-01-22 20:58

    The reason why conditional NEON instructions are not available in ARM mode is because they use encodings with the condition field set to NV (never). You need to use conditional branches or (better) rewrite the code to not use the comparison results directly - e.g. set a register to 0 or 1 depending on the result and use its value in further operations.

    0 讨论(0)
提交回复
热议问题