OSDN Git Service

[x86] Model the direction flag (DF) separately from the rest of EFLAGS.
authorChandler Carruth <chandlerc@gmail.com>
Tue, 10 Apr 2018 06:40:51 +0000 (06:40 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 10 Apr 2018 06:40:51 +0000 (06:40 +0000)
commit9f8f7c5e8ab12afcc92f51d0ed596ac0867eb0fa
tree1d7031ccf31bc8778bf5486a85d9eb295766e023
parent307dae5bd1db956562ca6ca26370627a2cc39b5e
[x86] Model the direction flag (DF) separately from the rest of EFLAGS.

This cleans up a number of operations that only claimed te use EFLAGS
due to using DF. But no instructions which we think of us setting EFLAGS
actually modify DF (other than things like popf) and so this needlessly
creates uses of EFLAGS that aren't really there.

In fact, DF is so restrictive it is pretty easy to model. Only STD, CLD,
and the whole-flags writes (WRFLAGS and POPF) need to model this.

I've also somewhat cleaned up some of the flag management instruction
definitions to be in the correct .td file.

Adding this extra register also uncovered a failure to use the correct
datatype to hold X86 registers, and I've corrected that as necessary
here.

Differential Revision: https://reviews.llvm.org/D45154

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329673 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/Disassembler/X86Disassembler.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrCompiler.td
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrInfo.td
lib/Target/X86/X86InstrSystem.td
lib/Target/X86/X86RegisterInfo.td
test/CodeGen/X86/ipra-reg-usage.ll