3 // Simulator definition for the MIPS MIPS-3D ASE.
4 // Copyright (C) 2002 Free Software Foundation, Inc.
5 // Contributed by Ed Satterthwaite and Chris Demetriou, of Broadcom
6 // Corporation (SiByte).
8 // This file is part of GDB, the GNU debugger.
10 // This program is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU General Public License as published by
12 // the Free Software Foundation; either version 2, or (at your option)
15 // This program is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
20 // You should have received a copy of the GNU General Public License along
21 // with this program; if not, write to the Free Software Foundation, Inc.,
22 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 // Reference: MIPS64 Architecture for Programmers Volume IV-c:
25 // The MIPS-3D Application-Specific Extension to the
26 // MIPS64 Architecture. (MIPS Document MD00099)
29 010001,10,110,5.FT,5.FS,5.FD,011000:COP1:64,f::ADDR.PS
30 "addr.ps f<FD>, f<FS>, f<FT>"
33 /* fd.PL = ft.PU + ft.PL; fd.PU = fs.PU + fs.PL; */
35 check_u64 (SD_, instruction_0);
36 StoreFPR (FD, fmt_ps, AddR (ValueFPR (FS, fmt_ps),
37 ValueFPR (FT, fmt_ps), fmt_ps));
41 010001,01001,3.CC,0,1.TF,16.OFFSET:COP1:64,f::BC1ANY2tf
42 "bc1any2%s<TF> <CC>, %#lx<OFFSET>"
48 check_u64 (SD_, instruction_0);
51 if ((GETFCC (cc) == TF) || (GETFCC (cc + 1) == TF))
53 offset = (EXTEND16 (OFFSET) << 2);
54 DELAY_SLOT (NIA + offset);
59 010001,01010,3.CC,0,1.TF,16.OFFSET:COP1:64,f::BC1ANY4tf
60 "bc1any4%s<TF> <CC>, %#lx<OFFSET>"
66 check_u64 (SD_, instruction_0);
69 if ((GETFCC (cc) == TF)
70 || (GETFCC (cc + 1) == TF)
71 || (GETFCC (cc + 2) == TF)
72 || (GETFCC (cc + 3) == TF))
74 offset = (EXTEND16 (OFFSET) << 2);
75 DELAY_SLOT (NIA + offset);
80 010001,10,3.FMT,5.FT,5.FS,3.CC,01,11,4.COND:COP1:64,f::CABS.cond.fmt
81 "cabs.%s<COND>.%s<FMT> <CC>, f<FS>, f<FT>"
86 check_u64 (SD_, instruction_0);
87 check_fmt_p (SD_, fmt, instruction_0);
88 CompareAbs (ValueFPR (FS, fmt), ValueFPR (FT, fmt), fmt, COND, CC);
89 TRACE_ALU_RESULT (ValueFCR (31));
93 010001,10,110,00000,5.FS,5.FD,100100:COP1:64,f::CVT.PW.PS
94 "cvt.pw.ps f<FD>, f<FS>"
97 /* fd.pu = cvt_rnd (fs.pu); fd.pl = cvt_rnd (fs.pl); */
98 /* fmt_pw is fmt_long for 64 bit transfers, but cvt encoding is fmt_word. */
100 check_u64 (SD_, instruction_0);
101 StoreFPR (FD, fmt_pw, ConvertPS (GETRM (), ValueFPR (FS, fmt_ps),
106 010001,10,100,00000,5.FS,5.FD,100110:COP1:64,f::CVT.PS.PW
107 "cvt.ps.pw f<FD>, f<FS>"
110 /* fd.pl = cvt_rnd (fs.pl); fd.pu = cvt_rnd (fs.pu); */
111 /* fmt_pw is fmt_long for 64 bit transfers, but cvt encoding is fmt_word. */
113 check_u64 (SD_, instruction_0);
114 StoreFPR (FD, fmt_ps, ConvertPS (GETRM (), ValueFPR (FS, fmt_pw),
119 010001,10,110,5.FT,5.FS,5.FD,011010:COP1:64,f::MULR.PS
120 "mulr.ps f<FD>, f<FS>, f<FT>"
123 /* fd.PL = ft.PU * ft.PL; fd.PU = fs.PU * fs.PL; */
125 check_u64 (SD_, instruction_0);
126 StoreFPR (FD, fmt_ps, MultiplyR (ValueFPR (FS, fmt_ps),
127 ValueFPR (FT, fmt_ps), fmt_ps));
131 010001,10,3.FMT,00000,5.FS,5.FD,011101:COP1:64,f::RECIP1.fmt
132 "recip1.%s<FMT> f<FD>, f<FS>"
137 check_u64 (SD_, instruction_0);
138 check_fmt_p (SD_, fmt, instruction_0);
139 StoreFPR (FD, fmt, Recip1 (ValueFPR (FS, fmt), fmt));
143 010001,10,3.FMT,5.FT,5.FS,5.FD,011100:COP1:64,f::RECIP2.fmt
144 "recip2.%s<FMT> f<FD>, f<FS>, f<FT>"
149 check_u64 (SD_, instruction_0);
150 check_fmt_p (SD_, fmt, instruction_0);
151 StoreFPR (FD, fmt, Recip2 (ValueFPR (FS, fmt), ValueFPR (FT, fmt), fmt));
155 010001,10,3.FMT,00000,5.FS,5.FD,011110:COP1:64,f::RSQRT1.fmt
156 "rsqrt1.%s<FMT> f<FD>, f<FS>"
161 check_u64 (SD_, instruction_0);
162 check_fmt_p (SD_, fmt, instruction_0);
163 StoreFPR (FD, fmt, RSquareRoot1 (ValueFPR (FS, fmt), fmt));
167 010001,10,3.FMT,5.FT,5.FS,5.FD,011111:COP1:64,f::RSQRT2.fmt
168 "rsqrt2.%s<FMT> f<FD>, f<FS>, f<FT>"
173 check_u64 (SD_, instruction_0);
174 check_fmt_p (SD_, fmt, instruction_0);
175 StoreFPR (FD, fmt, RSquareRoot2 (ValueFPR (FS, fmt),
176 ValueFPR (FT, fmt), fmt));