< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java

Print this page




 104 import org.graalvm.compiler.lir.LIRValueUtil;
 105 import org.graalvm.compiler.lir.Variable;
 106 import org.graalvm.compiler.lir.amd64.AMD64AddressValue;
 107 import org.graalvm.compiler.lir.amd64.AMD64Arithmetic.FPDivRemOp;
 108 import org.graalvm.compiler.lir.amd64.AMD64ArithmeticLIRGeneratorTool;
 109 import org.graalvm.compiler.lir.amd64.AMD64Binary;
 110 import org.graalvm.compiler.lir.amd64.AMD64BinaryConsumer;
 111 import org.graalvm.compiler.lir.amd64.AMD64ClearRegisterOp;
 112 import org.graalvm.compiler.lir.amd64.AMD64MathCosOp;
 113 import org.graalvm.compiler.lir.amd64.AMD64MathExpOp;
 114 import org.graalvm.compiler.lir.amd64.AMD64MathLog10Op;
 115 import org.graalvm.compiler.lir.amd64.AMD64MathLogOp;
 116 import org.graalvm.compiler.lir.amd64.AMD64MathPowOp;
 117 import org.graalvm.compiler.lir.amd64.AMD64MathSinOp;
 118 import org.graalvm.compiler.lir.amd64.AMD64MathTanOp;
 119 import org.graalvm.compiler.lir.amd64.AMD64Move;
 120 import org.graalvm.compiler.lir.amd64.AMD64MulDivOp;
 121 import org.graalvm.compiler.lir.amd64.AMD64ShiftOp;
 122 import org.graalvm.compiler.lir.amd64.AMD64SignExtendOp;
 123 import org.graalvm.compiler.lir.amd64.AMD64Unary;

 124 import org.graalvm.compiler.lir.amd64.vector.AMD64VectorBinary;
 125 import org.graalvm.compiler.lir.amd64.vector.AMD64VectorBinary.AVXBinaryOp;
 126 import org.graalvm.compiler.lir.amd64.vector.AMD64VectorUnary;
 127 import org.graalvm.compiler.lir.gen.ArithmeticLIRGenerator;
 128 
 129 import jdk.vm.ci.amd64.AMD64;
 130 import jdk.vm.ci.amd64.AMD64.CPUFeature;
 131 import jdk.vm.ci.amd64.AMD64Kind;
 132 import jdk.vm.ci.code.CodeUtil;
 133 import jdk.vm.ci.code.Register;
 134 import jdk.vm.ci.code.RegisterValue;
 135 import jdk.vm.ci.code.TargetDescription;
 136 import jdk.vm.ci.meta.AllocatableValue;
 137 import jdk.vm.ci.meta.Constant;
 138 import jdk.vm.ci.meta.JavaConstant;
 139 import jdk.vm.ci.meta.JavaKind;
 140 import jdk.vm.ci.meta.PlatformKind;
 141 import jdk.vm.ci.meta.VMConstant;
 142 import jdk.vm.ci.meta.Value;
 143 import jdk.vm.ci.meta.ValueKind;


