NEON pack vector compare result into bitmap

前端 未结 1 1371
既然无缘
既然无缘 2020-12-21 14:23

I have a comparison result of comparison of two floating point operands as follows; What I need to do is based on the result of comparison need to perform the following: i.e

相关标签:
1条回答
  • 2020-12-21 14:38
    vmov.i32 qmask, #1
    vand qres, qmask, qres
    vsra.u64 qres, qres, #30
    vsli.64 dres_bottom, dres_top, #2
    

    And you have the bits you need at the four least significant bits of qres.

    //////////////////////// edit

    An improved version of above:

    vshr.u64 qres, qres, #31
    vsli.64 dres_bot, dres_top, #2
    // the four LSBs already contain the bitmap, the rest is optional:
    vbic.i16 dres_bot, #0xf0
    // you can now use byte 0 of dres_bot as the result.
    
    0 讨论(0)
提交回复
热议问题