aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-framework/tensorflow/files/0001-fix-XNNPACK-build-failure-for-qemuarm.patch
blob: dea74d993aac040c78b622235be5d62b5f247b31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
From c15caa4d5f133307a23114c41a9c497e5ec9da2c Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Thu, 23 Mar 2023 10:28:04 +0800
Subject: [PATCH] fix XNNPACK build failure for qemuarm

Does not support 32 bit ARM with Neon DotProduct

Upstream-Status: Inappropriate [oe specific]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../0001-XNNPACK-support-32-bit-x86.patch     | 216 +++++++++++++++++-
 1 file changed, 209 insertions(+), 7 deletions(-)

diff --git a/third_party/0001-XNNPACK-support-32-bit-x86.patch b/third_party/0001-XNNPACK-support-32-bit-x86.patch
index 2141c37236b..ca6a38545b1 100644
--- a/third_party/0001-XNNPACK-support-32-bit-x86.patch
+++ b/third_party/0001-XNNPACK-support-32-bit-x86.patch
@@ -1,22 +1,36 @@
-From 2345756776fa09fd95e29f96f781e15e3b18a61b Mon Sep 17 00:00:00 2001
+From 5ba6883121e91a334cc97ee98eea6ef0afb7a314 Mon Sep 17 00:00:00 2001
 From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Tue, 17 Aug 2021 01:09:53 -0700
+Date: Thu, 23 Mar 2023 10:11:11 +0800
 Subject: [PATCH] XNNPACK: support 32 bit x86
 
 Use android_x86 as a workaround to support 32 bit x86
 
+Does not support 32 bit ARM with Neon DotProduct
+
 Upstream-Status: Inappropriate [oe specific]
 
 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 ---
- BUILD.bazel | 1 -
- 1 file changed, 1 deletion(-)
+ BUILD.bazel                                                   | 2 --
+ ...c8-gemm-4x8c4-minmax-fp32-asm-aarch32-neondot-cortex-a55.S | 4 ++--
+ .../gen/qc8-gemm-4x8c4-minmax-fp32-asm-aarch32-neondot-ld64.S | 4 ++--
+ ...8-igemm-4x8c4-minmax-fp32-asm-aarch32-neondot-cortex-a55.S | 4 ++--
+ .../qc8-igemm-4x8c4-minmax-fp32-asm-aarch32-neondot-ld64.S    | 4 ++--
+ src/qs8-gemm/4x8c4-aarch32-neondot-cortex-a55.S.in            | 4 ++--
+ src/qs8-gemm/4x8c4-aarch32-neondot-ld64.S.in                  | 4 ++--
+ ...8-gemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-cortex-a55.S | 4 ++--
+ .../qs8-gemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-ld64.S    | 4 ++--
+ src/qs8-igemm/4x8c4-aarch32-neondot-cortex-a55.S.in           | 4 ++--
+ src/qs8-igemm/4x8c4-aarch32-neondot-ld64.S.in                 | 4 ++--
+ ...-igemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-cortex-a55.S | 4 ++--
+ .../qs8-igemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-ld64.S   | 4 ++--
+ 13 files changed, 24 insertions(+), 26 deletions(-)
 
 diff --git a/BUILD.bazel b/BUILD.bazel
-index 27ab07c9..f223d2ab 100644
+index b2a3b58..5144903 100644
 --- a/BUILD.bazel
 +++ b/BUILD.bazel
-@@ -8783,7 +8783,6 @@ config_setting(
+@@ -11077,7 +11077,6 @@ config_setting(
  config_setting(
      name = "android_x86",
      values = {
@@ -24,6 +38,194 @@ index 27ab07c9..f223d2ab 100644
          "cpu": "x86",
      },
  )
+@@ -11332,7 +11331,6 @@ alias(
+ selects.config_setting_group(
+     name = "arm_dotprod_enabled_by_default",
+     match_any = [
+-        ":aarch32",
+         ":aarch64",
+     ],
+ )
+diff --git a/src/qc8-gemm/gen/qc8-gemm-4x8c4-minmax-fp32-asm-aarch32-neondot-cortex-a55.S b/src/qc8-gemm/gen/qc8-gemm-4x8c4-minmax-fp32-asm-aarch32-neondot-cortex-a55.S
+index 0a52e85..1bf5016 100644
+--- a/src/qc8-gemm/gen/qc8-gemm-4x8c4-minmax-fp32-asm-aarch32-neondot-cortex-a55.S
++++ b/src/qc8-gemm/gen/qc8-gemm-4x8c4-minmax-fp32-asm-aarch32-neondot-cortex-a55.S
+@@ -45,8 +45,8 @@
+ //    int8_t output_max;          d13[7]
+ //  } xnn_qs8_minmax_params.neonv8;
+ 
+-// iOS does not support 32 bit ARM with Neon DotProduct.
+-#ifndef __APPLE__
++// Do not support 32 bit ARM with Neon DotProduct.
++#if 0
+ 
+ BEGIN_FUNCTION xnn_qc8_gemm_minmax_fp32_ukernel_4x8c4__asm_aarch32_neondot_cortex_a55
+         # Push 80 bytes
+diff --git a/src/qc8-gemm/gen/qc8-gemm-4x8c4-minmax-fp32-asm-aarch32-neondot-ld64.S b/src/qc8-gemm/gen/qc8-gemm-4x8c4-minmax-fp32-asm-aarch32-neondot-ld64.S
+index 6b5a2e9..15d4a89 100644
+--- a/src/qc8-gemm/gen/qc8-gemm-4x8c4-minmax-fp32-asm-aarch32-neondot-ld64.S
++++ b/src/qc8-gemm/gen/qc8-gemm-4x8c4-minmax-fp32-asm-aarch32-neondot-ld64.S
+@@ -45,8 +45,8 @@
+ //    int8_t output_max;          d13[7]
+ //  } xnn_qs8_minmax_params.neonv8;
+ 
+-// iOS does not support 32 bit ARM with Neon DotProduct.
+-#ifndef __APPLE__
++// Do not support 32 bit ARM with Neon DotProduct.
++#if 0
+ 
+ BEGIN_FUNCTION xnn_qc8_gemm_minmax_fp32_ukernel_4x8c4__asm_aarch32_neondot_ld64
+         # Push 80 bytes
+diff --git a/src/qc8-igemm/gen/qc8-igemm-4x8c4-minmax-fp32-asm-aarch32-neondot-cortex-a55.S b/src/qc8-igemm/gen/qc8-igemm-4x8c4-minmax-fp32-asm-aarch32-neondot-cortex-a55.S
+index 5af733a..affaee8 100644
+--- a/src/qc8-igemm/gen/qc8-igemm-4x8c4-minmax-fp32-asm-aarch32-neondot-cortex-a55.S
++++ b/src/qc8-igemm/gen/qc8-igemm-4x8c4-minmax-fp32-asm-aarch32-neondot-cortex-a55.S
+@@ -47,8 +47,8 @@
+ //    int8_t output_max;          d13[7]
+ //  } xnn_qs8_minmax_params.neonv8;
+ 
+-// iOS does not support 32 bit ARM with Neon DotProduct.
+-#ifndef __APPLE__
++// Do not support 32 bit ARM with Neon DotProduct.
++#if 0
+ 
+ BEGIN_FUNCTION xnn_qc8_igemm_minmax_fp32_ukernel_4x8c4__asm_aarch32_neondot_cortex_a55
+         ADD     r2, r2, 3               // kc = (kc + 3) & ~3
+diff --git a/src/qc8-igemm/gen/qc8-igemm-4x8c4-minmax-fp32-asm-aarch32-neondot-ld64.S b/src/qc8-igemm/gen/qc8-igemm-4x8c4-minmax-fp32-asm-aarch32-neondot-ld64.S
+index 12e263b..addced4 100644
+--- a/src/qc8-igemm/gen/qc8-igemm-4x8c4-minmax-fp32-asm-aarch32-neondot-ld64.S
++++ b/src/qc8-igemm/gen/qc8-igemm-4x8c4-minmax-fp32-asm-aarch32-neondot-ld64.S
+@@ -47,8 +47,8 @@
+ //    int8_t output_max;          d13[7]
+ //  } xnn_qs8_minmax_params.neonv8;
+ 
+-// iOS does not support 32 bit ARM with Neon DotProduct.
+-#ifndef __APPLE__
++// Do not support 32 bit ARM with Neon DotProduct.
++#if 0
+ 
+ BEGIN_FUNCTION xnn_qc8_igemm_minmax_fp32_ukernel_4x8c4__asm_aarch32_neondot_ld64
+         ADD     r2, r2, 3               // kc = (kc + 3) & ~3
+diff --git a/src/qs8-gemm/4x8c4-aarch32-neondot-cortex-a55.S.in b/src/qs8-gemm/4x8c4-aarch32-neondot-cortex-a55.S.in
+index 5d97e30..5c8bbbc 100644
+--- a/src/qs8-gemm/4x8c4-aarch32-neondot-cortex-a55.S.in
++++ b/src/qs8-gemm/4x8c4-aarch32-neondot-cortex-a55.S.in
+@@ -57,8 +57,8 @@ $else:
+   //    int8_t output_max;          d13[7]
+   //  } xnn_qs8_minmax_params.neonv8;
+ 
+-// iOS does not support 32 bit ARM with Neon DotProduct.
+-#ifndef __APPLE__
++// Do not support 32 bit ARM with Neon DotProduct.
++#if 0
+ 
+ BEGIN_FUNCTION xnn_${DATATYPE.lower()}_gemm_minmax_${REQUANTIZATION.lower()}_ukernel_4x8c4__asm_aarch32_neondot_cortex_a55
+         # Push 80 bytes
+diff --git a/src/qs8-gemm/4x8c4-aarch32-neondot-ld64.S.in b/src/qs8-gemm/4x8c4-aarch32-neondot-ld64.S.in
+index d542a8b..1cdbf6f 100644
+--- a/src/qs8-gemm/4x8c4-aarch32-neondot-ld64.S.in
++++ b/src/qs8-gemm/4x8c4-aarch32-neondot-ld64.S.in
+@@ -58,8 +58,8 @@ $else:
+   //    int8_t output_max;          d13[7]
+   //  } xnn_qs8_minmax_params.neonv8;
+ 
+-// iOS does not support 32 bit ARM with Neon DotProduct.
+-#ifndef __APPLE__
++// Do not support 32 bit ARM with Neon DotProduct.
++#if 0
+ 
+ BEGIN_FUNCTION xnn_${DATATYPE.lower()}_gemm_minmax_${REQUANTIZATION.lower()}_ukernel_4x8c4__asm_aarch32_neondot_ld64
+         # Push 80 bytes
+diff --git a/src/qs8-gemm/gen/qs8-gemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-cortex-a55.S b/src/qs8-gemm/gen/qs8-gemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-cortex-a55.S
+index 7e8fc05..24defaa 100644
+--- a/src/qs8-gemm/gen/qs8-gemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-cortex-a55.S
++++ b/src/qs8-gemm/gen/qs8-gemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-cortex-a55.S
+@@ -48,8 +48,8 @@
+ //    int8_t output_max;          d13[7]
+ //  } rndnu_neon;
+ 
+-// iOS does not support 32 bit ARM with Neon DotProduct.
+-#ifndef __APPLE__
++// Do not support 32 bit ARM with Neon DotProduct.
++#if 0
+ 
+ BEGIN_FUNCTION xnn_qs8_gemm_minmax_rndnu_ukernel_4x8c4__asm_aarch32_neondot_cortex_a55
+         # Push 80 bytes
+diff --git a/src/qs8-gemm/gen/qs8-gemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-ld64.S b/src/qs8-gemm/gen/qs8-gemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-ld64.S
+index f71a348..9dcf6f3 100644
+--- a/src/qs8-gemm/gen/qs8-gemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-ld64.S
++++ b/src/qs8-gemm/gen/qs8-gemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-ld64.S
+@@ -48,8 +48,8 @@
+ //    int8_t output_max;          d13[7]
+ //  } rndnu_neon;
+ 
+-// iOS does not support 32 bit ARM with Neon DotProduct.
+-#ifndef __APPLE__
++// Do not support 32 bit ARM with Neon DotProduct.
++#if 0
+ 
+ BEGIN_FUNCTION xnn_qs8_gemm_minmax_rndnu_ukernel_4x8c4__asm_aarch32_neondot_ld64
+         # Push 80 bytes
+diff --git a/src/qs8-igemm/4x8c4-aarch32-neondot-cortex-a55.S.in b/src/qs8-igemm/4x8c4-aarch32-neondot-cortex-a55.S.in
+index 1651b4a..44aba03 100644
+--- a/src/qs8-igemm/4x8c4-aarch32-neondot-cortex-a55.S.in
++++ b/src/qs8-igemm/4x8c4-aarch32-neondot-cortex-a55.S.in
+@@ -59,8 +59,8 @@ $else:
+   //    int8_t output_max;          d13[7]
+   //  } xnn_qs8_minmax_params.neonv8;
+ 
+-// iOS does not support 32 bit ARM with Neon DotProduct.
+-#ifndef __APPLE__
++// Do not support 32 bit ARM with Neon DotProduct.
++#if 0
+ 
+ BEGIN_FUNCTION xnn_${DATATYPE.lower()}_igemm_minmax_${REQUANTIZATION.lower()}_ukernel_4x8c4__asm_aarch32_neondot_cortex_a55
+         ADD     r2, r2, 3               // kc = (kc + 3) & ~3
+diff --git a/src/qs8-igemm/4x8c4-aarch32-neondot-ld64.S.in b/src/qs8-igemm/4x8c4-aarch32-neondot-ld64.S.in
+index 2e2d17d..6f9c5cc 100644
+--- a/src/qs8-igemm/4x8c4-aarch32-neondot-ld64.S.in
++++ b/src/qs8-igemm/4x8c4-aarch32-neondot-ld64.S.in
+@@ -60,8 +60,8 @@ $else:
+   //    int8_t output_max;          d13[7]
+   //  } xnn_qs8_minmax_params.neonv8;
+ 
+-// iOS does not support 32 bit ARM with Neon DotProduct.
+-#ifndef __APPLE__
++// Do not support 32 bit ARM with Neon DotProduct.
++#if 0
+ 
+ BEGIN_FUNCTION xnn_${DATATYPE.lower()}_igemm_minmax_${REQUANTIZATION.lower()}_ukernel_4x8c4__asm_aarch32_neondot_ld64
+         ADD     r2, r2, 3               // kc = (kc + 3) & ~3
+diff --git a/src/qs8-igemm/gen/qs8-igemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-cortex-a55.S b/src/qs8-igemm/gen/qs8-igemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-cortex-a55.S
+index 7b50fc5..2bb9477 100644
+--- a/src/qs8-igemm/gen/qs8-igemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-cortex-a55.S
++++ b/src/qs8-igemm/gen/qs8-igemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-cortex-a55.S
+@@ -50,8 +50,8 @@
+ //    int8_t output_max;          d13[7]
+ //  } rndnu_neon;
+ 
+-// iOS does not support 32 bit ARM with Neon DotProduct.
+-#ifndef __APPLE__
++// Do not support 32 bit ARM with Neon DotProduct.
++#if 0
+ 
+ BEGIN_FUNCTION xnn_qs8_igemm_minmax_rndnu_ukernel_4x8c4__asm_aarch32_neondot_cortex_a55
+         ADD     r2, r2, 3               // kc = (kc + 3) & ~3
+diff --git a/src/qs8-igemm/gen/qs8-igemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-ld64.S b/src/qs8-igemm/gen/qs8-igemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-ld64.S
+index 2797425..be14ae4 100644
+--- a/src/qs8-igemm/gen/qs8-igemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-ld64.S
++++ b/src/qs8-igemm/gen/qs8-igemm-4x8c4-minmax-rndnu-asm-aarch32-neondot-ld64.S
+@@ -50,8 +50,8 @@
+ //    int8_t output_max;          d13[7]
+ //  } rndnu_neon;
+ 
+-// iOS does not support 32 bit ARM with Neon DotProduct.
+-#ifndef __APPLE__
++// Do not support 32 bit ARM with Neon DotProduct.
++#if 0
+ 
+ BEGIN_FUNCTION xnn_qs8_igemm_minmax_rndnu_ukernel_4x8c4__asm_aarch32_neondot_ld64
+         ADD     r2, r2, 3               // kc = (kc + 3) & ~3
 -- 
-2.30.2
+2.27.0
 
-- 
2.27.0