< prev index next >

src/hotspot/share/adlc/archDesc.cpp

Print this page
rev 60615 : 8231441: Initial SVE backend support
Reviewed-by: adinn, pli
Contributed-by: joshua.zhu@arm.com, yang.zhang@arm.com, ningsheng.jian@arm.com
   1 //
   2 // Copyright (c) 1997, 2018, 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 //


 917 void ArchDesc::set_stack_or_reg(const char *reg_class_name) {
 918   if( _register ) {
 919     RegClass *reg_class  = _register->getRegClass(reg_class_name);
 920     reg_class->set_stack_version(true);
 921   }
 922 }
 923 
 924 
 925 // Return the type signature for the ideal operation
 926 const char *ArchDesc::getIdealType(const char *idealOp) {
 927   // Find last character in idealOp, it specifies the type
 928   char  last_char = 0;
 929   const char *ptr = idealOp;
 930   for (; *ptr != '\0'; ++ptr) {
 931     last_char = *ptr;
 932   }
 933 
 934   // Match Vector types.
 935   if (strncmp(idealOp, "Vec",3)==0) {
 936     switch(last_char) {

 937     case 'S':  return "TypeVect::VECTS";
 938     case 'D':  return "TypeVect::VECTD";
 939     case 'X':  return "TypeVect::VECTX";
 940     case 'Y':  return "TypeVect::VECTY";
 941     case 'Z':  return "TypeVect::VECTZ";
 942     default:
 943       internal_err("Vector type %s with unrecognized type\n",idealOp);
 944     }




 945   }
 946 
 947   // !!!!!
 948   switch(last_char) {
 949   case 'I':    return "TypeInt::INT";
 950   case 'P':    return "TypePtr::BOTTOM";
 951   case 'N':    return "TypeNarrowOop::BOTTOM";
 952   case 'F':    return "Type::FLOAT";
 953   case 'D':    return "Type::DOUBLE";
 954   case 'L':    return "TypeLong::LONG";
 955   case 's':    return "TypeInt::CC /*flags*/";
 956   default:
 957     return NULL;
 958     // !!!!!
 959     // internal_err("Ideal type %s with unrecognized type\n",idealOp);
 960     break;
 961   }
 962 
 963   return NULL;
 964 }


   1 //
   2 // Copyright (c) 1997, 2020, 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 //


 917 void ArchDesc::set_stack_or_reg(const char *reg_class_name) {
 918   if( _register ) {
 919     RegClass *reg_class  = _register->getRegClass(reg_class_name);
 920     reg_class->set_stack_version(true);
 921   }
 922 }
 923 
 924 
 925 // Return the type signature for the ideal operation
 926 const char *ArchDesc::getIdealType(const char *idealOp) {
 927   // Find last character in idealOp, it specifies the type
 928   char  last_char = 0;
 929   const char *ptr = idealOp;
 930   for (; *ptr != '\0'; ++ptr) {
 931     last_char = *ptr;
 932   }
 933 
 934   // Match Vector types.
 935   if (strncmp(idealOp, "Vec",3)==0) {
 936     switch(last_char) {
 937     case 'A':  return "TypeVect::VECTA";
 938     case 'S':  return "TypeVect::VECTS";
 939     case 'D':  return "TypeVect::VECTD";
 940     case 'X':  return "TypeVect::VECTX";
 941     case 'Y':  return "TypeVect::VECTY";
 942     case 'Z':  return "TypeVect::VECTZ";
 943     default:
 944       internal_err("Vector type %s with unrecognized type\n",idealOp);
 945     }
 946   }
 947 
 948   if (strncmp(idealOp, "RegVMask", 8) == 0) {
 949     return "Type::BOTTOM";
 950   }
 951 
 952   // !!!!!
 953   switch(last_char) {
 954   case 'I':    return "TypeInt::INT";
 955   case 'P':    return "TypePtr::BOTTOM";
 956   case 'N':    return "TypeNarrowOop::BOTTOM";
 957   case 'F':    return "Type::FLOAT";
 958   case 'D':    return "Type::DOUBLE";
 959   case 'L':    return "TypeLong::LONG";
 960   case 's':    return "TypeInt::CC /*flags*/";
 961   default:
 962     return NULL;
 963     // !!!!!
 964     // internal_err("Ideal type %s with unrecognized type\n",idealOp);
 965     break;
 966   }
 967 
 968   return NULL;
 969 }


< prev index next >