1 /* 2 * Copyright (c) 2007, 2009, 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 24 #include "incls/_precompiled.incl" 25 #include "incls/_vectornode.cpp.incl" 26 27 //------------------------------VectorNode-------------------------------------- 28 29 // Return vector type for an element type and vector length. 30 const Type* VectorNode::vect_type(BasicType elt_bt, uint len) { 31 assert(len <= VectorNode::max_vlen(elt_bt), "len in range"); 32 switch(elt_bt) { 33 case T_BOOLEAN: 34 case T_BYTE: 35 switch(len) { 36 case 2: return TypeInt::CHAR; 37 case 4: return TypeInt::INT; 38 case 8: return TypeLong::LONG; 39 } 40 break; 41 case T_CHAR: 42 case T_SHORT: 43 switch(len) { 44 case 2: return TypeInt::INT; 45 case 4: return TypeLong::LONG; | 1 /* 2 * Copyright (c) 2007, 2010, 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 24 #include "precompiled.hpp" 25 #include "memory/allocation.inline.hpp" 26 #include "opto/connode.hpp" 27 #include "opto/vectornode.hpp" 28 29 //------------------------------VectorNode-------------------------------------- 30 31 // Return vector type for an element type and vector length. 32 const Type* VectorNode::vect_type(BasicType elt_bt, uint len) { 33 assert(len <= VectorNode::max_vlen(elt_bt), "len in range"); 34 switch(elt_bt) { 35 case T_BOOLEAN: 36 case T_BYTE: 37 switch(len) { 38 case 2: return TypeInt::CHAR; 39 case 4: return TypeInt::INT; 40 case 8: return TypeLong::LONG; 41 } 42 break; 43 case T_CHAR: 44 case T_SHORT: 45 switch(len) { 46 case 2: return TypeInt::INT; 47 case 4: return TypeLong::LONG; |