xref: /netbsd-src/external/gpl3/gdb/dist/include/opcode/sparc.h (revision aab831cebf6361fb2b518a47c70732e608d9abd2)
198b9484cSchristos /* Definitions for opcode table for the sparc.
2*aab831ceSchristos    Copyright (C) 1989-2024 Free Software Foundation, Inc.
398b9484cSchristos 
498b9484cSchristos    This file is part of GAS, the GNU Assembler, GDB, the GNU debugger, and
598b9484cSchristos    the GNU Binutils.
698b9484cSchristos 
798b9484cSchristos    GAS/GDB is free software; you can redistribute it and/or modify
898b9484cSchristos    it under the terms of the GNU General Public License as published by
998b9484cSchristos    the Free Software Foundation; either version 3, or (at your option)
1098b9484cSchristos    any later version.
1198b9484cSchristos 
1298b9484cSchristos    GAS/GDB is distributed in the hope that it will be useful,
1398b9484cSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1498b9484cSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
1598b9484cSchristos    GNU General Public License for more details.
1698b9484cSchristos 
1798b9484cSchristos    You should have received a copy of the GNU General Public License
1898b9484cSchristos    along with GAS or GDB; see the file COPYING3.  If not, write to
1998b9484cSchristos    the Free Software Foundation, 51 Franklin Street - Fifth Floor,
2098b9484cSchristos    Boston, MA 02110-1301, USA.  */
2198b9484cSchristos 
2298b9484cSchristos #include "ansidecl.h"
2398b9484cSchristos 
24ba340e45Schristos #ifdef __cplusplus
25ba340e45Schristos extern "C" {
26ba340e45Schristos #endif
27ba340e45Schristos 
2898b9484cSchristos /* The SPARC opcode table (and other related data) is defined in
2998b9484cSchristos    the opcodes library in sparc-opc.c.  If you change anything here, make
3098b9484cSchristos    sure you fix up that file, and vice versa.  */
3198b9484cSchristos 
3298b9484cSchristos  /* FIXME-someday: perhaps the ,a's and such should be embedded in the
3398b9484cSchristos     instruction's name rather than the args.  This would make gas faster, pinsn
3498b9484cSchristos     slower, but would mess up some macros a bit.  xoxorich. */
3598b9484cSchristos 
3698b9484cSchristos /* List of instruction sets variations.
3798b9484cSchristos    These values are such that each element is either a superset of a
3898b9484cSchristos    preceding each one or they conflict in which case SPARC_OPCODE_CONFLICT_P
3998b9484cSchristos    returns non-zero.
4098b9484cSchristos    The values are indices into `sparc_opcode_archs' defined in sparc-opc.c.
4198b9484cSchristos    Don't change this without updating sparc-opc.c.  */
4298b9484cSchristos 
4398b9484cSchristos enum sparc_opcode_arch_val
4498b9484cSchristos {
4598b9484cSchristos   SPARC_OPCODE_ARCH_V6 = 0,
4698b9484cSchristos   SPARC_OPCODE_ARCH_V7,
4798b9484cSchristos   SPARC_OPCODE_ARCH_V8,
4803467a24Schristos   SPARC_OPCODE_ARCH_LEON,
4998b9484cSchristos   SPARC_OPCODE_ARCH_SPARCLET,
5098b9484cSchristos   SPARC_OPCODE_ARCH_SPARCLITE,
5198b9484cSchristos   /* V9 variants must appear last.  */
5298b9484cSchristos   SPARC_OPCODE_ARCH_V9,
5398b9484cSchristos   SPARC_OPCODE_ARCH_V9A, /* V9 with ultrasparc additions.  */
5498b9484cSchristos   SPARC_OPCODE_ARCH_V9B, /* V9 with ultrasparc and cheetah additions.  */
55ba340e45Schristos   SPARC_OPCODE_ARCH_V9C, /* V9 with UA2005 and T1 additions.  */
56ba340e45Schristos   SPARC_OPCODE_ARCH_V9D, /* V9 with UA2007 and T3 additions.  */
57ba340e45Schristos   SPARC_OPCODE_ARCH_V9E, /* V9 with OSA2011 and T4 additions modulus integer multiply-add.  */
58ba340e45Schristos   SPARC_OPCODE_ARCH_V9V, /* V9 with OSA2011 and T4 additions, integer
59ba340e45Schristos                             multiply and Fujitsu fp multiply-add.  */
60ba340e45Schristos   SPARC_OPCODE_ARCH_V9M, /* V9 with OSA2015 and M7 additions.  */
614559860eSchristos   SPARC_OPCODE_ARCH_M8,  /* V9 with OSA2017 and M8 additions.  */
624559860eSchristos   SPARC_OPCODE_ARCH_MAX = SPARC_OPCODE_ARCH_M8,
6398b9484cSchristos   SPARC_OPCODE_ARCH_BAD  /* Error return from sparc_opcode_lookup_arch.  */
6498b9484cSchristos };
6598b9484cSchristos 
6698b9484cSchristos 
6798b9484cSchristos /* Given an enum sparc_opcode_arch_val, return the bitmask to use in
6898b9484cSchristos    insn encoding/decoding.  */
6998b9484cSchristos #define SPARC_OPCODE_ARCH_MASK(arch) (1 << (arch))
7098b9484cSchristos 
7198b9484cSchristos /* Given a valid sparc_opcode_arch_val, return non-zero if it's v9.  */
7298b9484cSchristos #define SPARC_OPCODE_ARCH_V9_P(arch) ((arch) >= SPARC_OPCODE_ARCH_V9)
7398b9484cSchristos 
7498b9484cSchristos /* Table of cpu variants.  */
7598b9484cSchristos 
7698b9484cSchristos typedef struct sparc_opcode_arch
7798b9484cSchristos {
7898b9484cSchristos   const char *name;
7998b9484cSchristos   /* Mask of sparc_opcode_arch_val's supported.
8098b9484cSchristos      EG: For v7 this would be
8198b9484cSchristos      (SPARC_OPCODE_ARCH_MASK (..._V6) | SPARC_OPCODE_ARCH_MASK (..._V7)).
8298b9484cSchristos      These are short's because sparc_opcode.architecture is.  */
8398b9484cSchristos   short supported;
84796c32c9Schristos   /* Bitmaps describing the set of hardware capabilities implemented
85796c32c9Schristos      by the opcode arch.  */
86796c32c9Schristos   int hwcaps;
87796c32c9Schristos   int hwcaps2;
8898b9484cSchristos } sparc_opcode_arch;
8998b9484cSchristos 
9098b9484cSchristos extern const struct sparc_opcode_arch sparc_opcode_archs[];
9198b9484cSchristos 
9298b9484cSchristos /* Given architecture name, look up it's sparc_opcode_arch_val value.  */
9398b9484cSchristos extern enum sparc_opcode_arch_val sparc_opcode_lookup_arch (const char *);
9498b9484cSchristos 
9598b9484cSchristos /* Return the bitmask of supported architectures for ARCH.  */
9698b9484cSchristos #define SPARC_OPCODE_SUPPORTED(ARCH) (sparc_opcode_archs[ARCH].supported)
9798b9484cSchristos 
9898b9484cSchristos /* Non-zero if ARCH1 conflicts with ARCH2.
9998b9484cSchristos    IE: ARCH1 as a supported bit set that ARCH2 doesn't, and vice versa.  */
10098b9484cSchristos #define SPARC_OPCODE_CONFLICT_P(ARCH1, ARCH2) \
10198b9484cSchristos  (((SPARC_OPCODE_SUPPORTED (ARCH1) & SPARC_OPCODE_SUPPORTED (ARCH2)) \
10298b9484cSchristos    != SPARC_OPCODE_SUPPORTED (ARCH1)) \
10398b9484cSchristos   && ((SPARC_OPCODE_SUPPORTED (ARCH1) & SPARC_OPCODE_SUPPORTED (ARCH2)) \
10498b9484cSchristos      != SPARC_OPCODE_SUPPORTED (ARCH2)))
10598b9484cSchristos 
10698b9484cSchristos /* Structure of an opcode table entry.  */
10798b9484cSchristos 
10898b9484cSchristos typedef struct sparc_opcode
10998b9484cSchristos {
11098b9484cSchristos   const char *name;
11198b9484cSchristos   unsigned long match;	/* Bits that must be set.  */
11298b9484cSchristos   unsigned long lose;	/* Bits that must not be set.  */
11398b9484cSchristos   const char *args;
11498b9484cSchristos   /* This was called "delayed" in versions before the flags.  */
115a2e2270fSchristos   unsigned int flags;
116a2e2270fSchristos   unsigned int hwcaps;
117968cf8f2Schristos   unsigned int hwcaps2;
11898b9484cSchristos   short architecture;	/* Bitmask of sparc_opcode_arch_val's.  */
11998b9484cSchristos } sparc_opcode;
12098b9484cSchristos 
121796c32c9Schristos /* Struct for ASIs - to handle ASIs introduced in a specific architecture */
122796c32c9Schristos typedef struct
123796c32c9Schristos {
124796c32c9Schristos   int value;
125796c32c9Schristos   const char *name;
126796c32c9Schristos   short architecture;
127796c32c9Schristos } sparc_asi;
128796c32c9Schristos 
12998b9484cSchristos /* FIXME: Add F_ANACHRONISTIC flag for v9.  */
130a2e2270fSchristos #define	F_DELAYED	0x00000001 /* Delayed branch.  */
131a2e2270fSchristos #define	F_ALIAS		0x00000002 /* Alias for a "real" instruction.  */
132a2e2270fSchristos #define	F_UNBR		0x00000004 /* Unconditional branch.  */
133a2e2270fSchristos #define	F_CONDBR	0x00000008 /* Conditional branch.  */
134a2e2270fSchristos #define	F_JSR		0x00000010 /* Subroutine call.  */
135a2e2270fSchristos #define F_FLOAT		0x00000020 /* Floating point instruction (not a branch).  */
136a2e2270fSchristos #define F_FBR		0x00000040 /* Floating point branch.  */
13703467a24Schristos #define F_PREFERRED	0x00000080 /* A preferred alias.  */
13803467a24Schristos 
13903467a24Schristos #define F_PREF_ALIAS	(F_ALIAS|F_PREFERRED)
140a2e2270fSchristos 
141968cf8f2Schristos /* These must match the ELF_SPARC_HWCAP_* and ELF_SPARC_HWCAP2_*
142968cf8f2Schristos    values precisely.  See include/elf/sparc.h.  */
143a2e2270fSchristos #define HWCAP_MUL32	0x00000001 /* umul/umulcc/smul/smulcc insns */
144a2e2270fSchristos #define HWCAP_DIV32	0x00000002 /* udiv/udivcc/sdiv/sdivcc insns */
145a2e2270fSchristos #define HWCAP_FSMULD	0x00000004 /* 'fsmuld' insn */
146a2e2270fSchristos #define HWCAP_V8PLUS	0x00000008 /* v9 insns available to 32bit */
147a2e2270fSchristos #define HWCAP_POPC	0x00000010 /* 'popc' insn */
148a2e2270fSchristos #define HWCAP_VIS	0x00000020 /* VIS insns */
149a2e2270fSchristos #define HWCAP_VIS2	0x00000040 /* VIS2 insns */
150a2e2270fSchristos #define HWCAP_ASI_BLK_INIT	\
151a2e2270fSchristos 			0x00000080 /* block init ASIs */
152a2e2270fSchristos #define HWCAP_FMAF	0x00000100 /* fused multiply-add */
153a2e2270fSchristos #define HWCAP_VIS3	0x00000400 /* VIS3 insns */
154a2e2270fSchristos #define HWCAP_HPC	0x00000800 /* HPC insns */
155a2e2270fSchristos #define HWCAP_RANDOM	0x00001000 /* 'random' insn */
156a2e2270fSchristos #define HWCAP_TRANS	0x00002000 /* transaction insns */
157a2e2270fSchristos #define HWCAP_FJFMAU	0x00004000 /* unfused multiply-add */
158a2e2270fSchristos #define HWCAP_IMA	0x00008000 /* integer multiply-add */
159a2e2270fSchristos #define HWCAP_ASI_CACHE_SPARING \
160a2e2270fSchristos 			0x00010000 /* cache sparing ASIs */
161a2e2270fSchristos #define HWCAP_AES	0x00020000 /* AES crypto insns */
162a2e2270fSchristos #define HWCAP_DES	0x00040000 /* DES crypto insns */
163a2e2270fSchristos #define HWCAP_KASUMI	0x00080000 /* KASUMI crypto insns */
164a2e2270fSchristos #define HWCAP_CAMELLIA 	0x00100000 /* CAMELLIA crypto insns */
165a2e2270fSchristos #define HWCAP_MD5	0x00200000 /* MD5 hashing insns */
166a2e2270fSchristos #define HWCAP_SHA1	0x00400000 /* SHA1 hashing insns */
167a2e2270fSchristos #define HWCAP_SHA256	0x00800000 /* SHA256 hashing insns */
168a2e2270fSchristos #define HWCAP_SHA512	0x01000000 /* SHA512 hashing insns */
169a2e2270fSchristos #define HWCAP_MPMUL	0x02000000 /* Multiple Precision Multiply */
170a2e2270fSchristos #define HWCAP_MONT	0x04000000 /* Montgomery Mult/Sqrt */
171a2e2270fSchristos #define HWCAP_PAUSE	0x08000000 /* Pause insn */
172a2e2270fSchristos #define HWCAP_CBCOND	0x10000000 /* Compare and Branch insns */
173a2e2270fSchristos #define HWCAP_CRC32C	0x20000000 /* CRC32C insn */
17498b9484cSchristos 
175968cf8f2Schristos #define HWCAP2_FJATHPLUS 0x00000001 /* Fujitsu Athena+ */
176968cf8f2Schristos #define HWCAP2_VIS3B     0x00000002 /* Subset of VIS3 present on sparc64 X+.  */
177968cf8f2Schristos #define HWCAP2_ADP       0x00000004 /* Application Data Protection */
178968cf8f2Schristos #define HWCAP2_SPARC5    0x00000008 /* The 29 new fp and sub instructions */
179968cf8f2Schristos #define HWCAP2_MWAIT     0x00000010 /* mwait instruction and load/monitor ASIs */
180968cf8f2Schristos #define HWCAP2_XMPMUL    0x00000020 /* XOR multiple precision multiply */
181968cf8f2Schristos #define HWCAP2_XMONT     0x00000040 /* XOR Montgomery mult/sqr instructions */
182968cf8f2Schristos #define HWCAP2_NSEC      \
183968cf8f2Schristos                          0x00000080 /* pause insn with support for nsec timings */
184968cf8f2Schristos #define HWCAP2_FJATHHPC  0x00001000 /* Fujitsu HPC instrs */
185968cf8f2Schristos #define HWCAP2_FJDES     0x00002000 /* Fujitsu DES instrs */
186968cf8f2Schristos #define HWCAP2_FJAES     0x00010000 /* Fujitsu AES instrs */
187968cf8f2Schristos 
1884559860eSchristos #define HWCAP2_SPARC6    0x00020000 /* OSA2017 new instructions */
1894559860eSchristos #define HWCAP2_ONADDSUB  0x00040000 /* Oracle Number add/subtract */
1904559860eSchristos #define HWCAP2_ONMUL     0x00080000 /* Oracle Number multiply */
1914559860eSchristos #define HWCAP2_ONDIV     0x00100000 /* Oracle Number divide */
1924559860eSchristos #define HWCAP2_DICTUNP   0x00200000 /* Dictionary unpack instruction */
1934559860eSchristos #define HWCAP2_FPCMPSHL  0x00400000 /* Partition compare with shifted result */
1944559860eSchristos #define HWCAP2_RLE       0x00800000 /* Run-length encoded burst and length */
1954559860eSchristos #define HWCAP2_SHA3      0x01000000 /* SHA3 instruction */
1964559860eSchristos 
197968cf8f2Schristos 
19898b9484cSchristos /* All sparc opcodes are 32 bits, except for the `set' instruction (really a
19998b9484cSchristos    macro), which is 64 bits. It is handled as a special case.
20098b9484cSchristos 
20198b9484cSchristos    The match component is a mask saying which bits must match a particular
20298b9484cSchristos    opcode in order for an instruction to be an instance of that opcode.
20398b9484cSchristos 
20498b9484cSchristos    The args component is a string containing one character for each operand of the
20598b9484cSchristos    instruction.
20698b9484cSchristos 
20798b9484cSchristos    Kinds of operands:
20898b9484cSchristos 	#	Number used by optimizer.	It is ignored.
20998b9484cSchristos 	1	rs1 register.
21098b9484cSchristos 	2	rs2 register.
21198b9484cSchristos 	d	rd register.
21298b9484cSchristos 	e	frs1 floating point register.
21398b9484cSchristos 	v	frs1 floating point register (double/even).
21498b9484cSchristos 	V	frs1 floating point register (quad/multiple of 4).
2154559860eSchristos 	;	frs1 floating piont register (multiple of 8).
21698b9484cSchristos 	f	frs2 floating point register.
21798b9484cSchristos 	B	frs2 floating point register (double/even).
21898b9484cSchristos 	R	frs2 floating point register (quad/multiple of 4).
2194559860eSchristos 	:	frs2 floating point register (multiple of 8).
2204559860eSchristos 	'	rs2m floating point register (double/even) in FPCMPSHL. (m8)
221a2e2270fSchristos 	4	frs3 floating point register.
222a2e2270fSchristos 	5	frs3 floating point register (doube/even).
22398b9484cSchristos 	g	frsd floating point register.
22498b9484cSchristos 	H	frsd floating point register (double/even).
22598b9484cSchristos 	J	frsd floating point register (quad/multiple of 4).
226968cf8f2Schristos 	}       frsd floating point register (double/even) that is == frs2
2274559860eSchristos 	^	frsd floating piont register in ON instructions.
22898b9484cSchristos 	b	crs1 coprocessor register
22998b9484cSchristos 	c	crs2 coprocessor register
23098b9484cSchristos 	D	crsd coprocessor register
23198b9484cSchristos 	m	alternate space register (asr) in rd
23298b9484cSchristos 	M	alternate space register (asr) in rs1
23398b9484cSchristos 	h	22 high bits.
23498b9484cSchristos 	X	5 bit unsigned immediate
23598b9484cSchristos 	Y	6 bit unsigned immediate
23698b9484cSchristos 	3	SIAM mode (3 bits). (v9b)
23798b9484cSchristos 	K	MEMBAR mask (7 bits). (v9)
23898b9484cSchristos 	j	10 bit Immediate. (v9)
23998b9484cSchristos 	I	11 bit Immediate. (v9)
24098b9484cSchristos 	i	13 bit Immediate.
24198b9484cSchristos 	n	22 bit immediate.
24298b9484cSchristos 	k	2+14 bit PC relative immediate. (v9)
24398b9484cSchristos 	G	19 bit PC relative immediate. (v9)
24498b9484cSchristos 	l	22 bit PC relative immediate.
24598b9484cSchristos 	L	30 bit PC relative immediate.
24698b9484cSchristos 	a	Annul.	The annul bit is set.
24798b9484cSchristos 	A	Alternate address space. Stored as 8 bits.
24898b9484cSchristos 	C	Coprocessor state register.
24998b9484cSchristos 	F	floating point state register.
25098b9484cSchristos 	p	Processor state register.
25198b9484cSchristos 	N	Branch predict clear ",pn" (v9)
25298b9484cSchristos 	T	Branch predict set ",pt" (v9)
25398b9484cSchristos 	z	%icc. (v9)
25498b9484cSchristos 	Z	%xcc. (v9)
25598b9484cSchristos 	q	Floating point queue.
25698b9484cSchristos 	r	Single register that is both rs1 and rd.
25798b9484cSchristos 	O	Single register that is both rs2 and rd.
25898b9484cSchristos 	Q	Coprocessor queue.
25998b9484cSchristos 	S	Special case.
26098b9484cSchristos 	t	Trap base register.
26198b9484cSchristos 	w	Window invalid mask register.
26298b9484cSchristos 	y	Y register.
26398b9484cSchristos 	u	sparclet coprocessor registers in rd position
26498b9484cSchristos 	U	sparclet coprocessor registers in rs1 position
26598b9484cSchristos 	E	%ccr. (v9)
26698b9484cSchristos 	s	%fprs. (v9)
26798b9484cSchristos 	P	%pc.  (v9)
26898b9484cSchristos 	W	%tick.	(v9)
269968cf8f2Schristos 	{	%mcdper. (v9b)
2704559860eSchristos 	&	%entropy.  (m8)
27198b9484cSchristos 	o	%asi. (v9)
27298b9484cSchristos 	6	%fcc0. (v9)
27398b9484cSchristos 	7	%fcc1. (v9)
27498b9484cSchristos 	8	%fcc2. (v9)
27598b9484cSchristos 	9	%fcc3. (v9)
27698b9484cSchristos 	!	Privileged Register in rd (v9)
27798b9484cSchristos 	?	Privileged Register in rs1 (v9)
278ba340e45Schristos 	%	Hyperprivileged Register in rd (v9b)
279ba340e45Schristos 	$	Hyperprivileged Register in rs1 (v9b)
28098b9484cSchristos 	*	Prefetch function constant. (v9)
28198b9484cSchristos 	x	OPF field (v9 impdep).
28298b9484cSchristos 	0	32/64 bit immediate for set or setx (v9) insns
28398b9484cSchristos 	_	Ancillary state register in rd (v9a)
28498b9484cSchristos 	/	Ancillary state register in rs1 (v9a)
285a2e2270fSchristos 	(	entire floating point state register (%efsr)
286a2e2270fSchristos 	)	5 bit immediate placed in RS3 field
2874559860eSchristos 	=	2+8 bit PC relative immediate. (v9)
2884559860eSchristos 	|	FPCMPSHL 2 bit immediate. (m8)  */
28998b9484cSchristos 
29098b9484cSchristos #define OP2(x)		(((x) & 0x7) << 22)  /* Op2 field of format2 insns.  */
29198b9484cSchristos #define OP3(x)		(((x) & 0x3f) << 19) /* Op3 field of format3 insns.  */
29298b9484cSchristos #define OP(x)		((unsigned) ((x) & 0x3) << 30) /* Op field of all insns.  */
29398b9484cSchristos #define OPF(x)		(((x) & 0x1ff) << 5) /* Opf field of float insns.  */
29498b9484cSchristos #define OPF_LOW5(x)	OPF ((x) & 0x1f)     /* V9.  */
295a2e2270fSchristos #define OPF_LOW4(x)	OPF ((x) & 0xf)      /* V9.  */
2964559860eSchristos #define OPM(x)		(((x) & 0x7) << 10)  /* opm field of misaligned load/store insns.  */
2974559860eSchristos #define OPMI(x)	(((x) & 0x1) << 9)   /* opm i field of misaligned load/store insns.  */
2984559860eSchristos #define ONFCN(x)	(((x) & 0x3) << 26)  /* fcn field of Oracle Number insns.  */
2994559860eSchristos #define REVFCN(x)	(((x) & 0x3) << 0)   /* fcn field of REV* insns.  */
30098b9484cSchristos #define F3F(x, y, z)	(OP (x) | OP3 (y) | OPF (z)) /* Format3 float insns.  */
301a2e2270fSchristos #define F3F4(x, y, z)	(OP (x) | OP3 (y) | OPF_LOW4 (z))
30298b9484cSchristos #define F3I(x)		(((x) & 0x1) << 13)  /* Immediate field of format 3 insns.  */
30398b9484cSchristos #define F2(x, y)	(OP (x) | OP2(y))    /* Format 2 insns.  */
30498b9484cSchristos #define F3(x, y, z)	(OP (x) | OP3(y) | F3I(z)) /* Format3 insns.  */
30598b9484cSchristos #define F1(x)		(OP (x))
30698b9484cSchristos #define DISP30(x)	((x) & 0x3fffffff)
30798b9484cSchristos #define ASI(x)		(((x) & 0xff) << 5)  /* Asi field of format3 insns.  */
30898b9484cSchristos #define RS2(x)		((x) & 0x1f)         /* Rs2 field.  */
30998b9484cSchristos #define SIMM13(x)	((x) & 0x1fff)       /* Simm13 field.  */
3104559860eSchristos #define SIMM10(x)	((x) & 0x3ff)	     /* Simm10 field.  */
31198b9484cSchristos #define RD(x)		(((x) & 0x1f) << 25) /* Destination register field.  */
31298b9484cSchristos #define RS1(x)		(((x) & 0x1f) << 14) /* Rs1 field.  */
313a2e2270fSchristos #define RS3(x)		(((x) & 0x1f) << 9)  /* Rs3 field.  */
31498b9484cSchristos #define ASI_RS2(x)	(SIMM13 (x))
31598b9484cSchristos #define MEMBAR(x)	((x) & 0x7f)
31698b9484cSchristos #define SLCPOP(x)	(((x) & 0x7f) << 6)  /* Sparclet cpop.  */
31798b9484cSchristos 
31898b9484cSchristos #define ANNUL	(1 << 29)
31998b9484cSchristos #define BPRED	(1 << 19)	/* V9.  */
32098b9484cSchristos #define	IMMED	F3I (1)
32198b9484cSchristos #define RD_G0	RD (~0)
32298b9484cSchristos #define	RS1_G0	RS1 (~0)
32398b9484cSchristos #define	RS2_G0	RS2 (~0)
32498b9484cSchristos 
32598b9484cSchristos extern const struct sparc_opcode sparc_opcodes[];
32698b9484cSchristos extern const int sparc_num_opcodes;
32798b9484cSchristos 
328796c32c9Schristos extern const sparc_asi *sparc_encode_asi (const char *);
32998b9484cSchristos extern const char *sparc_decode_asi (int);
33098b9484cSchristos extern int sparc_encode_membar (const char *);
33198b9484cSchristos extern const char *sparc_decode_membar (int);
33298b9484cSchristos extern int sparc_encode_prefetch (const char *);
33398b9484cSchristos extern const char *sparc_decode_prefetch (int);
33498b9484cSchristos extern int sparc_encode_sparclet_cpreg (const char *);
33598b9484cSchristos extern const char *sparc_decode_sparclet_cpreg (int);
33698b9484cSchristos 
33798b9484cSchristos /* Local Variables:
33898b9484cSchristos    fill-column: 131
33998b9484cSchristos    comment-column: 0
34098b9484cSchristos    End: */
34198b9484cSchristos 
342ba340e45Schristos #ifdef __cplusplus
343ba340e45Schristos }
344ba340e45Schristos #endif
345