OSDN Git Service

Regenerate cgen files, update copyright year.
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / cgen-cpu / xstormy16 / xstormy16-cpu.h
1 /* CPU class elements for xstormy16.
2
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
4
5 Copyright (C) 2000-2010 Red Hat, Inc.
6
7 This file is part of the Red Hat simulators.
8
9
10 */
11
12 // This file is included in the middle of the cpu class struct.
13
14 public:
15
16 // CPU state information.
17
18   // Hardware elements.
19   struct {
20   /* program counter */
21   USI h_pc;
22   /* registers */
23   SI h_gr[16];
24   } hardware;
25
26   void stream_cgen_hardware (std::ostream &ost) const 
27   {
28     ost << hardware.h_pc << ' ';
29     for (int i = 0; i < 16; i++)
30       ost << hardware.h_gr[i] << ' ';
31   }
32   void destream_cgen_hardware (std::istream &ist) 
33   {
34     ist >> hardware.h_pc;
35     for (int i = 0; i < 16; i++)
36       ist >> hardware.h_gr[i];
37   }
38   // C++ register access function templates
39 #define current_cpu this
40
41   inline USI h_pc_get () const { return this->hardware.h_pc; }
42   inline void h_pc_set (USI newval) { current_cpu->h_pc_set_handler (newval);
43  }
44
45   inline SI h_gr_get (UINT regno) const { return ((65535) & (current_cpu->hardware.h_gr[regno])); }
46   inline void h_gr_set (UINT regno, SI newval) { current_cpu->h_gr_set_handler (regno, newval);
47  }
48
49   inline SI h_Rb_get (UINT regno) const { return current_cpu->h_gr_get (((regno) + (8))); }
50   inline void h_Rb_set (UINT regno, SI newval) { current_cpu->h_gr_set (((regno) + (8)), newval);
51  }
52
53   inline SI h_Rbj_get (UINT regno) const { return current_cpu->h_gr_get (((regno) + (8))); }
54   inline void h_Rbj_set (UINT regno, SI newval) { current_cpu->h_gr_set (((regno) + (8)), newval);
55  }
56
57   inline SI h_Rpsw_get () const { return ((15) & (SRLSI (current_cpu->h_gr_get (((UINT) 14)), 12))); }
58   inline void h_Rpsw_set (SI newval) { current_cpu->h_gr_set (((UINT) 14), ORSI (ANDSI (current_cpu->h_gr_get (((UINT) 14)), 4095), SLLHI (newval, 12)));
59  }
60
61   inline SI h_z8_get () const { return ((1) & (SRLSI (current_cpu->h_gr_get (((UINT) 14)), 0))); }
62   inline void h_z8_set (SI newval) { current_cpu->h_gr_set (((UINT) 14), ORSI (ANDSI (current_cpu->h_gr_get (((UINT) 14)), INVHI (SLLHI (1, 0))), SLLHI (newval, 0)));
63  }
64
65   inline SI h_z16_get () const { return ((1) & (SRLSI (current_cpu->h_gr_get (((UINT) 14)), 1))); }
66   inline void h_z16_set (SI newval) { current_cpu->h_gr_set (((UINT) 14), ORSI (ANDSI (current_cpu->h_gr_get (((UINT) 14)), INVHI (SLLHI (1, 1))), SLLHI (newval, 1)));
67  }
68
69   inline SI h_cy_get () const { return ((1) & (SRLSI (current_cpu->h_gr_get (((UINT) 14)), 2))); }
70   inline void h_cy_set (SI newval) { current_cpu->h_gr_set (((UINT) 14), ORSI (ANDSI (current_cpu->h_gr_get (((UINT) 14)), INVHI (SLLHI (1, 2))), SLLHI (newval, 2)));
71  }
72
73   inline SI h_hc_get () const { return ((1) & (SRLSI (current_cpu->h_gr_get (((UINT) 14)), 3))); }
74   inline void h_hc_set (SI newval) { current_cpu->h_gr_set (((UINT) 14), ORSI (ANDSI (current_cpu->h_gr_get (((UINT) 14)), INVHI (SLLHI (1, 3))), SLLHI (newval, 3)));
75  }
76
77   inline SI h_ov_get () const { return ((1) & (SRLSI (current_cpu->h_gr_get (((UINT) 14)), 4))); }
78   inline void h_ov_set (SI newval) { current_cpu->h_gr_set (((UINT) 14), ORSI (ANDSI (current_cpu->h_gr_get (((UINT) 14)), INVHI (SLLHI (1, 4))), SLLHI (newval, 4)));
79  }
80
81   inline SI h_pt_get () const { return ((1) & (SRLSI (current_cpu->h_gr_get (((UINT) 14)), 5))); }
82   inline void h_pt_set (SI newval) { current_cpu->h_gr_set (((UINT) 14), ORSI (ANDSI (current_cpu->h_gr_get (((UINT) 14)), INVHI (SLLHI (1, 5))), SLLHI (newval, 5)));
83  }
84
85   inline SI h_s_get () const { return ((1) & (SRLSI (current_cpu->h_gr_get (((UINT) 14)), 6))); }
86   inline void h_s_set (SI newval) { current_cpu->h_gr_set (((UINT) 14), ORSI (ANDSI (current_cpu->h_gr_get (((UINT) 14)), INVHI (SLLHI (1, 6))), SLLHI (newval, 6)));
87  }
88
89 #undef current_cpu
90