The BEXTR instruction documents the SF bit as undefined.
The TBM BEXTR instruction has the same issue, but I'm not sure how to test it. With the control being an immediate we can determine the sign bit is 0 or the BEXTR would have been removed.
Paths
| Differential D55807
[X86] Don't allow optimizeCompareInstr to replace a CMP with BEXTR if the sign flag is used. ClosedPublic Authored by craig.topper on Dec 17 2018, 9:14 PM.
Details Summary The BEXTR instruction documents the SF bit as undefined. The TBM BEXTR instruction has the same issue, but I'm not sure how to test it. With the control being an immediate we can determine the sign bit is 0 or the BEXTR would have been removed.
Diff Detail
Event TimelineComment Actions At some point we're probably going to have to properly tag what state each flag bit is in after an instruction - I think @andreadb is keen on this for llvm-mca as well to account for different cpus splitting the eflags into different partial registers.
This revision is now accepted and ready to land.Dec 21 2018, 10:56 AM Closed by commit rL349956: [X86] Don't allow optimizeCompareInstr to replace a CMP with BEXTR if the sign… (authored by ctopper). · Explain WhyDec 21 2018, 1:19 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 179343 llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
llvm/trunk/test/CodeGen/X86/bmi.ll
|