s390x: Basic support for IaddIfcout

This adds enough support for the IaddIfcout opcode to make the
code emitted by dynamic_addr work on s390x.

Note: On s390x, the condition code mask that has to be used to
implement unsigned_add_overflow_condition does not match any of
the masks for the "normal" condition codes, so this design is
not really a good match for s390x ...
This commit is contained in:
Ulrich Weigand
2021-06-22 13:46:07 +02:00
parent 8760bccc8e
commit 3c678a7900
2 changed files with 45 additions and 6 deletions

View File

@@ -121,7 +121,12 @@ impl MachBackend for S390xBackend {
}
fn unsigned_add_overflow_condition(&self) -> IntCC {
unimplemented!()
// The ADD LOGICAL family of instructions set the condition code
// differently from normal comparisons, in a way that cannot be
// represented by any of the standard IntCC values. So we use a
// dummy value here, which gets remapped to the correct condition
// code mask during lowering.
IntCC::UnsignedGreaterThan
}
fn unsigned_sub_overflow_condition(&self) -> IntCC {