output_c.cpp (5985:1410ad6b05f1) | output_c.cpp (5988:318d0622a6d7) |
---|---|
1/* 2 * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * --- 1825 unchanged lines hidden (view full) --- 1834 fprintf(fp," }\n"); 1835 fprintf(fp," _num_opnds = %d;\n", new_num_opnds); 1836 assert(new_num_opnds == node->num_unique_opnds(), "what?"); 1837 } 1838 } 1839 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). | 1/* 2 * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * --- 1825 unchanged lines hidden (view full) --- 1834 fprintf(fp," }\n"); 1835 fprintf(fp," _num_opnds = %d;\n", new_num_opnds); 1836 assert(new_num_opnds == node->num_unique_opnds(), "what?"); 1837 } 1838 } 1839 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). |
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"); 1844 } 1845 1846 fprintf(fp,"\n"); 1847 if( node->expands() ) { 1848 fprintf(fp," return result;\n"); 1849 } else { 1850 fprintf(fp," return this;\n"); --- 96 unchanged lines hidden (view full) --- 1947 if ( Opcode::as_opcode_type(rep_var) != Opcode::NOT_AN_OPCODE ) { 1948 // No state needed. 1949 assert( _opclass == NULL, 1950 "'primary', 'secondary' and 'tertiary' don't follow operand."); 1951 } 1952 else if ((strcmp(rep_var, "constanttablebase") == 0) || 1953 (strcmp(rep_var, "constantoffset") == 0) || 1954 (strcmp(rep_var, "constantaddress") == 0)) { | 1845 fprintf(fp," add_req(C->mach_constant_base_node());\n"); 1846 } 1847 1848 fprintf(fp,"\n"); 1849 if( node->expands() ) { 1850 fprintf(fp," return result;\n"); 1851 } else { 1852 fprintf(fp," return this;\n"); --- 96 unchanged lines hidden (view full) --- 1949 if ( Opcode::as_opcode_type(rep_var) != Opcode::NOT_AN_OPCODE ) { 1950 // No state needed. 1951 assert( _opclass == NULL, 1952 "'primary', 'secondary' and 'tertiary' don't follow operand."); 1953 } 1954 else if ((strcmp(rep_var, "constanttablebase") == 0) || 1955 (strcmp(rep_var, "constantoffset") == 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); 1959 } 1960 } 1961 else { 1962 // Lookup its position in (formal) parameter list of encoding 1963 int param_no = _encoding.rep_var_index(rep_var); 1964 if ( param_no == -1 ) { 1965 _AD.syntax_err( _encoding._linenum, --- 1211 unchanged lines hidden (view full) --- 3177 _instructions.reset(); 3178 for( ; (instr = (InstructForm*)_instructions.iter()) != NULL; ) { 3179 // Ensure this is a machine-world instruction 3180 if ( instr->ideal_only() ) continue; 3181 // If there are multiple defs/kills, or an explicit expand rule, build rule 3182 if( instr->expands() || instr->needs_projections() || 3183 instr->has_temps() || 3184 instr->is_mach_constant() || | 1960 rep_var, _encoding._name); 1961 } 1962 } 1963 else { 1964 // Lookup its position in (formal) parameter list of encoding 1965 int param_no = _encoding.rep_var_index(rep_var); 1966 if ( param_no == -1 ) { 1967 _AD.syntax_err( _encoding._linenum, --- 1211 unchanged lines hidden (view full) --- 3179 _instructions.reset(); 3180 for( ; (instr = (InstructForm*)_instructions.iter()) != NULL; ) { 3181 // Ensure this is a machine-world instruction 3182 if ( instr->ideal_only() ) continue; 3183 // If there are multiple defs/kills, or an explicit expand rule, build rule 3184 if( instr->expands() || instr->needs_projections() || 3185 instr->has_temps() || 3186 instr->is_mach_constant() || |
3187 instr->needs_constant_base() || |
|
3185 instr->_matrule != NULL && 3186 instr->num_opnds() != instr->num_unique_opnds() ) 3187 defineExpand(_CPP_EXPAND_file._fp, instr); 3188 // If there is an explicit peephole rule, build it 3189 if ( instr->peepholes() ) 3190 definePeephole(_CPP_PEEPHOLE_file._fp, instr); 3191 3192 // Output code to convert to the cisc version, if applicable --- 756 unchanged lines hidden (view full) --- 3949 path_to_constant(fp_cpp, _globalNames, op->_matrule, i); 3950 } 3951 } 3952 fprintf(fp_cpp, " );\n"); 3953 // ##### 3954 } 3955 3956 // Fill in the bottom_type where requested | 3188 instr->_matrule != NULL && 3189 instr->num_opnds() != instr->num_unique_opnds() ) 3190 defineExpand(_CPP_EXPAND_file._fp, instr); 3191 // If there is an explicit peephole rule, build it 3192 if ( instr->peepholes() ) 3193 definePeephole(_CPP_PEEPHOLE_file._fp, instr); 3194 3195 // Output code to convert to the cisc version, if applicable --- 756 unchanged lines hidden (view full) --- 3952 path_to_constant(fp_cpp, _globalNames, op->_matrule, i); 3953 } 3954 } 3955 fprintf(fp_cpp, " );\n"); 3956 // ##### 3957 } 3958 3959 // Fill in the bottom_type where requested |
3957 if ( inst->captures_bottom_type(_globalNames) ) { 3958 fprintf(fp_cpp, "%s node->_bottom_type = _leaf->bottom_type();\n", indent); | 3960 if (inst->captures_bottom_type(_globalNames)) { 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 } 3960 if( inst->is_ideal_if() ) { 3961 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); 3963 } 3964 if( inst->is_ideal_fastlock() ) { 3965 fprintf(fp_cpp, "%s node->_counters = _leaf->as_FastLock()->counters();\n", indent); 3966 } --- 425 unchanged lines hidden --- | 3964 } 3965 if( inst->is_ideal_if() ) { 3966 fprintf(fp_cpp, "%s node->_prob = _leaf->as_If()->_prob;\n", indent); 3967 fprintf(fp_cpp, "%s node->_fcnt = _leaf->as_If()->_fcnt;\n", indent); 3968 } 3969 if( inst->is_ideal_fastlock() ) { 3970 fprintf(fp_cpp, "%s node->_counters = _leaf->as_FastLock()->counters();\n", indent); 3971 } --- 425 unchanged lines hidden --- |