Mercurial > hg > graal-jvmci-8
comparison src/share/vm/adlc/output_c.cpp @ 14434:318d0622a6d7
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
Summary: extends MachCall nodes so that they can issue constants to the constant table
Reviewed-by: kvn
author | goetz |
---|---|
date | Wed, 20 Nov 2013 11:08:09 -0800 |
parents | 1410ad6b05f1 |
children | 492e67693373 |
comparison
equal
deleted
inserted
replaced
14433:018b357638aa | 14434:318d0622a6d7 |
---|---|
1837 } | 1837 } |
1838 } | 1838 } |
1839 | 1839 |
1840 // If the node is a MachConstantNode, insert the MachConstantBaseNode edge. | 1840 // If the node is a MachConstantNode, insert the MachConstantBaseNode edge. |
1841 // NOTE: this edge must be the last input (see MachConstantNode::mach_constant_base_node_input). | 1841 // NOTE: this edge must be the last input (see MachConstantNode::mach_constant_base_node_input). |
1842 if (node->is_mach_constant()) { | 1842 // There are nodes that don't use $constantablebase, but still require that it |
1843 // is an input to the node. Example: divF_reg_immN, Repl32B_imm on x86_64. | |
1844 if (node->is_mach_constant() || node->needs_constant_base()) { | |
1843 fprintf(fp," add_req(C->mach_constant_base_node());\n"); | 1845 fprintf(fp," add_req(C->mach_constant_base_node());\n"); |
1844 } | 1846 } |
1845 | 1847 |
1846 fprintf(fp,"\n"); | 1848 fprintf(fp,"\n"); |
1847 if( node->expands() ) { | 1849 if( node->expands() ) { |
1950 "'primary', 'secondary' and 'tertiary' don't follow operand."); | 1952 "'primary', 'secondary' and 'tertiary' don't follow operand."); |
1951 } | 1953 } |
1952 else if ((strcmp(rep_var, "constanttablebase") == 0) || | 1954 else if ((strcmp(rep_var, "constanttablebase") == 0) || |
1953 (strcmp(rep_var, "constantoffset") == 0) || | 1955 (strcmp(rep_var, "constantoffset") == 0) || |
1954 (strcmp(rep_var, "constantaddress") == 0)) { | 1956 (strcmp(rep_var, "constantaddress") == 0)) { |
1955 if (!_inst.is_mach_constant()) { | 1957 if (!(_inst.is_mach_constant() || _inst.needs_constant_base())) { |
1956 _AD.syntax_err(_encoding._linenum, | 1958 _AD.syntax_err(_encoding._linenum, |
1957 "Replacement variable %s not allowed in instruct %s (only in MachConstantNode).\n", | 1959 "Replacement variable %s not allowed in instruct %s (only in MachConstantNode or MachCall).\n", |
1958 rep_var, _encoding._name); | 1960 rep_var, _encoding._name); |
1959 } | 1961 } |
1960 } | 1962 } |
1961 else { | 1963 else { |
1962 // Lookup its position in (formal) parameter list of encoding | 1964 // Lookup its position in (formal) parameter list of encoding |
3180 if ( instr->ideal_only() ) continue; | 3182 if ( instr->ideal_only() ) continue; |
3181 // If there are multiple defs/kills, or an explicit expand rule, build rule | 3183 // If there are multiple defs/kills, or an explicit expand rule, build rule |
3182 if( instr->expands() || instr->needs_projections() || | 3184 if( instr->expands() || instr->needs_projections() || |
3183 instr->has_temps() || | 3185 instr->has_temps() || |
3184 instr->is_mach_constant() || | 3186 instr->is_mach_constant() || |
3187 instr->needs_constant_base() || | |
3185 instr->_matrule != NULL && | 3188 instr->_matrule != NULL && |
3186 instr->num_opnds() != instr->num_unique_opnds() ) | 3189 instr->num_opnds() != instr->num_unique_opnds() ) |
3187 defineExpand(_CPP_EXPAND_file._fp, instr); | 3190 defineExpand(_CPP_EXPAND_file._fp, instr); |
3188 // If there is an explicit peephole rule, build it | 3191 // If there is an explicit peephole rule, build it |
3189 if ( instr->peepholes() ) | 3192 if ( instr->peepholes() ) |
3952 fprintf(fp_cpp, " );\n"); | 3955 fprintf(fp_cpp, " );\n"); |
3953 // ##### | 3956 // ##### |
3954 } | 3957 } |
3955 | 3958 |
3956 // Fill in the bottom_type where requested | 3959 // Fill in the bottom_type where requested |
3957 if ( inst->captures_bottom_type(_globalNames) ) { | 3960 if (inst->captures_bottom_type(_globalNames)) { |
3958 fprintf(fp_cpp, "%s node->_bottom_type = _leaf->bottom_type();\n", indent); | 3961 if (strncmp("MachCall", inst->mach_base_class(_globalNames), strlen("MachCall"))) { |
3962 fprintf(fp_cpp, "%s node->_bottom_type = _leaf->bottom_type();\n", indent); | |
3963 } | |
3959 } | 3964 } |
3960 if( inst->is_ideal_if() ) { | 3965 if( inst->is_ideal_if() ) { |
3961 fprintf(fp_cpp, "%s node->_prob = _leaf->as_If()->_prob;\n", indent); | 3966 fprintf(fp_cpp, "%s node->_prob = _leaf->as_If()->_prob;\n", indent); |
3962 fprintf(fp_cpp, "%s node->_fcnt = _leaf->as_If()->_fcnt;\n", indent); | 3967 fprintf(fp_cpp, "%s node->_fcnt = _leaf->as_If()->_fcnt;\n", indent); |
3963 } | 3968 } |