2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
10 void Matrix4Mul(float* src_mat_1
, const float* src_mat_2
)
13 // Store A & B leaving room at top of registers for result (q0-q3)
14 "vldmia %0, { q4-q7 } \n\t"
15 "vldmia %1, { q8-q11 } \n\t"
17 // result = first column of B x first row of A
18 "vmul.f32 q0, q8, d8[0]\n\t"
19 "vmul.f32 q1, q8, d10[0]\n\t"
20 "vmul.f32 q2, q8, d12[0]\n\t"
21 "vmul.f32 q3, q8, d14[0]\n\t"
23 // result += second column of B x second row of A
24 "vmla.f32 q0, q9, d8[1]\n\t"
25 "vmla.f32 q1, q9, d10[1]\n\t"
26 "vmla.f32 q2, q9, d12[1]\n\t"
27 "vmla.f32 q3, q9, d14[1]\n\t"
29 // result += third column of B x third row of A
30 "vmla.f32 q0, q10, d9[0]\n\t"
31 "vmla.f32 q1, q10, d11[0]\n\t"
32 "vmla.f32 q2, q10, d13[0]\n\t"
33 "vmla.f32 q3, q10, d15[0]\n\t"
35 // result += last column of B x last row of A
36 "vmla.f32 q0, q11, d9[1]\n\t"
37 "vmla.f32 q1, q11, d11[1]\n\t"
38 "vmla.f32 q2, q11, d13[1]\n\t"
39 "vmla.f32 q3, q11, d15[1]\n\t"
41 // output = result registers
42 "vstmia %1, { q0-q3 }"
44 : "r" (src_mat_2
), "r" (src_mat_1
) // input - note *value* of pointer doesn't change
45 : "memory", "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9", "q10", "q11" //clobber