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