root / target-i386 / opreg_template.h @ 298e01b6
History | View | Annotate | Download (1.4 kB)
1 | 2c0262af | bellard | /*
|
---|---|---|---|
2 | 2c0262af | bellard | * i386 micro operations (templates for various register related
|
3 | 2c0262af | bellard | * operations)
|
4 | 5fafdf24 | ths | *
|
5 | 2c0262af | bellard | * Copyright (c) 2003 Fabrice Bellard
|
6 | 2c0262af | bellard | *
|
7 | 2c0262af | bellard | * This library is free software; you can redistribute it and/or
|
8 | 2c0262af | bellard | * modify it under the terms of the GNU Lesser General Public
|
9 | 2c0262af | bellard | * License as published by the Free Software Foundation; either
|
10 | 2c0262af | bellard | * version 2 of the License, or (at your option) any later version.
|
11 | 2c0262af | bellard | *
|
12 | 2c0262af | bellard | * This library is distributed in the hope that it will be useful,
|
13 | 2c0262af | bellard | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 | 2c0262af | bellard | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15 | 2c0262af | bellard | * Lesser General Public License for more details.
|
16 | 2c0262af | bellard | *
|
17 | 2c0262af | bellard | * You should have received a copy of the GNU Lesser General Public
|
18 | 2c0262af | bellard | * License along with this library; if not, write to the Free Software
|
19 | 2c0262af | bellard | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
20 | 2c0262af | bellard | */
|
21 | 2c0262af | bellard | /* mov T1 to REG if T0 is true */
|
22 | 2c0262af | bellard | void OPPROTO glue(glue(op_cmovw,REGNAME),_T1_T0)(void) |
23 | 2c0262af | bellard | { |
24 | 2c0262af | bellard | if (T0)
|
25 | 14ce26e7 | bellard | REG = (REG & ~0xffff) | (T1 & 0xffff); |
26 | 128b346e | bellard | FORCE_RET(); |
27 | 2c0262af | bellard | } |
28 | 2c0262af | bellard | |
29 | 2c0262af | bellard | void OPPROTO glue(glue(op_cmovl,REGNAME),_T1_T0)(void) |
30 | 2c0262af | bellard | { |
31 | 57fec1fe | bellard | #ifdef TARGET_X86_64
|
32 | 2c0262af | bellard | if (T0)
|
33 | 14ce26e7 | bellard | REG = (uint32_t)T1; |
34 | 57fec1fe | bellard | else
|
35 | 57fec1fe | bellard | REG = (uint32_t)REG; |
36 | 57fec1fe | bellard | #else
|
37 | 57fec1fe | bellard | if (T0)
|
38 | 57fec1fe | bellard | REG = (uint32_t)T1; |
39 | 57fec1fe | bellard | #endif
|
40 | 14ce26e7 | bellard | FORCE_RET(); |
41 | 14ce26e7 | bellard | } |
42 | 14ce26e7 | bellard | |
43 | 14ce26e7 | bellard | #ifdef TARGET_X86_64
|
44 | 14ce26e7 | bellard | void OPPROTO glue(glue(op_cmovq,REGNAME),_T1_T0)(void) |
45 | 14ce26e7 | bellard | { |
46 | 14ce26e7 | bellard | if (T0)
|
47 | 2c0262af | bellard | REG = T1; |
48 | 128b346e | bellard | FORCE_RET(); |
49 | 2c0262af | bellard | } |
50 | 14ce26e7 | bellard | #endif |