1249 } 1250 virtual const Type *bottom_type() const { return TypeInt::BOOL; } 1251 virtual uint ideal_reg() const { return Op_RegI; } // TODO Should be RegFlags but due to missing comparison flags for BoolTest 1252 // in middle-end, we make it boolean result directly. 1253 Assembler::Condition get_predicate() const { return _predicate; } 1254 }; 1255 1256 class VectorBlendNode : public VectorNode { 1257 public: 1258 VectorBlendNode(Node* vec1, Node* vec2, Node* mask) 1259 : VectorNode(vec1, vec2, mask, vec1->bottom_type()->is_vect()) { 1260 // assert(mask->is_VectorMask(), "VectorBlendNode requires that third argument be a mask"); 1261 } 1262 1263 virtual int Opcode() const; 1264 Node* vec1() const { return in(1); } 1265 Node* vec2() const { return in(2); } 1266 Node* vec_mask() const { return in(3); } 1267 }; 1268 1269 class VectorLoadMaskNode : public VectorNode { 1270 public: 1271 VectorLoadMaskNode(Node* in, const TypeVect* vt) 1272 : VectorNode(in, vt) { 1273 assert(in->is_LoadVector(), "expected load vector"); 1274 assert(in->as_LoadVector()->vect_type()->element_basic_type() == T_BOOLEAN, "must be boolean"); 1275 } 1276 1277 int GetOutMaskSize() const { return type2aelembytes(vect_type()->element_basic_type()); } 1278 virtual int Opcode() const; 1279 }; 1280 1281 class VectorStoreMaskNode : public VectorNode { 1282 private: 1283 int _mask_size; 1284 protected: 1285 uint size_of() const { return sizeof(*this); } 1286 1287 public: 1288 VectorStoreMaskNode(Node* in, BasicType in_type, uint num_elem) 1289 : VectorNode(in, TypeVect::make(T_BOOLEAN, num_elem)) { 1290 _mask_size = type2aelembytes(in_type); 1291 } 1292 1293 virtual uint hash() const { return VectorNode::hash() + _mask_size; } 1294 virtual uint cmp( const Node &n ) const { 1295 return VectorNode::cmp(n) && _mask_size == ((VectorStoreMaskNode&)n)._mask_size; 1296 } 1297 int GetInputMaskSize() const { return _mask_size; } | 1249 } 1250 virtual const Type *bottom_type() const { return TypeInt::BOOL; } 1251 virtual uint ideal_reg() const { return Op_RegI; } // TODO Should be RegFlags but due to missing comparison flags for BoolTest 1252 // in middle-end, we make it boolean result directly. 1253 Assembler::Condition get_predicate() const { return _predicate; } 1254 }; 1255 1256 class VectorBlendNode : public VectorNode { 1257 public: 1258 VectorBlendNode(Node* vec1, Node* vec2, Node* mask) 1259 : VectorNode(vec1, vec2, mask, vec1->bottom_type()->is_vect()) { 1260 // assert(mask->is_VectorMask(), "VectorBlendNode requires that third argument be a mask"); 1261 } 1262 1263 virtual int Opcode() const; 1264 Node* vec1() const { return in(1); } 1265 Node* vec2() const { return in(2); } 1266 Node* vec_mask() const { return in(3); } 1267 }; 1268 1269 class VectorRearrangeNode : public VectorNode { 1270 public: 1271 VectorRearrangeNode(Node* vec1, Node* shuffle) 1272 : VectorNode(vec1, shuffle, vec1->bottom_type()->is_vect()) { 1273 // assert(mask->is_VectorMask(), "VectorBlendNode requires that third argument be a mask"); 1274 } 1275 1276 virtual int Opcode() const; 1277 Node* vec1() const { return in(1); } 1278 Node* vec_shuffle() const { return in(2); } 1279 }; 1280 1281 1282 class VectorLoadMaskNode : public VectorNode { 1283 public: 1284 VectorLoadMaskNode(Node* in, const TypeVect* vt) 1285 : VectorNode(in, vt) { 1286 assert(in->is_LoadVector(), "expected load vector"); 1287 assert(in->as_LoadVector()->vect_type()->element_basic_type() == T_BOOLEAN, "must be boolean"); 1288 } 1289 1290 int GetOutMaskSize() const { return type2aelembytes(vect_type()->element_basic_type()); } 1291 virtual int Opcode() const; 1292 }; 1293 1294 class VectorLoadShuffleNode : public VectorNode { 1295 public: 1296 VectorLoadShuffleNode(Node* in, const TypeVect* vt) 1297 : VectorNode(in, vt) { 1298 assert(in->is_LoadVector(), "expected load vector"); 1299 assert(in->as_LoadVector()->vect_type()->element_basic_type() == T_BYTE, "must be BYTE"); 1300 } 1301 1302 int GetOutShuffleSize() const { return type2aelembytes(vect_type()->element_basic_type()); } 1303 virtual int Opcode() const; 1304 }; 1305 1306 class VectorStoreMaskNode : public VectorNode { 1307 private: 1308 int _mask_size; 1309 protected: 1310 uint size_of() const { return sizeof(*this); } 1311 1312 public: 1313 VectorStoreMaskNode(Node* in, BasicType in_type, uint num_elem) 1314 : VectorNode(in, TypeVect::make(T_BOOLEAN, num_elem)) { 1315 _mask_size = type2aelembytes(in_type); 1316 } 1317 1318 virtual uint hash() const { return VectorNode::hash() + _mask_size; } 1319 virtual uint cmp( const Node &n ) const { 1320 return VectorNode::cmp(n) && _mask_size == ((VectorStoreMaskNode&)n)._mask_size; 1321 } 1322 int GetInputMaskSize() const { return _mask_size; } |