451ab91e |
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
2 | * Mupen64plus - g_cop1_l.c * |
3 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * |
4 | * Copyright (C) 2007 Richard Goedeken (Richard42) * |
5 | * Copyright (C) 2002 Hacktarux * |
6 | * * |
7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * |
11 | * * |
12 | * This program is distributed in the hope that it will be useful, * |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
15 | * GNU General Public License for more details. * |
16 | * * |
17 | * You should have received a copy of the GNU General Public License * |
18 | * along with this program; if not, write to the * |
19 | * Free Software Foundation, Inc., * |
20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * |
21 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
22 | |
23 | #include "assemble.h" |
24 | #include "interpret.h" |
25 | |
26 | #include "r4300/recomph.h" |
27 | #include "r4300/r4300.h" |
28 | #include "r4300/ops.h" |
29 | |
30 | void gencvt_s_l(void) |
31 | { |
32 | #if defined(COUNT_INSTR) |
33 | inc_m32rel(&instr_count[117]); |
34 | #endif |
35 | #ifdef INTERPRET_CVT_S_L |
36 | gencallinterp((unsigned long long)cached_interpreter_table.CVT_S_L, 0); |
37 | #else |
38 | gencheck_cop1_unusable(); |
39 | mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); |
40 | fild_preg64_qword(RAX); |
41 | mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); |
42 | fstp_preg64_dword(RAX); |
43 | #endif |
44 | } |
45 | |
46 | void gencvt_d_l(void) |
47 | { |
48 | #if defined(COUNT_INSTR) |
49 | inc_m32rel(&instr_count[117]); |
50 | #endif |
51 | #ifdef INTERPRET_CVT_D_L |
52 | gencallinterp((unsigned long long)cached_interpreter_table.CVT_D_L, 0); |
53 | #else |
54 | gencheck_cop1_unusable(); |
55 | mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); |
56 | fild_preg64_qword(RAX); |
57 | mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); |
58 | fstp_preg64_qword(RAX); |
59 | #endif |
60 | } |
61 | |