/[pcsx2_0.9.7]/trunk/common/include/x86emitter/inlines.inl
ViewVC logotype

Annotation of /trunk/common/include/x86emitter/inlines.inl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (hide annotations) (download)
Tue Sep 7 03:24:11 2010 UTC (9 years, 11 months ago) by william
File size: 3643 byte(s)
committing r3113 initial commit again...
1 william 31 /* PCSX2 - PS2 Emulator for PCs
2     * Copyright (C) 2002-2010 PCSX2 Dev Team
3     *
4     * PCSX2 is free software: you can redistribute it and/or modify it under the terms
5     * of the GNU Lesser General Public License as published by the Free Software Found-
6     * ation, either version 3 of the License, or (at your option) any later version.
7     *
8     * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9     * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10     * PURPOSE. See the GNU General Public License for more details.
11     *
12     * You should have received a copy of the GNU General Public License along with PCSX2.
13     * If not, see <http://www.gnu.org/licenses/>.
14     */
15    
16     /*
17     * ix86 core v0.9.1
18     *
19     * Original Authors (v0.6.2 and prior):
20     * linuzappz <linuzappz@pcsx.net>
21     * alexey silinov
22     * goldfinger
23     * zerofrog(@gmail.com)
24     *
25     * Authors of v0.9.1:
26     * Jake.Stine(@gmail.com)
27     * cottonvibes(@gmail.com)
28     * sudonim(1@gmail.com)
29     */
30    
31     #pragma once
32    
33     // This header module contains functions which, under most circumstances, inline
34     // nicely with constant propagation from the compiler, resulting in little or
35     // no actual codegen in the majority of emitter statements. (common forms include:
36     // RegToReg, PointerToReg, RegToPointer). These cannot be included in the class
37     // definitions in the .h file because of inter-dependencies with other classes.
38     // (score one for C++!!)
39     //
40     // In order for MSVC to work correctly with __forceinline on class members,
41     // however, we need to include these methods into all source files which might
42     // reference them. Without this MSVC generates linker errors. Or, in other words,
43     // global optimization fails to resolve the externals and junk.
44     // (score one for MSVC!)
45    
46     namespace x86Emitter
47     {
48     // --------------------------------------------------------------------------------------
49     // x86Register Method Implementations (inlined!)
50     // --------------------------------------------------------------------------------------
51    
52     __forceinline xAddressInfo xAddressReg::operator+( const xAddressReg& right ) const
53     {
54     pxAssertMsg( Id != -1, "Uninitialized x86 register." );
55     return xAddressInfo( *this, right );
56     }
57    
58     __forceinline xAddressInfo xAddressReg::operator+( const xAddressInfo& right ) const
59     {
60     pxAssertMsg( Id != -1, "Uninitialized x86 register." );
61     return right + *this;
62     }
63    
64     __forceinline xAddressInfo xAddressReg::operator+( s32 right ) const
65     {
66     pxAssertMsg( Id != -1, "Uninitialized x86 register." );
67     return xAddressInfo( *this, right );
68     }
69    
70     __forceinline xAddressInfo xAddressReg::operator+( const void* right ) const
71     {
72     pxAssertMsg( Id != -1, "Uninitialized x86 register." );
73     return xAddressInfo( *this, (s32)right );
74     }
75    
76     // ------------------------------------------------------------------------
77     __forceinline xAddressInfo xAddressReg::operator-( s32 right ) const
78     {
79     pxAssertMsg( Id != -1, "Uninitialized x86 register." );
80     return xAddressInfo( *this, -right );
81     }
82    
83     __forceinline xAddressInfo xAddressReg::operator-( const void* right ) const
84     {
85     pxAssertMsg( Id != -1, "Uninitialized x86 register." );
86     return xAddressInfo( *this, -(s32)right );
87     }
88    
89     // ------------------------------------------------------------------------
90     __forceinline xAddressInfo xAddressReg::operator*( u32 right ) const
91     {
92     pxAssertMsg( Id != -1, "Uninitialized x86 register." );
93     return xAddressInfo( xEmptyReg, *this, right );
94     }
95    
96     __forceinline xAddressInfo xAddressReg::operator<<( u32 shift ) const
97     {
98     pxAssertMsg( Id != -1, "Uninitialized x86 register." );
99     return xAddressInfo( xEmptyReg, *this, 1<<shift );
100     }
101     }

  ViewVC Help
Powered by ViewVC 1.1.22