27 #if defined(ARM_COMPUTE_ENABLE_SME)
31 void sme_transpose_interleave_8VL_1x4(uint8_t *out,
const uint8_t *in,
size_t width,
size_t in_stride,
size_t height)
33 uint8_t *pad_row =
reinterpret_cast<uint8_t *
>(alloca(width *
sizeof(uint8_t)));
36 memset(pad_row, 0, width *
sizeof(uint8_t));
39 size_t out_stride = 8 * roundup<size_t>(height, 4) * sme::get_vector_length<uint32_t>();
42 ".inst 0xd503477f // SMSTART ZA\n"
46 "add x25, x26, %x[in_stride]\n"
47 "add x24, x25, %x[in_stride]\n"
48 "add x23, x24, %x[in_stride]\n"
49 "cmp %x[height], #0x3\n"
50 "add %x[in], x23, %x[in_stride]\n"
51 "csel x23, x23, %x[pad_row], GT\n"
52 "csel x24, x24, %x[pad_row], GE\n"
53 "cmp %x[height], #0x1\n"
55 "csel x25, x25, %x[pad_row], GT\n"
56 "sub %x[height], %x[height], #0x4\n"
57 "mov x21, %x[width]\n"
60 "whilelt p1.b, XZR, x20\n"
61 "ld1b { z19.b }, p1/Z, [x26]\n"
63 "whilelt p0.b, XZR, x20\n"
64 "ld1b { z17.b }, p0/Z, [x26, #1, MUL VL]\n"
65 "ld1b { z18.b }, p1/Z, [x25]\n"
66 "decw x21, ALL, MUL #8\n"
68 "ld1b { z21.b }, p0/Z, [x25, #1, MUL VL]\n"
69 "addvl x26, x26, #2\n"
70 "addvl x25, x25, #2\n"
71 "ld1b { z16.b }, p1/Z, [x24]\n"
72 "zip1 z24.b, z19.b, z16.b\n"
73 "zip2 z20.b, z19.b, z16.b\n"
74 "ld1b { z16.b }, p0/Z, [x24, #1, MUL VL]\n"
75 "zip1 z23.b, z17.b, z16.b\n"
76 "zip2 z22.b, z17.b, z16.b\n"
77 "addvl x24, x24, #2\n"
78 "ld1b { z16.b }, p1/Z, [x23]\n"
79 "zip1 z17.b, z18.b, z16.b\n"
80 "zip2 z19.b, z18.b, z16.b\n"
81 "ld1b { z16.b }, p0/Z, [x23, #1, MUL VL]\n"
82 "zip1 z18.b, z21.b, z16.b\n"
83 "zip2 z21.b, z21.b, z16.b\n"
84 "addvl x23, x23, #2\n"
85 "zip1 z16.b, z24.b, z17.b\n"
86 "zip2 z17.b, z24.b, z17.b\n"
87 "st1b { z16.b }, p2, [x22]\n"
88 "zip1 z16.b, z20.b, z19.b\n"
89 "zip2 z20.b, z20.b, z19.b\n"
90 "st1b { z17.b }, p2, [x22, #1, MUL VL]\n"
91 "zip1 z19.b, z23.b, z18.b\n"
92 "zip2 z18.b, z23.b, z18.b\n"
93 "st1b { z16.b }, p2, [x22, #2, MUL VL]\n"
94 "zip1 z17.b, z22.b, z21.b\n"
95 "zip2 z16.b, z22.b, z21.b\n"
96 "st1b { z20.b }, p2, [x22, #3, MUL VL]\n"
97 "st1b { z19.b }, p2, [x22, #4, MUL VL]\n"
98 "st1b { z18.b }, p2, [x22, #5, MUL VL]\n"
99 "st1b { z17.b }, p2, [x22, #6, MUL VL]\n"
100 "st1b { z16.b }, p2, [x22, #7, MUL VL]\n"
101 "add x22, x22, %x[out_stride]\n"
104 "cmp %x[height], #0x1\n"
105 "addvl %x[out], %x[out], #8\n"
107 ".inst 0xd503467f // SMSTOP\n"
108 : [height]
"+&r" (height), [in]
"+&r" (in), [out]
"+&r" (out)
109 : [in_stride]
"r" (in_stride), [out_stride]
"r" (out_stride), [pad_row]
"r" (pad_row), [width]
"r" (width)
110 :
"cc",
"memory",
"p0",
"p1",
"p2",
"p3",
"p4",
"p5",
"p6",
"p7",
"p8",
"p9",
"p10",
"p11",
"p12",
"p13",
"p14",
"p15",
"x20",
"x21",
"x22",
"x23",
"x24",
"x25",
"x26",
"z0",
"z1",
"z2",
"z3",
"z4",
"z5",
"z6",
"z7",
"z8",
"z9",
"z10",
"z11",
"z12",
"z13",
"z14",
"z15",
"z16",
"z17",
"z18",
"z19",
"z20",
"z21",
"z22",
"z23",
"z24",
"z25",
"z26",
"z27",
"z28",
"z29",
"z30",
"z31"
117 void Transform<8, 4, true, VLType::SME>(
118 uint8_t *out,
const uint8_t *in,
int stride,
int x0,
int xmax,
int k0,
int kmax)
120 sme_transpose_interleave_8VL_1x4(
121 reinterpret_cast<uint8_t *
>(out),
122 reinterpret_cast<const uint8_t *
>(in + k0 * stride + x0),
123 (xmax-x0) *
sizeof(uint8_t) / 1,
124 stride *
sizeof(uint8_t),
130 void Transform<8, 4, true, VLType::SME>(
131 int8_t *out,
const int8_t *in,
int stride,
int x0,
int xmax,
int k0,
int kmax)
133 sme_transpose_interleave_8VL_1x4(
134 reinterpret_cast<uint8_t *
>(out),
135 reinterpret_cast<const uint8_t *
>(in + k0 * stride + x0),
136 (xmax-x0) *
sizeof(int8_t) / 1,
137 stride *
sizeof(int8_t),
143 #endif // defined(ARM_COMPUTE_ENABLE_SME)