Index: src/s390/macro-assembler-s390.cc |
diff --git a/src/s390/macro-assembler-s390.cc b/src/s390/macro-assembler-s390.cc |
index 37db6df1ba46859c5abc311562450d460f38f60e..789fa5d575d09efb569e6af647c1b94446e6f37c 100644 |
--- a/src/s390/macro-assembler-s390.cc |
+++ b/src/s390/macro-assembler-s390.cc |
@@ -4076,6 +4076,42 @@ void MacroAssembler::AddLogicalP(Register dst, const MemOperand& opnd) { |
// Subtract Instructions |
//---------------------------------------------------------------------------- |
+// Subtract Logical With Carry 32-bit (Register dst = Register src1 - Register |
+// src2) |
+void MacroAssembler::SubLogicalWithBorrow32(Register dst, Register src1, |
+ Register src2) { |
+ if (!dst.is(src2) && !dst.is(src1)) { |
+ lr(dst, src1); |
+ slbr(dst, src2); |
+ } else if (!dst.is(src2)) { |
+ // dst == src1 |
+ DCHECK(dst.is(src1)); |
+ slbr(dst, src2); |
+ } else { |
+ // dst == src2 |
+ DCHECK(dst.is(src2)); |
+ lr(r0, dst); |
+ SubLogicalWithBorrow32(dst, src1, r0); |
+ } |
+} |
+ |
+// Subtract Logical 32-bit (Register dst = Register src1 - Register src2) |
+void MacroAssembler::SubLogical32(Register dst, Register src1, Register src2) { |
+ if (!dst.is(src2) && !dst.is(src1)) { |
+ lr(dst, src1); |
+ slr(dst, src2); |
+ } else if (!dst.is(src2)) { |
+ // dst == src1 |
+ DCHECK(dst.is(src1)); |
+ slr(dst, src2); |
+ } else { |
+ // dst == src2 |
+ DCHECK(dst.is(src2)); |
+ lr(r0, dst); |
+ SubLogical32(dst, src1, r0); |
+ } |
+} |
+ |
// Subtract 32-bit (Register dst = Register dst - Immediate opnd) |
void MacroAssembler::Sub32(Register dst, const Operand& imm) { |
Add32(dst, Operand(-(imm.imm_))); |