diff mbox series

[FFmpeg-devel,2/4,mips] : Fix prob that 'ulw' and 'uld' unsupported by clang.

Message ID 1596017461-9117-3-git-send-email-yinshiyou-hf@loongson.cn
State Accepted
Commit 0e0a9ca04822f7d3ce0792f5cec3be7b2c738f9a
Headers show
Series : Adapt clang compiler for mips.
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Shiyou Yin July 29, 2020, 10:10 a.m. UTC
GCC support these two synthesized instruction, but clang does not yet.
Use machine instruction instead to adapt clang compiler.
---
 libavutil/mips/generic_macros_msa.h | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libavutil/mips/generic_macros_msa.h b/libavutil/mips/generic_macros_msa.h
index 267d4e6..bb25e9f 100644
--- a/libavutil/mips/generic_macros_msa.h
+++ b/libavutil/mips/generic_macros_msa.h
@@ -111,10 +111,11 @@ 
         uint32_t val_lw_m;                           \
                                                      \
         __asm__ volatile (                           \
-            "ulw  %[val_lw_m],  %[psrc_lw_m]  \n\t"  \
+            "lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t"  \
+            "lwl %[val_lw_m], 3(%[psrc_lw_m]) \n\t"  \
                                                      \
-            : [val_lw_m] "=r" (val_lw_m)             \
-            : [psrc_lw_m] "m" (*psrc_lw_m)           \
+            : [val_lw_m] "=&r"(val_lw_m)             \
+            : [psrc_lw_m] "r"(psrc_lw_m)             \
         );                                           \
                                                      \
         val_lw_m;                                    \
@@ -127,10 +128,11 @@ 
             uint64_t val_ld_m = 0;                       \
                                                          \
             __asm__ volatile (                           \
-                "uld  %[val_ld_m],  %[psrc_ld_m]  \n\t"  \
+                "ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t"  \
+                "ldl %[val_ld_m], 7(%[psrc_ld_m]) \n\t"  \
                                                          \
-                : [val_ld_m] "=r" (val_ld_m)             \
-                : [psrc_ld_m] "m" (*psrc_ld_m)           \
+                : [val_ld_m] "=&r" (val_ld_m)            \
+                : [psrc_ld_m] "r" (psrc_ld_m)            \
             );                                           \
                                                          \
             val_ld_m;                                    \