use of org.graalvm.compiler.core.match.MatchRule in project graal by oracle.
the class AMD64NodeMatchRules method mulMemory.
@MatchRule("(Mul value Read=access)")
@MatchRule("(Mul value FloatingRead=access)")
public ComplexMatchResult mulMemory(ValueNode value, LIRLowerableAccess access) {
OperandSize size = getMemorySize(access);
if (size.isXmmType()) {
TargetDescription target = getLIRGeneratorTool().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
if (isAvx) {
return binaryRead(AVXOp.MUL, size, value, access);
} else {
return binaryRead(SSEOp.MUL, size, value, access);
}
} else {
return binaryRead(AMD64RMOp.IMUL, size, value, access);
}
}
use of org.graalvm.compiler.core.match.MatchRule in project graal by oracle.
the class MatchProcessor method processMatchRule.
private void processMatchRule(EconomicMap<TypeElement, MatchRuleDescriptor> map, Element element, AnnotationMirror mirror) {
if (!processedMatchRule.contains(element)) {
try {
processedMatchRule.add(element);
// The annotation element type should ensure this is true.
assert element instanceof ExecutableElement;
findMatchableNodes(element);
TypeElement topDeclaringType = topDeclaringType(element);
MatchRuleDescriptor info = map.get(topDeclaringType);
if (info == null) {
info = new MatchRuleDescriptor(topDeclaringType);
map.put(topDeclaringType, info);
}
List<AnnotationMirror> mirrors = null;
if (typeUtils().isSameType(mirror.getAnnotationType(), matchRulesTypeMirror)) {
// Unpack the mirrors for a repeatable annotation
mirrors = getAnnotationValueList(AnnotationMirror.class, mirror, "value");
}
int i = 0;
for (MatchRule matchRule : element.getAnnotationsByType(MatchRule.class)) {
processMethodMatchRule((ExecutableElement) element, info, matchRule, mirrors != null ? mirrors.get(i++) : mirror);
}
} catch (Throwable t) {
reportExceptionThrow(element, t);
}
}
}
Aggregations