Path: blob/master/test/hotspot/jtreg/compiler/intrinsics/bmi/Expr.java
41155 views
/*1* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package compiler.intrinsics.bmi;2425/**26* Expression that should be replaced by particular instrinsic27* or intruction during compilation.28*/29public abstract class Expr {3031public static class MemI {32public MemI(int i) {33this.value = i;34}3536public int value;37}3839public static class MemL {40public MemL(long l) {41this.value = l;42}4344public long value;45}4647public boolean isUnaryArgumentSupported() {48return false;49}5051public boolean isIntExprSupported() {52return false;53}5455public boolean isBinaryArgumentSupported() {56return false;57}5859public boolean isLongExprSupported() {60return false;61}6263public boolean isIntToLongExprSupported() {64return false;65}6667public boolean isMemExprSupported() {68return false;69}7071public int intExpr(int reg) {72throw new UnsupportedOperationException();73}7475public int intExpr(MemI mem) {76throw new UnsupportedOperationException();77}7879public int intExpr(int a, int b) {80throw new UnsupportedOperationException();81}8283public int intExpr(int a, MemI b) {84throw new UnsupportedOperationException();85}8687public int intExpr(MemI a, int b) {88throw new UnsupportedOperationException();89}9091public int intExpr(MemI a, MemI b) {92throw new UnsupportedOperationException();93}9495public long longExpr(long reg) {96throw new UnsupportedOperationException();97}9899public long longExpr(MemL mem) {100throw new UnsupportedOperationException();101}102103public long longExpr(long a, long b) {104throw new UnsupportedOperationException();105}106107public long longExpr(long a, MemL b) {108throw new UnsupportedOperationException();109}110111public long longExpr(MemL a, long b) {112throw new UnsupportedOperationException();113}114115public long longExpr(MemL a, MemL b) {116throw new UnsupportedOperationException();117}118119public long intToLongExpr(int reg) {120throw new UnsupportedOperationException();121}122123public static class BMIExpr extends Expr {124125public boolean isMemExprSupported() {126return true;127}128}129130public static class BMIBinaryExpr extends BMIExpr {131132public boolean isBinaryArgumentSupported() {133return true;134}135136}137138public static class BMIUnaryExpr extends BMIExpr {139public boolean isUnaryArgumentSupported() {140return true;141}142}143144public static class BMIBinaryIntExpr extends BMIBinaryExpr {145public boolean isIntExprSupported() {146return true;147}148}149150public static class BMIBinaryLongExpr extends BMIBinaryExpr {151public boolean isLongExprSupported() {152return true;153}154}155156public static class BMIUnaryIntExpr extends BMIUnaryExpr {157public boolean isIntExprSupported() {158return true;159}160}161162public static class BMIUnaryLongExpr extends BMIUnaryExpr {163public boolean isLongExprSupported() {164return true;165}166}167168public static class BMIUnaryIntToLongExpr extends BMIUnaryExpr {169public boolean isIntToLongExprSupported() {170return true;171}172}173174175public static class BitCountingExpr extends Expr {176public boolean isUnaryArgumentSupported() {177return true;178}179}180181public static class BitCountingIntExpr extends BitCountingExpr {182public boolean isIntExprSupported() {183return true;184}185}186187public static class BitCountingLongExpr extends BitCountingExpr {188public boolean isLongExprSupported() {189return true;190}191}192}193194195