Search in sources :

Example 1 with SPARCIMulccOp

use of org.graalvm.compiler.lir.sparc.SPARCArithmetic.SPARCIMulccOp in project graal by oracle.

the class SPARCArithmeticLIRGenerator method emitMul.

@Override
public Variable emitMul(Value a, Value b, boolean setFlags) {
    LIRKind resultKind = LIRKind.combine(a, b);
    PlatformKind aKind = a.getPlatformKind();
    if (isNumericInteger(aKind)) {
        if (setFlags) {
            Variable result = getLIRGen().newVariable(LIRKind.combine(a, b));
            if (aKind == XWORD) {
                getLIRGen().append(new SPARCLMulccOp(result, getLIRGen().load(a), getLIRGen().load(b), getLIRGen()));
            } else if (aKind == WORD) {
                getLIRGen().append(new SPARCIMulccOp(result, getLIRGen().load(a), getLIRGen().load(b)));
            } else {
                throw GraalError.shouldNotReachHere();
            }
            return result;
        } else {
            return emitBinary(resultKind, Op3s.Mulx, a, b);
        }
    } else {
        boolean isDouble = a.getPlatformKind().equals(DOUBLE);
        return emitBinary(resultKind, isDouble ? Fmuld : Fmuls, a, b);
    }
}
Also used : Variable(org.graalvm.compiler.lir.Variable) LIRKind(org.graalvm.compiler.core.common.LIRKind) PlatformKind(jdk.vm.ci.meta.PlatformKind) SPARCIMulccOp(org.graalvm.compiler.lir.sparc.SPARCArithmetic.SPARCIMulccOp) SPARCLMulccOp(org.graalvm.compiler.lir.sparc.SPARCArithmetic.SPARCLMulccOp)

Aggregations

PlatformKind (jdk.vm.ci.meta.PlatformKind)1 LIRKind (org.graalvm.compiler.core.common.LIRKind)1 Variable (org.graalvm.compiler.lir.Variable)1 SPARCIMulccOp (org.graalvm.compiler.lir.sparc.SPARCArithmetic.SPARCIMulccOp)1 SPARCLMulccOp (org.graalvm.compiler.lir.sparc.SPARCArithmetic.SPARCLMulccOp)1