xref: /openbsd/gnu/usr.bin/gcc/gcc/config/sh/ushmedia.h (revision c87b03e5)
1*c87b03e5Sespie /* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
2*c87b03e5Sespie 
3*c87b03e5Sespie This file is part of GNU CC.
4*c87b03e5Sespie 
5*c87b03e5Sespie GNU CC is free software; you can redistribute it and/or modify
6*c87b03e5Sespie it under the terms of the GNU General Public License as published by
7*c87b03e5Sespie the Free Software Foundation; either version 2, or (at your option)
8*c87b03e5Sespie any later version.
9*c87b03e5Sespie 
10*c87b03e5Sespie GNU CC is distributed in the hope that it will be useful,
11*c87b03e5Sespie but WITHOUT ANY WARRANTY; without even the implied warranty of
12*c87b03e5Sespie MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13*c87b03e5Sespie GNU General Public License for more details.
14*c87b03e5Sespie 
15*c87b03e5Sespie You should have received a copy of the GNU General Public License
16*c87b03e5Sespie along with GNU CC; see the file COPYING.  If not, write to
17*c87b03e5Sespie the Free Software Foundation, 59 Temple Place - Suite 330,
18*c87b03e5Sespie Boston, MA 02111-1307, USA.  */
19*c87b03e5Sespie 
20*c87b03e5Sespie /* As a special exception, if you include this header file into source
21*c87b03e5Sespie    files compiled by GCC, this header file does not by itself cause
22*c87b03e5Sespie    the resulting executable to be covered by the GNU General Public
23*c87b03e5Sespie    License.  This exception does not however invalidate any other
24*c87b03e5Sespie    reasons why the executable file might be covered by the GNU General
25*c87b03e5Sespie    Public License.  */
26*c87b03e5Sespie 
27*c87b03e5Sespie /* ushmedia.h: Intrinsics corresponding to SHmedia instructions that
28*c87b03e5Sespie    may be executed in both user and privileged mode.  */
29*c87b03e5Sespie 
30*c87b03e5Sespie #ifndef _USHMEDIA_H
31*c87b03e5Sespie #define _USHMEDIA_H
32*c87b03e5Sespie 
33*c87b03e5Sespie #if __SHMEDIA__
34*c87b03e5Sespie #if ! __SH4_NO_FPU
35*c87b03e5Sespie typedef float __GCC_FV __attribute__ ((mode (V4SF)));
36*c87b03e5Sespie typedef float __GCC_MTRX __attribute__ ((mode (V16SF)));
37*c87b03e5Sespie #endif
38*c87b03e5Sespie 
39*c87b03e5Sespie __inline__ static
40*c87b03e5Sespie unsigned long long
sh_media_MABS_L(unsigned long long mm)41*c87b03e5Sespie sh_media_MABS_L (unsigned long long mm)
42*c87b03e5Sespie {
43*c87b03e5Sespie   unsigned long long res;
44*c87b03e5Sespie   __asm__ ("mabs.l	%1, %0" : "=r" (res) : "r" (mm));
45*c87b03e5Sespie   return res;
46*c87b03e5Sespie }
47*c87b03e5Sespie 
48*c87b03e5Sespie __inline__ static
49*c87b03e5Sespie unsigned long long
sh_media_MABS_W(unsigned long long mm)50*c87b03e5Sespie sh_media_MABS_W (unsigned long long mm)
51*c87b03e5Sespie {
52*c87b03e5Sespie   unsigned long long res;
53*c87b03e5Sespie   __asm__ ("mabs.w	%1, %0" : "=r" (res) : "r" (mm));
54*c87b03e5Sespie   return res;
55*c87b03e5Sespie }
56*c87b03e5Sespie 
57*c87b03e5Sespie __inline__ static
58*c87b03e5Sespie unsigned long long
sh_media_MADD_L(unsigned long long mm,unsigned long long mn)59*c87b03e5Sespie sh_media_MADD_L (unsigned long long mm, unsigned long long mn)
60*c87b03e5Sespie {
61*c87b03e5Sespie   unsigned long long res;
62*c87b03e5Sespie   __asm__ ("madd.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
63*c87b03e5Sespie   return res;
64*c87b03e5Sespie }
65*c87b03e5Sespie 
66*c87b03e5Sespie __inline__ static
67*c87b03e5Sespie unsigned long long
sh_media_MADD_W(unsigned long long mm,unsigned long long mn)68*c87b03e5Sespie sh_media_MADD_W (unsigned long long mm, unsigned long long mn)
69*c87b03e5Sespie {
70*c87b03e5Sespie   unsigned long long res;
71*c87b03e5Sespie   __asm__ ("madd.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
72*c87b03e5Sespie   return res;
73*c87b03e5Sespie }
74*c87b03e5Sespie 
75*c87b03e5Sespie __inline__ static
76*c87b03e5Sespie unsigned long long
sh_media_MADDS_L(unsigned long long mm,unsigned long long mn)77*c87b03e5Sespie sh_media_MADDS_L (unsigned long long mm, unsigned long long mn)
78*c87b03e5Sespie {
79*c87b03e5Sespie   unsigned long long res;
80*c87b03e5Sespie   __asm__ ("madds.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
81*c87b03e5Sespie   return res;
82*c87b03e5Sespie }
83*c87b03e5Sespie 
84*c87b03e5Sespie __inline__ static
85*c87b03e5Sespie unsigned long long
sh_media_MADDS_UB(unsigned long long mm,unsigned long long mn)86*c87b03e5Sespie sh_media_MADDS_UB (unsigned long long mm, unsigned long long mn)
87*c87b03e5Sespie {
88*c87b03e5Sespie   unsigned long long res;
89*c87b03e5Sespie   __asm__ ("madds.ub	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
90*c87b03e5Sespie   return res;
91*c87b03e5Sespie }
92*c87b03e5Sespie 
93*c87b03e5Sespie __inline__ static
94*c87b03e5Sespie unsigned long long
sh_media_MADDS_W(unsigned long long mm,unsigned long long mn)95*c87b03e5Sespie sh_media_MADDS_W (unsigned long long mm, unsigned long long mn)
96*c87b03e5Sespie {
97*c87b03e5Sespie   unsigned long long res;
98*c87b03e5Sespie   __asm__ ("madds.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
99*c87b03e5Sespie   return res;
100*c87b03e5Sespie }
101*c87b03e5Sespie 
102*c87b03e5Sespie __inline__ static
103*c87b03e5Sespie unsigned long long
sh_media_MCMPEQ_B(unsigned long long mm,unsigned long long mn)104*c87b03e5Sespie sh_media_MCMPEQ_B (unsigned long long mm, unsigned long long mn)
105*c87b03e5Sespie {
106*c87b03e5Sespie   unsigned long long res;
107*c87b03e5Sespie   __asm__ ("mcmpeq.b	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
108*c87b03e5Sespie   return res;
109*c87b03e5Sespie }
110*c87b03e5Sespie 
111*c87b03e5Sespie __inline__ static
112*c87b03e5Sespie unsigned long long
sh_media_MCMPEQ_L(unsigned long long mm,unsigned long long mn)113*c87b03e5Sespie sh_media_MCMPEQ_L (unsigned long long mm, unsigned long long mn)
114*c87b03e5Sespie {
115*c87b03e5Sespie   unsigned long long res;
116*c87b03e5Sespie   __asm__ ("mcmpeq.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
117*c87b03e5Sespie   return res;
118*c87b03e5Sespie }
119*c87b03e5Sespie 
120*c87b03e5Sespie __inline__ static
121*c87b03e5Sespie unsigned long long
sh_media_MCMPEQ_W(unsigned long long mm,unsigned long long mn)122*c87b03e5Sespie sh_media_MCMPEQ_W (unsigned long long mm, unsigned long long mn)
123*c87b03e5Sespie {
124*c87b03e5Sespie   unsigned long long res;
125*c87b03e5Sespie   __asm__ ("mcmpeq.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
126*c87b03e5Sespie   return res;
127*c87b03e5Sespie }
128*c87b03e5Sespie 
129*c87b03e5Sespie __inline__ static
130*c87b03e5Sespie unsigned long long
sh_media_MCMPGT_L(unsigned long long mm,unsigned long long mn)131*c87b03e5Sespie sh_media_MCMPGT_L (unsigned long long mm, unsigned long long mn)
132*c87b03e5Sespie {
133*c87b03e5Sespie   unsigned long long res;
134*c87b03e5Sespie   __asm__ ("mcmpgt.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
135*c87b03e5Sespie   return res;
136*c87b03e5Sespie }
137*c87b03e5Sespie 
138*c87b03e5Sespie __inline__ static
139*c87b03e5Sespie unsigned long long
sh_media_MCMPGT_UB(unsigned long long mm,unsigned long long mn)140*c87b03e5Sespie sh_media_MCMPGT_UB (unsigned long long mm, unsigned long long mn)
141*c87b03e5Sespie {
142*c87b03e5Sespie   unsigned long long res;
143*c87b03e5Sespie   __asm__ ("mcmpgt.ub	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
144*c87b03e5Sespie   return res;
145*c87b03e5Sespie }
146*c87b03e5Sespie 
147*c87b03e5Sespie __inline__ static
148*c87b03e5Sespie unsigned long long
sh_media_MCMPGT_W(unsigned long long mm,unsigned long long mn)149*c87b03e5Sespie sh_media_MCMPGT_W (unsigned long long mm, unsigned long long mn)
150*c87b03e5Sespie {
151*c87b03e5Sespie   unsigned long long res;
152*c87b03e5Sespie   __asm__ ("mcmpgt.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
153*c87b03e5Sespie   return res;
154*c87b03e5Sespie }
155*c87b03e5Sespie 
156*c87b03e5Sespie __inline__ static
157*c87b03e5Sespie unsigned long long
sh_media_MCMV(unsigned long long mm,unsigned long long mn,unsigned long long mw)158*c87b03e5Sespie sh_media_MCMV (unsigned long long mm, unsigned long long mn, unsigned long long mw)
159*c87b03e5Sespie {
160*c87b03e5Sespie   unsigned long long res;
161*c87b03e5Sespie   __asm__ ("mcmv	%1, %2, %0" : "=r" (res)
162*c87b03e5Sespie 	   : "r" (mm), "r" (mn), "0" (mw));
163*c87b03e5Sespie   return res;
164*c87b03e5Sespie }
165*c87b03e5Sespie 
166*c87b03e5Sespie __inline__ static
167*c87b03e5Sespie unsigned long long
sh_media_MCNVS_LW(unsigned long long mm,unsigned long long mn)168*c87b03e5Sespie sh_media_MCNVS_LW (unsigned long long mm, unsigned long long mn)
169*c87b03e5Sespie {
170*c87b03e5Sespie   unsigned long long res;
171*c87b03e5Sespie   __asm__ ("mcnvs.lw	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
172*c87b03e5Sespie   return res;
173*c87b03e5Sespie }
174*c87b03e5Sespie 
175*c87b03e5Sespie __inline__ static
176*c87b03e5Sespie unsigned long long
sh_media_MCNVS_WB(unsigned long long mm,unsigned long long mn)177*c87b03e5Sespie sh_media_MCNVS_WB (unsigned long long mm, unsigned long long mn)
178*c87b03e5Sespie {
179*c87b03e5Sespie   unsigned long long res;
180*c87b03e5Sespie   __asm__ ("mcnvs.wb	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
181*c87b03e5Sespie   return res;
182*c87b03e5Sespie }
183*c87b03e5Sespie 
184*c87b03e5Sespie __inline__ static
185*c87b03e5Sespie unsigned long long
sh_media_MCNVS_WUB(unsigned long long mm,unsigned long long mn)186*c87b03e5Sespie sh_media_MCNVS_WUB (unsigned long long mm, unsigned long long mn)
187*c87b03e5Sespie {
188*c87b03e5Sespie   unsigned long long res;
189*c87b03e5Sespie   __asm__ ("mcnvs.wub	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
190*c87b03e5Sespie   return res;
191*c87b03e5Sespie }
192*c87b03e5Sespie 
193*c87b03e5Sespie __inline__ static
194*c87b03e5Sespie unsigned long long
sh_media_MEXTR1(unsigned long long mm,unsigned long long mn)195*c87b03e5Sespie sh_media_MEXTR1 (unsigned long long mm, unsigned long long mn)
196*c87b03e5Sespie {
197*c87b03e5Sespie   unsigned long long res;
198*c87b03e5Sespie   __asm__ ("mextr1	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
199*c87b03e5Sespie   return res;
200*c87b03e5Sespie }
201*c87b03e5Sespie 
202*c87b03e5Sespie __inline__ static
203*c87b03e5Sespie unsigned long long
sh_media_MEXTR2(unsigned long long mm,unsigned long long mn)204*c87b03e5Sespie sh_media_MEXTR2 (unsigned long long mm, unsigned long long mn)
205*c87b03e5Sespie {
206*c87b03e5Sespie   unsigned long long res;
207*c87b03e5Sespie   __asm__ ("mextr2	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
208*c87b03e5Sespie   return res;
209*c87b03e5Sespie }
210*c87b03e5Sespie 
211*c87b03e5Sespie __inline__ static
212*c87b03e5Sespie unsigned long long
sh_media_MEXTR3(unsigned long long mm,unsigned long long mn)213*c87b03e5Sespie sh_media_MEXTR3 (unsigned long long mm, unsigned long long mn)
214*c87b03e5Sespie {
215*c87b03e5Sespie   unsigned long long res;
216*c87b03e5Sespie   __asm__ ("mextr3	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
217*c87b03e5Sespie   return res;
218*c87b03e5Sespie }
219*c87b03e5Sespie 
220*c87b03e5Sespie __inline__ static
221*c87b03e5Sespie unsigned long long
sh_media_MEXTR4(unsigned long long mm,unsigned long long mn)222*c87b03e5Sespie sh_media_MEXTR4 (unsigned long long mm, unsigned long long mn)
223*c87b03e5Sespie {
224*c87b03e5Sespie   unsigned long long res;
225*c87b03e5Sespie   __asm__ ("mextr4	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
226*c87b03e5Sespie   return res;
227*c87b03e5Sespie }
228*c87b03e5Sespie 
229*c87b03e5Sespie __inline__ static
230*c87b03e5Sespie unsigned long long
sh_media_MEXTR5(unsigned long long mm,unsigned long long mn)231*c87b03e5Sespie sh_media_MEXTR5 (unsigned long long mm, unsigned long long mn)
232*c87b03e5Sespie {
233*c87b03e5Sespie   unsigned long long res;
234*c87b03e5Sespie   __asm__ ("mextr5	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
235*c87b03e5Sespie   return res;
236*c87b03e5Sespie }
237*c87b03e5Sespie 
238*c87b03e5Sespie __inline__ static
239*c87b03e5Sespie unsigned long long
sh_media_MEXTR6(unsigned long long mm,unsigned long long mn)240*c87b03e5Sespie sh_media_MEXTR6 (unsigned long long mm, unsigned long long mn)
241*c87b03e5Sespie {
242*c87b03e5Sespie   unsigned long long res;
243*c87b03e5Sespie   __asm__ ("mextr6	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
244*c87b03e5Sespie   return res;
245*c87b03e5Sespie }
246*c87b03e5Sespie 
247*c87b03e5Sespie __inline__ static
248*c87b03e5Sespie unsigned long long
sh_media_MEXTR7(unsigned long long mm,unsigned long long mn)249*c87b03e5Sespie sh_media_MEXTR7 (unsigned long long mm, unsigned long long mn)
250*c87b03e5Sespie {
251*c87b03e5Sespie   unsigned long long res;
252*c87b03e5Sespie   __asm__ ("mextr7	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
253*c87b03e5Sespie   return res;
254*c87b03e5Sespie }
255*c87b03e5Sespie 
256*c87b03e5Sespie __inline__ static
257*c87b03e5Sespie unsigned long long
sh_media_MMACFX_WL(unsigned long long mm,unsigned long long mn,unsigned long long mw)258*c87b03e5Sespie sh_media_MMACFX_WL (unsigned long long mm, unsigned long long mn, unsigned long long mw)
259*c87b03e5Sespie {
260*c87b03e5Sespie   unsigned long long res;
261*c87b03e5Sespie   __asm__ ("mmacfx.wl	%1, %2, %0" : "=r" (res)
262*c87b03e5Sespie 	   : "r" (mm), "r" (mn), "0" (mw));
263*c87b03e5Sespie   return res;
264*c87b03e5Sespie }
265*c87b03e5Sespie 
266*c87b03e5Sespie __inline__ static
267*c87b03e5Sespie unsigned long long
sh_media_MMACNFX_WL(unsigned long long mm,unsigned long long mn,unsigned long long mw)268*c87b03e5Sespie sh_media_MMACNFX_WL (unsigned long long mm, unsigned long long mn, unsigned long long mw)
269*c87b03e5Sespie {
270*c87b03e5Sespie   unsigned long long res;
271*c87b03e5Sespie   __asm__ ("mmacnfx.wl	%1, %2, %0" : "=r" (res)
272*c87b03e5Sespie 	   : "r" (mm), "r" (mn), "0" (mw));
273*c87b03e5Sespie   return res;
274*c87b03e5Sespie }
275*c87b03e5Sespie 
276*c87b03e5Sespie __inline__ static
277*c87b03e5Sespie unsigned long long
sh_media_MMUL_L(unsigned long long mm,unsigned long long mn)278*c87b03e5Sespie sh_media_MMUL_L (unsigned long long mm, unsigned long long mn)
279*c87b03e5Sespie {
280*c87b03e5Sespie   unsigned long long res;
281*c87b03e5Sespie   __asm__ ("mmul.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
282*c87b03e5Sespie   return res;
283*c87b03e5Sespie }
284*c87b03e5Sespie 
285*c87b03e5Sespie __inline__ static
286*c87b03e5Sespie unsigned long long
sh_media_MMUL_W(unsigned long long mm,unsigned long long mn)287*c87b03e5Sespie sh_media_MMUL_W (unsigned long long mm, unsigned long long mn)
288*c87b03e5Sespie {
289*c87b03e5Sespie   unsigned long long res;
290*c87b03e5Sespie   __asm__ ("mmul.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
291*c87b03e5Sespie   return res;
292*c87b03e5Sespie }
293*c87b03e5Sespie 
294*c87b03e5Sespie __inline__ static
295*c87b03e5Sespie unsigned long long
sh_media_MMULFX_L(unsigned long long mm,unsigned long long mn)296*c87b03e5Sespie sh_media_MMULFX_L (unsigned long long mm, unsigned long long mn)
297*c87b03e5Sespie {
298*c87b03e5Sespie   unsigned long long res;
299*c87b03e5Sespie   __asm__ ("mmulfx.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
300*c87b03e5Sespie   return res;
301*c87b03e5Sespie }
302*c87b03e5Sespie 
303*c87b03e5Sespie __inline__ static
304*c87b03e5Sespie unsigned long long
sh_media_MMULFX_W(unsigned long long mm,unsigned long long mn)305*c87b03e5Sespie sh_media_MMULFX_W (unsigned long long mm, unsigned long long mn)
306*c87b03e5Sespie {
307*c87b03e5Sespie   unsigned long long res;
308*c87b03e5Sespie   __asm__ ("mmulfx.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
309*c87b03e5Sespie   return res;
310*c87b03e5Sespie }
311*c87b03e5Sespie 
312*c87b03e5Sespie __inline__ static
313*c87b03e5Sespie unsigned long long
sh_media_MMULFXRP_W(unsigned long long mm,unsigned long long mn)314*c87b03e5Sespie sh_media_MMULFXRP_W (unsigned long long mm, unsigned long long mn)
315*c87b03e5Sespie {
316*c87b03e5Sespie   unsigned long long res;
317*c87b03e5Sespie   __asm__ ("mmulfxrp.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
318*c87b03e5Sespie   return res;
319*c87b03e5Sespie }
320*c87b03e5Sespie 
321*c87b03e5Sespie __inline__ static
322*c87b03e5Sespie unsigned long long
sh_media_MMULHI_WL(unsigned long long mm,unsigned long long mn)323*c87b03e5Sespie sh_media_MMULHI_WL (unsigned long long mm, unsigned long long mn)
324*c87b03e5Sespie {
325*c87b03e5Sespie   unsigned long long res;
326*c87b03e5Sespie   __asm__ ("mmulhi.wl	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
327*c87b03e5Sespie   return res;
328*c87b03e5Sespie }
329*c87b03e5Sespie 
330*c87b03e5Sespie __inline__ static
331*c87b03e5Sespie unsigned long long
sh_media_MMULLO_WL(unsigned long long mm,unsigned long long mn)332*c87b03e5Sespie sh_media_MMULLO_WL (unsigned long long mm, unsigned long long mn)
333*c87b03e5Sespie {
334*c87b03e5Sespie   unsigned long long res;
335*c87b03e5Sespie   __asm__ ("mmullo.wl	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
336*c87b03e5Sespie   return res;
337*c87b03e5Sespie }
338*c87b03e5Sespie 
339*c87b03e5Sespie __inline__ static
340*c87b03e5Sespie unsigned long long
sh_media_MMULSUM_WQ(unsigned long long mm,unsigned long long mn,unsigned long long mw)341*c87b03e5Sespie sh_media_MMULSUM_WQ (unsigned long long mm, unsigned long long mn, unsigned long long mw)
342*c87b03e5Sespie {
343*c87b03e5Sespie   unsigned long long res;
344*c87b03e5Sespie   __asm__ ("mmulsum.wq	%1, %2, %0" : "=r" (res)
345*c87b03e5Sespie 	   : "r" (mm), "r" (mn), "0" (mw));
346*c87b03e5Sespie   return res;
347*c87b03e5Sespie }
348*c87b03e5Sespie 
349*c87b03e5Sespie __inline__ static
350*c87b03e5Sespie unsigned long long
sh_media_MPERM_W(unsigned long long mm,unsigned int mn)351*c87b03e5Sespie sh_media_MPERM_W (unsigned long long mm, unsigned int mn)
352*c87b03e5Sespie {
353*c87b03e5Sespie   unsigned long long res;
354*c87b03e5Sespie   __asm__ ("mperm.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
355*c87b03e5Sespie   return res;
356*c87b03e5Sespie }
357*c87b03e5Sespie 
358*c87b03e5Sespie __inline__ static
359*c87b03e5Sespie unsigned long long
sh_media_MSAD_UBQ(unsigned long long mm,unsigned long long mn,unsigned long long mw)360*c87b03e5Sespie sh_media_MSAD_UBQ (unsigned long long mm, unsigned long long mn, unsigned long long mw)
361*c87b03e5Sespie {
362*c87b03e5Sespie   unsigned long long res;
363*c87b03e5Sespie   __asm__ ("msad.ubq	%1, %2, %0" : "=r" (res)
364*c87b03e5Sespie 	   : "r" (mm), "r" (mn), "0" (mw));
365*c87b03e5Sespie   return res;
366*c87b03e5Sespie }
367*c87b03e5Sespie 
368*c87b03e5Sespie __inline__ static
369*c87b03e5Sespie unsigned long long
sh_media_MSHALDS_L(unsigned long long mm,unsigned int mn)370*c87b03e5Sespie sh_media_MSHALDS_L (unsigned long long mm, unsigned int mn)
371*c87b03e5Sespie {
372*c87b03e5Sespie   unsigned long long res;
373*c87b03e5Sespie   __asm__ ("mshalds.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
374*c87b03e5Sespie   return res;
375*c87b03e5Sespie }
376*c87b03e5Sespie 
377*c87b03e5Sespie __inline__ static
378*c87b03e5Sespie unsigned long long
sh_media_MSHALDS_W(unsigned long long mm,unsigned int mn)379*c87b03e5Sespie sh_media_MSHALDS_W (unsigned long long mm, unsigned int mn)
380*c87b03e5Sespie {
381*c87b03e5Sespie   unsigned long long res;
382*c87b03e5Sespie   __asm__ ("mshalds.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
383*c87b03e5Sespie   return res;
384*c87b03e5Sespie }
385*c87b03e5Sespie 
386*c87b03e5Sespie __inline__ static
387*c87b03e5Sespie unsigned long long
sh_media_MSHARD_L(unsigned long long mm,unsigned int mn)388*c87b03e5Sespie sh_media_MSHARD_L (unsigned long long mm, unsigned int mn)
389*c87b03e5Sespie {
390*c87b03e5Sespie   unsigned long long res;
391*c87b03e5Sespie   __asm__ ("mshard.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
392*c87b03e5Sespie   return res;
393*c87b03e5Sespie }
394*c87b03e5Sespie 
395*c87b03e5Sespie __inline__ static
396*c87b03e5Sespie unsigned long long
sh_media_MSHARD_W(unsigned long long mm,unsigned int mn)397*c87b03e5Sespie sh_media_MSHARD_W (unsigned long long mm, unsigned int mn)
398*c87b03e5Sespie {
399*c87b03e5Sespie   unsigned long long res;
400*c87b03e5Sespie   __asm__ ("mshard.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
401*c87b03e5Sespie   return res;
402*c87b03e5Sespie }
403*c87b03e5Sespie 
404*c87b03e5Sespie __inline__ static
405*c87b03e5Sespie short
sh_media_MSHARDS_Q(long long mm,unsigned int mn)406*c87b03e5Sespie sh_media_MSHARDS_Q (long long mm, unsigned int mn)
407*c87b03e5Sespie {
408*c87b03e5Sespie   short res;
409*c87b03e5Sespie   __asm__ ("mshards.q	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
410*c87b03e5Sespie   return res;
411*c87b03e5Sespie }
412*c87b03e5Sespie 
413*c87b03e5Sespie __inline__ static
414*c87b03e5Sespie unsigned long long
sh_media_MSHFHI_B(unsigned long long mm,unsigned long long mn)415*c87b03e5Sespie sh_media_MSHFHI_B (unsigned long long mm, unsigned long long mn)
416*c87b03e5Sespie {
417*c87b03e5Sespie   unsigned long long res;
418*c87b03e5Sespie   __asm__ ("mshfhi.b	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
419*c87b03e5Sespie   return res;
420*c87b03e5Sespie }
421*c87b03e5Sespie 
422*c87b03e5Sespie __inline__ static
423*c87b03e5Sespie unsigned long long
sh_media_MSHFHI_L(unsigned long long mm,unsigned long long mn)424*c87b03e5Sespie sh_media_MSHFHI_L (unsigned long long mm, unsigned long long mn)
425*c87b03e5Sespie {
426*c87b03e5Sespie   unsigned long long res;
427*c87b03e5Sespie   __asm__ ("mshfhi.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
428*c87b03e5Sespie   return res;
429*c87b03e5Sespie }
430*c87b03e5Sespie 
431*c87b03e5Sespie __inline__ static
432*c87b03e5Sespie unsigned long long
sh_media_MSHFHI_W(unsigned long long mm,unsigned long long mn)433*c87b03e5Sespie sh_media_MSHFHI_W (unsigned long long mm, unsigned long long mn)
434*c87b03e5Sespie {
435*c87b03e5Sespie   unsigned long long res;
436*c87b03e5Sespie   __asm__ ("mshfhi.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
437*c87b03e5Sespie   return res;
438*c87b03e5Sespie }
439*c87b03e5Sespie 
440*c87b03e5Sespie __inline__ static
441*c87b03e5Sespie unsigned long long
sh_media_MSHFLO_B(unsigned long long mm,unsigned long long mn)442*c87b03e5Sespie sh_media_MSHFLO_B (unsigned long long mm, unsigned long long mn)
443*c87b03e5Sespie {
444*c87b03e5Sespie   unsigned long long res;
445*c87b03e5Sespie   __asm__ ("mshflo.b	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
446*c87b03e5Sespie   return res;
447*c87b03e5Sespie }
448*c87b03e5Sespie 
449*c87b03e5Sespie __inline__ static
450*c87b03e5Sespie unsigned long long
sh_media_MSHFLO_L(unsigned long long mm,unsigned long long mn)451*c87b03e5Sespie sh_media_MSHFLO_L (unsigned long long mm, unsigned long long mn)
452*c87b03e5Sespie {
453*c87b03e5Sespie   unsigned long long res;
454*c87b03e5Sespie   __asm__ ("mshflo.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
455*c87b03e5Sespie   return res;
456*c87b03e5Sespie }
457*c87b03e5Sespie 
458*c87b03e5Sespie __inline__ static
459*c87b03e5Sespie unsigned long long
sh_media_MSHFLO_W(unsigned long long mm,unsigned long long mn)460*c87b03e5Sespie sh_media_MSHFLO_W (unsigned long long mm, unsigned long long mn)
461*c87b03e5Sespie {
462*c87b03e5Sespie   unsigned long long res;
463*c87b03e5Sespie   __asm__ ("mshflo.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
464*c87b03e5Sespie   return res;
465*c87b03e5Sespie }
466*c87b03e5Sespie 
467*c87b03e5Sespie __inline__ static
468*c87b03e5Sespie unsigned long long
sh_media_MSHLLD_L(unsigned long long mm,unsigned int mn)469*c87b03e5Sespie sh_media_MSHLLD_L (unsigned long long mm, unsigned int mn)
470*c87b03e5Sespie {
471*c87b03e5Sespie   unsigned long long res;
472*c87b03e5Sespie   __asm__ ("mshlld.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
473*c87b03e5Sespie   return res;
474*c87b03e5Sespie }
475*c87b03e5Sespie 
476*c87b03e5Sespie __inline__ static
477*c87b03e5Sespie unsigned long long
sh_media_MSHLLD_W(unsigned long long mm,unsigned int mn)478*c87b03e5Sespie sh_media_MSHLLD_W (unsigned long long mm, unsigned int mn)
479*c87b03e5Sespie {
480*c87b03e5Sespie   unsigned long long res;
481*c87b03e5Sespie   __asm__ ("mshlld.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
482*c87b03e5Sespie   return res;
483*c87b03e5Sespie }
484*c87b03e5Sespie 
485*c87b03e5Sespie __inline__ static
486*c87b03e5Sespie unsigned long long
sh_media_MSHLRD_L(unsigned long long mm,unsigned int mn)487*c87b03e5Sespie sh_media_MSHLRD_L (unsigned long long mm, unsigned int mn)
488*c87b03e5Sespie {
489*c87b03e5Sespie   unsigned long long res;
490*c87b03e5Sespie   __asm__ ("mshlrd.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
491*c87b03e5Sespie   return res;
492*c87b03e5Sespie }
493*c87b03e5Sespie 
494*c87b03e5Sespie __inline__ static
495*c87b03e5Sespie unsigned long long
sh_media_MSHLRD_W(unsigned long long mm,unsigned int mn)496*c87b03e5Sespie sh_media_MSHLRD_W (unsigned long long mm, unsigned int mn)
497*c87b03e5Sespie {
498*c87b03e5Sespie   unsigned long long res;
499*c87b03e5Sespie   __asm__ ("mshlrd.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
500*c87b03e5Sespie   return res;
501*c87b03e5Sespie }
502*c87b03e5Sespie 
503*c87b03e5Sespie __inline__ static
504*c87b03e5Sespie unsigned long long
sh_media_MSUB_L(unsigned long long mm,unsigned long long mn)505*c87b03e5Sespie sh_media_MSUB_L (unsigned long long mm, unsigned long long mn)
506*c87b03e5Sespie {
507*c87b03e5Sespie   unsigned long long res;
508*c87b03e5Sespie   __asm__ ("msub.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
509*c87b03e5Sespie   return res;
510*c87b03e5Sespie }
511*c87b03e5Sespie 
512*c87b03e5Sespie __inline__ static
513*c87b03e5Sespie unsigned long long
sh_media_MSUB_W(unsigned long long mm,unsigned long long mn)514*c87b03e5Sespie sh_media_MSUB_W (unsigned long long mm, unsigned long long mn)
515*c87b03e5Sespie {
516*c87b03e5Sespie   unsigned long long res;
517*c87b03e5Sespie   __asm__ ("msub.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
518*c87b03e5Sespie   return res;
519*c87b03e5Sespie }
520*c87b03e5Sespie 
521*c87b03e5Sespie __inline__ static
522*c87b03e5Sespie unsigned long long
sh_media_MSUBS_L(unsigned long long mm,unsigned long long mn)523*c87b03e5Sespie sh_media_MSUBS_L (unsigned long long mm, unsigned long long mn)
524*c87b03e5Sespie {
525*c87b03e5Sespie   unsigned long long res;
526*c87b03e5Sespie   __asm__ ("msubs.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
527*c87b03e5Sespie   return res;
528*c87b03e5Sespie }
529*c87b03e5Sespie 
530*c87b03e5Sespie __inline__ static
531*c87b03e5Sespie unsigned long long
sh_media_MSUBS_UB(unsigned long long mm,unsigned long long mn)532*c87b03e5Sespie sh_media_MSUBS_UB (unsigned long long mm, unsigned long long mn)
533*c87b03e5Sespie {
534*c87b03e5Sespie   unsigned long long res;
535*c87b03e5Sespie   __asm__ ("msubs.ub	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
536*c87b03e5Sespie   return res;
537*c87b03e5Sespie }
538*c87b03e5Sespie 
539*c87b03e5Sespie __inline__ static
540*c87b03e5Sespie unsigned long long
sh_media_MSUBS_W(unsigned long long mm,unsigned long long mn)541*c87b03e5Sespie sh_media_MSUBS_W (unsigned long long mm, unsigned long long mn)
542*c87b03e5Sespie {
543*c87b03e5Sespie   unsigned long long res;
544*c87b03e5Sespie   __asm__ ("msubs.w	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
545*c87b03e5Sespie   return res;
546*c87b03e5Sespie }
547*c87b03e5Sespie 
548*c87b03e5Sespie #if ! __SH4_NOFPU__
549*c87b03e5Sespie __inline__ static
550*c87b03e5Sespie double
sh_media_FABS_D(double dg)551*c87b03e5Sespie sh_media_FABS_D (double dg)
552*c87b03e5Sespie {
553*c87b03e5Sespie   double res;
554*c87b03e5Sespie   __asm__ ("fabs.d	%1, %0" : "=f" (res) : "f" (dg));
555*c87b03e5Sespie   return res;
556*c87b03e5Sespie }
557*c87b03e5Sespie 
558*c87b03e5Sespie __inline__ static
559*c87b03e5Sespie float
sh_media_FABS_S(float fg)560*c87b03e5Sespie sh_media_FABS_S (float fg)
561*c87b03e5Sespie {
562*c87b03e5Sespie   float res;
563*c87b03e5Sespie   __asm__ ("fabs.s	%1, %0" : "=f" (res) : "f" (fg));
564*c87b03e5Sespie   return res;
565*c87b03e5Sespie }
566*c87b03e5Sespie 
567*c87b03e5Sespie __inline__ static
568*c87b03e5Sespie int
sh_media_FCMPUN_D(double dg,double dh)569*c87b03e5Sespie sh_media_FCMPUN_D (double dg, double dh)
570*c87b03e5Sespie {
571*c87b03e5Sespie   int res;
572*c87b03e5Sespie   __asm__ ("fcmpun.d	%1, %2, %0" : "=f" (res) : "f" (dg), "f" (dh));
573*c87b03e5Sespie   return res;
574*c87b03e5Sespie }
575*c87b03e5Sespie 
576*c87b03e5Sespie __inline__ static
577*c87b03e5Sespie int
sh_media_FCMPUN_S(float fg,float fh)578*c87b03e5Sespie sh_media_FCMPUN_S (float fg, float fh)
579*c87b03e5Sespie {
580*c87b03e5Sespie   int res;
581*c87b03e5Sespie   __asm__ ("fcmpun.s	%1, %2, %0" : "=f" (res) : "f" (fg), "f" (fh));
582*c87b03e5Sespie   return res;
583*c87b03e5Sespie }
584*c87b03e5Sespie 
585*c87b03e5Sespie __inline__ static
586*c87b03e5Sespie float
sh_media_FGETSCR(void)587*c87b03e5Sespie sh_media_FGETSCR (void)
588*c87b03e5Sespie {
589*c87b03e5Sespie   float res;
590*c87b03e5Sespie   __asm__ ("fgetscr	%0" : "=f" (res));
591*c87b03e5Sespie   return res;
592*c87b03e5Sespie }
593*c87b03e5Sespie 
594*c87b03e5Sespie __inline__ static
595*c87b03e5Sespie float
sh_media_FIPR_S(const void * fvg,const void * fvh)596*c87b03e5Sespie sh_media_FIPR_S (const void *fvg, const void *fvh)
597*c87b03e5Sespie {
598*c87b03e5Sespie   float res;
599*c87b03e5Sespie   __asm__ ("fipr.s	%1, %2, %0" : "=f" (res)
600*c87b03e5Sespie 	   : "f" (*(const __GCC_FV *)fvg), "f" (*(const __GCC_FV *)fvh));
601*c87b03e5Sespie   return res;
602*c87b03e5Sespie }
603*c87b03e5Sespie 
604*c87b03e5Sespie __inline__ static
605*c87b03e5Sespie float
sh_media_FMAC_S(float fg,float fh,float fq)606*c87b03e5Sespie sh_media_FMAC_S (float fg, float fh, float fq)
607*c87b03e5Sespie {
608*c87b03e5Sespie   float res;
609*c87b03e5Sespie   __asm__ ("fmac.s	%1, %2, %0" : "=f" (res)
610*c87b03e5Sespie 	   : "f" (fg), "f" (fh), "0" (fq));
611*c87b03e5Sespie   return res;
612*c87b03e5Sespie }
613*c87b03e5Sespie 
614*c87b03e5Sespie __inline__ static
615*c87b03e5Sespie long long
sh_media_FMOV_DQ(double dg)616*c87b03e5Sespie sh_media_FMOV_DQ (double dg)
617*c87b03e5Sespie {
618*c87b03e5Sespie   long long res;
619*c87b03e5Sespie   __asm__ ("fmov.dq	%1, %0" : "=r" (res) : "f" (dg));
620*c87b03e5Sespie   return res;
621*c87b03e5Sespie }
622*c87b03e5Sespie 
623*c87b03e5Sespie __inline__ static
624*c87b03e5Sespie float
sh_media_FMOV_LS(int mm)625*c87b03e5Sespie sh_media_FMOV_LS (int mm)
626*c87b03e5Sespie {
627*c87b03e5Sespie   float res;
628*c87b03e5Sespie   __asm__ ("fmov.ls	%1, %0" : "=f" (res) : "r" (mm));
629*c87b03e5Sespie   return res;
630*c87b03e5Sespie }
631*c87b03e5Sespie 
632*c87b03e5Sespie __inline__ static
633*c87b03e5Sespie double
sh_media_FMOV_QD(long long mm)634*c87b03e5Sespie sh_media_FMOV_QD (long long mm)
635*c87b03e5Sespie {
636*c87b03e5Sespie   double res;
637*c87b03e5Sespie   __asm__ ("fmov.qd	%1, %0" : "=f" (res) : "r" (mm));
638*c87b03e5Sespie   return res;
639*c87b03e5Sespie }
640*c87b03e5Sespie 
641*c87b03e5Sespie __inline__ static
642*c87b03e5Sespie int
sh_media_FMOV_SL(float fg)643*c87b03e5Sespie sh_media_FMOV_SL (float fg)
644*c87b03e5Sespie {
645*c87b03e5Sespie   int res;
646*c87b03e5Sespie   __asm__ ("fmov.sl	%1, %0" : "=r" (res) : "f" (fg));
647*c87b03e5Sespie   return res;
648*c87b03e5Sespie }
649*c87b03e5Sespie 
650*c87b03e5Sespie __inline__ static
651*c87b03e5Sespie void
sh_media_FPUTSCR(float fg)652*c87b03e5Sespie sh_media_FPUTSCR (float fg)
653*c87b03e5Sespie {
654*c87b03e5Sespie   __asm__ ("fputscr	%0" : : "f" (fg));
655*c87b03e5Sespie }
656*c87b03e5Sespie 
657*c87b03e5Sespie __inline__ static
658*c87b03e5Sespie double
sh_media_FSQRT_D(double dg)659*c87b03e5Sespie sh_media_FSQRT_D (double dg)
660*c87b03e5Sespie {
661*c87b03e5Sespie   double res;
662*c87b03e5Sespie   __asm__ ("fsqrt.d	%1, %0" : "=f" (res) : "f" (dg));
663*c87b03e5Sespie   return res;
664*c87b03e5Sespie }
665*c87b03e5Sespie 
666*c87b03e5Sespie __inline__ static
667*c87b03e5Sespie float
sh_media_FSQRT_S(float fg)668*c87b03e5Sespie sh_media_FSQRT_S (float fg)
669*c87b03e5Sespie {
670*c87b03e5Sespie   float res;
671*c87b03e5Sespie   __asm__ ("fsqrt.s	%1, %0" : "=f" (res) : "f" (fg));
672*c87b03e5Sespie   return res;
673*c87b03e5Sespie }
674*c87b03e5Sespie 
675*c87b03e5Sespie __inline__ static
676*c87b03e5Sespie void
sh_media_FTRV_S(const void * mtrxg,const void * fvh,void * fvf)677*c87b03e5Sespie sh_media_FTRV_S (const void *mtrxg, const void *fvh, void *fvf)
678*c87b03e5Sespie {
679*c87b03e5Sespie   __asm__ ("ftrv.s	%2, %1, %0" : "=f" (*(__GCC_FV *)fvf)
680*c87b03e5Sespie 	   : "f" (*(const __GCC_FV *)fvh), "f" (*(const __GCC_MTRX *)mtrxg));
681*c87b03e5Sespie }
682*c87b03e5Sespie #endif /* ! __SH4_NOFPU__ */
683*c87b03e5Sespie 
684*c87b03e5Sespie __inline__ static
685*c87b03e5Sespie unsigned long long
sh_media_LDHI_L(void * p,int s)686*c87b03e5Sespie sh_media_LDHI_L (void *p, int s)
687*c87b03e5Sespie {
688*c87b03e5Sespie   unsigned long long res;
689*c87b03e5Sespie   __asm__ ("ldhi.l	%m1, %0" : "=r" (res) : "o" (((char*)p)[s]));
690*c87b03e5Sespie   return res;
691*c87b03e5Sespie }
692*c87b03e5Sespie 
693*c87b03e5Sespie __inline__ static
694*c87b03e5Sespie unsigned long long
sh_media_LDHI_Q(void * p,int s)695*c87b03e5Sespie sh_media_LDHI_Q (void *p, int s)
696*c87b03e5Sespie {
697*c87b03e5Sespie   unsigned long long res;
698*c87b03e5Sespie   __asm__ ("ldhi.q	%m1, %0" : "=r" (res) : "o" (((char*)p)[s]));
699*c87b03e5Sespie   return res;
700*c87b03e5Sespie }
701*c87b03e5Sespie 
702*c87b03e5Sespie __inline__ static
703*c87b03e5Sespie unsigned long long
sh_media_LDLO_L(void * p,int s)704*c87b03e5Sespie sh_media_LDLO_L (void *p, int s)
705*c87b03e5Sespie {
706*c87b03e5Sespie   unsigned long long res;
707*c87b03e5Sespie   __asm__ ("ldlo.l	%m1, %0" : "=r" (res) : "o" (((char*)p)[s]));
708*c87b03e5Sespie   return res;
709*c87b03e5Sespie }
710*c87b03e5Sespie 
711*c87b03e5Sespie __inline__ static
712*c87b03e5Sespie unsigned long long
sh_media_LDLO_Q(void * p,int s)713*c87b03e5Sespie sh_media_LDLO_Q (void *p, int s)
714*c87b03e5Sespie {
715*c87b03e5Sespie   unsigned long long res;
716*c87b03e5Sespie   __asm__ ("ldlo.q	%m1, %0" : "=r" (res) : "o" (((char*)p)[s]));
717*c87b03e5Sespie   return res;
718*c87b03e5Sespie }
719*c87b03e5Sespie 
720*c87b03e5Sespie __inline__ static
721*c87b03e5Sespie void
sh_media_STHI_L(void * p,int s,unsigned int mw)722*c87b03e5Sespie sh_media_STHI_L (void *p, int s, unsigned int mw)
723*c87b03e5Sespie {
724*c87b03e5Sespie   __asm__ ("sthi.l %m0, %1" : "+o" (((char*)p)[s]) : "r" (mw));
725*c87b03e5Sespie }
726*c87b03e5Sespie 
727*c87b03e5Sespie __inline__ static
728*c87b03e5Sespie void
sh_media_STHI_Q(void * p,int s,unsigned long long mw)729*c87b03e5Sespie sh_media_STHI_Q (void *p, int s, unsigned long long mw)
730*c87b03e5Sespie {
731*c87b03e5Sespie   __asm__ ("sthi.q %m0, %1" : "+o" (((char*)p)[s]) : "r" (mw));
732*c87b03e5Sespie }
733*c87b03e5Sespie 
734*c87b03e5Sespie __inline__ static
735*c87b03e5Sespie void
sh_media_STLO_L(void * p,int s,unsigned int mw)736*c87b03e5Sespie sh_media_STLO_L (void *p, int s, unsigned int mw)
737*c87b03e5Sespie {
738*c87b03e5Sespie   __asm__ ("stlo.l %m0, %1" : "+o" (((char*)p)[s]) : "r" (mw));
739*c87b03e5Sespie }
740*c87b03e5Sespie 
741*c87b03e5Sespie __inline__ static
742*c87b03e5Sespie void
sh_media_STLO_Q(void * p,int s,unsigned long long mw)743*c87b03e5Sespie sh_media_STLO_Q (void *p, int s, unsigned long long mw)
744*c87b03e5Sespie {
745*c87b03e5Sespie   __asm__ ("stlo.q %m0, %1" : "+o" (((char*)p)[s]) : "r" (mw));
746*c87b03e5Sespie }
747*c87b03e5Sespie 
748*c87b03e5Sespie __inline__ static
749*c87b03e5Sespie unsigned char
sh_media_NSB(long long mm)750*c87b03e5Sespie sh_media_NSB (long long mm)
751*c87b03e5Sespie {
752*c87b03e5Sespie   unsigned char res;
753*c87b03e5Sespie   __asm__ ("nsb	%1, %0" : "=r" (res) : "r" (mm));
754*c87b03e5Sespie   return res;
755*c87b03e5Sespie }
756*c87b03e5Sespie 
757*c87b03e5Sespie __inline__ static
758*c87b03e5Sespie unsigned long long
sh_media_BYTEREV(unsigned long long mm)759*c87b03e5Sespie sh_media_BYTEREV (unsigned long long mm)
760*c87b03e5Sespie {
761*c87b03e5Sespie   unsigned long long res;
762*c87b03e5Sespie   __asm__ ("byterev	%1, %0" : "=r" (res) : "r" (mm));
763*c87b03e5Sespie   return res;
764*c87b03e5Sespie }
765*c87b03e5Sespie 
766*c87b03e5Sespie __inline__ static
767*c87b03e5Sespie unsigned long long
sh_media_CMVEQ(unsigned long long mm,unsigned long long mn,unsigned long long mw)768*c87b03e5Sespie sh_media_CMVEQ (unsigned long long mm, unsigned long long mn, unsigned long long mw)
769*c87b03e5Sespie {
770*c87b03e5Sespie   unsigned long long res;
771*c87b03e5Sespie   __asm__ ("cmveq	%1, %2, %0" : "=r" (res)
772*c87b03e5Sespie 	   : "r" (mm), "r" (mn), "0" (mw));
773*c87b03e5Sespie   return res;
774*c87b03e5Sespie }
775*c87b03e5Sespie 
776*c87b03e5Sespie __inline__ static
777*c87b03e5Sespie unsigned long long
sh_media_CMVNE(unsigned long long mm,unsigned long long mn,unsigned long long mw)778*c87b03e5Sespie sh_media_CMVNE (unsigned long long mm, unsigned long long mn, unsigned long long mw)
779*c87b03e5Sespie {
780*c87b03e5Sespie   unsigned long long res;
781*c87b03e5Sespie   __asm__ ("cmveq	%1, %2, %0" : "=r" (res)
782*c87b03e5Sespie 	   : "r" (mm), "r" (mn), "0" (mw));
783*c87b03e5Sespie   return res;
784*c87b03e5Sespie }
785*c87b03e5Sespie 
786*c87b03e5Sespie __inline__ static
787*c87b03e5Sespie unsigned long long
sh_media_ADDZ_L(unsigned int mm,unsigned int mn)788*c87b03e5Sespie sh_media_ADDZ_L (unsigned int mm, unsigned int mn)
789*c87b03e5Sespie {
790*c87b03e5Sespie   unsigned long long res;
791*c87b03e5Sespie   __asm__ ("addz.l	%1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn));
792*c87b03e5Sespie   return res;
793*c87b03e5Sespie }
794*c87b03e5Sespie 
795*c87b03e5Sespie __inline__ static
796*c87b03e5Sespie void
sh_media_NOP(void)797*c87b03e5Sespie sh_media_NOP (void)
798*c87b03e5Sespie {
799*c87b03e5Sespie   __asm__ __volatile__ ("nop" : :);
800*c87b03e5Sespie }
801*c87b03e5Sespie 
802*c87b03e5Sespie __inline__ static
803*c87b03e5Sespie unsigned long long
sh_media_SWAP_Q(void * mm,long long mn,unsigned long long mw)804*c87b03e5Sespie sh_media_SWAP_Q (void *mm, long long mn, unsigned long long mw)
805*c87b03e5Sespie {
806*c87b03e5Sespie   unsigned long long res;
807*c87b03e5Sespie   unsigned long long *addr = (unsigned long long *)((char *)mm + mn);
808*c87b03e5Sespie   __asm__ ("swap.q	%m1, %0" : "=r" (res), "+o" (*addr) : "0" (mw));
809*c87b03e5Sespie   return res;
810*c87b03e5Sespie }
811*c87b03e5Sespie 
812*c87b03e5Sespie __inline__ static
813*c87b03e5Sespie void
sh_media_SYNCI(void)814*c87b03e5Sespie sh_media_SYNCI (void)
815*c87b03e5Sespie {
816*c87b03e5Sespie   __asm__ __volatile__ ("synci");
817*c87b03e5Sespie }
818*c87b03e5Sespie 
819*c87b03e5Sespie __inline__ static
820*c87b03e5Sespie void
sh_media_SYNCO(void)821*c87b03e5Sespie sh_media_SYNCO (void)
822*c87b03e5Sespie {
823*c87b03e5Sespie   __asm__ __volatile__ ("synco");
824*c87b03e5Sespie }
825*c87b03e5Sespie 
826*c87b03e5Sespie __inline__ static
827*c87b03e5Sespie void
sh_media_ALLOCO(void * mm,int s)828*c87b03e5Sespie sh_media_ALLOCO (void *mm, int s)
829*c87b03e5Sespie {
830*c87b03e5Sespie   __asm__ __volatile__ ("alloco	%m0" : : "o" (((char*)mm)[s]));
831*c87b03e5Sespie }
832*c87b03e5Sespie 
833*c87b03e5Sespie __inline__ static
834*c87b03e5Sespie void
sh_media_ICBI(void * mm,int s)835*c87b03e5Sespie sh_media_ICBI (void *mm, int s)
836*c87b03e5Sespie {
837*c87b03e5Sespie   __asm__ __volatile__ ("icbi	%m0" : : "o" (((char*)mm)[s]));
838*c87b03e5Sespie }
839*c87b03e5Sespie 
840*c87b03e5Sespie __inline__ static
841*c87b03e5Sespie void
sh_media_OCBI(void * mm,int s)842*c87b03e5Sespie sh_media_OCBI (void *mm, int s)
843*c87b03e5Sespie {
844*c87b03e5Sespie   __asm__ __volatile__ ("ocbi	%m0" : : "o" (((char*)mm)[s]));
845*c87b03e5Sespie }
846*c87b03e5Sespie 
847*c87b03e5Sespie __inline__ static
848*c87b03e5Sespie void
sh_media_OCBP(void * mm,int s)849*c87b03e5Sespie sh_media_OCBP (void *mm, int s)
850*c87b03e5Sespie {
851*c87b03e5Sespie   __asm__ __volatile__ ("ocbp	%m0" : : "o" (((char*)mm)[s]));
852*c87b03e5Sespie }
853*c87b03e5Sespie 
854*c87b03e5Sespie __inline__ static
855*c87b03e5Sespie void
sh_media_OCBWB(void * mm,int s)856*c87b03e5Sespie sh_media_OCBWB (void *mm, int s)
857*c87b03e5Sespie {
858*c87b03e5Sespie   __asm__ __volatile__ ("ocbwb	%m0" : : "o" (((char*)mm)[s]));
859*c87b03e5Sespie }
860*c87b03e5Sespie 
861*c87b03e5Sespie __inline__ static
862*c87b03e5Sespie void
sh_media_PREFI(void * mm,int s)863*c87b03e5Sespie sh_media_PREFI (void *mm, int s)
864*c87b03e5Sespie {
865*c87b03e5Sespie   __asm__ __volatile__ ("prefi	%m0" : : "o" (((char*)mm)[s]));
866*c87b03e5Sespie }
867*c87b03e5Sespie 
868*c87b03e5Sespie __inline__ static
869*c87b03e5Sespie void
sh_media_PREFO(void * mm,int s)870*c87b03e5Sespie sh_media_PREFO (void *mm, int s)
871*c87b03e5Sespie {
872*c87b03e5Sespie   __asm__ __volatile__ ("ld.b	%m0, r63" : : "o" (((char*)mm)[s]));
873*c87b03e5Sespie }
874*c87b03e5Sespie 
875*c87b03e5Sespie __inline__ static
876*c87b03e5Sespie void
sh_media_BRK(void)877*c87b03e5Sespie sh_media_BRK (void)
878*c87b03e5Sespie {
879*c87b03e5Sespie   __asm__ __volatile__ ("brk");
880*c87b03e5Sespie }
881*c87b03e5Sespie 
882*c87b03e5Sespie __inline__ static
883*c87b03e5Sespie void
sh_media_TRAPA(unsigned long long mm)884*c87b03e5Sespie sh_media_TRAPA (unsigned long long mm)
885*c87b03e5Sespie {
886*c87b03e5Sespie   __asm__ __volatile__ ("trapa	%%0" : : "r" (mm));
887*c87b03e5Sespie }
888*c87b03e5Sespie 
889*c87b03e5Sespie __inline__ static
890*c87b03e5Sespie short
sh_media_unaligned_LD_W(void * p)891*c87b03e5Sespie sh_media_unaligned_LD_W (void *p)
892*c87b03e5Sespie {
893*c87b03e5Sespie #if __LITTLE_ENDIAN__
894*c87b03e5Sespie   return (((unsigned char *)p)[0]
895*c87b03e5Sespie 	  | (((short)((__signed__ char *)p)[1]) << 8));
896*c87b03e5Sespie #else
897*c87b03e5Sespie   return ((((short)((__signed__ char *)p)[0]) << 8)
898*c87b03e5Sespie 	  | ((unsigned char *)p)[1]);
899*c87b03e5Sespie #endif
900*c87b03e5Sespie }
901*c87b03e5Sespie 
902*c87b03e5Sespie __inline__ static
903*c87b03e5Sespie unsigned short
sh_media_unaligned_LD_UW(void * p)904*c87b03e5Sespie sh_media_unaligned_LD_UW (void *p)
905*c87b03e5Sespie {
906*c87b03e5Sespie   unsigned char *addr = p;
907*c87b03e5Sespie #if __LITTLE_ENDIAN__
908*c87b03e5Sespie   return sh_media_MSHFLO_B (addr[0], addr[1]);
909*c87b03e5Sespie #else
910*c87b03e5Sespie   return sh_media_MSHFLO_B (addr[1], addr[0]);
911*c87b03e5Sespie #endif
912*c87b03e5Sespie }
913*c87b03e5Sespie 
914*c87b03e5Sespie __inline__ static
915*c87b03e5Sespie int
sh_media_unaligned_LD_L(void * p)916*c87b03e5Sespie sh_media_unaligned_LD_L (void *p)
917*c87b03e5Sespie {
918*c87b03e5Sespie #if __LITTLE_ENDIAN__
919*c87b03e5Sespie   return sh_media_LDHI_L (p, 3) | sh_media_LDLO_L (p, 0);
920*c87b03e5Sespie #else
921*c87b03e5Sespie   return sh_media_LDLO_L (p, 3) | sh_media_LDHI_L (p, 0);
922*c87b03e5Sespie #endif
923*c87b03e5Sespie }
924*c87b03e5Sespie 
925*c87b03e5Sespie __inline__ static
926*c87b03e5Sespie long long
sh_media_unaligned_LD_Q(void * p)927*c87b03e5Sespie sh_media_unaligned_LD_Q (void *p)
928*c87b03e5Sespie {
929*c87b03e5Sespie #if __LITTLE_ENDIAN__
930*c87b03e5Sespie   return sh_media_LDHI_Q (p, 7) | sh_media_LDLO_Q (p, 0);
931*c87b03e5Sespie #else
932*c87b03e5Sespie   return sh_media_LDLO_Q (p, 7) | sh_media_LDHI_Q (p, 0);
933*c87b03e5Sespie #endif
934*c87b03e5Sespie }
935*c87b03e5Sespie 
936*c87b03e5Sespie __inline__ static
937*c87b03e5Sespie void
sh_media_unaligned_ST_W(void * p,unsigned int k)938*c87b03e5Sespie sh_media_unaligned_ST_W (void *p, unsigned int k)
939*c87b03e5Sespie {
940*c87b03e5Sespie   char *addr = p;
941*c87b03e5Sespie #if __LITTLE_ENDIAN__
942*c87b03e5Sespie   addr[0] = k;
943*c87b03e5Sespie   addr[1] = k >> 8;
944*c87b03e5Sespie #else
945*c87b03e5Sespie   addr[1] = k;
946*c87b03e5Sespie   addr[0] = k >> 8;
947*c87b03e5Sespie #endif
948*c87b03e5Sespie }
949*c87b03e5Sespie 
950*c87b03e5Sespie __inline__ static
951*c87b03e5Sespie void
sh_media_unaligned_ST_L(void * p,unsigned int k)952*c87b03e5Sespie sh_media_unaligned_ST_L (void *p, unsigned int k)
953*c87b03e5Sespie {
954*c87b03e5Sespie #if __LITTLE_ENDIAN__
955*c87b03e5Sespie   sh_media_STHI_L (p, 3, k);
956*c87b03e5Sespie   sh_media_STLO_L (p, 0, k);
957*c87b03e5Sespie #else
958*c87b03e5Sespie   sh_media_STLO_L (p, 3, k);
959*c87b03e5Sespie   sh_media_STHI_L (p, 0, k);
960*c87b03e5Sespie #endif
961*c87b03e5Sespie }
962*c87b03e5Sespie 
963*c87b03e5Sespie __inline__ static
964*c87b03e5Sespie void
sh_media_unaligned_ST_Q(void * p,unsigned long long k)965*c87b03e5Sespie sh_media_unaligned_ST_Q (void *p, unsigned long long k)
966*c87b03e5Sespie {
967*c87b03e5Sespie #if __LITTLE_ENDIAN__
968*c87b03e5Sespie   sh_media_STHI_Q (p, 7, k);
969*c87b03e5Sespie   sh_media_STLO_Q (p, 0, k);
970*c87b03e5Sespie #else
971*c87b03e5Sespie   sh_media_STLO_Q (p, 7, k);
972*c87b03e5Sespie   sh_media_STHI_Q (p, 0, k);
973*c87b03e5Sespie #endif
974*c87b03e5Sespie }
975*c87b03e5Sespie 
976*c87b03e5Sespie #if ! __SH4_NOFPU__
977*c87b03e5Sespie __inline__ static
978*c87b03e5Sespie void
sh_media_FVCOPY_S(const void * fvg,void * fvf)979*c87b03e5Sespie sh_media_FVCOPY_S (const void *fvg, void *fvf)
980*c87b03e5Sespie {
981*c87b03e5Sespie   const __GCC_FV *g = fvg;
982*c87b03e5Sespie   __GCC_FV *f = fvf;
983*c87b03e5Sespie   *f = *g;
984*c87b03e5Sespie }
985*c87b03e5Sespie 
986*c87b03e5Sespie __inline__ static
987*c87b03e5Sespie void
sh_media_FVADD_S(const void * fvg,const void * fvh,void * fvf)988*c87b03e5Sespie sh_media_FVADD_S (const void *fvg, const void *fvh, void *fvf)
989*c87b03e5Sespie {
990*c87b03e5Sespie   const float *g = fvg, *h = fvh;
991*c87b03e5Sespie   float *f = fvf;
992*c87b03e5Sespie #if 1
993*c87b03e5Sespie   int i;
994*c87b03e5Sespie 
995*c87b03e5Sespie   for (i = 0; i < 4; i++)
996*c87b03e5Sespie     f[i] = g[i] + h[i];
997*c87b03e5Sespie #else
998*c87b03e5Sespie   f[0] = g[0] + h[0];
999*c87b03e5Sespie   f[1] = g[1] + h[1];
1000*c87b03e5Sespie   f[2] = g[2] + h[2];
1001*c87b03e5Sespie   f[3] = g[3] + h[3];
1002*c87b03e5Sespie #endif
1003*c87b03e5Sespie }
1004*c87b03e5Sespie 
1005*c87b03e5Sespie __inline__ static
1006*c87b03e5Sespie void
sh_media_FVSUB_S(const void * fvg,const void * fvh,void * fvf)1007*c87b03e5Sespie sh_media_FVSUB_S (const void *fvg, const void *fvh, void *fvf)
1008*c87b03e5Sespie {
1009*c87b03e5Sespie   const float *g = fvg, *h = fvh;
1010*c87b03e5Sespie   float *f = fvf;
1011*c87b03e5Sespie #if 1
1012*c87b03e5Sespie   int i;
1013*c87b03e5Sespie 
1014*c87b03e5Sespie   for (i = 0; i < 4; i++)
1015*c87b03e5Sespie     f[i] = g[i] - h[i];
1016*c87b03e5Sespie #else
1017*c87b03e5Sespie   f[0] = g[0] - h[0];
1018*c87b03e5Sespie   f[1] = g[1] - h[1];
1019*c87b03e5Sespie   f[2] = g[2] - h[2];
1020*c87b03e5Sespie   f[3] = g[3] - h[3];
1021*c87b03e5Sespie #endif
1022*c87b03e5Sespie }
1023*c87b03e5Sespie 
1024*c87b03e5Sespie __inline__ static
1025*c87b03e5Sespie void
sh_media_FMTRXCOPY_S(const void * mtrxg,void * mtrxf)1026*c87b03e5Sespie sh_media_FMTRXCOPY_S (const void *mtrxg, void *mtrxf)
1027*c87b03e5Sespie {
1028*c87b03e5Sespie   const __GCC_MTRX *g = mtrxg;
1029*c87b03e5Sespie   __GCC_MTRX *f = mtrxf;
1030*c87b03e5Sespie   *f = *g;
1031*c87b03e5Sespie }
1032*c87b03e5Sespie 
1033*c87b03e5Sespie __inline__ static
1034*c87b03e5Sespie void
sh_media_FMTRXADD_S(const void * mtrxg,const void * mtrxh,void * mtrxf)1035*c87b03e5Sespie sh_media_FMTRXADD_S (const void *mtrxg, const void *mtrxh, void *mtrxf)
1036*c87b03e5Sespie {
1037*c87b03e5Sespie   const __GCC_FV *g = mtrxg, *h = mtrxh;
1038*c87b03e5Sespie   __GCC_FV *f = mtrxf;
1039*c87b03e5Sespie #if 1
1040*c87b03e5Sespie   int i;
1041*c87b03e5Sespie 
1042*c87b03e5Sespie   for (i = 0; i < 4; i++)
1043*c87b03e5Sespie     sh_media_FVADD_S (&g[i], &h[i], &f[i]);
1044*c87b03e5Sespie #else
1045*c87b03e5Sespie   sh_media_FVADD_S (&g[0], &h[0], &f[0]);
1046*c87b03e5Sespie   sh_media_FVADD_S (&g[1], &h[1], &f[1]);
1047*c87b03e5Sespie   sh_media_FVADD_S (&g[2], &h[2], &f[2]);
1048*c87b03e5Sespie   sh_media_FVADD_S (&g[3], &h[3], &f[3]);
1049*c87b03e5Sespie #endif
1050*c87b03e5Sespie }
1051*c87b03e5Sespie 
1052*c87b03e5Sespie __inline__ static
1053*c87b03e5Sespie void
sh_media_FMTRXSUB_S(const void * mtrxg,const void * mtrxh,void * mtrxf)1054*c87b03e5Sespie sh_media_FMTRXSUB_S (const void *mtrxg, const void *mtrxh, void *mtrxf)
1055*c87b03e5Sespie {
1056*c87b03e5Sespie   const __GCC_FV *g = mtrxg, *h = mtrxh;
1057*c87b03e5Sespie   __GCC_FV *f = mtrxf;
1058*c87b03e5Sespie #if 1
1059*c87b03e5Sespie   int i;
1060*c87b03e5Sespie 
1061*c87b03e5Sespie   for (i = 0; i < 4; i++)
1062*c87b03e5Sespie     sh_media_FVSUB_S (&g[i], &h[i], &f[i]);
1063*c87b03e5Sespie #else
1064*c87b03e5Sespie   sh_media_FVSUB_S (&g[0], &h[0], &f[0]);
1065*c87b03e5Sespie   sh_media_FVSUB_S (&g[1], &h[1], &f[1]);
1066*c87b03e5Sespie   sh_media_FVSUB_S (&g[2], &h[2], &f[2]);
1067*c87b03e5Sespie   sh_media_FVSUB_S (&g[3], &h[3], &f[3]);
1068*c87b03e5Sespie #endif
1069*c87b03e5Sespie }
1070*c87b03e5Sespie 
1071*c87b03e5Sespie __inline__ static
1072*c87b03e5Sespie void
sh_media_FTRVADD_S(const void * mtrxg,const void * fvh,const void * fvi,void * fvf)1073*c87b03e5Sespie sh_media_FTRVADD_S (const void *mtrxg, const void *fvh, const void *fvi, void *fvf)
1074*c87b03e5Sespie {
1075*c87b03e5Sespie   sh_media_FTRV_S (mtrxg, fvh, fvf);
1076*c87b03e5Sespie   sh_media_FVADD_S (fvf, fvi, fvf);
1077*c87b03e5Sespie }
1078*c87b03e5Sespie 
1079*c87b03e5Sespie __inline__ static
1080*c87b03e5Sespie void
sh_media_FTRVSUB_S(const void * mtrxg,const void * fvh,const void * fvi,void * fvf)1081*c87b03e5Sespie sh_media_FTRVSUB_S (const void *mtrxg, const void *fvh, const void *fvi, void *fvf)
1082*c87b03e5Sespie {
1083*c87b03e5Sespie   sh_media_FTRV_S (mtrxg, fvh, fvf);
1084*c87b03e5Sespie   sh_media_FVSUB_S (fvf, fvi, fvf);
1085*c87b03e5Sespie }
1086*c87b03e5Sespie 
1087*c87b03e5Sespie __inline__ static
1088*c87b03e5Sespie void
sh_media_FMTRXMUL_S(const void * mtrxg,const void * mtrxh,void * mtrxf)1089*c87b03e5Sespie sh_media_FMTRXMUL_S (const void *mtrxg, const void *mtrxh, void *mtrxf)
1090*c87b03e5Sespie {
1091*c87b03e5Sespie   const __GCC_FV *g = mtrxg;
1092*c87b03e5Sespie   __GCC_FV *f = mtrxf;
1093*c87b03e5Sespie #if 1
1094*c87b03e5Sespie   int j;
1095*c87b03e5Sespie 
1096*c87b03e5Sespie   for (j = 0; j < 4; j++)
1097*c87b03e5Sespie     sh_media_FTRV_S (mtrxh, &g[j], &f[j]);
1098*c87b03e5Sespie #else
1099*c87b03e5Sespie   sh_media_FTRV_S (mtrxh, &g[0], &f[0]);
1100*c87b03e5Sespie   sh_media_FTRV_S (mtrxh, &g[1], &f[1]);
1101*c87b03e5Sespie   sh_media_FTRV_S (mtrxh, &g[2], &f[2]);
1102*c87b03e5Sespie   sh_media_FTRV_S (mtrxh, &g[3], &f[3]);
1103*c87b03e5Sespie #endif
1104*c87b03e5Sespie }
1105*c87b03e5Sespie 
1106*c87b03e5Sespie __inline__ static
1107*c87b03e5Sespie void
sh_media_FMTRXMULADD_S(const void * mtrxg,const void * mtrxh,const void * mtrxi,void * mtrxf)1108*c87b03e5Sespie sh_media_FMTRXMULADD_S (const void *mtrxg, const void *mtrxh, const void *mtrxi, void *mtrxf)
1109*c87b03e5Sespie {
1110*c87b03e5Sespie   const __GCC_FV *g = mtrxg, *i = mtrxi;
1111*c87b03e5Sespie   __GCC_FV *f = mtrxf;
1112*c87b03e5Sespie #if 1
1113*c87b03e5Sespie   int j;
1114*c87b03e5Sespie 
1115*c87b03e5Sespie   for (j = 0; j < 4; j++)
1116*c87b03e5Sespie     sh_media_FTRVADD_S (mtrxh, &g[j], &i[j], &f[j]);
1117*c87b03e5Sespie #else
1118*c87b03e5Sespie   sh_media_FTRVADD_S (mtrxh, &g[0], &i[0], &f[0]);
1119*c87b03e5Sespie   sh_media_FTRVADD_S (mtrxh, &g[1], &i[1], &f[1]);
1120*c87b03e5Sespie   sh_media_FTRVADD_S (mtrxh, &g[2], &i[2], &f[2]);
1121*c87b03e5Sespie   sh_media_FTRVADD_S (mtrxh, &g[3], &i[3], &f[3]);
1122*c87b03e5Sespie #endif
1123*c87b03e5Sespie }
1124*c87b03e5Sespie 
1125*c87b03e5Sespie __inline__ static
1126*c87b03e5Sespie void
sh_media_FMTRXMULSUB_S(const void * mtrxg,const void * mtrxh,const void * mtrxi,void * mtrxf)1127*c87b03e5Sespie sh_media_FMTRXMULSUB_S (const void *mtrxg, const void *mtrxh, const void *mtrxi, void *mtrxf)
1128*c87b03e5Sespie {
1129*c87b03e5Sespie   const __GCC_FV *g = mtrxg, *i = mtrxi;
1130*c87b03e5Sespie   __GCC_FV *f = mtrxf;
1131*c87b03e5Sespie #if 1
1132*c87b03e5Sespie   int j;
1133*c87b03e5Sespie 
1134*c87b03e5Sespie   for (j = 0; j < 4; j++)
1135*c87b03e5Sespie     sh_media_FTRVSUB_S (mtrxh, &g[j], &i[j], &f[j]);
1136*c87b03e5Sespie #else
1137*c87b03e5Sespie   sh_media_FTRVSUB_S (mtrxh, &g[0], &i[0], &f[0]);
1138*c87b03e5Sespie   sh_media_FTRVSUB_S (mtrxh, &g[1], &i[1], &f[1]);
1139*c87b03e5Sespie   sh_media_FTRVSUB_S (mtrxh, &g[2], &i[2], &f[2]);
1140*c87b03e5Sespie   sh_media_FTRVSUB_S (mtrxh, &g[3], &i[3], &f[3]);
1141*c87b03e5Sespie #endif
1142*c87b03e5Sespie }
1143*c87b03e5Sespie #endif /* ! __SH4_NOFPU__ */
1144*c87b03e5Sespie 
1145*c87b03e5Sespie #endif /* __SHMEDIA__ */
1146*c87b03e5Sespie 
1147*c87b03e5Sespie #endif /* _USHMEDIA_H */
1148