Skip to content

Commit ac1e9ec

Browse files
committed
cpu/
* m32c.opc (opc.h): cgen-types.h -> cgen/basic-modes.h. cgen-ops.h -> cgen/basic-ops.h. include/opcode/ * cgen-bitset.h: Delete, moved to ../cgen/bitset.h. * cgen.h: Update. Improve multi-inclusion macro name. include/cgen/ * basic-modes.h: New file. Moved here from opcodes/cgen-types.h. * basic-ops.h: New file. Moved here from opcodes/cgen-ops.h. * bitset.h: New file. Moved here from ../opcode/cgen-bitset.h. Update license to GPL v3. opcodes/ * cgen-ops.h: Delete, moved to ../include/cgen/basic-ops.h. * cgen-types.h: Delete, moved to ../include/cgen/basic-modes.h. * cgen-bitset.c: Update. * fr30-desc.h: Regenerate. * frv-desc.h: Regenerate. * ip2k-desc.h: Regenerate. * iq2000-desc.h: Regenerate. * lm32-desc.h: Regenerate. * m32c-desc.h: Regenerate. * m32c-opc.h: Regenerate. * m32r-desc.h: Regenerate. * mep-desc.h: Regenerate. * mt-desc.h: Regenerate. * openrisc-desc.h: Regenerate. * xc16x-desc.h: Regenerate. * xstormy16-desc.h: Regenerate.
1 parent 3f67a01 commit ac1e9ec

24 files changed

Lines changed: 131 additions & 195 deletions

‎cpu/ChangeLog‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2009-10-23 Doug Evans <dje@sebabeach.org>
2+
3+
* m32c.opc (opc.h): cgen-types.h -> cgen/basic-modes.h.
4+
cgen-ops.h -> cgen/basic-ops.h.
5+
16
2009-09-25 Alan Modra <amodra@bigpond.net.au>
27

38
* m32r.cpu (stb-plus): Typo fix.

‎cpu/m32c.opc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
/* -- opc.h */
4141

4242
/* Needed for RTL's 'ext' and 'trunc' operators. */
43-
#include "cgen-types.h"
44-
#include "cgen-ops.h"
43+
#include "cgen/basic-modes.h"
44+
#include "cgen/basic-ops.h"
4545

4646
/* We can't use the default hash size because many bits are used by
4747
operands. */

‎include/cgen/ChangeLog‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2009-10-23 Doug Evans <dje@sebabeach.org>
2+
3+
* basic-modes.h: New file. Moved here from opcodes/cgen-types.h.
4+
* basic-ops.h: New file. Moved here from opcodes/cgen-ops.h.
5+
* bitset.h: New file. Moved here from ../opcode/cgen-bitset.h.
6+
Update license to GPL v3.

