2 * i386 micro operations (included several times to generate
3 * different operand sizes)
5 * Copyright (c) 2003 Fabrice Bellard
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library 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 GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #define MEM_SUFFIX b_raw
28 #define MEM_SUFFIX w_raw
30 #define MEM_SUFFIX l_raw
32 #define MEM_SUFFIX q_raw
38 #define MEM_SUFFIX b_kernel
40 #define MEM_SUFFIX w_kernel
42 #define MEM_SUFFIX l_kernel
44 #define MEM_SUFFIX q_kernel
50 #define MEM_SUFFIX b_user
52 #define MEM_SUFFIX w_user
54 #define MEM_SUFFIX l_user
56 #define MEM_SUFFIX q_user
61 #error invalid MEM_WRITE
67 #define MEM_SUFFIX SUFFIX
71 /* carry add/sub (we only need to set CC_OP differently) */
73 void OPPROTO glue(glue(op_adc, MEM_SUFFIX), _T0_T1_cc)(void)
76 cf = cc_table[CC_OP].compute_c();
79 glue(st, MEM_SUFFIX)(A0, T0);
83 CC_OP = CC_OP_ADDB + SHIFT + cf * 4;
86 void OPPROTO glue(glue(op_sbb, MEM_SUFFIX), _T0_T1_cc)(void)
89 cf = cc_table[CC_OP].compute_c();
92 glue(st, MEM_SUFFIX)(A0, T0);
96 CC_OP = CC_OP_SUBB + SHIFT + cf * 4;
99 void OPPROTO glue(glue(op_cmpxchg, MEM_SUFFIX), _T0_T1_EAX_cc)(void)
101 target_ulong src, dst;
105 if ((DATA_TYPE)dst == 0) {
108 glue(st, MEM_SUFFIX)(A0, T0);
111 EAX = (EAX & ~DATA_MASK) | (T0 & DATA_MASK);