29 #if defined(__aarch64__)
34 void a64_u8_nhwc_max_2x2_s1_output2x2_depthfirst_impl(
35 const unsigned int n_channels,
36 const uint8_t *
const *
const inptrs,
37 uint8_t *
const *
const outptrs,
38 const bool exclude_padding,
39 const unsigned int pad_left,
40 const unsigned int pad_top,
41 const unsigned int pad_right,
42 const unsigned int pad_bottom
47 const uint64_t n_channels;
48 const uint8_t *
const *
const inptrs;
49 uint8_t *
const *
const outptrs;
51 unsigned int channels,
52 const uint8_t *
const *input_ptrs,
53 uint8_t *
const * output_ptrs,
54 bool,
unsigned int,
unsigned int,
unsigned int,
unsigned int
55 ) : n_channels(channels),
62 const KernelArgs
args(n_channels, inptrs, outptrs, exclude_padding,
63 pad_left, pad_top, pad_right, pad_bottom);
66 "ldr x16, [%x[args], %[offsetof_n_channels]]\n"
67 "ldr x21, [%x[args], %[offsetof_outptrs]]\n"
70 "ldr x20, [%x[args], %[offsetof_inptrs]]\n"
71 "ldp x14, x13, [x21, #0x0]\n"
73 "ldp x11, x10, [x21, #0x10]\n"
74 "ldp x9, x28, [x20, #0x0]\n"
75 "ldp x27, x26, [x20, #0x10]\n"
76 "ldp x25, x24, [x20, #0x20]\n"
77 "ldp x23, x22, [x20, #0x30]\n"
78 "ldr x21, [x20, #0x40]\n"
80 "ldr q30, [x28, x15]\n"
81 "ldr q29, [x25, x15]\n"
82 "lsr x20, x16, #0x4\n"
83 "sub x16, x16, x20, LSL #4\n"
84 "ldr q28, [x22, x15]\n"
85 "ldr q27, [x26, x15]\n"
86 "subs x20, x20, #0x1\n"
87 "ldr q26, [x9, x15]\n"
88 "ldr q25, [x27, x15]\n"
89 "ldr q24, [x24, x15]\n"
90 "ldr q23, [x23, x15]\n"
91 "ldr q22, [x21, x15]\n"
92 "add x15, x15, #0x10\n"
95 "umax v21.16b, v30.16b, v29.16b\n"
96 "ldr q30, [x28, x15]\n"
97 "umax v20.16b, v29.16b, v28.16b\n"
98 "ldr q29, [x25, x15]\n"
99 "ldr q28, [x22, x15]\n"
100 "umax v19.16b, v27.16b, v26.16b\n"
101 "ldr q26, [x9, x15]\n"
102 "umax v18.16b, v25.16b, v24.16b\n"
103 "ldr q25, [x27, x15]\n"
104 "umax v17.16b, v27.16b, v23.16b\n"
105 "ldr q27, [x26, x15]\n"
106 "umax v16.16b, v24.16b, v22.16b\n"
107 "ldr q24, [x24, x15]\n"
108 "ldr q23, [x23, x15]\n"
109 "subs x20, x20, #0x1\n"
110 "umax v19.16b, v21.16b, v19.16b\n"
111 "ldr q22, [x21, x15]\n"
112 "umax v18.16b, v18.16b, v21.16b\n"
113 "umax v17.16b, v17.16b, v20.16b\n"
114 "add x15, x15, #0x10\n"
115 "umax v16.16b, v20.16b, v16.16b\n"
116 "str q19, [x14, x12]\n"
117 "str q18, [x13, x12]\n"
118 "str q17, [x11, x12]\n"
119 "str q16, [x10, x12]\n"
120 "add x12, x12, #0x10\n"
123 "umax v21.16b, v30.16b, v29.16b\n"
124 "umax v20.16b, v29.16b, v28.16b\n"
125 "umax v16.16b, v27.16b, v26.16b\n"
126 "umax v18.16b, v25.16b, v24.16b\n"
127 "umax v17.16b, v27.16b, v23.16b\n"
128 "umax v19.16b, v24.16b, v22.16b\n"
129 "umax v16.16b, v21.16b, v16.16b\n"
130 "umax v18.16b, v18.16b, v21.16b\n"
131 "str q16, [x14, x12]\n"
132 "umax v17.16b, v17.16b, v20.16b\n"
133 "umax v16.16b, v20.16b, v19.16b\n"
134 "str q18, [x13, x12]\n"
135 "str q17, [x11, x12]\n"
136 "str q16, [x10, x12]\n"
137 "add x12, x12, #0x10\n"
140 "ldr b16, [x28, x15]\n"
141 "ldr b17, [x25, x15]\n"
142 "umax v23.16b, v16.16b, v17.16b\n"
143 "subs x16, x16, #0x1\n"
144 "ldr b16, [x22, x15]\n"
145 "ldr b22, [x26, x15]\n"
146 "umax v21.16b, v17.16b, v16.16b\n"
147 "ldr b16, [x9, x15]\n"
148 "ldr b17, [x27, x15]\n"
149 "umax v16.16b, v22.16b, v16.16b\n"
150 "umax v20.16b, v23.16b, v16.16b\n"
151 "ldr b19, [x24, x15]\n"
152 "ldr b16, [x23, x15]\n"
153 "umax v18.16b, v17.16b, v19.16b\n"
154 "umax v17.16b, v22.16b, v16.16b\n"
155 "ldr b16, [x21, x15]\n"
156 "umax v16.16b, v19.16b, v16.16b\n"
157 "add x15, x15, #0x1\n"
158 "umax v18.16b, v18.16b, v23.16b\n"
159 "umax v17.16b, v17.16b, v21.16b\n"
160 "umax v16.16b, v21.16b, v16.16b\n"
161 "str b20, [x14, x12]\n"
162 "str b18, [x13, x12]\n"
163 "str b17, [x11, x12]\n"
164 "str b16, [x10, x12]\n"
165 "add x12, x12, #0x1\n"
169 : [
args]
"r" (&
args), [offsetof_inptrs]
"I" (offsetof(KernelArgs, inptrs)), [offsetof_n_channels]
"I" (offsetof(KernelArgs, n_channels)), [offsetof_outptrs]
"I" (offsetof(KernelArgs, outptrs))
170 :
"cc",
"memory",
"v16",
"v17",
"v18",
"v19",
"v20",
"v21",
"v22",
"v23",
"v24",
"v25",
"v26",
"v27",
"v28",
"v29",
"v30",
"x9",
"x10",
"x11",
"x12",
"x13",
"x14",
"x15",
"x16",
"x20",
"x21",
"x22",
"x23",
"x24",
"x25",
"x26",
"x27",
"x28"
177 #endif // defined(__aarch64__)