OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [binutils-2.18.50/] [gas/] [testsuite/] [gas/] [ia64/] [regs.pl] - Blame information for rev 156

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
print ".text\n";
2
print "\t.type _start,@","function\n";
3
print "_start:\n\n";
4
 
5
print "// Fixed and stacked integer registers.\n";
6
for ($i = 1; $i < 128; ++$i) {
7
  print "\t{ .mii; mov r$i = r0; nop.i 0; nop.i 0;; }\n";
8
}
9
print "\n";
10
 
11
print "// Alternate names for input registers\n";
12
print "\t.regstk 96, 0, 0, 0\n";
13
for ($i = 0; $i < 96; ++$i) {
14
  print "\t{ .mii; mov in$i = r0; nop.i 0; nop.i 0;; }\n";
15
}
16
print "\n";
17
 
18
print "// Alternate names for output registers\n";
19
print "\t.regstk 0, 0, 96, 0\n";
20
for ($i = 0; $i < 96; ++$i) {
21
  print "\t{ .mii; mov out$i = r0; nop.i 0; nop.i 0;; }\n";
22
}
23
print "\n";
24
 
25
print "// Alternate names for local registers\n";
26
print "\t.regstk 0, 96, 0, 0\n";
27
for ($i = 0; $i < 96; ++$i) {
28
  print "\t{ .mii; mov loc$i = r0; nop.i 0; nop.i 0;; }\n";
29
}
30
print "\n";
31
 
32
print "// Return value registers\n";
33
for ($i = 0; $i < 4; ++$i) {
34
  print "\t{ .mii; mov ret$i = r0; nop.i 0; nop.i 0;; }\n";
35
}
36
print "\n";
37
 
38
print "\t{ .mii;\n";
39
print "\tmov gp = r0\n";
40
print "\tmov sp = r0\n";
41
print "\tmov tp = r0;; }\n\n";
42
 
43
print "// Floating point registers\n";
44
for ($i = 2; $i < 128; ++$i) {
45
  print "\t{ .mfi; mov f$i = f0 ;; }\n";
46
}
47
print "\n";
48
 
49
print "// Floating point argument registers\n";
50
for ($i = 0; $i < 8; ++$i) {
51
  print "\t{ .mfi; mov farg$i = f1 ;; }\n";
52
}
53
print "\n";
54
 
55
print "// Floating point return value registers\n";
56
for ($i = 0; $i < 8; ++$i) {
57
  print "\t{ .mfi; mov fret$i = f1 ;; }\n";
58
}
59
print "\n";
60
 
61
print "// Predicate registers\n";
62
for ($i = 0; $i < 64; ++$i) {
63
  print "\t{ .mii; (p$i)\tmov r", $i+1, " = r0; nop.i 0; nop.i 0;; }\n";
64
}
65
print "\n";
66
 
67
print "// Predicates as a unit\n";
68
print "\t{ .mmi; nop.m 0; mov r1 = pr ;; }\n";
69
print "//\tmov r2 = pr.rot\n";
70
print "\n";
71
 
72
print "// Branch registers.\n";
73
for ($i = 0; $i < 8; ++$i) {
74
  print "\t{ .mmi; mov b$i = r0;; }\n";
75
}
76
print "\n";
77
 
78
print "\t{ .mmi; mov rp = r0;; }\n";
79
print "\n";
80
 
81
print "// Application registers\n";
82
@reserved = ( 8..15, 20, 22..23, 31, 33..35, 37..39, 41..47, 67..111 );
83
%reserved = ();
84
foreach $i (@reserved) {
85
  $reserved{$i} = 1;
86
}
87
for ($i = 0; $i < 128; ++$i) {
88
  print "//" if $reserved{$i};
89
  print "\t{ .mmi; nop.m 0; mov r1 = ar$i ;; }";
90
  print "\t\t// reserved" if $reserved{$i};
91
  print "\n";
92
}
93
print "\n";
94
 
95
print "// Application registers by name\n";
96
for ($i = 0; $i < 8; ++$i) {
97
  print "\t{ .mmi; nop.m 0; mov r1 = ar.k$i ;;}\n";
98
}
99
 
100
@regs = ( "rsc", "bsp", "bspstore", "rnat", "ccv", "unat", "fpsr", "itc",
101
          "pfs", "lc", "ec" );
102
foreach $i (@regs) {
103
  print "\t{ .mmi; nop.m 0; mov r1 = ar.$i ;; }\n";
104
}
105
print "\n";
106
 
107
print "// Control registers\n";
108
@reserved = ( 3..7, 10..15, 18, 26..63, 75..79, 82..127 );
109
%reserved = ();
110
foreach $i (@reserved) {
111
  $reserved{$i} = 1;
112
}
113
for ($i = 0; $i < 128; ++$i) {
114
  print "//" if $reserved{$i};
115
  print "\t{ .mfb; mov r1 = cr$i ;; }";
116
  print "\t\t// reserved" if $reserved{$i};
117
  print "\n";
118
}
119
print "\n";
120
 
121
print "// Control registers by name\n";
122
@regs = ( "dcr", "itm", "iva", "pta", "ipsr", "isr", "iip",
123
          "iipa", "ifs", "iim", "iha", "lid", "ivr",
124
          "tpr", "eoi", "irr0", "irr1", "irr2", "irr3", "itv", "pmv",
125
          "lrr0", "lrr1", "cmcv" );
126
# ias doesn't accept these, despite documentation to the contrary.
127
# push @regs, "ida", "idtr", "iitr"
128
foreach $i (@regs) {
129
  print "\t{ .mfb; mov r1 = cr.$i ;; }\n";
130
}
131
print "\n";
132
 
133
 
134
print "// Other registers\n";
135
print "\t{ .mfb; mov r1 = psr ;; }\n";
136
print "//\t{ .mfb; mov r1 = psr.l ;; }\n";
137
print "\t{ .mfb; mov r1 = psr.um ;; }\n";
138
print "\t{ .mmi; mov r1 = ip ;; }\n";
139
print "\n";
140
 
141
print "// Indirect register files\n";
142
@regs = ("pmc", "pmd", "pkr", "rr", "ibr", "dbr", "CPUID", "cpuid");
143
# ias doesn't accept these, despite documentation to the contrary.
144
# push @regs, "itr", "dtr";
145
foreach $i (@regs) {
146
  print "\t{ .mmi\n";
147
  print "\tmov r1 = ${i}[r3]\n";
148
  print "\tmov r2 = ${i}[r4]\n";
149
  print "\tnop.i 0;; }\n";
150
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.