Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / sh3 / include / sh_opcode.h
blob32470cd342cd6ab61eee322e4f8bb934545fd8e4
1 /* $NetBSD: sh_opcode.h,v 1.2 2000/08/02 11:32:43 msaitoh Exp $ */
3 typedef union {
4 unsigned word;
6 #if _BYTE_ORDER == BIG_ENDIAN
7 struct {
8 unsigned op: 16;
9 } oType;
11 struct {
12 unsigned op1: 4;
13 unsigned n: 4;
14 unsigned op2: 8;
15 } nType;
17 struct {
18 unsigned op1: 4;
19 unsigned m: 4;
20 unsigned op2: 8;
21 } mType;
23 struct {
24 unsigned op1: 4;
25 unsigned n: 4;
26 unsigned m: 4;
27 unsigned op2: 4;
28 } nmType;
30 struct {
31 unsigned op: 8;
32 unsigned m: 4;
33 unsigned d: 4;
34 } mdType;
36 struct {
37 unsigned op: 8;
38 unsigned n: 4;
39 unsigned d: 4;
40 } nd4Type;
42 struct {
43 unsigned op: 4;
44 unsigned n: 4;
45 unsigned m: 4;
46 unsigned d: 4;
47 } nmdType;
49 struct {
50 unsigned op: 8;
51 unsigned d: 8;
52 } dType;
54 struct {
55 unsigned op: 4;
56 unsigned d: 12;
57 } d12Type;
59 struct {
60 unsigned op: 4;
61 unsigned n: 4;
62 unsigned d: 8;
63 } nd8Type;
65 struct {
66 unsigned op: 8;
67 unsigned i: 8;
68 } iType;
70 struct {
71 unsigned op: 4;
72 unsigned n: 4;
73 unsigned i: 8;
74 } niType;
75 #endif
76 #if _BYTE_ORDER == LITTLE_ENDIAN
77 struct {
78 unsigned op: 16;
79 } oType;
81 struct {
82 unsigned op2: 8;
83 unsigned n: 4;
84 unsigned op1: 4;
85 } nType;
87 struct {
88 unsigned op2: 8;
89 unsigned m: 4;
90 unsigned op1: 4;
91 } mType;
93 struct {
94 unsigned op2: 4;
95 unsigned m: 4;
96 unsigned n: 4;
97 unsigned op1: 4;
98 } nmType;
100 struct {
101 unsigned d: 4;
102 unsigned m: 4;
103 unsigned op: 8;
104 } mdType;
106 struct {
107 unsigned d: 4;
108 unsigned n: 4;
109 unsigned op: 8;
110 } nd4Type;
112 struct {
113 unsigned d: 4;
114 unsigned m: 4;
115 unsigned n: 4;
116 unsigned op: 4;
117 } nmdType;
119 struct {
120 unsigned d: 8;
121 unsigned op: 8;
122 } dType;
124 struct {
125 unsigned d: 12;
126 unsigned op: 4;
127 } d12Type;
129 struct {
130 unsigned d: 8;
131 unsigned n: 4;
132 unsigned op: 4;
133 } nd8Type;
135 struct {
136 unsigned i: 8;
137 unsigned op: 8;
138 } iType;
140 struct {
141 unsigned i: 8;
142 unsigned n: 4;
143 unsigned op: 4;
144 } niType;
145 #endif
146 } InstFmt;
148 #define OP_BF 0x8b
149 #define OP_BFS 0x8f
150 #define OP_BT 0x89
151 #define OP_BTS 0x8d
152 #define OP_BRA 0xa
153 #define OP_BSR 0xb
154 #define OP1_BRAF 0x0
155 #define OP2_BRAF 0x23
156 #define OP1_BSRF 0x0
157 #define OP2_BSRF 0x03
158 #define OP1_JMP 0x4
159 #define OP2_JMP 0x2b
160 #define OP1_JSR 0x4
161 #define OP2_JSR 0x0b
162 #define OP_RTS 0xffff