Deleted Added
full compact
instr.h (96422) instr.h (96491)
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 *
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 96422 2002-05-11 21:20:05Z jake $
34 * $FreeBSD: head/sys/sparc64/include/instr.h 96491 2002-05-13 04:26:38Z jake $
35 */
36
37#ifndef _MACHINE_INSTR_H_
38#define _MACHINE_INSTR_H_
39
40/*
41 * Definitions for all instruction formats
42 */

--- 100 unchanged lines hidden (view full) ---

143/* Extract a field */
144#define IF_MASK(s, w) (((1 << (w)) - 1) << (s))
145#define IF_EXTRACT(x, s, w) (((x) & IF_MASK((s), (w))) >> (s))
146#define IF_DECODE(x, f) \
147 IF_EXTRACT((x), IF_ ## f ## _SHIFT, IF_ ## f ## _BITS)
148
149/* Sign-extend a field of width W */
150#define IF_SEXT(x, w) \
35 */
36
37#ifndef _MACHINE_INSTR_H_
38#define _MACHINE_INSTR_H_
39
40/*
41 * Definitions for all instruction formats
42 */

--- 100 unchanged lines hidden (view full) ---

143/* Extract a field */
144#define IF_MASK(s, w) (((1 << (w)) - 1) << (s))
145#define IF_EXTRACT(x, s, w) (((x) & IF_MASK((s), (w))) >> (s))
146#define IF_DECODE(x, f) \
147 IF_EXTRACT((x), IF_ ## f ## _SHIFT, IF_ ## f ## _BITS)
148
149/* Sign-extend a field of width W */
150#define IF_SEXT(x, w) \
151 (((x) & (1 << ((w) - 1))) != 0 ? (-1L - ((x) ^ ((1 << (w)) - 1))) : (x))
151 (((x) & (1L << ((w) - 1))) != 0 ? \
152 (-1L - ((x) ^ ((1L << (w)) - 1))) : (x))
152
153#if 0
154/*
155 * The following C variant is from db_disassemble.c, and surely faster, but it
156 * relies on behaviour that is undefined by the C standard (>> in conjunction
157 * with signed negative arguments).
158 */
159#define IF_SEXT(v, w) ((((long long)(v)) << (64 - w)) >> (64 - w))

--- 449 unchanged lines hidden ---
153
154#if 0
155/*
156 * The following C variant is from db_disassemble.c, and surely faster, but it
157 * relies on behaviour that is undefined by the C standard (>> in conjunction
158 * with signed negative arguments).
159 */
160#define IF_SEXT(v, w) ((((long long)(v)) << (64 - w)) >> (64 - w))

--- 449 unchanged lines hidden ---