< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java

Print this page
rev 52509 : [mq]: graal


 184     public Value emitShr(Value a, Value b) {
 185         assert isNumericInteger(a.getPlatformKind());
 186         return emitBinary(LIRKind.combine(a, b), AArch64ArithmeticOp.ASHR, false, a, b);
 187     }
 188 
 189     @Override
 190     public Value emitUShr(Value a, Value b) {
 191         assert isNumericInteger(a.getPlatformKind());
 192         return emitBinary(LIRKind.combine(a, b), AArch64ArithmeticOp.LSHR, false, a, b);
 193     }
 194 
 195     @Override
 196     public Value emitFloatConvert(FloatConvert op, Value inputVal) {
 197         PlatformKind resultPlatformKind = getFloatConvertResultKind(op);
 198         LIRKind resultLirKind = LIRKind.combine(inputVal).changeType(resultPlatformKind);
 199         Variable result = getLIRGen().newVariable(resultLirKind);
 200         getLIRGen().append(new AArch64FloatConvertOp(op, result, asAllocatable(inputVal)));
 201         return result;
 202     }
 203 










 204     private static PlatformKind getFloatConvertResultKind(FloatConvert op) {
 205         switch (op) {
 206             case F2I:
 207             case D2I:
 208                 return AArch64Kind.DWORD;
 209             case F2L:
 210             case D2L:
 211                 return AArch64Kind.QWORD;
 212             case I2F:
 213             case L2F:
 214             case D2F:
 215                 return AArch64Kind.SINGLE;
 216             case I2D:
 217             case L2D:
 218             case F2D:
 219                 return AArch64Kind.DOUBLE;
 220             default:
 221                 throw GraalError.shouldNotReachHere();
 222         }
 223     }




 184     public Value emitShr(Value a, Value b) {
 185         assert isNumericInteger(a.getPlatformKind());
 186         return emitBinary(LIRKind.combine(a, b), AArch64ArithmeticOp.ASHR, false, a, b);
 187     }
 188 
 189     @Override
 190     public Value emitUShr(Value a, Value b) {
 191         assert isNumericInteger(a.getPlatformKind());
 192         return emitBinary(LIRKind.combine(a, b), AArch64ArithmeticOp.LSHR, false, a, b);
 193     }
 194 
 195     @Override
 196     public Value emitFloatConvert(FloatConvert op, Value inputVal) {
 197         PlatformKind resultPlatformKind = getFloatConvertResultKind(op);
 198         LIRKind resultLirKind = LIRKind.combine(inputVal).changeType(resultPlatformKind);
 199         Variable result = getLIRGen().newVariable(resultLirKind);
 200         getLIRGen().append(new AArch64FloatConvertOp(op, result, asAllocatable(inputVal)));
 201         return result;
 202     }
 203 
 204     public Value emitAddSubShift(AArch64ArithmeticOp op, Value a, Value b, AArch64MacroAssembler.ShiftType shiftType, int shiftAmount) {
 205         assert isNumericInteger(a.getPlatformKind());
 206         assert isNumericInteger(b.getPlatformKind());
 207         Variable result = getLIRGen().newVariable(LIRKind.combine(a, b));
 208         AllocatableValue x = moveSp(asAllocatable(a));
 209         AllocatableValue y = moveSp(asAllocatable(b));
 210         getLIRGen().append(new AArch64ArithmeticOp.AddSubShiftOp(op, result, x, y, shiftType, shiftAmount));
 211         return result;
 212     }
 213 
 214     private static PlatformKind getFloatConvertResultKind(FloatConvert op) {
 215         switch (op) {
 216             case F2I:
 217             case D2I:
 218                 return AArch64Kind.DWORD;
 219             case F2L:
 220             case D2L:
 221                 return AArch64Kind.QWORD;
 222             case I2F:
 223             case L2F:
 224             case D2F:
 225                 return AArch64Kind.SINGLE;
 226             case I2D:
 227             case L2D:
 228             case F2D:
 229                 return AArch64Kind.DOUBLE;
 230             default:
 231                 throw GraalError.shouldNotReachHere();
 232         }
 233     }


< prev index next >