77 if (isNumericInteger(a.getPlatformKind())) {
78 AArch64ArithmeticOp op = setFlags ? AArch64ArithmeticOp.ADDS : AArch64ArithmeticOp.ADD;
79 return emitBinary(resultKind, op, true, a, b);
80 } else {
81 assert !setFlags : "Cannot set flags on floating point arithmetic";
82 return emitBinary(resultKind, AArch64ArithmeticOp.FADD, true, a, b);
83 }
84 }
85
86 @Override
87 protected Variable emitSub(LIRKind resultKind, Value a, Value b, boolean setFlags) {
88 if (isNumericInteger(a.getPlatformKind())) {
89 AArch64ArithmeticOp op = setFlags ? AArch64ArithmeticOp.SUBS : AArch64ArithmeticOp.SUB;
90 return emitBinary(resultKind, op, false, a, b);
91 } else {
92 assert !setFlags : "Cannot set flags on floating point arithmetic";
93 return emitBinary(resultKind, AArch64ArithmeticOp.FSUB, false, a, b);
94 }
95 }
96
97 protected Value emitExtendMemory(boolean isSigned, AArch64Kind memoryKind, int resultBits, AArch64AddressValue address, LIRFrameState state) {
98 // Issue a zero extending load of the proper bit size and set the result to
99 // the proper kind.
100 Variable result = getLIRGen().newVariable(LIRKind.value(resultBits == 32 ? AArch64Kind.DWORD : AArch64Kind.QWORD));
101
102 int targetSize = resultBits <= 32 ? 32 : 64;
103 switch (memoryKind) {
104 case BYTE:
105 case WORD:
106 case DWORD:
107 case QWORD:
108 getLIRGen().append(new AArch64Unary.MemoryOp(isSigned, targetSize,
109 memoryKind.getSizeInBytes() * 8, result, address, state));
110 break;
111 default:
112 throw GraalError.shouldNotReachHere();
113 }
114 return result;
115 }
116
117 @Override
|
77 if (isNumericInteger(a.getPlatformKind())) {
78 AArch64ArithmeticOp op = setFlags ? AArch64ArithmeticOp.ADDS : AArch64ArithmeticOp.ADD;
79 return emitBinary(resultKind, op, true, a, b);
80 } else {
81 assert !setFlags : "Cannot set flags on floating point arithmetic";
82 return emitBinary(resultKind, AArch64ArithmeticOp.FADD, true, a, b);
83 }
84 }
85
86 @Override
87 protected Variable emitSub(LIRKind resultKind, Value a, Value b, boolean setFlags) {
88 if (isNumericInteger(a.getPlatformKind())) {
89 AArch64ArithmeticOp op = setFlags ? AArch64ArithmeticOp.SUBS : AArch64ArithmeticOp.SUB;
90 return emitBinary(resultKind, op, false, a, b);
91 } else {
92 assert !setFlags : "Cannot set flags on floating point arithmetic";
93 return emitBinary(resultKind, AArch64ArithmeticOp.FSUB, false, a, b);
94 }
95 }
96
97 public Value emitExtendMemory(boolean isSigned, AArch64Kind memoryKind, int resultBits, AArch64AddressValue address, LIRFrameState state) {
98 // Issue a zero extending load of the proper bit size and set the result to
99 // the proper kind.
100 Variable result = getLIRGen().newVariable(LIRKind.value(resultBits == 32 ? AArch64Kind.DWORD : AArch64Kind.QWORD));
101
102 int targetSize = resultBits <= 32 ? 32 : 64;
103 switch (memoryKind) {
104 case BYTE:
105 case WORD:
106 case DWORD:
107 case QWORD:
108 getLIRGen().append(new AArch64Unary.MemoryOp(isSigned, targetSize,
109 memoryKind.getSizeInBytes() * 8, result, address, state));
110 break;
111 default:
112 throw GraalError.shouldNotReachHere();
113 }
114 return result;
115 }
116
117 @Override
|