OSDN Git Service

11fa739bbc9e0d71e9cdba25a9f954dad125434e
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / cgen-cpu / sh / sh2a-fpu-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 "sh2a_fpu.h"
14
15   template <typename ST> 
16   static void clear_stacks (ST &st)
17   {
18     for (int i = 0; i < sh2a_fpu::pipe_sz; i++)
19       st[i].clear();
20   }
21
22   void sh2a_fpu::write_stacks::reset ()
23   {
24     clear_stacks (h_pc_writes);
25     clear_stacks (h_pr_writes);
26   }
27   void sh2a_fpu::write_stacks::writeback (int tick, sh2a_fpu::sh2a_fpu_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   }