From 47929ef7a321782295793b90ed81acfee6c7da35 Mon Sep 17 00:00:00 2001 From: kvn Date: Tue, 25 Sep 2012 10:41:15 -0700 Subject: [PATCH] 7200233: C2: can't use expand rules for vector instruction rules Summary: Added missed _bottom_type set in ArchDesc::defineExpand() and missed vector nodes in MatchRule::is_vector(). Reviewed-by: twisti, roland, dlong --- src/share/vm/adlc/formssel.cpp | 31 +++++++++++++++++++----------- src/share/vm/adlc/output_c.cpp | 6 ++++++ src/share/vm/runtime/vmStructs.cpp | 10 ++++++++++ 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/src/share/vm/adlc/formssel.cpp b/src/share/vm/adlc/formssel.cpp index 824306cbb..fa5f91ca8 100644 --- a/src/share/vm/adlc/formssel.cpp +++ b/src/share/vm/adlc/formssel.cpp @@ -4043,18 +4043,27 @@ Form::DataType MatchRule::is_ideal_load() const { } bool MatchRule::is_vector() const { - if( _rChild ) { + static const char *vector_list[] = { + "AddVB","AddVS","AddVI","AddVL","AddVF","AddVD", + "SubVB","SubVS","SubVI","SubVL","SubVF","SubVD", + "MulVS","MulVI","MulVF","MulVD", + "DivVF","DivVD", + "AndV" ,"XorV" ,"OrV", + "LShiftVB","LShiftVS","LShiftVI","LShiftVL", + "RShiftVB","RShiftVS","RShiftVI","RShiftVL", + "URShiftVB","URShiftVS","URShiftVI","URShiftVL", + "ReplicateB","ReplicateS","ReplicateI","ReplicateL","ReplicateF","ReplicateD", + "LoadVector","StoreVector", + // Next are not supported currently. + "PackB","PackS","PackI","PackL","PackF","PackD","Pack2L","Pack2D", + "ExtractB","ExtractUB","ExtractC","ExtractS","ExtractI","ExtractL","ExtractF","ExtractD" + }; + int cnt = sizeof(vector_list)/sizeof(char*); + if (_rChild) { const char *opType = _rChild->_opType; - if( strcmp(opType,"ReplicateB")==0 || - strcmp(opType,"ReplicateS")==0 || - strcmp(opType,"ReplicateI")==0 || - strcmp(opType,"ReplicateL")==0 || - strcmp(opType,"ReplicateF")==0 || - strcmp(opType,"ReplicateD")==0 || - strcmp(opType,"LoadVector")==0 || - strcmp(opType,"StoreVector")==0 || - 0 /* 0 to line up columns nicely */ ) - return true; + for (int i=0; i_counters = _counters;\n",cnt); } + // Fill in the bottom_type where requested + if (node->captures_bottom_type(_globalNames) && + new_inst->captures_bottom_type(_globalNames)) { + fprintf(fp, " ((MachTypeNode*)n%d)->_bottom_type = bottom_type();\n", cnt); + } + const char *resultOper = new_inst->reduce_result(); fprintf(fp," n%d->set_opnd_array(0, state->MachOperGenerator( %s, C ));\n", cnt, machOperEnum(resultOper)); diff --git a/src/share/vm/runtime/vmStructs.cpp b/src/share/vm/runtime/vmStructs.cpp index 6d35e0708..1f0f2becc 100644 --- a/src/share/vm/runtime/vmStructs.cpp +++ b/src/share/vm/runtime/vmStructs.cpp @@ -1905,6 +1905,8 @@ typedef TwoOopHashtable SymbolTwoOopHashtable; declare_c2_type(SubVLNode, VectorNode) \ declare_c2_type(SubVFNode, VectorNode) \ declare_c2_type(SubVDNode, VectorNode) \ + declare_c2_type(MulVSNode, VectorNode) \ + declare_c2_type(MulVINode, VectorNode) \ declare_c2_type(MulVFNode, VectorNode) \ declare_c2_type(MulVDNode, VectorNode) \ declare_c2_type(DivVFNode, VectorNode) \ @@ -1912,9 +1914,15 @@ typedef TwoOopHashtable SymbolTwoOopHashtable; declare_c2_type(LShiftVBNode, VectorNode) \ declare_c2_type(LShiftVSNode, VectorNode) \ declare_c2_type(LShiftVINode, VectorNode) \ + declare_c2_type(LShiftVLNode, VectorNode) \ declare_c2_type(RShiftVBNode, VectorNode) \ declare_c2_type(RShiftVSNode, VectorNode) \ declare_c2_type(RShiftVINode, VectorNode) \ + declare_c2_type(RShiftVLNode, VectorNode) \ + declare_c2_type(URShiftVBNode, VectorNode) \ + declare_c2_type(URShiftVSNode, VectorNode) \ + declare_c2_type(URShiftVINode, VectorNode) \ + declare_c2_type(URShiftVLNode, VectorNode) \ declare_c2_type(AndVNode, VectorNode) \ declare_c2_type(OrVNode, VectorNode) \ declare_c2_type(XorVNode, VectorNode) \ @@ -1937,6 +1945,8 @@ typedef TwoOopHashtable SymbolTwoOopHashtable; declare_c2_type(Pack2DNode, PackNode) \ declare_c2_type(ExtractNode, Node) \ declare_c2_type(ExtractBNode, ExtractNode) \ + declare_c2_type(ExtractUBNode, ExtractNode) \ + declare_c2_type(ExtractCNode, ExtractNode) \ declare_c2_type(ExtractSNode, ExtractNode) \ declare_c2_type(ExtractINode, ExtractNode) \ declare_c2_type(ExtractLNode, ExtractNode) \ -- GitLab