297
@@ at this point, R0=block, R1-R11 (free)
298
@@ R12=__const_ptr_, R14=&block[n]
299
add r14, r0, #14 @ R14=&block[7], better start from the last col, and decrease the value until col=0, i.e. R14=block.
299
@@ at this point, R0=block, R1-R11 (free)
300
@@ R12=__const_ptr_, R14=&block[n]
301
add r14, r0, #14 @ R14=&block[7], better start from the last col, and decrease the value until col=0, i.e. R14=block.
303
@@ at this point, R0=block (temp), R1-R11 (free)
304
@@ R12=__const_ptr_, R14=&block[n]
305
@@ proceed with b0-b3 first, followed by a0-a3
306
@@ MUL16(b0, W1, col[8x1]);
307
@@ MUL16(b1, W3, col[8x1]);
308
@@ MUL16(b2, W5, col[8x1]);
309
@@ MUL16(b3, W7, col[8x1]);
310
@@ MAC16(b0, W3, col[8x3]);
311
@@ MAC16(b1, -W7, col[8x3]);
312
@@ MAC16(b2, -W1, col[8x3]);
313
@@ MAC16(b3, -W5, col[8x3]);
314
ldr r8, [r12, #offW1] @ R8=W1
316
mul r0, r8, r7 @ R0=W1*ROWr16[1]=b0 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
317
ldr r9, [r12, #offW3] @ R9=W3
318
ldr r10, [r12, #offW5] @ R10=W5
319
mul r1, r9, r7 @ R1=W3*ROWr16[1]=b1 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
320
ldr r11, [r12, #offW7] @ R11=W7
321
mul r5, r10, r7 @ R5=W5*ROWr16[1]=b2 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
323
mul r7, r11, r7 @ R7=W7*ROWr16[1]=b3 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
324
teq r2, #0 @ if 0, then avoid muls
325
mlane r0, r9, r2, r0 @ R0+=W3*ROWr16[3]=b0 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
326
rsbne r2, r2, #0 @ R2=-ROWr16[3]
327
mlane r1, r11, r2, r1 @ R1-=W7*ROWr16[3]=b1 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
328
mlane r5, r8, r2, r5 @ R5-=W1*ROWr16[3]=b2 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
329
mlane r7, r10, r2, r7 @ R7-=W5*ROWr16[3]=b3 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
305
@@ at this point, R0=block (temp), R1-R11 (free)
306
@@ R12=__const_ptr_, R14=&block[n]
307
@@ proceed with b0-b3 first, followed by a0-a3
308
@@ MUL16(b0, W1, col[8x1]);
309
@@ MUL16(b1, W3, col[8x1]);
310
@@ MUL16(b2, W5, col[8x1]);
311
@@ MUL16(b3, W7, col[8x1]);
312
@@ MAC16(b0, W3, col[8x3]);
313
@@ MAC16(b1, -W7, col[8x3]);
314
@@ MAC16(b2, -W1, col[8x3]);
315
@@ MAC16(b3, -W5, col[8x3]);
316
ldr r8, [r12, #offW1] @ R8=W1
318
mul r0, r8, r7 @ R0=W1*ROWr16[1]=b0 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
319
ldr r9, [r12, #offW3] @ R9=W3
320
ldr r10, [r12, #offW5] @ R10=W5
321
mul r1, r9, r7 @ R1=W3*ROWr16[1]=b1 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
322
ldr r11, [r12, #offW7] @ R11=W7
323
mul r5, r10, r7 @ R5=W5*ROWr16[1]=b2 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
325
mul r7, r11, r7 @ R7=W7*ROWr16[1]=b3 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
326
teq r2, #0 @ if 0, then avoid muls
327
mlane r0, r9, r2, r0 @ R0+=W3*ROWr16[3]=b0 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
328
rsbne r2, r2, #0 @ R2=-ROWr16[3]
329
mlane r1, r11, r2, r1 @ R1-=W7*ROWr16[3]=b1 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
330
mlane r5, r8, r2, r5 @ R5-=W1*ROWr16[3]=b2 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
331
mlane r7, r10, r2, r7 @ R7-=W5*ROWr16[3]=b3 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
331
@@ at this point, R0=b0, R1=b1, R2 (free), R3 (free), R4 (free),
332
@@ R5=b2, R6 (free), R7=b3, R8=W1, R9=W3, R10=W5, R11=W7,
333
@@ R12=__const_ptr_, R14=&block[n]
334
@@ MAC16(b0, W5, col[5x8]);
335
@@ MAC16(b2, W7, col[5x8]);
336
@@ MAC16(b3, W3, col[5x8]);
337
@@ MAC16(b1, -W1, col[5x8]);
338
@@ MAC16(b0, W7, col[7x8]);
339
@@ MAC16(b2, W3, col[7x8]);
340
@@ MAC16(b3, -W1, col[7x8]);
341
@@ MAC16(b1, -W5, col[7x8]);
342
ldrsh r3, [r14, #80] @ R3=COLr16[5x8]
343
teq r3, #0 @ if 0 then avoid muls
344
mlane r0, r10, r3, r0 @ R0+=W5*ROWr16[5x8]=b0
345
mlane r5, r11, r3, r5 @ R5+=W7*ROWr16[5x8]=b2
346
mlane r7, r9, r3, r7 @ R7+=W3*ROWr16[5x8]=b3
347
rsbne r3, r3, #0 @ R3=-ROWr16[5x8]
348
ldrsh r4, [r14, #112] @ R4=COLr16[7x8]
349
mlane r1, r8, r3, r1 @ R7-=W1*ROWr16[5x8]=b1
351
teq r4, #0 @ if 0 then avoid muls
352
mlane r0, r11, r4, r0 @ R0+=W7*ROWr16[7x8]=b0
353
mlane r5, r9, r4, r5 @ R5+=W3*ROWr16[7x8]=b2
354
rsbne r4, r4, #0 @ R4=-ROWr16[7x8]
355
mlane r7, r8, r4, r7 @ R7-=W1*ROWr16[7x8]=b3
356
mlane r1, r10, r4, r1 @ R1-=W5*ROWr16[7x8]=b1
333
@@ at this point, R0=b0, R1=b1, R2 (free), R3 (free), R4 (free),
334
@@ R5=b2, R6 (free), R7=b3, R8=W1, R9=W3, R10=W5, R11=W7,
335
@@ R12=__const_ptr_, R14=&block[n]
336
@@ MAC16(b0, W5, col[5x8]);
337
@@ MAC16(b2, W7, col[5x8]);
338
@@ MAC16(b3, W3, col[5x8]);
339
@@ MAC16(b1, -W1, col[5x8]);
340
@@ MAC16(b0, W7, col[7x8]);
341
@@ MAC16(b2, W3, col[7x8]);
342
@@ MAC16(b3, -W1, col[7x8]);
343
@@ MAC16(b1, -W5, col[7x8]);
344
ldrsh r3, [r14, #80] @ R3=COLr16[5x8]
345
teq r3, #0 @ if 0 then avoid muls
346
mlane r0, r10, r3, r0 @ R0+=W5*ROWr16[5x8]=b0
347
mlane r5, r11, r3, r5 @ R5+=W7*ROWr16[5x8]=b2
348
mlane r7, r9, r3, r7 @ R7+=W3*ROWr16[5x8]=b3
349
rsbne r3, r3, #0 @ R3=-ROWr16[5x8]
350
ldrsh r4, [r14, #112] @ R4=COLr16[7x8]
351
mlane r1, r8, r3, r1 @ R7-=W1*ROWr16[5x8]=b1
353
teq r4, #0 @ if 0 then avoid muls
354
mlane r0, r11, r4, r0 @ R0+=W7*ROWr16[7x8]=b0
355
mlane r5, r9, r4, r5 @ R5+=W3*ROWr16[7x8]=b2
356
rsbne r4, r4, #0 @ R4=-ROWr16[7x8]
357
mlane r7, r8, r4, r7 @ R7-=W1*ROWr16[7x8]=b3
358
mlane r1, r10, r4, r1 @ R1-=W5*ROWr16[7x8]=b1
358
360
__end_b_evaluation2:
359
@@ at this point, R0=b0, R1=b1, R2 (free), R3 (free), R4 (free),
360
@@ R5=b2, R6 (free), R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
361
@@ R12=__const_ptr_, R14=&block[n]
361
@@ at this point, R0=b0, R1=b1, R2 (free), R3 (free), R4 (free),
362
@@ R5=b2, R6 (free), R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
363
@@ R12=__const_ptr_, R14=&block[n]
364
@@ a0 = (W4 * col[8x0]) + (1 << (COL_SHIFT - 1));
365
@@ a1 = a0 + W6 * row[2];
366
@@ a2 = a0 - W6 * row[2];
367
@@ a3 = a0 - W2 * row[2];
368
@@ a0 = a0 + W2 * row[2];
370
ldr r9, [r12, #offW4] @ R9=W4
371
mul r6, r9, r6 @ R6=W4*ROWr16[0]
372
ldr r10, [r12, #offW6] @ R10=W6
373
ldrsh r4, [r14, #32] @ R4=ROWr16[2] (a3 not defined yet)
374
add r6, r6, #COL_SHIFTED_1 @ R6=W4*ROWr16[0] + 1<<(COL_SHIFT-1) (a0)
375
mul r11, r10, r4 @ R11=W6*ROWr16[2]
376
ldr r8, [r12, #offW2] @ R8=W2
377
add r2, r6, r11 @ R2=a0+W6*ROWr16[2] (a1)
378
sub r3, r6, r11 @ R3=a0-W6*ROWr16[2] (a2)
379
mul r11, r8, r4 @ R11=W2*ROWr16[2]
380
sub r4, r6, r11 @ R4=a0-W2*ROWr16[2] (a3)
381
add r6, r6, r11 @ R6=a0+W2*ROWr16[2] (a0)
366
@@ a0 = (W4 * col[8x0]) + (1 << (COL_SHIFT - 1));
367
@@ a1 = a0 + W6 * row[2];
368
@@ a2 = a0 - W6 * row[2];
369
@@ a3 = a0 - W2 * row[2];
370
@@ a0 = a0 + W2 * row[2];
372
ldr r9, [r12, #offW4] @ R9=W4
373
mul r6, r9, r6 @ R6=W4*ROWr16[0]
374
ldr r10, [r12, #offW6] @ R10=W6
375
ldrsh r4, [r14, #32] @ R4=ROWr16[2] (a3 not defined yet)
376
add r6, r6, #COL_SHIFTED_1 @ R6=W4*ROWr16[0] + 1<<(COL_SHIFT-1) (a0)
377
mul r11, r10, r4 @ R11=W6*ROWr16[2]
378
ldr r8, [r12, #offW2] @ R8=W2
379
add r2, r6, r11 @ R2=a0+W6*ROWr16[2] (a1)
380
sub r3, r6, r11 @ R3=a0-W6*ROWr16[2] (a2)
381
mul r11, r8, r4 @ R11=W2*ROWr16[2]
382
sub r4, r6, r11 @ R4=a0-W2*ROWr16[2] (a3)
383
add r6, r6, r11 @ R6=a0+W2*ROWr16[2] (a0)
383
@@ at this point, R0=b0, R1=b1, R2=a1, R3=a2, R4=a3,
384
@@ R5=b2, R6=a0, R7=b3, R8=W2, R9=W4, R10=W6, R11 (free),
385
@@ R12=__const_ptr_, R14=&block[n]
390
ldrsh r11, [r14, #64] @ R11=ROWr16[4]
391
teq r11, #0 @ if null avoid muls
392
mulne r11, r9, r11 @ R11=W4*ROWr16[4]
394
addne r6, r6, r11 @ R6+=W4*ROWr16[4] (a0)
395
subne r2, r2, r11 @ R2-=W4*ROWr16[4] (a1)
396
subne r3, r3, r11 @ R3-=W4*ROWr16[4] (a2)
397
ldrsh r9, [r14, #96] @ R9=ROWr16[6]
398
addne r4, r4, r11 @ R4+=W4*ROWr16[4] (a3)
399
@@ W6 alone is no more useful, save W2*ROWr16[6] in it instead
400
teq r9, #0 @ if null avoid muls
401
mulne r11, r10, r9 @ R11=W6*ROWr16[6]
402
addne r6, r6, r11 @ R6+=W6*ROWr16[6] (a0)
403
mulne r10, r8, r9 @ R10=W2*ROWr16[6]
408
subne r4, r4, r11 @ R4-=W6*ROWr16[6] (a3)
409
subne r2, r2, r10 @ R2-=W2*ROWr16[6] (a1)
410
addne r3, r3, r10 @ R3+=W2*ROWr16[6] (a2)
385
@@ at this point, R0=b0, R1=b1, R2=a1, R3=a2, R4=a3,
386
@@ R5=b2, R6=a0, R7=b3, R8=W2, R9=W4, R10=W6, R11 (free),
387
@@ R12=__const_ptr_, R14=&block[n]
392
ldrsh r11, [r14, #64] @ R11=ROWr16[4]
393
teq r11, #0 @ if null avoid muls
394
mulne r11, r9, r11 @ R11=W4*ROWr16[4]
396
addne r6, r6, r11 @ R6+=W4*ROWr16[4] (a0)
397
subne r2, r2, r11 @ R2-=W4*ROWr16[4] (a1)
398
subne r3, r3, r11 @ R3-=W4*ROWr16[4] (a2)
399
ldrsh r9, [r14, #96] @ R9=ROWr16[6]
400
addne r4, r4, r11 @ R4+=W4*ROWr16[4] (a3)
401
@@ W6 alone is no more useful, save W2*ROWr16[6] in it instead
402
teq r9, #0 @ if null avoid muls
403
mulne r11, r10, r9 @ R11=W6*ROWr16[6]
404
addne r6, r6, r11 @ R6+=W6*ROWr16[6] (a0)
405
mulne r10, r8, r9 @ R10=W2*ROWr16[6]
410
subne r4, r4, r11 @ R4-=W6*ROWr16[6] (a3)
411
subne r2, r2, r10 @ R2-=W2*ROWr16[6] (a1)
412
addne r3, r3, r10 @ R3+=W2*ROWr16[6] (a2)
411
413
__end_a_evaluation2:
412
@@ at this point, R0=b0, R1=b1, R2=a1, R3=a2, R4=a3,
413
@@ R5=b2, R6=a0, R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
414
@@ R12=__const_ptr_, R14=&block[n]
415
@@ col[0 ] = ((a0 + b0) >> COL_SHIFT);
416
@@ col[8 ] = ((a1 + b1) >> COL_SHIFT);
417
@@ col[16] = ((a2 + b2) >> COL_SHIFT);
418
@@ col[24] = ((a3 + b3) >> COL_SHIFT);
419
@@ col[32] = ((a3 - b3) >> COL_SHIFT);
420
@@ col[40] = ((a2 - b2) >> COL_SHIFT);
421
@@ col[48] = ((a1 - b1) >> COL_SHIFT);
422
@@ col[56] = ((a0 - b0) >> COL_SHIFT);
423
@@@@@ no optimisation here @@@@@
424
add r8, r6, r0 @ R8=a0+b0
425
add r9, r2, r1 @ R9=a1+b1
426
mov r8, r8, asr #COL_SHIFT
427
mov r9, r9, asr #COL_SHIFT
430
add r8, r3, r5 @ R8=a2+b2
431
add r9, r4, r7 @ R9=a3+b3
432
mov r8, r8, asr #COL_SHIFT
433
mov r9, r9, asr #COL_SHIFT
436
sub r8, r4, r7 @ R8=a3-b3
437
sub r9, r3, r5 @ R9=a2-b2
438
mov r8, r8, asr #COL_SHIFT
439
mov r9, r9, asr #COL_SHIFT
442
sub r8, r2, r1 @ R8=a1-b1
443
sub r9, r6, r0 @ R9=a0-b0
444
mov r8, r8, asr #COL_SHIFT
445
mov r9, r9, asr #COL_SHIFT
414
@@ at this point, R0=b0, R1=b1, R2=a1, R3=a2, R4=a3,
415
@@ R5=b2, R6=a0, R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
416
@@ R12=__const_ptr_, R14=&block[n]
417
@@ col[0 ] = ((a0 + b0) >> COL_SHIFT);
418
@@ col[8 ] = ((a1 + b1) >> COL_SHIFT);
419
@@ col[16] = ((a2 + b2) >> COL_SHIFT);
420
@@ col[24] = ((a3 + b3) >> COL_SHIFT);
421
@@ col[32] = ((a3 - b3) >> COL_SHIFT);
422
@@ col[40] = ((a2 - b2) >> COL_SHIFT);
423
@@ col[48] = ((a1 - b1) >> COL_SHIFT);
424
@@ col[56] = ((a0 - b0) >> COL_SHIFT);
425
@@@@@ no optimisation here @@@@@
426
add r8, r6, r0 @ R8=a0+b0
427
add r9, r2, r1 @ R9=a1+b1
428
mov r8, r8, asr #COL_SHIFT
429
mov r9, r9, asr #COL_SHIFT
432
add r8, r3, r5 @ R8=a2+b2
433
add r9, r4, r7 @ R9=a3+b3
434
mov r8, r8, asr #COL_SHIFT
435
mov r9, r9, asr #COL_SHIFT
438
sub r8, r4, r7 @ R8=a3-b3
439
sub r9, r3, r5 @ R9=a2-b2
440
mov r8, r8, asr #COL_SHIFT
441
mov r9, r9, asr #COL_SHIFT
444
sub r8, r2, r1 @ R8=a1-b1
445
sub r9, r6, r0 @ R9=a0-b0
446
mov r8, r8, asr #COL_SHIFT
447
mov r9, r9, asr #COL_SHIFT
450
@@ at this point, R0-R11 (free)
451
@@ R12=__const_ptr_, R14=&block[n]
452
ldr r0, [sp, #0] @ R0=block
453
teq r0, r14 @ compare current &block[n] to block, when block is reached, the loop is finished.
452
@@ at this point, R0-R11 (free)
453
@@ R12=__const_ptr_, R14=&block[n]
454
ldr r0, [sp, #0] @ R0=block
455
teq r0, r14 @ compare current &block[n] to block, when block is reached, the loop is finished.