1 /* CPU class elements for xstormy16.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright (C) 2000-2009 Red Hat, Inc.
7 This file is part of the Red Hat simulators.
12 // This file is included in the middle of the cpu class struct.
16 // CPU state information.
26 void stream_cgen_hardware (std::ostream &ost) const
28 ost << hardware.h_pc << ' ';
29 for (int i = 0; i < 16; i++)
30 ost << hardware.h_gr[i] << ' ';
32 void destream_cgen_hardware (std::istream &ist)
35 for (int i = 0; i < 16; i++)
36 ist >> hardware.h_gr[i];
38 // C++ register access function templates
39 #define current_cpu this
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);
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);
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);
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);
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)));
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)));
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)));
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)));
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)));
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)));
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)));
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)));