1 /*
2 * Copyright (c) 2013, 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 */
296
297 @Override
298 public PlatformKind getPlatformKind(JavaKind javaKind) {
299 switch (javaKind) {
300 case Boolean:
301 case Byte:
302 return SPARCKind.BYTE;
303 case Short:
304 case Char:
305 return SPARCKind.HWORD;
306 case Int:
307 return SPARCKind.WORD;
308 case Long:
309 case Object:
310 return SPARCKind.XWORD;
311 case Float:
312 return SPARCKind.SINGLE;
313 case Double:
314 return SPARCKind.DOUBLE;
315 default:
316 throw new IllegalArgumentException("Unknown JavaKind: " + javaKind);
317 }
318 }
319
320 private static int getDoubleEncoding(int reg) {
321 assert reg < 64 && ((reg & 1) == 0);
322 return (reg & 0x1e) | ((reg & 0x20) >> 5);
323 }
324
325 private static int getQuadncoding(int reg) {
326 assert reg < 64 && ((reg & 1) == 0);
327 return (reg & 0x1c) | ((reg & 0x20) >> 5);
328 }
329
330 public Set<CPUFeature> getFeatures() {
331 return features;
332 }
333
334 public boolean hasFeature(CPUFeature feature) {
335 return features.contains(feature);
336 }
|
1 /*
2 * Copyright (c) 2013, 2019, 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 */
296
297 @Override
298 public PlatformKind getPlatformKind(JavaKind javaKind) {
299 switch (javaKind) {
300 case Boolean:
301 case Byte:
302 return SPARCKind.BYTE;
303 case Short:
304 case Char:
305 return SPARCKind.HWORD;
306 case Int:
307 return SPARCKind.WORD;
308 case Long:
309 case Object:
310 return SPARCKind.XWORD;
311 case Float:
312 return SPARCKind.SINGLE;
313 case Double:
314 return SPARCKind.DOUBLE;
315 default:
316 return null;
317 }
318 }
319
320 private static int getDoubleEncoding(int reg) {
321 assert reg < 64 && ((reg & 1) == 0);
322 return (reg & 0x1e) | ((reg & 0x20) >> 5);
323 }
324
325 private static int getQuadncoding(int reg) {
326 assert reg < 64 && ((reg & 1) == 0);
327 return (reg & 0x1c) | ((reg & 0x20) >> 5);
328 }
329
330 public Set<CPUFeature> getFeatures() {
331 return features;
332 }
333
334 public boolean hasFeature(CPUFeature feature) {
335 return features.contains(feature);
336 }
|