Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java @ 23297:4b58c92e939b
remove redundant modifiers
author | Manuel Rigger <rigger.manuel@gmail.com> |
---|---|
date | Tue, 02 Feb 2016 16:19:37 +0100 |
parents | 577a4a8caa72 |
children | 1d4ce2d19e52 |
rev | line source |
---|---|
22759 | 1 /* |
2 * Copyright (c) 2015, 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 jdk.vm.ci.aarch64; | |
24 | |
25 import jdk.vm.ci.meta.PlatformKind; | |
26 | |
27 public enum AArch64Kind implements PlatformKind { | |
28 | |
29 // scalar | |
30 BYTE(1), | |
31 WORD(2), | |
32 DWORD(4), | |
33 QWORD(8), | |
34 SINGLE(4), | |
35 DOUBLE(8), | |
36 | |
37 // SIMD | |
38 V32_BYTE(4, BYTE), | |
39 V32_WORD(4, WORD), | |
40 V64_BYTE(8, BYTE), | |
41 V64_WORD(8, WORD), | |
42 V64_DWORD(8, DWORD), | |
43 V128_BYTE(16, BYTE), | |
44 V128_WORD(16, WORD), | |
45 V128_DWORD(16, DWORD), | |
46 V128_QWORD(16, QWORD), | |
47 V128_SINGLE(16, SINGLE), | |
48 V128_DOUBLE(16, DOUBLE), | |
49 | |
50 MASK8(1), | |
51 MASK16(2), | |
52 MASK32(4), | |
53 MASK64(8); | |
54 | |
55 private final int size; | |
56 private final int vectorLength; | |
57 | |
58 private final AArch64Kind scalar; | |
59 private final EnumKey<AArch64Kind> key = new EnumKey<>(this); | |
60 | |
23297
4b58c92e939b
remove redundant modifiers
Manuel Rigger <rigger.manuel@gmail.com>
parents:
22759
diff
changeset
|
61 AArch64Kind(int size) { |
22759 | 62 this.size = size; |
63 this.scalar = this; | |
64 this.vectorLength = 1; | |
65 } | |
66 | |
23297
4b58c92e939b
remove redundant modifiers
Manuel Rigger <rigger.manuel@gmail.com>
parents:
22759
diff
changeset
|
67 AArch64Kind(int size, AArch64Kind scalar) { |
22759 | 68 this.size = size; |
69 this.scalar = scalar; | |
70 | |
71 assert size % scalar.size == 0; | |
72 this.vectorLength = size / scalar.size; | |
73 } | |
74 | |
75 public AArch64Kind getScalar() { | |
76 return scalar; | |
77 } | |
78 | |
79 public int getSizeInBytes() { | |
80 return size; | |
81 } | |
82 | |
83 public int getVectorLength() { | |
84 return vectorLength; | |
85 } | |
86 | |
87 public Key getKey() { | |
88 return key; | |
89 } | |
90 | |
91 public boolean isInteger() { | |
92 switch (this) { | |
93 case BYTE: | |
94 case WORD: | |
95 case DWORD: | |
96 case QWORD: | |
97 return true; | |
98 default: | |
99 return false; | |
100 } | |
101 } | |
102 | |
103 public boolean isSIMD() { | |
104 switch (this) { | |
105 case SINGLE: | |
106 case DOUBLE: | |
107 case V32_BYTE: | |
108 case V32_WORD: | |
109 case V64_BYTE: | |
110 case V64_WORD: | |
111 case V64_DWORD: | |
112 case V128_BYTE: | |
113 case V128_WORD: | |
114 case V128_DWORD: | |
115 case V128_QWORD: | |
116 case V128_SINGLE: | |
117 case V128_DOUBLE: | |
118 return true; | |
119 default: | |
120 return false; | |
121 } | |
122 } | |
123 | |
124 public boolean isMask() { | |
125 switch (this) { | |
126 case MASK8: | |
127 case MASK16: | |
128 case MASK32: | |
129 case MASK64: | |
130 return true; | |
131 default: | |
132 return false; | |
133 } | |
134 } | |
135 | |
136 public char getTypeChar() { | |
137 switch (this) { | |
138 case BYTE: | |
139 return 'b'; | |
140 case WORD: | |
141 return 'w'; | |
142 case DWORD: | |
143 return 'd'; | |
144 case QWORD: | |
145 return 'q'; | |
146 case SINGLE: | |
147 return 'S'; | |
148 case DOUBLE: | |
149 return 'D'; | |
150 case V32_BYTE: | |
151 case V32_WORD: | |
152 case V64_BYTE: | |
153 case V64_WORD: | |
154 case V64_DWORD: | |
155 case V128_BYTE: | |
156 case V128_WORD: | |
157 case V128_DWORD: | |
158 case V128_QWORD: | |
159 case V128_SINGLE: | |
160 case V128_DOUBLE: | |
161 return 'v'; | |
162 case MASK8: | |
163 case MASK16: | |
164 case MASK32: | |
165 case MASK64: | |
166 return 'k'; | |
167 default: | |
168 return '-'; | |
169 } | |
170 } | |
171 } |