‎include/cgen/basic-modes.h‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/* Basic CGEN modes.
2+
Copyright 2005, 2007, 2009 Free Software Foundation, Inc.
3+
Contributed by Red Hat.
4+
5+
This file is part of the GNU opcodes library.
6+
7+
This library is free software; you can redistribute it and/or modify
8+
it under the terms of the GNU General Public License as published by
9+
the Free Software Foundation; either version 3, or (at your option)
10+
any later version.
11+
12+
It is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License for more details.
16+
17+
You should have received a copy of the GNU General Public License
18+
along with this library; see the file COPYING3. If not, write to the
19+
Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
20+
02110-1301, USA. */
21+
22+
#ifndef CGEN_BASIC_MODES_H
23+
#define CGEN_BASIC_MODES_H
24+
25+
/* This file doesn't contain all modes,
26+
just the basic/portable ones.
27+
It also provides access to stdint.h (*1) so the includer doesn't have
28+
to deal with the portability issues.
29+
(*1): To the extent that bfd_stdint.h does for now. */
30+
31+
/* IWBN to avoid unnecessary dependencies on bfd-anything. */
32+
#include "bfd_stdint.h"
33+
34+
typedef int8_t QI;
35+
typedef uint8_t UQI;
36+
37+
typedef int16_t HI;
38+
typedef uint16_t UHI;
39+
40+
typedef int32_t SI;
41+
typedef uint32_t USI;
42+
43+
typedef int64_t DI;
44+
typedef uint64_t UDI;
45+
46+
typedef int INT;
47+
typedef unsigned int UINT;
48+
49+
#endif /* CGEN_BASIC_MODES_H */
Lines changed: 20 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
/* Semantics ops support for CGEN-based opcode libraries.
2-
Copyright (C) 2005, 2007 Free Software Foundation, Inc.
1+
/* Basic semantics ops support for CGEN.
2+
Copyright 2005, 2007, 2009 Free Software Foundation, Inc.
33
Contributed by Red Hat.
44
55
This file is part of the GNU opcodes library.
66
7-
This program is free software; you can redistribute it and/or modify
7+
This library is free software; you can redistribute it and/or modify
88
it under the terms of the GNU General Public License as published by
99
the Free Software Foundation; either version 3, or (at your option)
1010
any later version.
1111
12-
It is distributed in the hope that it will be useful, but WITHOUT
13-
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14-
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15-
License for more details.
12+
It is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License for more details.
1616
17-
You should have received a copy of the GNU General Public License along
18-
with this program; if not, write to the Free Software Foundation, Inc.,
19-
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
17+
You should have received a copy of the GNU General Public License
18+
along with this library; see the file COPYING3. If not, write to the
19+
Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
20+
02110-1301, USA. */
2021

21-
#ifndef CGEN_SEM_OPS_H
22-
#define CGEN_SEM_OPS_H
22+
#ifndef CGEN_BASIC_OPS_H
23+
#define CGEN_BASIC_OPS_H
2324

2425
#include <assert.h>
2526

@@ -30,8 +31,6 @@
3031
#define SEMOPS_INLINE
3132
#endif
3233

33-
/* TODO: Lazy encoding/decoding of fp values. */
34-
3534
/* These don't really have a mode. */
3635
#define ANDIF(x, y) ((x) && (y))
3736
#define ORIF(x, y) ((x) || (y))
@@ -298,50 +297,26 @@ extern SI TRUNCDISI (DI);
298297

299298
QI SUBWORDSIQI (SI, int);
300299
HI SUBWORDSIHI (SI, int);
301-
SI SUBWORDSFSI (SF);
302-
SF SUBWORDSISF (SI);
303-
DI SUBWORDDFDI (DF);
304-
DF SUBWORDDIDF (DI);
305300
QI SUBWORDDIQI (DI, int);
306301
HI SUBWORDDIHI (DI, int);
307302
SI SUBWORDDISI (DI, int);
308-
SI SUBWORDDFSI (DF, int);
309-
SI SUBWORDXFSI (XF, int);
310-
SI SUBWORDTFSI (TF, int);
311-
312-
UQI SUBWORDSIUQI (SI, int);
313-
UQI SUBWORDDIUQI (DI, int);
314303

315304
#ifdef SEMOPS_DEFINE_INLINE
316305

317-
SEMOPS_INLINE SF
318-
SUBWORDSISF (SI in)
319-
{
320-
union { SI in; SF out; } x;
321-
x.in = in;
322-
return x.out;
323-
}
324-
325-
SEMOPS_INLINE DF
326-
SUBWORDDIDF (DI in)
327-
{
328-
union { DI in; DF out; } x;
329-
x.in = in;
330-
return x.out;
331-
}
332-
333306
SEMOPS_INLINE QI
334307
SUBWORDSIQI (SI in, int byte)
335308
{
336309
assert (byte >= 0 && byte <= 3);
337310
return (UQI) (in >> (8 * (3 - byte))) & 0xFF;
338311
}
339312

