提交 47929ef7 编写于 作者: K kvn

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
上级 fe6933cf
......@@ -4043,17 +4043,26 @@ 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 */ )
for (int i=0; i<cnt; i++)
if (strcmp(opType,vector_list[i]) == 0)
return true;
}
return false;
......
......@@ -1606,6 +1606,12 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) {
fprintf(fp, " ((MachFastLockNode*)n%d)->_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));
......
......@@ -1905,6 +1905,8 @@ typedef TwoOopHashtable<Symbol*, mtClass> 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<Symbol*, mtClass> 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<Symbol*, mtClass> 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) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册