00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 #ifndef _ALPHA_INST_H_
00065 #define _ALPHA_INST_H_ 1
00066
00067
00068
00069
00070
00071 #define IEEE_FLOAT 1
00072 #define VAX_FLOATS 0
00073
00074 #define SINGLE_PRECISION 0
00075 #define DOUBLE_PRECISION 1
00076
00077
00078
00079
00080
00081 union alpha_instruction {
00082 unsigned long word;
00083 unsigned char byte[4];
00084
00085
00086 struct {
00087 #ifdef __MSDOS__
00088 unsigned short function_lo: 16;
00089 unsigned function_hi:10;
00090 #else
00091 unsigned : 26;
00092 #endif
00093 unsigned opcode : 6;
00094 } common;
00095
00096
00097 struct {
00098 signed memory_displacement : 16;
00099 unsigned rb : 5;
00100 unsigned ra : 5;
00101 unsigned opcode : 6;
00102 } m_format;
00103
00104
00105 struct {
00106 #ifdef __MSDOS__
00107 unsigned short branch_displacement_lo;
00108 unsigned branch_displacement_hi : 5;
00109 #else
00110 signed branch_displacement : 21;
00111 #endif
00112 unsigned ra : 5;
00113 unsigned opcode : 6;
00114 } b_format;
00115
00116
00117 struct {
00118 unsigned rc : 5;
00119 unsigned function : 7;
00120 unsigned form : 1;
00121 unsigned : 3;
00122 unsigned rb : 5;
00123 unsigned ra : 5;
00124 unsigned opcode : 6;
00125 } o_format;
00126
00127
00128 struct {
00129 unsigned rc : 5;
00130 unsigned function : 7;
00131 unsigned form : 1;
00132 #ifdef __MSDOS__
00133 unsigned literal_lo : 3;
00134 unsigned literal_hi : 5;
00135 #else
00136 unsigned literal : 8;
00137 #endif
00138 unsigned ra : 5;
00139 unsigned opcode : 6;
00140 } l_format;
00141
00142
00143 struct {
00144 unsigned fc: 5;
00145 unsigned fnc: 4;
00146 unsigned src: 2;
00147 unsigned rnd: 2;
00148 unsigned u: 1;
00149 unsigned ie: 1;
00150 unsigned s: 1;
00151 unsigned fb : 5;
00152 unsigned fa : 5;
00153 unsigned opcode : 6;
00154 } f_format;
00155
00156
00157 struct {
00158 unsigned fc: 5;
00159 unsigned function : 11;
00160 unsigned fb : 5;
00161 unsigned fa : 5;
00162 unsigned opcode : 6;
00163 } ipf_format;
00164
00165
00166 struct {
00167 unsigned fc: 5;
00168 unsigned function : 11;
00169 unsigned fb : 5;
00170 unsigned fa : 5;
00171 unsigned opcode : 6;
00172 } vax_format;
00173
00174
00175 struct {
00176 #ifdef __MSDOS__
00177 unsigned short function_lo: 16;
00178 unsigned function_hi:10;
00179 #else
00180 unsigned function: 26;
00181 #endif
00182 unsigned opcode : 6;
00183 } pal_format;
00184
00185
00186 struct {
00187 signed hint : 14;
00188 unsigned function : 2;
00189 unsigned rb : 5;
00190 unsigned ra : 5;
00191 unsigned opcode : 6;
00192 } j_format;
00193 };
00194
00195
00196
00197
00198
00199
00200 #define IEEE$_COULD_BE_INTOVF 2
00201
00202
00203
00204
00205
00206
00207 #define op_call_pal 0x00
00208 #define op_opc01 0x01
00209 #define op_opc02 0x02
00210 #define op_opc03 0x03
00211 #define op_opc04 0x04
00212 #define op_opc05 0x05
00213 #define op_opc06 0x06
00214 #define op_opc07 0x07
00215 #define op_lda 0x08
00216 #define op_ldah 0x09
00217 #define op_ldbu 0x0a
00218 #define op_ldq_u 0x0b
00219 #define op_ldwu 0x0c
00220 #define op_stw 0x0d
00221 #define op_stb 0x0e
00222 #define op_stq_u 0x0f
00223 #define op_inta 0x10
00224 #define op_intl 0x11
00225 #define op_ints 0x12
00226 #define op_intm 0x13
00227 #define op_itfp 0x14
00228 #define op_fltv 0x15
00229 #define op_flti 0x16
00230 #define op_fltl 0x17
00231 #define op_misc 0x18
00232 #define op_pal19 0x19
00233 #define op_jsr 0x1a
00234 #define op_pal1b 0x1b
00235 #define op_sext 0x1c
00236 #define op_pal1d 0x1d
00237 #define op_pal1e 0x1e
00238 #define op_pal1f 0x1f
00239 #define op_ldf 0x20
00240 #define op_ldg 0x21
00241 #define op_lds 0x22
00242 #define op_ldt 0x23
00243 #define op_stf 0x24
00244 #define op_stg 0x25
00245 #define op_sts 0x26
00246 #define op_stt 0x27
00247 #define op_ldl 0x28
00248 #define op_ldq 0x29
00249 #define op_ldl_l 0x2a
00250 #define op_ldq_l 0x2b
00251 #define op_stl 0x2c
00252 #define op_stq 0x2d
00253 #define op_stl_c 0x2e
00254 #define op_stq_c 0x2f
00255 #define op_br 0x30
00256 #define op_fbeq 0x31
00257 #define op_fblt 0x32
00258 #define op_fble 0x33
00259 #define op_bsr 0x34
00260 #define op_fbne 0x35
00261 #define op_fbge 0x36
00262 #define op_fbgt 0x37
00263 #define op_blbc 0x38
00264 #define op_beq 0x39
00265 #define op_blt 0x3a
00266 #define op_ble 0x3b
00267 #define op_blbs 0x3c
00268 #define op_bne 0x3d
00269 #define op_bge 0x3e
00270 #define op_bgt 0x3f
00271
00272
00273
00274
00275
00276
00277 #define inta_addl 0x00
00278 #define inta_s4addl 0x02
00279 #define inta_subl 0x09
00280 #define inta_s4subl 0x0b
00281 #define inta_cmpbge 0x0f
00282 #define inta_s8addl 0x12
00283 #define inta_s8subl 0x1b
00284 #define inta_cmpult 0x1d
00285 #define inta_addq 0x20
00286 #define inta_s4addq 0x22
00287 #define inta_subq 0x29
00288 #define inta_s4subq 0x2b
00289 #define inta_cmpeq 0x2d
00290 #define inta_s8addq 0x32
00291 #define inta_s8subq 0x3b
00292 #define inta_cmpule 0x3d
00293 #define inta_addlv 0x40
00294 #define inta_sublv 0x49
00295 #define inta_cmplt 0x4d
00296 #define inta_addqv 0x60
00297 #define inta_subqv 0x69
00298 #define inta_cmple 0x6d
00299
00300
00301
00302
00303
00304
00305 #define intl_and 0x00
00306 #define intl_bic 0x08
00307 #define intl_cmovlbs 0x14
00308 #define intl_cmovlbc 0x16
00309 #define intl_bis 0x20
00310 #define intl_cmoveq 0x24
00311 #define intl_cmovne 0x26
00312 #define intl_ornot 0x28
00313 #define intl_xor 0x40
00314 #define intl_cmovlt 0x44
00315 #define intl_cmovge 0x46
00316 #define intl_eqv 0x48
00317 #define intl_cmovle 0x64
00318 #define intl_cmovgt 0x66
00319
00320
00321
00322
00323
00324
00325 #define ints_mskbl 0x02
00326 #define ints_extbl 0x06
00327 #define ints_insbl 0x0b
00328 #define ints_mskwl 0x12
00329 #define ints_extwl 0x16
00330 #define ints_inswl 0x1b
00331 #define ints_mskll 0x22
00332 #define ints_extll 0x26
00333 #define ints_insll 0x2b
00334 #define ints_zap 0x30
00335 #define ints_zapnot 0x31
00336 #define ints_mskql 0x32
00337 #define ints_srl 0x34
00338 #define ints_extql 0x36
00339 #define ints_sll 0x39
00340 #define ints_insql 0x3b
00341 #define ints_sra 0x3c
00342 #define ints_mskwh 0x52
00343 #define ints_inswh 0x57
00344 #define ints_extwh 0x5a
00345 #define ints_msklh 0x62
00346 #define ints_inslh 0x67
00347 #define ints_extlh 0x6a
00348 #define ints_mskqh 0x72
00349 #define ints_insqh 0x77
00350 #define ints_extqh 0x7a
00351
00352
00353
00354
00355
00356
00357 #define intm_mull 0x00
00358 #define intm_mulq 0x20
00359 #define intm_umulh 0x30
00360 #define intm_mullv 0x40
00361 #define intm_mulqv 0x60
00362
00363
00364
00365
00366
00367
00368 #define jsr_jmp 0x0
00369 #define jsr_jsr 0x1
00370 #define jsr_ret 0x2
00371 #define jsr_jsr_coroutine 0x3
00372
00373
00374
00375
00376
00377
00378 #define misc_trapb 0x0000
00379 #define misc_excb 0x0400
00380 #define misc_mb 0x4000
00381 #define misc_wmb 0x4400
00382 #define misc_fetch 0x8000
00383 #define misc_fetch_m 0xa000
00384 #define misc_rpcc 0xc000
00385 #define misc_rc 0xe000
00386 #define misc_rs 0xf000
00387
00388
00389
00390
00391
00392
00393 #define fltl_cvtlq 0x010
00394 #define fltl_cpys 0x020
00395 #define fltl_cpysn 0x021
00396 #define fltl_cpyse 0x022
00397 #define fltl_mt_fpcr 0x024
00398 #define fltl_mf_fpcr 0x025
00399 #define fltl_fcmoveq 0x02a
00400 #define fltl_fcmovne 0x02b
00401 #define fltl_fcmovlt 0x02c
00402 #define fltl_fcmovge 0x02d
00403 #define fltl_fcmovle 0x02e
00404 #define fltl_fcmovgt 0x02f
00405 #define fltl_cvtql 0x030
00406 #define fltl_cvtqlv 0x130
00407 #define fltl_cvtqlsv 0x530
00408
00409
00410
00411
00412
00413 #define fltv_cvtgqsv 0x5af
00414
00415
00416
00417
00418
00419
00420 #define fltl_add 0x0
00421 #define fltl_sub 0x1
00422 #define fltl_mul 0x2
00423 #define fltl_div 0x3
00424 #define fltl_cmpun 0x4
00425 #define fltl_cmpeq 0x5
00426 #define fltl_cmplt 0x6
00427 #define fltl_cmple 0x7
00428 #define fltl_res8 0x8
00429 #define fltl_res9 0x9
00430 #define fltl_resa 0xa
00431 #define fltl_resb 0xb
00432 #define fltl_cvtxq 0xf
00433 #define fltl_cvtxf 0xc
00434 #define fltl_cvtxd 0xd
00435 #define fltl_cvtxg 0xe
00436 #define fltl_cvtxq 0xf
00437
00438
00439
00440
00441 #define itfp_sqrts 0x08b
00442 #define itfp_sqrtt 0x0ab
00443
00444
00445
00446
00447 #define sext_sextb 0x0
00448 #define sext_sextw 0x1
00449
00450 #define sext_ctpop 0x30
00451 #define sext_ctlz 0x32
00452 #define sext_cttz 0x33
00453
00454 #endif