]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/sparc/vis.h
Replace ffmpeg references with more accurate libav* references.
[ffmpeg] / libavcodec / sparc / vis.h
index fda115d822f9b54b0cf5859cbddfb84c70d85818..505c735cbbbfc2cfe0b19076d5b0f86ced1d9aa8 100644 (file)
@@ -1,22 +1,20 @@
 /*
- * vis.h
  * Copyright (C) 2003 David S. Miller <davem@redhat.com>
  *
- * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
+ * This file is part of Libav.
  *
- * mpeg2dec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * mpeg2dec is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -41,6 +39,9 @@
  * the assembler to keep the binary from becoming tainted.
  */
 
+#ifndef AVCODEC_SPARC_VIS_H
+#define AVCODEC_SPARC_VIS_H
+
 #define vis_opc_base    ((0x1 << 31) | (0x36 << 19))
 #define vis_opf(X)      ((X) << 5)
 #define vis_sreg(X)     (X)
 #define vis_rd_d(X)     (vis_dreg(X) << 25)
 
 #define vis_ss2s(opf,rs1,rs2,rd) \
-        __asm__ __volatile__ (".word %0" \
+        __asm__ volatile (".word %0" \
                               : : "i" (vis_opc_base | vis_opf(opf) | \
                                        vis_rs1_s(rs1) | \
                                        vis_rs2_s(rs2) | \
                                        vis_rd_s(rd)))
 
 #define vis_dd2d(opf,rs1,rs2,rd) \
-        __asm__ __volatile__ (".word %0" \
+        __asm__ volatile (".word %0" \
                               : : "i" (vis_opc_base | vis_opf(opf) | \
                                        vis_rs1_d(rs1) | \
                                        vis_rs2_d(rs2) | \
                                        vis_rd_d(rd)))
 
 #define vis_ss2d(opf,rs1,rs2,rd) \
-        __asm__ __volatile__ (".word %0" \
+        __asm__ volatile (".word %0" \
                               : : "i" (vis_opc_base | vis_opf(opf) | \
                                        vis_rs1_s(rs1) | \
                                        vis_rs2_s(rs2) | \
                                        vis_rd_d(rd)))
 
 #define vis_sd2d(opf,rs1,rs2,rd) \
-        __asm__ __volatile__ (".word %0" \
+        __asm__ volatile (".word %0" \
                               : : "i" (vis_opc_base | vis_opf(opf) | \
                                        vis_rs1_s(rs1) | \
                                        vis_rs2_d(rs2) | \
                                        vis_rd_d(rd)))
 
 #define vis_d2s(opf,rs2,rd) \
-        __asm__ __volatile__ (".word %0" \
+        __asm__ volatile (".word %0" \
                               : : "i" (vis_opc_base | vis_opf(opf) | \
                                        vis_rs2_d(rs2) | \
                                        vis_rd_s(rd)))
 
 #define vis_s2d(opf,rs2,rd) \
-        __asm__ __volatile__ (".word %0" \
+        __asm__ volatile (".word %0" \
                               : : "i" (vis_opc_base | vis_opf(opf) | \
                                        vis_rs2_s(rs2) | \
                                        vis_rd_d(rd)))
 
 #define vis_d12d(opf,rs1,rd) \
-        __asm__ __volatile__ (".word %0" \
+        __asm__ volatile (".word %0" \
                               : : "i" (vis_opc_base | vis_opf(opf) | \
                                        vis_rs1_d(rs1) | \
                                        vis_rd_d(rd)))
 
 #define vis_d22d(opf,rs2,rd) \
-        __asm__ __volatile__ (".word %0" \
+        __asm__ volatile (".word %0" \
                               : : "i" (vis_opc_base | vis_opf(opf) | \
                                        vis_rs2_d(rs2) | \
                                        vis_rd_d(rd)))
 
 #define vis_s12s(opf,rs1,rd) \
-        __asm__ __volatile__ (".word %0" \
+        __asm__ volatile (".word %0" \
                               : : "i" (vis_opc_base | vis_opf(opf) | \
                                        vis_rs1_s(rs1) | \
                                        vis_rd_s(rd)))
 
 #define vis_s22s(opf,rs2,rd) \
-        __asm__ __volatile__ (".word %0" \
+        __asm__ volatile (".word %0" \
                               : : "i" (vis_opc_base | vis_opf(opf) | \
                                        vis_rs2_s(rs2) | \
                                        vis_rd_s(rd)))
 
 #define vis_s(opf,rd) \
-        __asm__ __volatile__ (".word %0" \
+        __asm__ volatile (".word %0" \
                               : : "i" (vis_opc_base | vis_opf(opf) | \
                                        vis_rd_s(rd)))
 
 #define vis_d(opf,rd) \
-        __asm__ __volatile__ (".word %0" \
+        __asm__ volatile (".word %0" \
                               : : "i" (vis_opc_base | vis_opf(opf) | \
                                        vis_rd_d(rd)))
 
 #define vis_r2m(op,rd,mem) \
-        __asm__ __volatile__ (#op "\t%%f" #rd ", [%0]" : : "r" (&(mem)) )
+        __asm__ volatile (#op "\t%%f" #rd ", [%0]" : : "r" (&(mem)) )
 
 #define vis_r2m_2(op,rd,mem1,mem2) \
-        __asm__ __volatile__ (#op "\t%%f" #rd ", [%0 + %1]" : : "r" (mem1), "r" (mem2) )
+        __asm__ volatile (#op "\t%%f" #rd ", [%0 + %1]" : : "r" (mem1), "r" (mem2) )
 
 #define vis_m2r(op,mem,rd) \
-        __asm__ __volatile__ (#op "\t[%0], %%f" #rd : : "r" (&(mem)) )
+        __asm__ volatile (#op "\t[%0], %%f" #rd : : "r" (&(mem)) )
 
 #define vis_m2r_2(op,mem1,mem2,rd) \
-        __asm__ __volatile__ (#op "\t[%0 + %1], %%f" #rd : : "r" (mem1), "r" (mem2) )
+        __asm__ volatile (#op "\t[%0 + %1], %%f" #rd : : "r" (mem1), "r" (mem2) )
 
 static inline void vis_set_gsr(unsigned int _val)
 {
-        register unsigned int val asm("g1");
+        register unsigned int val __asm__("g1");
 
         val = _val;
-        __asm__ __volatile__(".word 0xa7804000"
+        __asm__ volatile(".word 0xa7804000"
                              : : "r" (val));
 }
 
@@ -162,9 +163,9 @@ static inline void vis_set_gsr(unsigned int _val)
 #define vis_st64_2(rs1,mem1,mem2)       vis_r2m_2(std, rs1, mem1, mem2)
 
 #define vis_ldblk(mem, rd) \
-do {        register void *__mem asm("g1"); \
+do {        register void *__mem __asm__("g1"); \
         __mem = &(mem); \
-        __asm__ __volatile__(".word 0xc1985e00 | %1" \
+        __asm__ volatile(".word 0xc1985e00 | %1" \
                              : \
                              : "r" (__mem), \
                                "i" (vis_rd_d(rd)) \
@@ -172,9 +173,9 @@ do {        register void *__mem asm("g1"); \
 } while (0)
 
 #define vis_stblk(rd, mem) \
-do {        register void *__mem asm("g1"); \
+do {        register void *__mem __asm__("g1"); \
         __mem = &(mem); \
-        __asm__ __volatile__(".word 0xc1b85e00 | %1" \
+        __asm__ volatile(".word 0xc1b85e00 | %1" \
                              : \
                              : "r" (__mem), \
                                "i" (vis_rd_d(rd)) \
@@ -182,10 +183,10 @@ do {        register void *__mem asm("g1"); \
 } while (0)
 
 #define vis_membar_storestore()        \
-        __asm__ __volatile__(".word 0x8143e008" : : : "memory")
+        __asm__ volatile(".word 0x8143e008" : : : "memory")
 
 #define vis_membar_sync()        \
-        __asm__ __volatile__(".word 0x8143e040" : : : "memory")
+        __asm__ volatile(".word 0x8143e040" : : : "memory")
 
 /* 16 and 32 bit partitioned addition and subtraction.  The normal
  * versions perform 4 16-bit or 2 32-bit additions or subtractions.
@@ -222,13 +223,13 @@ do {        register void *__mem asm("g1"); \
 
 /* Alignment instructions.  */
 
-static inline void *vis_alignaddr(void *_ptr)
+static inline const void *vis_alignaddr(const void *_ptr)
 {
-        register void *ptr asm("g1");
+        register const void *ptr __asm__("g1");
 
         ptr = _ptr;
 
-        __asm__ __volatile__(".word %2"
+        __asm__ volatile(".word %2"
                              : "=&r" (ptr)
                              : "0" (ptr),
                                "i" (vis_opc_base | vis_opf(0x18) |
@@ -241,11 +242,11 @@ static inline void *vis_alignaddr(void *_ptr)
 
 static inline void vis_alignaddr_g0(void *_ptr)
 {
-        register void *ptr asm("g1");
+        register void *ptr __asm__("g1");
 
         ptr = _ptr;
 
-        __asm__ __volatile__(".word %2"
+        __asm__ volatile(".word %2"
                              : "=&r" (ptr)
                              : "0" (ptr),
                                "i" (vis_opc_base | vis_opf(0x18) |
@@ -256,11 +257,11 @@ static inline void vis_alignaddr_g0(void *_ptr)
 
 static inline void *vis_alignaddrl(void *_ptr)
 {
-        register void *ptr asm("g1");
+        register void *ptr __asm__("g1");
 
         ptr = _ptr;
 
-        __asm__ __volatile__(".word %2"
+        __asm__ volatile(".word %2"
                              : "=&r" (ptr)
                              : "0" (ptr),
                                "i" (vis_opc_base | vis_opf(0x19) |
@@ -273,11 +274,11 @@ static inline void *vis_alignaddrl(void *_ptr)
 
 static inline void vis_alignaddrl_g0(void *_ptr)
 {
-        register void *ptr asm("g1");
+        register void *ptr __asm__("g1");
 
         ptr = _ptr;
 
-        __asm__ __volatile__(".word %2"
+        __asm__ volatile(".word %2"
                              : "=&r" (ptr)
                              : "0" (ptr),
                                "i" (vis_opc_base | vis_opf(0x19) |
@@ -326,3 +327,5 @@ static inline void vis_alignaddrl_g0(void *_ptr)
 /* Pixel component distance.  */
 
 #define vis_pdist(rs1,rs2,rd)           vis_dd2d(0x3e, rs1, rs2, rd)
+
+#endif /* AVCODEC_SPARC_VIS_H */