340-
SEMOPS_INLINE UQI
341-
SUBWORDSIUQI (SI in, int byte)
313+
SEMOPS_INLINE HI
314+
SUBWORDSIHI (SI in, int word)
342315
{
343-
assert (byte >= 0 && byte <= 3);
344-
return (UQI) (in >> (8 * (3 - byte))) & 0xFF;
316+
if (word == 0)
317+
return (USI) in >> 16;
318+
else
319+
return in;
345320
}
346321

347322
SEMOPS_INLINE QI
@@ -358,38 +333,6 @@ SUBWORDDIHI (DI in, int word)
358333
return (UHI) (in >> (16 * (3 - word))) & 0xFFFF;
359334
}
360335

361-
SEMOPS_INLINE HI
362-
SUBWORDSIHI (SI in, int word)
363-
{
364-
if (word == 0)
365-
return (USI) in >> 16;
366-
else
367-
return in;
368-
}
369-
370-
SEMOPS_INLINE SI
371-
SUBWORDSFSI (SF in)
372-
{
373-
union { SF in; SI out; } x;
374-
x.in = in;
375-
return x.out;
376-
}
377-
378-
SEMOPS_INLINE DI
379-
SUBWORDDFDI (DF in)
380-
{
381-
union { DF in; DI out; } x;
382-
x.in = in;
383-
return x.out;
384-
}
385-
386-
SEMOPS_INLINE UQI
387-
SUBWORDDIUQI (DI in, int byte)
388-
{
389-
assert (byte >= 0 && byte <= 7);
390-
return (UQI) (in >> (8 * (7 - byte)));
391-
}
392-
393336
SEMOPS_INLINE SI
394337
SUBWORDDISI (DI in, int word)
395338
{
@@ -399,34 +342,6 @@ SUBWORDDISI (DI in, int word)
399342
return in;
400343
}
401344

402-
SEMOPS_INLINE SI
403-
SUBWORDDFSI (DF in, int word)
404-
{
405-
/* Note: typedef UDI DF; */
406-
if (word == 0)
407-
return (UDI) in >> 32;
408-
else
409-
return in;
410-
}
411-
412-
SEMOPS_INLINE SI
413-
SUBWORDXFSI (XF in, int word)
414-
{
415-
/* Note: typedef struct { SI parts[3]; } XF; */
416-
union { XF in; SI out[3]; } x;
417-
x.in = in;
418-
return x.out[word];
419-
}
420-
421-
SEMOPS_INLINE SI
422-
SUBWORDTFSI (TF in, int word)
423-
{
424-
/* Note: typedef struct { SI parts[4]; } TF; */
425-
union { TF in; SI out[4]; } x;
426-
x.in = in;
427-
return x.out[word];
428-
}
429-
430345
#endif /* SUBWORD,JOIN */
431346

432-
#endif /* CGEN_SEM_OPS_H */
347+
#endif /* CGEN_BASIC_OPS_H */
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
/* Header file the type CGEN_BITSET.
2+
Copyright 2002, 2005, 2009 Free Software Foundation, Inc.
23
3-
Copyright 2002, 2005 Free Software Foundation, Inc.
4+
This file is part of the GNU opcodes library.
45
5-
This file is part of GDB, the GNU debugger, and the GNU Binutils.
6+
This library is free software; you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation; either version 3, or (at your option)
9+
any later version.
610
7-
This program is free software; you can redistribute it and/or modify
8-
it under the terms of the GNU General Public License as published by
9-
the Free Software Foundation; either version 2 of the License, or
10-
(at your option) any later version.
11+
It is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
1115
12-
This program is distributed in the hope that it will be useful,
13-
but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
GNU General Public License for more details.
16+
You should have received a copy of the GNU General Public License
17+
along with this library; see the file COPYING3. If not, write to the
18+
Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
19+
02110-1301, USA. */
1620

