comparison graal/Compiler/src/com/sun/c1x/target/sparc/SPARC.java @ 2507:9ec15d6914ca

Pull over of compiler from maxine repository.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 27 Apr 2011 11:43:22 +0200
parents
children
comparison
equal deleted inserted replaced
2506:4a3bf8a5bf41 2507:9ec15d6914ca
1 /*
2 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23 package com.sun.c1x.target.sparc;
24
25 import static com.sun.cri.bytecode.Bytecodes.MemoryBarriers.*;
26 import static com.sun.cri.ci.CiRegister.RegisterFlag.*;
27
28 import com.sun.cri.ci.*;
29
30 /**
31 * Represents the SPARC architecture.
32 *
33 * @author Thomas Wuerthinger
34 */
35 public class SPARC extends CiArchitecture {
36
37 // General purpose CPU registers
38 public static final CiRegister g0 = new CiRegister(0, 0, 8, "g0", CPU);
39 public static final CiRegister g1 = new CiRegister(1, 1, 8, "g1", CPU);
40 public static final CiRegister g2 = new CiRegister(2, 2, 8, "g2", CPU);
41 public static final CiRegister g3 = new CiRegister(3, 3, 8, "g3", CPU);
42 public static final CiRegister g4 = new CiRegister(4, 4, 8, "g4", CPU);
43 public static final CiRegister g5 = new CiRegister(5, 5, 8, "g5", CPU);
44 public static final CiRegister g6 = new CiRegister(6, 6, 8, "g6", CPU);
45 public static final CiRegister g7 = new CiRegister(7, 7, 8, "g7", CPU);
46
47 public static final CiRegister o0 = new CiRegister(8, 8, 8, "o0", CPU);
48 public static final CiRegister o1 = new CiRegister(9, 9, 8, "o1", CPU);
49 public static final CiRegister o2 = new CiRegister(10, 10, 8, "o2", CPU);
50 public static final CiRegister o3 = new CiRegister(11, 11, 8, "o3", CPU);
51 public static final CiRegister o4 = new CiRegister(12, 12, 8, "o4", CPU);
52 public static final CiRegister o5 = new CiRegister(13, 13, 8, "o5", CPU);
53 public static final CiRegister o6 = new CiRegister(14, 14, 8, "o6", CPU);
54 public static final CiRegister o7 = new CiRegister(15, 15, 8, "o7", CPU);
55
56 public static final CiRegister l0 = new CiRegister(16, 16, 8, "l0", CPU);
57 public static final CiRegister l1 = new CiRegister(17, 17, 8, "l1", CPU);
58 public static final CiRegister l2 = new CiRegister(18, 18, 8, "l2", CPU);
59 public static final CiRegister l3 = new CiRegister(19, 19, 8, "l3", CPU);
60 public static final CiRegister l4 = new CiRegister(20, 20, 8, "l4", CPU);
61 public static final CiRegister l5 = new CiRegister(21, 21, 8, "l5", CPU);
62 public static final CiRegister l6 = new CiRegister(22, 22, 8, "l6", CPU);
63 public static final CiRegister l7 = new CiRegister(23, 23, 8, "l7", CPU);
64
65 public static final CiRegister i0 = new CiRegister(24, 24, 8, "i0", CPU);
66 public static final CiRegister i1 = new CiRegister(25, 25, 8, "i1", CPU);
67 public static final CiRegister i2 = new CiRegister(26, 26, 8, "i2", CPU);
68 public static final CiRegister i3 = new CiRegister(27, 27, 8, "i3", CPU);
69 public static final CiRegister i4 = new CiRegister(28, 28, 8, "i4", CPU);
70 public static final CiRegister i5 = new CiRegister(29, 29, 8, "i5", CPU);
71 public static final CiRegister i6 = new CiRegister(30, 30, 8, "i6", CPU);
72 public static final CiRegister i7 = new CiRegister(31, 31, 8, "i7", CPU);
73
74 public static final CiRegister[] cpuRegisters = {
75 g0, g1, g2, g3, g4, g5, g6, g7,
76 o0, o1, o2, o3, o4, o5, o6, o7,
77 l0, l1, l2, l3, l4, l5, l6, l7,
78 i0, i1, i2, i3, i4, i5, i6, i7
79 };
80
81 protected SPARC(int wordSize, CiRegister[] registers) {
82 super("SPARC",
83 wordSize,
84 ByteOrder.BigEndian,
85 registers,
86 LOAD_LOAD | LOAD_STORE | STORE_STORE,
87 0,
88 i7.encoding + 1,
89 0);
90 }
91
92 @Override
93 public boolean isSPARC() {
94 return true;
95 }
96
97 }