annotate graal/com.oracle.graal.hsail/src/com/oracle/graal/hsail/HSAIL.java @ 13766:1a81855dae10

removed unused PTX code
author Doug Simon <doug.simon@oracle.com>
date Mon, 27 Jan 2014 15:49:33 +0100
parents 343541fb3b49
children 82e4fe6fa525
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 /*
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 *
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 *
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 * accompanied this code).
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 *
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 *
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 * questions.
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 */
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23 package com.oracle.graal.hsail;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
25 import static com.oracle.graal.api.code.ValueUtil.*;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
26
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
27 import java.nio.*;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
28
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
29 import com.oracle.graal.api.code.*;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
30 import com.oracle.graal.api.code.Register.RegisterCategory;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
31 import com.oracle.graal.api.meta.*;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
32
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
33 /**
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
34 * Represents the HSAIL architecture.
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
35 */
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
36 public class HSAIL extends Architecture {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
37
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
38 public static final RegisterCategory CPU = new RegisterCategory("CPU");
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
39 public static final RegisterCategory FPU = new RegisterCategory("FPU");
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
40
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
41 // Control registers.
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
42 public static final Register c0 = new Register(0, 0, "c0", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
43 public static final Register c1 = new Register(1, 1, "c1", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
44 public static final Register c2 = new Register(2, 2, "c2", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
45 public static final Register c3 = new Register(3, 3, "c3", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
46 public static final Register c4 = new Register(4, 4, "c4", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
47 public static final Register c5 = new Register(5, 5, "c5", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
48 public static final Register c6 = new Register(6, 6, "c6", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
49 public static final Register c7 = new Register(7, 7, "c7", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
50
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
51 // 32 bit registers.
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
52 public static final Register s0 = new Register(8, 0, "s0", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
53 public static final Register s1 = new Register(9, 1, "s1", CPU);
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
54 public static final Register s2 = new Register(10, 2, "s2", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
55 public static final Register s3 = new Register(11, 3, "s3", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
56 public static final Register s4 = new Register(12, 4, "s4", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
57 public static final Register s5 = new Register(13, 5, "s5", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
58 public static final Register s6 = new Register(14, 6, "s6", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
59 public static final Register s7 = new Register(15, 7, "s7", CPU);
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
60 public static final Register s8 = new Register(16, 8, "s8", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
61 public static final Register s9 = new Register(17, 9, "s9", CPU);
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
62 public static final Register s10 = new Register(18, 10, "s10", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
63 public static final Register s11 = new Register(19, 11, "s11", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
64 public static final Register s12 = new Register(20, 12, "s12", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
65 public static final Register s13 = new Register(21, 13, "s13", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
66 public static final Register s14 = new Register(22, 14, "s14", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
67 public static final Register s15 = new Register(23, 15, "s15", CPU);
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
68 public static final Register s16 = new Register(24, 16, "s16", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
69 public static final Register s17 = new Register(25, 17, "s17", CPU);
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
70 public static final Register s18 = new Register(26, 18, "s18", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
71 public static final Register s19 = new Register(27, 19, "s19", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
72 public static final Register s20 = new Register(28, 20, "s20", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
73 public static final Register s21 = new Register(29, 21, "s21", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
74 public static final Register s22 = new Register(30, 22, "s22", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
75 public static final Register s23 = new Register(31, 23, "s23", CPU);
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
76 public static final Register s24 = new Register(32, 24, "s24", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
77 public static final Register s25 = new Register(33, 25, "s25", CPU);
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
78 public static final Register s26 = new Register(34, 26, "s26", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
79 public static final Register s27 = new Register(35, 27, "s27", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
80 public static final Register s28 = new Register(36, 28, "s28", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
81 public static final Register s29 = new Register(37, 29, "s29", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
82 public static final Register s30 = new Register(38, 30, "s30", CPU);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
83 public static final Register s31 = new Register(39, 31, "s31", CPU);
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
84
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
85 // 64 bit registers.
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
86 public static final Register d0 = new Register(40, 0, "d0", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
87 public static final Register d1 = new Register(41, 1, "d1", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
88 public static final Register d2 = new Register(42, 2, "d2", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
89 public static final Register d3 = new Register(43, 3, "d3", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
90 public static final Register d4 = new Register(44, 4, "d4", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
91 public static final Register d5 = new Register(45, 5, "d5", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
92 public static final Register d6 = new Register(46, 6, "d6", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
93 public static final Register d7 = new Register(47, 7, "d7", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
94 public static final Register d8 = new Register(48, 8, "d8", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
95 public static final Register d9 = new Register(49, 9, "d9", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
96 public static final Register d10 = new Register(50, 10, "d10", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
97 public static final Register d11 = new Register(51, 11, "d11", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
98 public static final Register d12 = new Register(52, 12, "d12", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
99 public static final Register d13 = new Register(53, 13, "d13", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
100 public static final Register d14 = new Register(54, 14, "d14", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
101 public static final Register d15 = new Register(55, 15, "d15", CPU);
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
102
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
103 // 128 bit registers.
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
104 public static final Register q0 = new Register(56, 0, "q0", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
105 public static final Register q1 = new Register(57, 1, "q1", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
106 public static final Register q2 = new Register(58, 2, "q2", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
107 public static final Register q3 = new Register(59, 3, "q3", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
108 public static final Register q4 = new Register(60, 4, "q4", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
109 public static final Register q5 = new Register(61, 5, "q5", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
110 public static final Register q6 = new Register(62, 6, "q6", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
111 public static final Register q7 = new Register(63, 7, "q7", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
112 public static final Register q8 = new Register(64, 8, "q8", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
113 public static final Register q9 = new Register(65, 9, "q9", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
114 public static final Register q10 = new Register(66, 10, "q10", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
115 public static final Register q11 = new Register(67, 11, "q11", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
116 public static final Register q12 = new Register(68, 12, "q12", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
117 public static final Register q13 = new Register(69, 13, "q13", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
118 public static final Register q14 = new Register(70, 14, "q14", CPU);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
119 public static final Register q15 = new Register(71, 15, "q15", CPU);
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
120
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
121 // @formatter:off
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
122 public static final Register[] cRegisters = {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
123 c0, c1, c2, c3, c4, c5, c6, c7
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
124 };
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
125
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
126 public static final Register[] sRegisters = {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
127 s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10,
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
128 s11, s12, s13, s14, s15, s16, s17, s18, s19,
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
129 s20, s21, s22, s23, s24, s25, s26, s27, s28,
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
130 s29, s30, s31
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
131 };
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
132
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
133 public static final Register[] dRegisters = {
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
134 d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
135 };
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
136
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
137 public static final Register[] qRegisters = {
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
138 q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
139 };
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
140
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
141 public static final Register[] allRegisters = {
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
142 c0, c1, c2, c3, c4, c5, c6, c7, s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15,
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
143 d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13,
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
144 d14, d15, q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11,
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
145 q12, q13, q14, q15
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
146 };
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
147
10898
ea308a63760b added unalignedMemoryAccess to Architecture
twisti
parents: 10662
diff changeset
148 // @formatter:on
ea308a63760b added unalignedMemoryAccess to Architecture
twisti
parents: 10662
diff changeset
149
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
150 public HSAIL() {
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 10898
diff changeset
151 super("HSAIL", 8, ByteOrder.LITTLE_ENDIAN, false, allRegisters, 0, 1, q15.encoding + 1, 8);
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
152 }
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
153
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
154 public static int getStackOffset(Value reg) {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
155 return -(((StackSlot) reg).getRawOffset());
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
156 }
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
157
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
158 public static String mapStackSlot(Value reg) {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
159 StackSlot s = (StackSlot) reg;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
160 long offset = -s.getRawOffset();
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
161 return "[%spillseg]" + "[" + offset + "]";
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
162 }
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
163
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
164 public static String mapRegister(Value arg) {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
165 Register reg;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
166 int encoding = 0;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
167 String regPrefix = null;
13726
343541fb3b49 Support narrow oops in reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 12664
diff changeset
168 Kind kind = arg.getKind();
343541fb3b49 Support narrow oops in reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 12664
diff changeset
169 if (kind == Kind.Double || kind == Kind.Long) {
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
170 regPrefix = "$d";
13726
343541fb3b49 Support narrow oops in reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 12664
diff changeset
171 } else if (kind == Kind.Int || kind == Kind.Float || kind == Kind.NarrowOop) {
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
172 regPrefix = "$s";
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
173 } else {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
174 regPrefix = "$d";
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
175 }
13726
343541fb3b49 Support narrow oops in reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 12664
diff changeset
176 reg = asRegister(arg);
343541fb3b49 Support narrow oops in reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 12664
diff changeset
177 encoding = reg.encoding();
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
178 return new String(regPrefix + encoding);
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
179 }
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
180
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
181 @Override
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
182 public boolean canStoreValue(RegisterCategory category, PlatformKind platformKind) {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
183 if (!(platformKind instanceof Kind)) {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
184 return false;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
185 }
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
186 Kind kind = (Kind) platformKind;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
187 if (category == CPU) {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
188 switch (kind) {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
189 case Boolean:
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
190 case Byte:
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
191 case Char:
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
192 case Short:
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
193 case Int:
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
194 case Long:
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
195 case Object:
13726
343541fb3b49 Support narrow oops in reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 12664
diff changeset
196 case NarrowOop:
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
197 return true;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
198 }
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
199 } else if (category == FPU) {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
200 switch (kind) {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
201 case Float:
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
202 case Double:
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
203 return true;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
204 }
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
205 }
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
206 return false;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
207 }
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
208
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
209 @Override
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
210 public PlatformKind getLargestStorableKind(RegisterCategory category) {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
211 if (category == CPU) {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
212 return Kind.Long;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
213 } else if (category == FPU) {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
214 return Kind.Double;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
215 } else {
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
216 return Kind.Illegal;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
217 }
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
218 }
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
219 }