ALL: Huge upstream synch + PerRom DelaySI & CountPerOp parameters
[mupen64plus-pandora.git] / source / mupen64plus-core / src / r4300 / x86_64 / gcop1_w.c
CommitLineData
451ab91e 1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Mupen64plus - gcop1_w.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 <stdio.h>
24
25#include "assemble.h"
26#include "interpret.h"
27
28#include "r4300/recomph.h"
29#include "r4300/r4300.h"
30#include "r4300/ops.h"
31
32void gencvt_s_w(void)
33{
34#if defined(COUNT_INSTR)
35 inc_m32rel(&instr_count[117]);
36#endif
37#ifdef INTERPRET_CVT_S_W
38 gencallinterp((unsigned long long)cached_interpreter_table.CVT_S_W, 0);
39#else
40 gencheck_cop1_unusable();
41 mov_xreg64_m64rel(RAX, (unsigned long long *)(&reg_cop1_simple[dst->f.cf.fs]));
42 fild_preg64_dword(RAX);
43 mov_xreg64_m64rel(RAX, (unsigned long long *)(&reg_cop1_simple[dst->f.cf.fd]));
44 fstp_preg64_dword(RAX);
45#endif
46}
47
48void gencvt_d_w(void)
49{
50#if defined(COUNT_INSTR)
51 inc_m32rel(&instr_count[117]);
52#endif
53#ifdef INTERPRET_CVT_D_W
54 gencallinterp((unsigned long long)cached_interpreter_table.CVT_D_W, 0);
55#else
56 gencheck_cop1_unusable();
57 mov_xreg64_m64rel(RAX, (unsigned long long *)(&reg_cop1_simple[dst->f.cf.fs]));
58 fild_preg64_dword(RAX);
59 mov_xreg64_m64rel(RAX, (unsigned long long *)(&reg_cop1_double[dst->f.cf.fd]));
60 fstp_preg64_qword(RAX);
61#endif
62}
63