]> Git Repo - binutils.git/blob - sim/d30v/alu.h
Obsolete the d30v.
[binutils.git] / sim / d30v / alu.h
1 /* OBSOLETE /* Mitsubishi Electric Corp. D30V Simulator. */
2 /* OBSOLETE    Copyright (C) 1997, Free Software Foundation, Inc. */
3 /* OBSOLETE    Contributed by Cygnus Support. */
4 /* OBSOLETE  */
5 /* OBSOLETE This file is part of GDB, the GNU debugger. */
6 /* OBSOLETE  */
7 /* OBSOLETE This program is free software; you can redistribute it and/or modify */
8 /* OBSOLETE it under the terms of the GNU General Public License as published by */
9 /* OBSOLETE the Free Software Foundation; either version 2, or (at your option) */
10 /* OBSOLETE any later version. */
11 /* OBSOLETE  */
12 /* OBSOLETE This program is distributed in the hope that it will be useful, */
13 /* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
14 /* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the */
15 /* OBSOLETE GNU General Public License for more details. */
16 /* OBSOLETE  */
17 /* OBSOLETE You should have received a copy of the GNU General Public License along */
18 /* OBSOLETE with this program; if not, write to the Free Software Foundation, Inc., */
19 /* OBSOLETE 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */ */
20 /* OBSOLETE  */
21 /* OBSOLETE  */
22 /* OBSOLETE #ifndef _D30V_ALU_H_ */
23 /* OBSOLETE #define _D30V_ALU_H_ */
24 /* OBSOLETE  */
25 /* OBSOLETE #define ALU_CARRY (PSW_VAL(PSW_C) != 0) */
26 /* OBSOLETE  */
27 /* OBSOLETE #include "sim-alu.h" */
28 /* OBSOLETE  */
29 /* OBSOLETE #define ALU16_END(TARG, HIGH)                                               \ */
30 /* OBSOLETE {                                                                   \ */
31 /* OBSOLETE   unsigned32 mask, value;                                           \ */
32 /* OBSOLETE   if (ALU16_HAD_OVERFLOW) {                                         \ */
33 /* OBSOLETE     mask = BIT32 (PSW_V) | BIT32 (PSW_VA) | BIT32 (PSW_C);          \ */
34 /* OBSOLETE     value = BIT32 (PSW_V) | BIT32 (PSW_VA);                         \ */
35 /* OBSOLETE   }                                                                 \ */
36 /* OBSOLETE   else {                                                            \ */
37 /* OBSOLETE     mask = BIT32 (PSW_V) | BIT32 (PSW_C);                           \ */
38 /* OBSOLETE     value = 0;                                                              \ */
39 /* OBSOLETE   }                                                                 \ */
40 /* OBSOLETE   if (ALU16_HAD_CARRY_BORROW)                                               \ */
41 /* OBSOLETE     value |= BIT32 (PSW_C);                                         \ */
42 /* OBSOLETE   if (HIGH)                                                         \ */
43 /* OBSOLETE     WRITE32_QUEUE_MASK (TARG, ALU16_OVERFLOW_RESULT<<16, 0xffff0000);       \ */
44 /* OBSOLETE   else                                                                      \ */
45 /* OBSOLETE     WRITE32_QUEUE_MASK (TARG, ALU16_OVERFLOW_RESULT, 0x0000ffff);   \ */
46 /* OBSOLETE   WRITE32_QUEUE_MASK (&PSW, value, mask);                           \ */
47 /* OBSOLETE } */
48 /* OBSOLETE  */
49 /* OBSOLETE #define ALU32_END(TARG)                                                     \ */
50 /* OBSOLETE {                                                                   \ */
51 /* OBSOLETE   unsigned32 mask, value;                                           \ */
52 /* OBSOLETE   if (ALU32_HAD_OVERFLOW) {                                         \ */
53 /* OBSOLETE     mask = BIT32 (PSW_V) | BIT32 (PSW_VA) | BIT32 (PSW_C);          \ */
54 /* OBSOLETE     value = BIT32 (PSW_V) | BIT32 (PSW_VA);                         \ */
55 /* OBSOLETE   }                                                                 \ */
56 /* OBSOLETE   else {                                                            \ */
57 /* OBSOLETE     mask = BIT32 (PSW_V) | BIT32 (PSW_C);                           \ */
58 /* OBSOLETE     value = 0;                                                              \ */
59 /* OBSOLETE   }                                                                 \ */
60 /* OBSOLETE   if (ALU32_HAD_CARRY_BORROW)                                               \ */
61 /* OBSOLETE     value |= BIT32 (PSW_C);                                         \ */
62 /* OBSOLETE   WRITE32_QUEUE (TARG, ALU32_OVERFLOW_RESULT);                              \ */
63 /* OBSOLETE   WRITE32_QUEUE_MASK (&PSW, value, mask);                           \ */
64 /* OBSOLETE } */
65 /* OBSOLETE  */
66 /* OBSOLETE #define ALU_END(TARG) ALU32_END(TARG) */
67 /* OBSOLETE  */
68 /* OBSOLETE  */
69 /* OBSOLETE /* PSW & Flag manipulation */ */
70 /* OBSOLETE  */
71 /* OBSOLETE #define PSW_SET(BIT,VAL) BLIT32(PSW, (BIT), (VAL)) */
72 /* OBSOLETE #define PSW_VAL(BIT) EXTRACTED32(PSW, (BIT), (BIT)) */
73 /* OBSOLETE  */
74 /* OBSOLETE #define PSW_F(FLAG) (17 + ((FLAG) % 8) * 2) */
75 /* OBSOLETE #define PSW_FLAG_SET(FLAG,VAL) PSW_SET(PSW_F(FLAG), VAL) */
76 /* OBSOLETE #define PSW_FLAG_VAL(FLAG) PSW_VAL(PSW_F(FLAG)) */
77 /* OBSOLETE  */
78 /* OBSOLETE #define PSW_SET_QUEUE(BIT,VAL)                                              \ */
79 /* OBSOLETE do {                                                                        \ */
80 /* OBSOLETE   unsigned32 mask = BIT32 (BIT);                                    \ */
81 /* OBSOLETE   unsigned32 bitval = (VAL) ? mask : 0;                                     \ */
82 /* OBSOLETE   WRITE32_QUEUE_MASK (&PSW, bitval, mask);                          \ */
83 /* OBSOLETE } while (0) */
84 /* OBSOLETE  */
85 /* OBSOLETE #define PSW_FLAG_SET_QUEUE(FLAG,VAL)                                        \ */
86 /* OBSOLETE do {                                                                        \ */
87 /* OBSOLETE   unsigned32 mask = BIT32 (PSW_F (FLAG));                           \ */
88 /* OBSOLETE   unsigned32 bitval = (VAL) ? mask : 0;                                     \ */
89 /* OBSOLETE   WRITE32_QUEUE_MASK (&PSW, bitval, mask);                          \ */
90 /* OBSOLETE } while (0) */
91 /* OBSOLETE  */
92 /* OBSOLETE /* Bring data in from the cold */ */
93 /* OBSOLETE  */
94 /* OBSOLETE #define IMEM(EA) \ */
95 /* OBSOLETE (sim_core_read_8(STATE_CPU (sd, 0), cia, exec_map, (EA))) */
96 /* OBSOLETE  */
97 /* OBSOLETE #define MEM(SIGN, EA, NR_BYTES) \ */
98 /* OBSOLETE ((SIGN##_##NR_BYTES) sim_core_read_unaligned_##NR_BYTES(STATE_CPU (sd, 0), cia, read_map, (EA))) */
99 /* OBSOLETE  */
100 /* OBSOLETE #define STORE(EA, NR_BYTES, VAL) \ */
101 /* OBSOLETE do { \ */
102 /* OBSOLETE   sim_core_write_unaligned_##NR_BYTES(STATE_CPU (sd, 0), cia, write_map, (EA), (VAL)); \ */
103 /* OBSOLETE } while (0) */
104 /* OBSOLETE  */
105 /* OBSOLETE  */
106 /* OBSOLETE #endif */
This page took 0.0301 seconds and 4 git commands to generate.