This is an archive of the discontinued LLVM Phabricator instance.

x86: add has lahf/sahf feature
AbandonedPublic

Authored by jfb on Dec 4 2015, 11:41 AM.

Details

Reviewers
hans
Summary

Some CPUs don't support lahf/sahf.

Diff Detail

Event Timeline

jfb updated this revision to Diff 41904.Dec 4 2015, 11:41 AM
jfb retitled this revision from to x86: add has lahf/sahf feature.
jfb updated this object.
jfb added a reviewer: hans.
jfb added a subscriber: llvm-commits.
jfb added a comment.Dec 4 2015, 11:44 AM

Follow-up to: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150810/293071.html

This patch isn't ready yet:

  • It needs to be taught about which CPUs support LAHF/SAHF and which don't.
  • Code generation also needs to change in X86TargetLowering::ConvertCmpIfNecessary.
  • Some tests need to be added.

The following tests are currently failing, and may need to be updated:

LLVM :: CodeGen/X86/2004-02-22-Casts.ll
LLVM :: CodeGen/X86/2004-06-10-StackifierCrash.ll
LLVM :: CodeGen/X86/2006-05-22-FPSetEQ.ll
LLVM :: CodeGen/X86/2008-05-01-InvalidOrdCompare.ll
LLVM :: CodeGen/X86/2009-02-12-SpillerBug.ll
LLVM :: CodeGen/X86/2009-03-09-SpillerBug.ll
LLVM :: CodeGen/X86/2012-08-28-UnsafeMathCrash.ll
LLVM :: CodeGen/X86/2012-10-02-DAGCycle.ll
LLVM :: CodeGen/X86/bitcast-int-to-vector.ll
LLVM :: CodeGen/X86/block-placement.ll
LLVM :: CodeGen/X86/cmovcmov.ll
LLVM :: CodeGen/X86/cmpxchg-clobber-flags.ll
LLVM :: CodeGen/X86/constpool.ll
LLVM :: CodeGen/X86/crash.ll
LLVM :: CodeGen/X86/fabs.ll
LLVM :: CodeGen/X86/fp-stack-O0-crash.ll
LLVM :: CodeGen/X86/fp-stack-compare.ll
LLVM :: CodeGen/X86/fp-stack.ll
LLVM :: CodeGen/X86/isnan.ll
LLVM :: CodeGen/X86/peephole-na-phys-copy-folding.ll
LLVM :: CodeGen/X86/scalar-fp-to-i64.ll
LLVM :: CodeGen/X86/setuge.ll
LLVM :: CodeGen/X86/stack-protector.ll
LLVM :: CodeGen/X86/vec_fp_to_int.ll
jfb abandoned this revision.Dec 4 2015, 11:55 AM

Abandoning in favor of @hans' D15240.