Untitled
homm
0 Likes0 Commentsgolang
ldr q0, [x19] // Sx4 = vld1q_u8(&Srgba[0])
ldr q1, [x20] // Dx4 = vld1q_u8(&Drgba[0])
movi v17.2d, #0xffffffffffffffff
mov x9, xzr // i = 0
.LBB0_3:
tbl v5.16b, { v0.16b }, v16.16b // vqtbl1q_u8(Sx4, v16)
mvn v5.16b, v5.16b // Sax4 = vsubq_u8(vdupq_n_u8(255), v5)
add x10, x9, #16 // x10 = i + 16
umull v3.8h, v0.8b, v17.8b // Rx2lo = vmull_u8(Sx4, 0xff);
umull2 v4.8h, v0.16b, v17.16b // Rx2hi = vmull_high_u8(Sx4, 0xff)
ldr q0, [x19, x10] // Sx4 = vld1q_u8(&Srgba[i + 16])
umlal v3.8h, v1.8b, v5.8b // vmlal_u8(Rx2lo, Dx4, Sax4)
umlal2 v4.8h, v1.16b, v5.16b // vmlal_high_u8(Rx2hi, Dx4, Sax4)
ldr q1, [x20, x10] // Dx4 = vld1q_u8(&Drgba[i + 16])
ursra v3.8h, v3.8h, #8 // vrsraq_n_u16(Rx2lo, Rx2lo, 8)
ursra v4.8h, v4.8h, #8 // vrsraq_n_u16(Rx2hi, Rx2hi, 8)
uqrshrn v2.8b, v3.8h, #8 // Rx4 = vqrshrn_n_u16(Rx2lo, 8)
uqrshrn2 v2.16b, v4.8h, #8 // vqrshrn_high_n_u16(Rx4, Rx2hi, 8)
cmp x10, #3972
str q2, [x21, x9] // vst1q_u8(&Rrgba[i], Rx4)
mov x9, x10
b.lo .LBB0_3
You can change the width to suit the size area that you will be embedding to