88 return Flag::SUCCESS; |
88 return Flag::SUCCESS; |
89 } |
89 } |
90 } |
90 } |
91 |
91 |
92 Flag::Error AllocatePrefetchDistanceConstraintFunc(intx value, bool verbose) { |
92 Flag::Error AllocatePrefetchDistanceConstraintFunc(intx value, bool verbose) { |
93 if (value < 0) { |
93 if (value < 0 || value > 512) { |
94 CommandLineError::print(verbose, |
94 CommandLineError::print(verbose, |
95 "Unable to determine system-specific value for AllocatePrefetchDistance. " |
95 "AllocatePrefetchDistance (" INTX_FORMAT ") must be " |
96 "Please provide appropriate value, if unsure, use 0 to disable prefetching\n"); |
96 "between 0 and " INTX_FORMAT "\n", |
97 return Flag::VIOLATES_CONSTRAINT; |
97 AllocatePrefetchDistance, 512); |
98 } |
98 return Flag::VIOLATES_CONSTRAINT; |
99 |
99 } |
|
100 |
|
101 return Flag::SUCCESS; |
|
102 } |
|
103 |
|
104 Flag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) { |
|
105 if (AllocatePrefetchStyle == 3) { |
|
106 if (value % wordSize != 0) { |
|
107 CommandLineError::print(verbose, |
|
108 "AllocatePrefetchStepSize (" INTX_FORMAT ") must be multiple of %d\n", |
|
109 value, wordSize); |
|
110 return Flag::VIOLATES_CONSTRAINT; |
|
111 } |
|
112 } |
100 return Flag::SUCCESS; |
113 return Flag::SUCCESS; |
101 } |
114 } |
102 |
115 |
103 Flag::Error AllocatePrefetchInstrConstraintFunc(intx value, bool verbose) { |
116 Flag::Error AllocatePrefetchInstrConstraintFunc(intx value, bool verbose) { |
104 intx max_value = max_intx; |
117 intx max_value = max_intx; |
115 } |
128 } |
116 |
129 |
117 return Flag::SUCCESS; |
130 return Flag::SUCCESS; |
118 } |
131 } |
119 |
132 |
120 Flag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) { |
|
121 intx max_value = 512; |
|
122 if (value < 1 || value > max_value) { |
|
123 CommandLineError::print(verbose, |
|
124 "AllocatePrefetchStepSize (" INTX_FORMAT ") " |
|
125 "must be between 1 and %d\n", |
|
126 AllocatePrefetchStepSize, |
|
127 max_value); |
|
128 return Flag::VIOLATES_CONSTRAINT; |
|
129 } |
|
130 |
|
131 if (AllocatePrefetchDistance % AllocatePrefetchStepSize != 0) { |
|
132 CommandLineError::print(verbose, |
|
133 "AllocatePrefetchDistance (" INTX_FORMAT ") " |
|
134 "%% AllocatePrefetchStepSize (" INTX_FORMAT ") " |
|
135 "= " INTX_FORMAT " " |
|
136 "must be 0\n", |
|
137 AllocatePrefetchDistance, AllocatePrefetchStepSize, |
|
138 AllocatePrefetchDistance % AllocatePrefetchStepSize); |
|
139 return Flag::VIOLATES_CONSTRAINT; |
|
140 } |
|
141 |
|
142 /* The limit of 64 for the quotient of AllocatePrefetchDistance and AllocatePrefetchSize |
|
143 * originates from the limit of 64 for AllocatePrefetchLines/AllocateInstancePrefetchLines. |
|
144 * If AllocatePrefetchStyle == 2, the quotient from above is used in PhaseMacroExpand::prefetch_allocation() |
|
145 * to determine the number of lines to prefetch. For other values of AllocatePrefetchStyle, |
|
146 * AllocatePrefetchDistance and AllocatePrefetchSize is used. For consistency, all these |
|
147 * quantities must have the same limit (64 in this case). |
|
148 */ |
|
149 if (AllocatePrefetchDistance / AllocatePrefetchStepSize > 64) { |
|
150 CommandLineError::print(verbose, |
|
151 "AllocatePrefetchDistance (" INTX_FORMAT ") too large or " |
|
152 "AllocatePrefetchStepSize (" INTX_FORMAT ") too small; " |
|
153 "try decreasing/increasing values so that " |
|
154 "AllocatePrefetchDistance / AllocatePrefetchStepSize <= 64\n", |
|
155 AllocatePrefetchDistance, AllocatePrefetchStepSize, |
|
156 AllocatePrefetchDistance % AllocatePrefetchStepSize); |
|
157 return Flag::VIOLATES_CONSTRAINT; |
|
158 } |
|
159 |
|
160 return Flag::SUCCESS; |
|
161 } |
|
162 |
|
163 Flag::Error CompileThresholdConstraintFunc(intx value, bool verbose) { |
133 Flag::Error CompileThresholdConstraintFunc(intx value, bool verbose) { |
164 if (value < 0 || value > INT_MAX >> InvocationCounter::count_shift) { |
134 if (value < 0 || value > INT_MAX >> InvocationCounter::count_shift) { |
165 CommandLineError::print(verbose, |
135 CommandLineError::print(verbose, |
166 "CompileThreshold (" INTX_FORMAT ") " |
136 "CompileThreshold (" INTX_FORMAT ") " |
167 "must be between 0 and %d\n", |
137 "must be between 0 and %d\n", |