mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
7200233: C2: can't use expand rules for vector instruction rules
Added missed _bottom_type set in ArchDesc::defineExpand() and missed vector nodes in MatchRule::is_vector(). Reviewed-by: twisti, roland, dlong
This commit is contained in:
parent
ac3b6a6442
commit
9c3545d4fb
3 changed files with 36 additions and 11 deletions
|
@ -4043,18 +4043,27 @@ Form::DataType MatchRule::is_ideal_load() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MatchRule::is_vector() 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;
|
const char *opType = _rChild->_opType;
|
||||||
if( strcmp(opType,"ReplicateB")==0 ||
|
for (int i=0; i<cnt; i++)
|
||||||
strcmp(opType,"ReplicateS")==0 ||
|
if (strcmp(opType,vector_list[i]) == 0)
|
||||||
strcmp(opType,"ReplicateI")==0 ||
|
return true;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1606,6 +1606,12 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) {
|
||||||
fprintf(fp, " ((MachFastLockNode*)n%d)->_counters = _counters;\n",cnt);
|
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();
|
const char *resultOper = new_inst->reduce_result();
|
||||||
fprintf(fp," n%d->set_opnd_array(0, state->MachOperGenerator( %s, C ));\n",
|
fprintf(fp," n%d->set_opnd_array(0, state->MachOperGenerator( %s, C ));\n",
|
||||||
cnt, machOperEnum(resultOper));
|
cnt, machOperEnum(resultOper));
|
||||||
|
|
|
@ -1905,6 +1905,8 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
|
||||||
declare_c2_type(SubVLNode, VectorNode) \
|
declare_c2_type(SubVLNode, VectorNode) \
|
||||||
declare_c2_type(SubVFNode, VectorNode) \
|
declare_c2_type(SubVFNode, VectorNode) \
|
||||||
declare_c2_type(SubVDNode, VectorNode) \
|
declare_c2_type(SubVDNode, VectorNode) \
|
||||||
|
declare_c2_type(MulVSNode, VectorNode) \
|
||||||
|
declare_c2_type(MulVINode, VectorNode) \
|
||||||
declare_c2_type(MulVFNode, VectorNode) \
|
declare_c2_type(MulVFNode, VectorNode) \
|
||||||
declare_c2_type(MulVDNode, VectorNode) \
|
declare_c2_type(MulVDNode, VectorNode) \
|
||||||
declare_c2_type(DivVFNode, VectorNode) \
|
declare_c2_type(DivVFNode, VectorNode) \
|
||||||
|
@ -1912,9 +1914,15 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
|
||||||
declare_c2_type(LShiftVBNode, VectorNode) \
|
declare_c2_type(LShiftVBNode, VectorNode) \
|
||||||
declare_c2_type(LShiftVSNode, VectorNode) \
|
declare_c2_type(LShiftVSNode, VectorNode) \
|
||||||
declare_c2_type(LShiftVINode, VectorNode) \
|
declare_c2_type(LShiftVINode, VectorNode) \
|
||||||
|
declare_c2_type(LShiftVLNode, VectorNode) \
|
||||||
declare_c2_type(RShiftVBNode, VectorNode) \
|
declare_c2_type(RShiftVBNode, VectorNode) \
|
||||||
declare_c2_type(RShiftVSNode, VectorNode) \
|
declare_c2_type(RShiftVSNode, VectorNode) \
|
||||||
declare_c2_type(RShiftVINode, 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(AndVNode, VectorNode) \
|
||||||
declare_c2_type(OrVNode, VectorNode) \
|
declare_c2_type(OrVNode, VectorNode) \
|
||||||
declare_c2_type(XorVNode, VectorNode) \
|
declare_c2_type(XorVNode, VectorNode) \
|
||||||
|
@ -1937,6 +1945,8 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
|
||||||
declare_c2_type(Pack2DNode, PackNode) \
|
declare_c2_type(Pack2DNode, PackNode) \
|
||||||
declare_c2_type(ExtractNode, Node) \
|
declare_c2_type(ExtractNode, Node) \
|
||||||
declare_c2_type(ExtractBNode, ExtractNode) \
|
declare_c2_type(ExtractBNode, ExtractNode) \
|
||||||
|
declare_c2_type(ExtractUBNode, ExtractNode) \
|
||||||
|
declare_c2_type(ExtractCNode, ExtractNode) \
|
||||||
declare_c2_type(ExtractSNode, ExtractNode) \
|
declare_c2_type(ExtractSNode, ExtractNode) \
|
||||||
declare_c2_type(ExtractINode, ExtractNode) \
|
declare_c2_type(ExtractINode, ExtractNode) \
|
||||||
declare_c2_type(ExtractLNode, ExtractNode) \
|
declare_c2_type(ExtractLNode, ExtractNode) \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue