/[pcsx2_0.9.7]/trunk/common/include/x86emitter/implement/movs.h
ViewVC logotype

Annotation of /trunk/common/include/x86emitter/implement/movs.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62 - (hide annotations) (download)
Tue Sep 7 11:08:22 2010 UTC (9 years, 11 months ago) by william
File MIME type: text/plain
File size: 5081 byte(s)
Auto Commited Import of: pcsx2-0.9.7-r3738-debug in ./trunk
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     #pragma once
17    
18     // Header: ix86_impl_movs.h -- covers mov, cmov, movsx/movzx, and SETcc (which shares
19     // with cmov many similarities).
20    
21     namespace x86Emitter {
22    
23     // --------------------------------------------------------------------------------------
24     // MovImplAll
25     // --------------------------------------------------------------------------------------
26     // MOV instruction Implementation, plus many SIMD sub-mov variants.
27     //
28     struct xImpl_Mov
29     {
30     xImpl_Mov() {} // Satisfy GCC's whims.
31    
32     void operator()( const xRegister8& to, const xRegister8& from ) const;
33     void operator()( const xRegister16& to, const xRegister16& from ) const;
34     void operator()( const xRegister32& to, const xRegister32& from ) const;
35    
36 william 62 void operator()( const xIndirectVoid& dest, const xRegisterInt& from ) const;
37     void operator()( const xRegisterInt& to, const xIndirectVoid& src ) const;
38     void operator()( const xIndirect32orLess& dest, int imm ) const;
39 william 31 void operator()( const xRegisterInt& to, int imm, bool preserve_flags=false ) const;
40    
41     #if 0
42     template< typename T > __noinline void operator()( const ModSibBase& to, const xImmReg<T>& immOrReg ) const
43     {
44     _DoI_helpermess( *this, to, immOrReg );
45     }
46    
47     template< typename T > __noinline void operator()( const xDirectOrIndirect<T>& to, const xImmReg<T>& immOrReg ) const
48     {
49     _DoI_helpermess( *this, to, immOrReg );
50     }
51    
52     template< typename T > __noinline void operator()( const xDirectOrIndirect<T>& to, int imm ) const
53     {
54     _DoI_helpermess( *this, to, imm );
55     }
56    
57     template< typename T > __noinline void operator()( const xDirectOrIndirect<T>& to, const xDirectOrIndirect<T>& from ) const
58     {
59     if( to == from ) return;
60     _DoI_helpermess( *this, to, from );
61     }
62    
63     /*template< typename T > __noinline void operator()( const xRegister<T>& to, const xDirectOrIndirect<T>& from ) const
64     {
65     _DoI_helpermess( *this, xDirectOrIndirect<T>( to ), from );
66     }
67    
68     template< typename T > __noinline void operator()( const xDirectOrIndirect<T>& to, const xRegister<T>& from ) const
69     {
70     _DoI_helpermess( *this, to, xDirectOrIndirect<T>( from ) );
71     }*/
72     #endif
73     };
74    
75     // --------------------------------------------------------------------------------------
76     // xImpl_CMov
77     // --------------------------------------------------------------------------------------
78     // CMOVcc !! [in all of it's disappointing lack-of glory] .. and ..
79     // SETcc !! [more glory, less lack!]
80     //
81     // CMOV Disclaimer: Caution! This instruction can look exciting and cool, until you
82     // realize that it cannot load immediate values into registers. -_-
83     //
84     // I use explicit method declarations here instead of templates, in order to provide
85     // *only* 32 and 16 bit register operand forms (8 bit registers are not valid in CMOV).
86     //
87    
88     struct xImpl_CMov
89     {
90     JccComparisonType ccType;
91    
92     void operator()( const xRegister32& to, const xRegister32& from ) const;
93 william 62 void operator()( const xRegister32& to, const xIndirectVoid& sibsrc ) const;
94 william 31
95     void operator()( const xRegister16& to, const xRegister16& from ) const;
96 william 62 void operator()( const xRegister16& to, const xIndirectVoid& sibsrc ) const;
97 william 31
98     //void operator()( const xDirectOrIndirect32& to, const xDirectOrIndirect32& from );
99     //void operator()( const xDirectOrIndirect16& to, const xDirectOrIndirect16& from ) const;
100     };
101    
102     struct xImpl_Set
103     {
104     JccComparisonType ccType;
105    
106     void operator()( const xRegister8& to ) const;
107 william 62 void operator()( const xIndirect8& dest ) const;
108 william 31
109     //void operator()( const xDirectOrIndirect8& dest ) const;
110     };
111    
112    
113     // --------------------------------------------------------------------------------------
114     // xImpl_MovExtend
115     // --------------------------------------------------------------------------------------
116     // Mov with sign/zero extension implementations (movsx / movzx)
117     //
118     struct xImpl_MovExtend
119     {
120     bool SignExtend;
121    
122     void operator()( const xRegister16or32& to, const xRegister8& from ) const;
123 william 62 void operator()( const xRegister16or32& to, const xIndirect8& sibsrc ) const;
124 william 31 void operator()( const xRegister32& to, const xRegister16& from ) const;
125 william 62 void operator()( const xRegister32& to, const xIndirect16& sibsrc ) const;
126 william 31
127     //void operator()( const xRegister32& to, const xDirectOrIndirect16& src ) const;
128     //void operator()( const xRegister16or32& to, const xDirectOrIndirect8& src ) const;
129     //void operator()( const xRegister16& to, const xDirectOrIndirect8& src ) const;
130     };
131    
132     } // End namespace x86Emitter

  ViewVC Help
Powered by ViewVC 1.1.22