OSDN Git Service

2b162bfcbc5ab3f910bcf0772232c08eb02f676d
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / cgen-cpu / sh / sh5-compact-write.cxx
1 /* Simulator instruction operand writer for sh.
2
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
4
5 Copyright (C) 2000-2009 Red Hat, Inc.
6
7 This file is part of the Red Hat simulators.
8
9
10 */
11
12
13 #include "sh5.h"
14
15   template <typename ST> 
16   static void clear_stacks (ST &st)
17   {
18     for (int i = 0; i < sh5_compact::pipe_sz; i++)
19       st[i].clear();
20   }
21
22   void sh5_compact::write_stacks::reset ()
23   {
24     clear_stacks (h_pc_writes);
25     clear_stacks (h_pr_writes);
26   }
27   void sh5_compact::write_stacks::writeback (int tick, sh5::sh5_cpu* current_cpu) 
28   {
29
30     // register writeback loops
31     while (! h_pc_writes[tick].empty())
32     {
33       write<UDI> &w = h_pc_writes[tick].top();
34       current_cpu->h_pc_set(w.val);
35       h_pc_writes[tick].pop();
36     }
37
38     while (! h_pr_writes[tick].empty())
39     {
40       write<SI> &w = h_pr_writes[tick].top();
41       current_cpu->h_pr_set(w.val);
42       h_pr_writes[tick].pop();
43     }
44
45
46     // memory writeback loops
47
48   }