1 /* 2 * SPARC assembly matrix code. 3 */ 4 5 #ifndef _SPARC_MATRIX_H 6 #define _SPARC_MATRIX_H 7 8 #ifdef __arch64__ 9 #define LDPTR ldx 10 #define MATH_ASM_PTR_SIZE 8 11 #include "math/m_vector_asm.h" 12 #else 13 #define LDPTR ld 14 #define MATH_ASM_PTR_SIZE 4 15 #include "math/m_vector_asm.h" 16 #endif 17 18 #define VEC_SIZE_1 1 19 #define VEC_SIZE_2 3 20 #define VEC_SIZE_3 7 21 #define VEC_SIZE_4 15 22 23 #define M0 %f16 24 #define M1 %f17 25 #define M2 %f18 26 #define M3 %f19 27 #define M4 %f20 28 #define M5 %f21 29 #define M6 %f22 30 #define M7 %f23 31 #define M8 %f24 32 #define M9 %f25 33 #define M10 %f26 34 #define M11 %f27 35 #define M12 %f28 36 #define M13 %f29 37 #define M14 %f30 38 #define M15 %f31 39 40 #define LDMATRIX_0_1_2_3_12_13_14_15(BASE) \ 41 ldd [BASE + ( 0 * 0x4)], M0; \ 42 ldd [BASE + ( 2 * 0x4)], M2; \ 43 ldd [BASE + (12 * 0x4)], M12; \ 44 ldd [BASE + (14 * 0x4)], M14 45 46 #define LDMATRIX_0_1_12_13(BASE) \ 47 ldd [BASE + ( 0 * 0x4)], M0; \ 48 ldd [BASE + (12 * 0x4)], M12 49 50 #define LDMATRIX_0_12_13(BASE) \ 51 ld [BASE + ( 0 * 0x4)], M0; \ 52 ldd [BASE + (12 * 0x4)], M12 53 54 #define LDMATRIX_0_1_2_12_13_14(BASE) \ 55 ldd [BASE + ( 0 * 0x4)], M0; \ 56 ld [BASE + ( 2 * 0x4)], M2; \ 57 ldd [BASE + (12 * 0x4)], M12; \ 58 ld [BASE + (14 * 0x4)], M14 59 60 #define LDMATRIX_0_12_13_14(BASE) \ 61 ld [BASE + ( 0 * 0x4)], M0; \ 62 ldd [BASE + (12 * 0x4)], M12; \ 63 ld [BASE + (14 * 0x4)], M14 64 65 #define LDMATRIX_0_14(BASE) \ 66 ld [BASE + ( 0 * 0x4)], M0; \ 67 ld [BASE + (14 * 0x4)], M14 68 69 #define LDMATRIX_0_1_2_3_4_5_6_7_12_13_14_15(BASE) \ 70 ldd [BASE + ( 0 * 0x4)], M0; \ 71 ldd [BASE + ( 2 * 0x4)], M2; \ 72 ldd [BASE + ( 4 * 0x4)], M4; \ 73 ldd [BASE + ( 6 * 0x4)], M6; \ 74 ldd [BASE + (12 * 0x4)], M12; \ 75 ldd [BASE + (14 * 0x4)], M14 76 77 #define LDMATRIX_0_5_12_13(BASE) \ 78 ld [BASE + ( 0 * 0x4)], M0; \ 79 ld [BASE + ( 5 * 0x4)], M5; \ 80 ldd [BASE + (12 * 0x4)], M12 81 82 #define LDMATRIX_0_1_2_3_4_5_6_12_13_14(BASE) \ 83 ldd [BASE + ( 0 * 0x4)], M0; \ 84 ldd [BASE + ( 2 * 0x4)], M2; \ 85 ldd [BASE + ( 4 * 0x4)], M4; \ 86 ld [BASE + ( 6 * 0x4)], M6; \ 87 ldd [BASE + (12 * 0x4)], M12; \ 88 ld [BASE + (14 * 0x4)], M14 89 90 #define LDMATRIX_0_5_12_13_14(BASE) \ 91 ld [BASE + ( 0 * 0x4)], M0; \ 92 ld [BASE + ( 5 * 0x4)], M5; \ 93 ldd [BASE + (12 * 0x4)], M12; \ 94 ld [BASE + (14 * 0x4)], M14 95 96 #define LDMATRIX_0_5_14(BASE) \ 97 ld [BASE + ( 0 * 0x4)], M0; \ 98 ld [BASE + ( 5 * 0x4)], M5; \ 99 ld [BASE + (14 * 0x4)], M14 100 101 #define LDMATRIX_0_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15(BASE) \ 102 ldd [BASE + ( 0 * 0x4)], M0; \ 103 ldd [BASE + ( 2 * 0x4)], M2; \ 104 ldd [BASE + ( 4 * 0x4)], M4; \ 105 ldd [BASE + ( 6 * 0x4)], M6; \ 106 ldd [BASE + ( 8 * 0x4)], M8; \ 107 ldd [BASE + (10 * 0x4)], M10; \ 108 ldd [BASE + (12 * 0x4)], M12; \ 109 ldd [BASE + (14 * 0x4)], M14 110 111 #define LDMATRIX_0_1_4_5_12_13(BASE) \ 112 ldd [BASE + ( 0 * 0x4)], M0; \ 113 ldd [BASE + ( 4 * 0x4)], M4; \ 114 ldd [BASE + (12 * 0x4)], M12 115 116 #define LDMATRIX_0_5_12_13(BASE) \ 117 ld [BASE + ( 0 * 0x4)], M0; \ 118 ld [BASE + ( 5 * 0x4)], M5; \ 119 ldd [BASE + (12 * 0x4)], M12 120 121 #define LDMATRIX_0_1_2_4_5_6_8_9_10(BASE) \ 122 ldd [BASE + ( 0 * 0x4)], M0; \ 123 ld [BASE + ( 2 * 0x4)], M2; \ 124 ldd [BASE + ( 4 * 0x4)], M4; \ 125 ld [BASE + ( 6 * 0x4)], M6; \ 126 ldd [BASE + ( 8 * 0x4)], M8; \ 127 ld [BASE + (10 * 0x4)], M10 128 129 #define LDMATRIX_0_1_2_4_5_6_8_9_10_12_13_14(BASE) \ 130 ldd [BASE + ( 0 * 0x4)], M0; \ 131 ld [BASE + ( 2 * 0x4)], M2; \ 132 ldd [BASE + ( 4 * 0x4)], M4; \ 133 ld [BASE + ( 6 * 0x4)], M6; \ 134 ldd [BASE + ( 8 * 0x4)], M8; \ 135 ld [BASE + (10 * 0x4)], M10; \ 136 ldd [BASE + (12 * 0x4)], M12; \ 137 ld [BASE + (14 * 0x4)], M14 138 139 #define LDMATRIX_0_5_10(BASE) \ 140 ld [BASE + ( 0 * 0x4)], M0; \ 141 ld [BASE + ( 5 * 0x4)], M5; \ 142 ld [BASE + (10 * 0x4)], M10; 143 144 #define LDMATRIX_0_5_10_12_13_14(BASE) \ 145 ld [BASE + ( 0 * 0x4)], M0; \ 146 ld [BASE + ( 5 * 0x4)], M5; \ 147 ld [BASE + (10 * 0x4)], M10; \ 148 ldd [BASE + (12 * 0x4)], M12; \ 149 ld [BASE + (14 * 0x4)], M14 150 151 #define LDMATRIX_0_5_8_9_10_14(BASE) \ 152 ld [BASE + ( 0 * 0x4)], M0; \ 153 ld [BASE + ( 5 * 0x4)], M5; \ 154 ldd [BASE + ( 8 * 0x4)], M8; \ 155 ld [BASE + (10 * 0x4)], M10; \ 156 ld [BASE + (14 * 0x4)], M14 157 158 #endif /* !(_SPARC_MATRIX_H) */ 159