Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ul> <li>If you're going to use a LUT anyway, just fill it with the necessary floats.</li> <li>If you don't mind a requirement of iOS 4, see <a href="http://developer.apple.com/library/ios//#documentation/Accelerate/Reference/vDSPRef/Reference/reference.html#//apple_ref/doc/uid/TP40009464" rel="nofollow">vDSP_vflt8()</a></li> </ul> <p><strong>EDIT:</strong> "unsigned char to int conversion" merely involves adding some zero bytes at the right places. The obvious way is to perform the necessary shifts, then VDUP to clear a vector, and VMOV.U8 four times. That seems a bit slow.</p> <p>The faster way is probably with <a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j/CIHCFEBA.html" rel="nofollow">VTBL</a>:</p> <pre><code>; load stuff into D4 (e.g. {6,7,8,9,a,b,c,d}) ; D5 already contains {0,-1,-1,-1,1,-1-1-1} ; D6 already contains {2,-1,-1,-1,3,-1-1-1} ; D7 and D8 are similar... vtbl.8 D0,{D4},D5 vtbl.8 D1,{D4},D6 vtbl.8 D2,{D4},D7 vtbl.8 D3,{D4},D8 ; Now Q0 should contain {6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0}; similarly for Q1 ; Interpret them as (little-endian) 32-bit ints and convert them to floats vcvt.f32.u32 Q0,Q0,#0 vcvt.f32.u32 Q1,Q1,#0 ; And save them somewhere </code></pre> <p>Of course, you can specify <code>#8</code> instead of <code>#0</code> to divide everything by 256.</p> <p>I didn't see a quadword version of VTBL, but such a rewrite wouldn't be too hard to do. The obvious extension is to do a quadword load in to Q2 = {D4,D5}, and repeat the process specifying D4 instead of D5 (or use more registers to avoid data dependency stalls).</p> <p>Other optimizations include preloading the cache (I forget what the corresponding ARM instructions are). In general, you'll probably find it difficult to beat Accelerate.framework without putting in significant effort.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload