1From c505f81e336088b6729a5407a03459f488353288 Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Mon, 24 May 2021 22:54:01 +0200
4Subject: [PATCH] codec/common/inc/asmdefs_mmi.h: fix mips32 build
5
6Fix the following build failure on mips32 which is raised since version
72.0.0 and
8https://github.com/cisco/openh264/commit/b13e5bceb18ebb93d0313b46aab4af6f480ca933:
9
10codec/common/mips/copy_mb_mmi.c: In function 'WelsCopy16x16_mmi':
11./codec/common/inc/asmdefs_mmi.h:293:21: error: '_ABI64' undeclared (first use in this function)
12  293 |    if (_MIPS_SIM == _ABI64)                                    \
13      |                     ^~~~~~
14
15Fixes:
16 - http://autobuild.buildroot.org/results/cba3e9d0fd061cc3a92cb732bcdc2c7b66dbf6cb
17
18Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
19[Upstream status: https://github.com/cisco/openh264/pull/3384]
20---
21 codec/common/inc/asmdefs_mmi.h | 17 +++++++++++------
22 1 file changed, 11 insertions(+), 6 deletions(-)
23
24diff --git a/codec/common/inc/asmdefs_mmi.h b/codec/common/inc/asmdefs_mmi.h
25index 69a7ae39..5d1aed93 100644
26--- a/codec/common/inc/asmdefs_mmi.h
27+++ b/codec/common/inc/asmdefs_mmi.h
28@@ -288,9 +288,9 @@
29 /**
30  * backup register
31  */
32+#if defined(_ABI64) && _MIPS_SIM == _ABI64
33 #define BACKUP_REG \
34    double __attribute__((aligned(16))) __back_temp[8];         \
35-   if (_MIPS_SIM == _ABI64)                                    \
36    __asm__ volatile (                                          \
37      "gssqc1       $f25,      $f24,       0x00(%[temp])  \n\t" \
38      "gssqc1       $f27,      $f26,       0x10(%[temp])  \n\t" \
39@@ -299,8 +299,10 @@
40      :                                                         \
41      : [temp]"r"(__back_temp)                                  \
42      : "memory"                                                \
43-   );                                                          \
44-  else                                                         \
45+   );
46+#else
47+#define BACKUP_REG \
48+   double __attribute__((aligned(16))) __back_temp[8];         \
49    __asm__ volatile (                                          \
50      "gssqc1       $f22,      $f20,       0x00(%[temp])  \n\t" \
51      "gssqc1       $f26,      $f24,       0x10(%[temp])  \n\t" \
52@@ -309,12 +311,13 @@
53      : [temp]"r"(__back_temp)                                  \
54      : "memory"                                                \
55    );
56+#endif
57
58 /**
59  * recover register
60  */
61+#if defined(_ABI64) && _MIPS_SIM == _ABI64
62 #define RECOVER_REG \
63-   if (_MIPS_SIM == _ABI64)                                    \
64    __asm__ volatile (                                          \
65      "gslqc1       $f25,      $f24,       0x00(%[temp])  \n\t" \
66      "gslqc1       $f27,      $f26,       0x10(%[temp])  \n\t" \
67@@ -323,8 +326,9 @@
68      :                                                         \
69      : [temp]"r"(__back_temp)                                  \
70      : "memory"                                                \
71-   );                                                          \
72-   else                                                        \
73+   );
74+#else
75+#define RECOVER_REG \
76    __asm__ volatile (                                          \
77      "gslqc1       $f22,      $f20,       0x00(%[temp])  \n\t" \
78      "gslqc1       $f26,      $f24,       0x10(%[temp])  \n\t" \
79@@ -333,6 +337,7 @@
80      : [temp]"r"(__back_temp)                                  \
81      : "memory"                                                \
82    );
83+#endif
84
85 # define OK             1
86 # define NOTOK          0
87--
882.30.2
89
90