42 #ifndef AVCODEC_SPARC_VIS_H 43 #define AVCODEC_SPARC_VIS_H 45 #define ACCEL_SPARC_VIS 1 46 #define ACCEL_SPARC_VIS2 2 56 #define vis_opc_base ((0x1 << 31) | (0x36 << 19)) 57 #define vis_opf(X) ((X) << 5) 58 #define vis_sreg(X) (X) 59 #define vis_dreg(X) (((X)&0x1f)|((X)>>5)) 60 #define vis_rs1_s(X) (vis_sreg(X) << 14) 61 #define vis_rs1_d(X) (vis_dreg(X) << 14) 62 #define vis_rs2_s(X) (vis_sreg(X) << 0) 63 #define vis_rs2_d(X) (vis_dreg(X) << 0) 64 #define vis_rd_s(X) (vis_sreg(X) << 25) 65 #define vis_rd_d(X) (vis_dreg(X) << 25) 67 #define vis_ss2s(opf,rs1,rs2,rd) \ 68 __asm__ volatile (".word %0" \ 69 : : "i" (vis_opc_base | vis_opf(opf) | \ 74 #define vis_dd2d(opf,rs1,rs2,rd) \ 75 __asm__ volatile (".word %0" \ 76 : : "i" (vis_opc_base | vis_opf(opf) | \ 81 #define vis_ss2d(opf,rs1,rs2,rd) \ 82 __asm__ volatile (".word %0" \ 83 : : "i" (vis_opc_base | vis_opf(opf) | \ 88 #define vis_sd2d(opf,rs1,rs2,rd) \ 89 __asm__ volatile (".word %0" \ 90 : : "i" (vis_opc_base | vis_opf(opf) | \ 95 #define vis_d2s(opf,rs2,rd) \ 96 __asm__ volatile (".word %0" \ 97 : : "i" (vis_opc_base | vis_opf(opf) | \ 101 #define vis_s2d(opf,rs2,rd) \ 102 __asm__ volatile (".word %0" \ 103 : : "i" (vis_opc_base | vis_opf(opf) | \ 107 #define vis_d12d(opf,rs1,rd) \ 108 __asm__ volatile (".word %0" \ 109 : : "i" (vis_opc_base | vis_opf(opf) | \ 113 #define vis_d22d(opf,rs2,rd) \ 114 __asm__ volatile (".word %0" \ 115 : : "i" (vis_opc_base | vis_opf(opf) | \ 119 #define vis_s12s(opf,rs1,rd) \ 120 __asm__ volatile (".word %0" \ 121 : : "i" (vis_opc_base | vis_opf(opf) | \ 125 #define vis_s22s(opf,rs2,rd) \ 126 __asm__ volatile (".word %0" \ 127 : : "i" (vis_opc_base | vis_opf(opf) | \ 131 #define vis_s(opf,rd) \ 132 __asm__ volatile (".word %0" \ 133 : : "i" (vis_opc_base | vis_opf(opf) | \ 136 #define vis_d(opf,rd) \ 137 __asm__ volatile (".word %0" \ 138 : : "i" (vis_opc_base | vis_opf(opf) | \ 141 #define vis_r2m(op,rd,mem) \ 142 __asm__ volatile (#op "\t%%f" #rd ", [%0]" : : "r" (&(mem)) ) 144 #define vis_r2m_2(op,rd,mem1,mem2) \ 145 __asm__ volatile (#op "\t%%f" #rd ", [%0 + %1]" : : "r" (mem1), "r" (mem2) ) 147 #define vis_m2r(op,mem,rd) \ 148 __asm__ volatile (#op "\t[%0], %%f" #rd : : "r" (&(mem)) ) 150 #define vis_m2r_2(op,mem1,mem2,rd) \ 151 __asm__ volatile (#op "\t[%0 + %1], %%f" #rd : : "r" (mem1), "r" (mem2) ) 155 register unsigned int val __asm__(
"g1");
158 __asm__
volatile(
".word 0xa7804000" 162 #define VIS_GSR_ALIGNADDR_MASK 0x0000007 163 #define VIS_GSR_ALIGNADDR_SHIFT 0 164 #define VIS_GSR_SCALEFACT_MASK 0x0000078 165 #define VIS_GSR_SCALEFACT_SHIFT 3 167 #define vis_ld32(mem,rs1) vis_m2r(ld, mem, rs1) 168 #define vis_ld32_2(mem1,mem2,rs1) vis_m2r_2(ld, mem1, mem2, rs1) 169 #define vis_st32(rs1,mem) vis_r2m(st, rs1, mem) 170 #define vis_st32_2(rs1,mem1,mem2) vis_r2m_2(st, rs1, mem1, mem2) 171 #define vis_ld64(mem,rs1) vis_m2r(ldd, mem, rs1) 172 #define vis_ld64_2(mem1,mem2,rs1) vis_m2r_2(ldd, mem1, mem2, rs1) 173 #define vis_st64(rs1,mem) vis_r2m(std, rs1, mem) 174 #define vis_st64_2(rs1,mem1,mem2) vis_r2m_2(std, rs1, mem1, mem2) 176 #define vis_ldblk(mem, rd) \ 177 do { register void *__mem __asm__("g1"); \ 179 __asm__ volatile(".word 0xc1985e00 | %1" \ 186 #define vis_stblk(rd, mem) \ 187 do { register void *__mem __asm__("g1"); \ 189 __asm__ volatile(".word 0xc1b85e00 | %1" \ 196 #define vis_membar_storestore() \ 197 __asm__ volatile(".word 0x8143e008" : : : "memory") 199 #define vis_membar_sync() \ 200 __asm__ volatile(".word 0x8143e040" : : : "memory") 208 #define vis_padd16(rs1,rs2,rd) vis_dd2d(0x50, rs1, rs2, rd) 209 #define vis_padd16s(rs1,rs2,rd) vis_ss2s(0x51, rs1, rs2, rd) 210 #define vis_padd32(rs1,rs2,rd) vis_dd2d(0x52, rs1, rs2, rd) 211 #define vis_padd32s(rs1,rs2,rd) vis_ss2s(0x53, rs1, rs2, rd) 212 #define vis_psub16(rs1,rs2,rd) vis_dd2d(0x54, rs1, rs2, rd) 213 #define vis_psub16s(rs1,rs2,rd) vis_ss2s(0x55, rs1, rs2, rd) 214 #define vis_psub32(rs1,rs2,rd) vis_dd2d(0x56, rs1, rs2, rd) 215 #define vis_psub32s(rs1,rs2,rd) vis_ss2s(0x57, rs1, rs2, rd) 219 #define vis_pack16(rs2,rd) vis_d2s( 0x3b, rs2, rd) 220 #define vis_pack32(rs1,rs2,rd) vis_dd2d(0x3a, rs1, rs2, rd) 221 #define vis_packfix(rs2,rd) vis_d2s( 0x3d, rs2, rd) 222 #define vis_expand(rs2,rd) vis_s2d( 0x4d, rs2, rd) 223 #define vis_pmerge(rs1,rs2,rd) vis_ss2d(0x4b, rs1, rs2, rd) 227 #define vis_mul8x16(rs1,rs2,rd) vis_sd2d(0x31, rs1, rs2, rd) 228 #define vis_mul8x16au(rs1,rs2,rd) vis_ss2d(0x33, rs1, rs2, rd) 229 #define vis_mul8x16al(rs1,rs2,rd) vis_ss2d(0x35, rs1, rs2, rd) 230 #define vis_mul8sux16(rs1,rs2,rd) vis_dd2d(0x36, rs1, rs2, rd) 231 #define vis_mul8ulx16(rs1,rs2,rd) vis_dd2d(0x37, rs1, rs2, rd) 232 #define vis_muld8sux16(rs1,rs2,rd) vis_ss2d(0x38, rs1, rs2, rd) 233 #define vis_muld8ulx16(rs1,rs2,rd) vis_ss2d(0x39, rs1, rs2, rd) 239 register const void *ptr __asm__(
"g1");
243 __asm__
volatile(
".word %2" 256 register void *ptr __asm__(
"g1");
260 __asm__
volatile(
".word %2" 271 register void *ptr __asm__(
"g1");
275 __asm__
volatile(
".word %2" 288 register void *ptr __asm__(
"g1");
292 __asm__
volatile(
".word %2" 301 #define vis_faligndata(rs1,rs2,rd) vis_dd2d(0x48, rs1, rs2, rd) 305 #define vis_fzero(rd) vis_d( 0x60, rd) 306 #define vis_fzeros(rd) vis_s( 0x61, rd) 307 #define vis_fone(rd) vis_d( 0x7e, rd) 308 #define vis_fones(rd) vis_s( 0x7f, rd) 309 #define vis_src1(rs1,rd) vis_d12d(0x74, rs1, rd) 310 #define vis_src1s(rs1,rd) vis_s12s(0x75, rs1, rd) 311 #define vis_src2(rs2,rd) vis_d22d(0x78, rs2, rd) 312 #define vis_src2s(rs2,rd) vis_s22s(0x79, rs2, rd) 313 #define vis_not1(rs1,rd) vis_d12d(0x6a, rs1, rd) 314 #define vis_not1s(rs1,rd) vis_s12s(0x6b, rs1, rd) 315 #define vis_not2(rs2,rd) vis_d22d(0x66, rs2, rd) 316 #define vis_not2s(rs2,rd) vis_s22s(0x67, rs2, rd) 317 #define vis_or(rs1,rs2,rd) vis_dd2d(0x7c, rs1, rs2, rd) 318 #define vis_ors(rs1,rs2,rd) vis_ss2s(0x7d, rs1, rs2, rd) 319 #define vis_nor(rs1,rs2,rd) vis_dd2d(0x62, rs1, rs2, rd) 320 #define vis_nors(rs1,rs2,rd) vis_ss2s(0x63, rs1, rs2, rd) 321 #define vis_and(rs1,rs2,rd) vis_dd2d(0x70, rs1, rs2, rd) 322 #define vis_ands(rs1,rs2,rd) vis_ss2s(0x71, rs1, rs2, rd) 323 #define vis_nand(rs1,rs2,rd) vis_dd2d(0x6e, rs1, rs2, rd) 324 #define vis_nands(rs1,rs2,rd) vis_ss2s(0x6f, rs1, rs2, rd) 325 #define vis_xor(rs1,rs2,rd) vis_dd2d(0x6c, rs1, rs2, rd) 326 #define vis_xors(rs1,rs2,rd) vis_ss2s(0x6d, rs1, rs2, rd) 327 #define vis_xnor(rs1,rs2,rd) vis_dd2d(0x72, rs1, rs2, rd) 328 #define vis_xnors(rs1,rs2,rd) vis_ss2s(0x73, rs1, rs2, rd) 329 #define vis_ornot1(rs1,rs2,rd) vis_dd2d(0x7a, rs1, rs2, rd) 330 #define vis_ornot1s(rs1,rs2,rd) vis_ss2s(0x7b, rs1, rs2, rd) 331 #define vis_ornot2(rs1,rs2,rd) vis_dd2d(0x76, rs1, rs2, rd) 332 #define vis_ornot2s(rs1,rs2,rd) vis_ss2s(0x77, rs1, rs2, rd) 333 #define vis_andnot1(rs1,rs2,rd) vis_dd2d(0x68, rs1, rs2, rd) 334 #define vis_andnot1s(rs1,rs2,rd) vis_ss2s(0x69, rs1, rs2, rd) 335 #define vis_andnot2(rs1,rs2,rd) vis_dd2d(0x64, rs1, rs2, rd) 336 #define vis_andnot2s(rs1,rs2,rd) vis_ss2s(0x65, rs1, rs2, rd) 340 #define vis_pdist(rs1,rs2,rd) vis_dd2d(0x3e, rs1, rs2, rd)
static const void * vis_alignaddr(const void *_ptr)
static void * vis_alignaddrl(void *_ptr)
static void vis_set_gsr(unsigned int _val)
static void vis_alignaddr_g0(void *_ptr)
static void vis_alignaddrl_g0(void *_ptr)
static int vis_level(void)