1083     }
1084 
1085     @Override
1086     public Value emitMathSin(Value input) {
1087         return new AMD64MathSinOp().emitLIRWrapper(getLIRGen(), input);
1088     }
1089 
1090     @Override
1091     public Value emitMathTan(Value input) {
1092         return new AMD64MathTanOp().emitLIRWrapper(getLIRGen(), input);
1093     }
1094 
1095     @Override
1096     public Value emitMathExp(Value input) {
1097         return new AMD64MathExpOp().emitLIRWrapper(getLIRGen(), input);
1098     }
1099 
1100     @Override
1101     public Value emitMathPow(Value x, Value y) {
1102         return new AMD64MathPowOp().emitLIRWrapper(getLIRGen(), x, y);






1103     }
1104 
1105     protected AMD64LIRGenerator getAMD64LIRGen() {
1106         return (AMD64LIRGenerator) getLIRGen();
1107     }
1108 
1109     @Override
1110     public Variable emitLoad(LIRKind kind, Value address, LIRFrameState state) {
1111         AMD64AddressValue loadAddress = getAMD64LIRGen().asAddressValue(address);
1112         Variable result = getLIRGen().newVariable(getLIRGen().toRegisterKind(kind));
1113         switch ((AMD64Kind) kind.getPlatformKind()) {
1114             case BYTE:
1115                 getLIRGen().append(new AMD64Unary.MemoryOp(MOVSXB, DWORD, result, loadAddress, state));
1116                 break;
1117             case WORD:
1118                 getLIRGen().append(new AMD64Unary.MemoryOp(MOVSX, DWORD, result, loadAddress, state));
1119                 break;
1120             case DWORD:
1121                 getLIRGen().append(new AMD64Unary.MemoryOp(MOV, DWORD, result, loadAddress, state));
1122                 break;




 104 import org.graalvm.compiler.lir.LIRValueUtil;
 105 import org.graalvm.compiler.lir.Variable;
 106 import org.graalvm.compiler.lir.amd64.AMD64AddressValue;
 107 import org.graalvm.compiler.lir.amd64.AMD64Arithmetic.FPDivRemOp;
 108 import org.graalvm.compiler.lir.amd64.AMD64ArithmeticLIRGeneratorTool;
 109 import org.graalvm.compiler.lir.amd64.AMD64Binary;
 110 import org.graalvm.compiler.lir.amd64.AMD64BinaryConsumer;
 111 import org.graalvm.compiler.lir.amd64.AMD64ClearRegisterOp;
 112 import org.graalvm.compiler.lir.amd64.AMD64MathCosOp;
 113 import org.graalvm.compiler.lir.amd64.AMD64MathExpOp;
 114 import org.graalvm.compiler.lir.amd64.AMD64MathLog10Op;
 115 import org.graalvm.compiler.lir.amd64.AMD64MathLogOp;
 116 import org.graalvm.compiler.lir.amd64.AMD64MathPowOp;
 117 import org.graalvm.compiler.lir.amd64.AMD64MathSinOp;
 118 import org.graalvm.compiler.lir.amd64.AMD64MathTanOp;
 119 import org.graalvm.compiler.lir.amd64.AMD64Move;
 120 import org.graalvm.compiler.lir.amd64.AMD64MulDivOp;
 121 import org.graalvm.compiler.lir.amd64.AMD64ShiftOp;
 122 import org.graalvm.compiler.lir.amd64.AMD64SignExtendOp;
 123 import org.graalvm.compiler.lir.amd64.AMD64Unary;
 124 import org.graalvm.compiler.lir.amd64.AMD64ZeroMemoryOp;
 125 import org.graalvm.compiler.lir.amd64.vector.AMD64VectorBinary;
 126 import org.graalvm.compiler.lir.amd64.vector.AMD64VectorBinary.AVXBinaryOp;
 127 import org.graalvm.compiler.lir.amd64.vector.AMD64VectorUnary;
 128 import org.graalvm.compiler.lir.gen.ArithmeticLIRGenerator;
 129 
 130 import jdk.vm.ci.amd64.AMD64;
 131 import jdk.vm.ci.amd64.AMD64.CPUFeature;
 132 import jdk.vm.ci.amd64.AMD64Kind;
 133 import jdk.vm.ci.code.CodeUtil;
 134 import jdk.vm.ci.code.Register;
 135 import jdk.vm.ci.code.RegisterValue;
 136 import jdk.vm.ci.code.TargetDescription;
 137 import jdk.vm.ci.meta.AllocatableValue;
 138 import jdk.vm.ci.meta.Constant;
 139 import jdk.vm.ci.meta.JavaConstant;
 140 import jdk.vm.ci.meta.JavaKind;
 141 import jdk.vm.ci.meta.PlatformKind;
 142 import jdk.vm.ci.meta.VMConstant;
 143 import jdk.vm.ci.meta.Value;
 144 import jdk.vm.ci.meta.ValueKind;


1084     }
1085 
1086     @Override
1087     public Value emitMathSin(Value input) {
1088         return new AMD64MathSinOp().emitLIRWrapper(getLIRGen(), input);
1089     }
1090 
1091     @Override
1092     public Value emitMathTan(Value input) {
1093         return new AMD64MathTanOp().emitLIRWrapper(getLIRGen(), input);
1094     }
1095 
1096     @Override
1097     public Value emitMathExp(Value input) {
1098         return new AMD64MathExpOp().emitLIRWrapper(getLIRGen(), input);
1099     }
1100 
1101     @Override
1102     public Value emitMathPow(Value x, Value y) {
1103         return new AMD64MathPowOp().emitLIRWrapper(getLIRGen(), x, y);
1104     }
1105 
1106     @Override
1107     public void emitZeroMemory(Value address, Value length) {
1108         RegisterValue lengthReg = moveToReg(AMD64.rcx, length);
1109         getLIRGen().append(new AMD64ZeroMemoryOp(getAMD64LIRGen().asAddressValue(address), lengthReg));
1110     }
1111 
1112     protected AMD64LIRGenerator getAMD64LIRGen() {
1113         return (AMD64LIRGenerator) getLIRGen();
1114     }
1115 
1116     @Override
1117     public Variable emitLoad(LIRKind kind, Value address, LIRFrameState state) {
1118         AMD64AddressValue loadAddress = getAMD64LIRGen().asAddressValue(address);
1119         Variable result = getLIRGen().newVariable(getLIRGen().toRegisterKind(kind));
1120         switch ((AMD64Kind) kind.getPlatformKind()) {
1121             case BYTE:
1122                 getLIRGen().append(new AMD64Unary.MemoryOp(MOVSXB, DWORD, result, loadAddress, state));
1123                 break;
1124             case WORD:
1125                 getLIRGen().append(new AMD64Unary.MemoryOp(MOVSX, DWORD, result, loadAddress, state));
1126                 break;
1127             case DWORD:
1128                 getLIRGen().append(new AMD64Unary.MemoryOp(MOV, DWORD, result, loadAddress, state));
1129                 break;


< prev index next >