This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ] Implement memcmp with variable length with CLC.
ClosedPublic

Authored by jonpa on Aug 3 2021, 11:26 AM.

Details

Summary

Following the same pattern of memset/memcpy, this patch implements a variable length memcmp with a CLC loop followed by an EXRL instruction.

  • For a zero length memcompare, the aghi check against -1 should return a CC that is equivalent to "EQ" also for the memcompare IPM result, which seems reasonable..?
  • Hope it's ok to add a CC-def on the EXRL_Pseudo instead of an extra opcode like EXRL_Pseudo_CC...
  • emitMemMemVarLen() has for now merely been copied from the memcpy patch (with some minor modification).
  • ~1300 less library calls on spec.

Now that benchmarking is in progress for the memcpy patch, could this also be evaluated in parallel at this point?

Diff Detail

Event Timeline

jonpa created this revision.Aug 3 2021, 11:26 AM
jonpa requested review of this revision.Aug 3 2021, 11:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2021, 11:26 AM
jonpa updated this revision to Diff 369479.Aug 30 2021, 10:06 AM

Remember to swap the operands for the IPM sequence.

This LGTM, but it would be good to see some full benchmark results as well.

This revision was not accepted when it landed; it landed in state Needs Review.Oct 5 2021, 9:21 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.