xref: /openbsd-src/gnu/usr.bin/binutils-2.17/gas/bit_fix.h (revision 3d8817e467ea46cf4772788d6804dd293abfb01a)
1*3d8817e4Smiod /* bit_fix.h
2*3d8817e4Smiod    Copyright 1987, 1992, 2000, 2001, 2003 Free Software Foundation, Inc.
3*3d8817e4Smiod 
4*3d8817e4Smiod    This file is part of GAS, the GNU Assembler.
5*3d8817e4Smiod 
6*3d8817e4Smiod    GAS is free software; you can redistribute it and/or modify
7*3d8817e4Smiod    it under the terms of the GNU General Public License as published by
8*3d8817e4Smiod    the Free Software Foundation; either version 2, or (at your option)
9*3d8817e4Smiod    any later version.
10*3d8817e4Smiod 
11*3d8817e4Smiod    GAS is distributed in the hope that it will be useful,
12*3d8817e4Smiod    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*3d8817e4Smiod    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*3d8817e4Smiod    GNU General Public License for more details.
15*3d8817e4Smiod 
16*3d8817e4Smiod    You should have received a copy of the GNU General Public License
17*3d8817e4Smiod    along with GAS; see the file COPYING.  If not, write to the Free
18*3d8817e4Smiod    Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
19*3d8817e4Smiod    02110-1301, USA.  */
20*3d8817e4Smiod 
21*3d8817e4Smiod /* The bit_fix was implemented to support machines that need variables
22*3d8817e4Smiod    to be inserted in bitfields other than 1, 2 and 4 bytes.
23*3d8817e4Smiod    Furthermore it gives us a possibility to mask in bits in the symbol
24*3d8817e4Smiod    when it's fixed in the objectcode and check the symbols limits.
25*3d8817e4Smiod 
26*3d8817e4Smiod    The or-mask is used to set the huffman bits in displacements for the
27*3d8817e4Smiod    ns32k port.
28*3d8817e4Smiod    The acbi, addqi, movqi, cmpqi instruction requires an assembler that
29*3d8817e4Smiod    can handle bitfields.  Ie. handle an expression, evaluate it and insert
30*3d8817e4Smiod    the result in some bitfield.  (eg: 5 bits in a short field of an opcode)
31*3d8817e4Smiod    */
32*3d8817e4Smiod 
33*3d8817e4Smiod #ifndef __bit_fix_h__
34*3d8817e4Smiod #define __bit_fix_h__
35*3d8817e4Smiod 
36*3d8817e4Smiod struct bit_fix {
37*3d8817e4Smiod   int fx_bit_size;		/* Length of bitfield */
38*3d8817e4Smiod   int fx_bit_offset;		/* Bit offset to bitfield */
39*3d8817e4Smiod   long fx_bit_base;		/* Where do we apply the bitfix.
40*3d8817e4Smiod 				   If this is zero, default is assumed.  */
41*3d8817e4Smiod   long fx_bit_base_adj;		/* Adjustment of base */
42*3d8817e4Smiod   long fx_bit_max;		/* Signextended max for bitfield */
43*3d8817e4Smiod   long fx_bit_min;		/* Signextended min for bitfield */
44*3d8817e4Smiod   long fx_bit_add;		/* Or mask, used for huffman prefix */
45*3d8817e4Smiod };
46*3d8817e4Smiod typedef struct bit_fix bit_fixS;
47*3d8817e4Smiod 
48*3d8817e4Smiod #endif /* __bit_fix_h__ */
49