1/* 2 * Copyright (c) 1994 David S. Miller, davem@nadzieja.rutgers.edu 3 * Copyright (c) 1995 Paul Kranenburg 4 * Copyright (c) 2001 Thomas Moestl <tmm@FreeBSD.org> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 17 unchanged lines hidden (view full) --- 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 * 32 * from: NetBSD: db_disasm.c,v 1.9 2000/08/16 11:29:42 pk Exp 33 * |
34 * $FreeBSD: head/sys/sparc64/include/instr.h 88663 2001-12-29 08:55:56Z jake $ |
35 */ 36 37#ifndef _MACHINE_INSTR_H_ 38#define _MACHINE_INSTR_H_ 39 40/* 41 * Definitions for all instruction formats 42 */ --- 89 unchanged lines hidden (view full) --- 132#define IF_F4_RS2_BITS IF_F3_RS2_BITS 133#define IF_F4_SW_TRAP_SHIFT 0 134#define IF_F4_SW_TRAP_BITS 7 135 136/* 137 * Macros to decode instructions 138 */ 139/* Extract a field */ |
140#define IF_MASK(s, w) (((1 << (w)) - 1) << (s)) 141#define IF_EXTRACT(x, s, w) (((x) & IF_MASK((s), (w))) >> (s)) |
142#define IF_DECODE(x, f) \ 143 IF_EXTRACT((x), IF_ ## f ## _SHIFT, IF_ ## f ## _BITS) 144 145/* Sign-extend a field of width W */ 146#define IF_SEXT(x, w) \ 147 (((x) & (1 << ((w) - 1))) != 0 ? (-1L - ((x) ^ ((1 << (w)) - 1))) : (x)) 148 149#if 0 --- 258 unchanged lines hidden (view full) --- 408/* undefined 0x38 - 0x3b */ 409#define INS3_CASA 0x39 410#define INS3_PREFETCHA 0x3a 411#define INS3_CASXA 0x3b 412 413/* 414 * OPF values (floating point instructions, IMPLDEP) 415 */ |
416/* 417 * These values are or'ed to the FPop values to get the instructions. 418 * They describe the operand type(s). 419 */ 420#define INSFP_i 0x000 /* 32-bit int */ 421#define INSFP_s 0x001 /* 32-bit single */ 422#define INSFP_d 0x002 /* 64-bit double */ 423#define INSFP_q 0x003 /* 128-bit quad */ 424/* FPop1. The comments give the types for which this instruction is defined. */ 425#define INSFP1_FMOV 0x000 /* s, d, q */ 426#define INSFP1_FNEG 0x004 /* s, d, q */ 427#define INSFP1_FABS 0x008 /* s, d, q */ 428#define INSFP1_FSQRT 0x028 /* s, d, q */ 429#define INSFP1_FADD 0x040 /* s, d, q */ 430#define INSFP1_FSUB 0x044 /* s, d, q */ 431#define INSFP1_FMUL 0x048 /* s, d, q */ 432#define INSFP1_FDIV 0x04c /* s, d, q */ 433#define INSFP1_FsMULd 0x068 /* s */ 434#define INSFP1_FdMULq 0x06c /* d */ 435#define INSFP1_FTOx 0x080 /* s, d, q */ 436#define INSFP1_FxTOs 0x084 /* special: i only */ 437#define INSFP1_FxTOd 0x088 /* special: i only */ 438#define INSFP1_FxTOq 0x08c /* special: i only */ 439#define INSFP1_FTOs 0x0c4 /* i, d, q */ 440#define INSFP1_FTOd 0x0c8 /* i, s, q */ 441#define INSFP1_FTOq 0x0cc /* i, s, d */ 442#define INSFP1_FTOi 0x0d0 /* i, s, d */ |
443 444/* FPop2 */ 445#define INSFP2_FMOV_CCMUL 0x40 |
446#define INSFP2_FMOV_CCOFFS 0x00 447/* Use the IFCC_* constants for cc. Operand types: s, d, q */ 448#define INSFP2_FMOV_CC(cc) ((cc) * INSFP2_FMOV_CCMUL + INSFP2_FMOV_CCOFFS) |
449#define INSFP2_FMOV_RCMUL 0x20 |
450#define INSFP2_FMOV_RCOFFS 0x04 451/* Use the IRCOND_* constants for rc. Operand types: s, d, q */ 452#define INSFP2_FMOV_RC(rc) ((rc) * INSFP2_FMOV_RCMUL + INSFP2_FMOV_RCOFFS) 453#define INSFP2_FCMP 0x050 /* s, d, q */ 454#define INSFP2_FCMPE 0x054 /* s, d, q */ |
455 456/* IMPLDEP1 for Sun UltraSparc */ 457#define IIDP1_EDGE8 0x00 458#define IIDP1_EDGE8L 0x02 459#define IIDP1_EDGE16 0x04 460#define IIDP1_EDGE16L 0x06 461#define IIDP1_EDGE32 0x08 462#define IIDP1_EDGE32L 0x0a --- 101 unchanged lines hidden (view full) --- 564#define IFCOND_UE 0x0a 565#define IFCOND_GE 0x0b 566#define IFCOND_UGE 0x0c 567#define IFCOND_LE 0x0d 568#define IFCOND_ULE 0x0e 569#define IFCOND_O 0x0f 570 571/* rcond values for BPr, MOVr, FMOVr */ |
572#define IRCOND_Z 0x01 |
573#define IRCOND_LEZ 0x02 574#define IRCOND_LZ 0x03 575#define IRCOND_NZ 0x05 576#define IRCOND_GZ 0x06 577#define IRCOND_GEZ 0x07 578 579/* cc values for MOVcc and FMOVcc */ 580#define IFCC_ICC 0x04 581#define IFCC_XCC 0x06 582/* if true, the lower 2 bits are the fcc number */ |
583#define IFCC_FCC(c) ((c) & 3) 584#define IFCC_GET_FCC(c) ((c) & 3) 585#define IFCC_ISFCC(c) (((c) & 4) == 0) |
586 587/* cc values for BPc and Tcc */ 588#define IBCC_ICC 0x00 589#define IBCC_XCC 0x02 590 591/* 592 * Integer registers 593 */ 594#define IREG_G0 0x00 595#define IREG_O0 0x08 596#define IREG_L0 0x10 597#define IREQ_I0 0x18 598 599#endif /* !_MACHINE_INSTR_H_ */ |