17-
You should have received a copy of the GNU General Public License along
18-
with this program; if not, write to the Free Software Foundation, Inc.,
19-
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2021
#ifndef CGEN_BITSET_H
2122
#define CGEN_BITSET_H
2223

‎include/opcode/ChangeLog‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2009-10-23 Doug Evans <dje@sebabeach.org>
2+
3+
* cgen-bitset.h: Delete, moved to ../cgen/bitset.h.
4+
* cgen.h: Update. Improve multi-inclusion macro name.
5+
16
2009-10-02 Peter Bergner <bergner@vnet.ibm.com>
27

38
* ppc.h (PPC_OPCODE_476): Define.

‎include/opcode/cgen.h‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Header file for targets using CGEN: Cpu tools GENerator.
22
3-
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005
3+
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2009
44
Free Software Foundation, Inc.
55
66
This file is part of GDB, the GNU debugger, and the GNU Binutils.
@@ -19,11 +19,12 @@ You should have received a copy of the GNU General Public License along
1919
with this program; if not, write to the Free Software Foundation, Inc.,
2020
51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
2121

22-
#ifndef CGEN_H
23-
#define CGEN_H
22+
#ifndef OPCODE_CGEN_H
23+
#define OPCODE_CGEN_H
2424

2525
#include "symcat.h"
26-
#include "cgen-bitset.h"
26+
#include "cgen/bitset.h"
27+
2728
/* ??? This file requires bfd.h but only to get bfd_vma.
2829
Seems like an awful lot to require just to get such a fundamental type.
2930
Perhaps the definition of bfd_vma can be moved outside of bfd.h.
@@ -1470,4 +1471,4 @@ extern void cgen_clear_signed_overflow_ok (CGEN_CPU_DESC);
14701471
/* Will an error message be generated if a signed field in an instruction overflows ? */
14711472
extern unsigned int cgen_signed_overflow_ok_p (CGEN_CPU_DESC);
14721473

1473-
#endif /* CGEN_H */
1474+
#endif /* OPCODE_CGEN_H */

‎opcodes/ChangeLog‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
2009-10-23 Doug Evans <dje@sebabeach.org>
2+
3+
* cgen-ops.h: Delete, moved to ../include/cgen/basic-ops.h.
4+
* cgen-types.h: Delete, moved to ../include/cgen/basic-modes.h.
5+
* cgen-bitset.c: Update.
6+
* fr30-desc.h: Regenerate.
7+
* frv-desc.h: Regenerate.
8+
* ip2k-desc.h: Regenerate.
9+
* iq2000-desc.h: Regenerate.
10+
* lm32-desc.h: Regenerate.
11+
* m32c-desc.h: Regenerate.
12+
* m32c-opc.h: Regenerate.
13+
* m32r-desc.h: Regenerate.
14+
* mep-desc.h: Regenerate.
15+
* mt-desc.h: Regenerate.
16+
* openrisc-desc.h: Regenerate.
17+
* xc16x-desc.h: Regenerate.
18+
* xstormy16-desc.h: Regenerate.
19+
120
2009-10-22 DJ Delorie <dj@redhat.com>
221

322
* rx-decode.opc (decode_opcode): Fix flags for MUL, SUNTIL, and SWHILE.

‎opcodes/cgen-bitset.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* CGEN generic opcode support.
2-
Copyright 2002, 2005, 2007
2+
Copyright 2002, 2005, 2007, 2009
33
Free Software Foundation, Inc.
44
55
This file is part of libopcodes.
@@ -21,10 +21,11 @@
2121
/* Functions for manipulating CGEN_BITSET. */
2222

2323
#include "libiberty.h"
24-
#include "opcode/cgen-bitset.h"
24+
#include "cgen/bitset.h"
2525
#include <string.h>
2626

2727
/* Create a bit mask. */
28+
2829
CGEN_BITSET *
2930
cgen_bitset_create (unsigned bit_count)
3031
{

0 commit comments

Comments
 (0)