x86: Extend validity of bsp_to_cpu
[qemu/aliguori-queue.git] / target-cris / crisv10-decode.h
blob0d6f3de219d1d335ec8f2bb3c5ab587a243718e1
1 /*
2 * CRISv10 insn decoding macros.
4 * Copyright (c) 2010 AXIS Communications AB
5 * Written by Edgar E. Iglesias.
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
22 #define CRISV10_MODE_QIMMEDIATE 0
23 #define CRISV10_MODE_REG 1
24 #define CRISV10_MODE_INDIRECT 2
25 #define CRISV10_MODE_AUTOINC 3
27 /* Quick Immediate. */
28 #define CRISV10_QIMM_BCC_R0 0
29 #define CRISV10_QIMM_BCC_R1 1
30 #define CRISV10_QIMM_BCC_R2 2
31 #define CRISV10_QIMM_BCC_R3 3
33 #define CRISV10_QIMM_BDAP_R0 4
34 #define CRISV10_QIMM_BDAP_R1 5
35 #define CRISV10_QIMM_BDAP_R2 6
36 #define CRISV10_QIMM_BDAP_R3 7
38 #define CRISV10_QIMM_ADDQ 8
39 #define CRISV10_QIMM_MOVEQ 9
40 #define CRISV10_QIMM_SUBQ 10
41 #define CRISV10_QIMM_CMPQ 11
42 #define CRISV10_QIMM_ANDQ 12
43 #define CRISV10_QIMM_ORQ 13
44 #define CRISV10_QIMM_ASHQ 14
45 #define CRISV10_QIMM_LSHQ 15
48 #define CRISV10_REG_ADDX 0
49 #define CRISV10_REG_MOVX 1
50 #define CRISV10_REG_SUBX 2
51 #define CRISV10_REG_LSL 3
52 #define CRISV10_REG_ADDI 4
53 #define CRISV10_REG_BIAP 5
54 #define CRISV10_REG_NEG 6
55 #define CRISV10_REG_BOUND 7
56 #define CRISV10_REG_ADD 8
57 #define CRISV10_REG_MOVE_R 9
58 #define CRISV10_REG_MOVE_SPR_R 9
59 #define CRISV10_REG_MOVE_R_SPR 8
60 #define CRISV10_REG_SUB 10
61 #define CRISV10_REG_CMP 11
62 #define CRISV10_REG_AND 12
63 #define CRISV10_REG_OR 13
64 #define CRISV10_REG_ASR 14
65 #define CRISV10_REG_LSR 15
67 #define CRISV10_REG_BTST 3
68 #define CRISV10_REG_SCC 4
69 #define CRISV10_REG_SETF 6
70 #define CRISV10_REG_CLEARF 7
71 #define CRISV10_REG_BIAP 5
72 #define CRISV10_REG_ABS 10
73 #define CRISV10_REG_DSTEP 11
74 #define CRISV10_REG_LZ 12
75 #define CRISV10_REG_NOT 13
76 #define CRISV10_REG_SWAP 13
77 #define CRISV10_REG_XOR 14
78 #define CRISV10_REG_MSTEP 15
80 /* Indirect, var size. */
81 #define CRISV10_IND_TEST 14
82 #define CRISV10_IND_MUL 4
83 #define CRISV10_IND_BDAP_M 5
84 #define CRISV10_IND_ADD 8
85 #define CRISV10_IND_MOVE_M_R 9
88 /* indirect fixed size. */
89 #define CRISV10_IND_ADDX 0
90 #define CRISV10_IND_MOVX 1
91 #define CRISV10_IND_SUBX 2
92 #define CRISV10_IND_CMPX 3
93 #define CRISV10_IND_JUMP_M 4
94 #define CRISV10_IND_DIP 5
95 #define CRISV10_IND_JUMP_R 6
96 #define CRISV10_IND_BOUND 7
97 #define CRISV10_IND_BCC_M 7
98 #define CRISV10_IND_MOVE_M_SPR 8
99 #define CRISV10_IND_MOVE_SPR_M 9
100 #define CRISV10_IND_SUB 10
101 #define CRISV10_IND_CMP 11
102 #define CRISV10_IND_AND 12
103 #define CRISV10_IND_OR 13
104 #define CRISV10_IND_MOVE_R_M 15
106 #define CRISV10_IND_MOVEM_M_R 14
107 #define CRISV10_IND_MOVEM_R_M 15