aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/README.txt
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-03-10 00:26:23 +0000
committerDan Gohman <gohman@apple.com>2009-03-10 00:26:23 +0000
commit3328adda6b9386c4442b5ec71eeaaf41e8df58b5 (patch)
tree0528dee520846214fb162cf274d20d2ca0c7e4c6 /lib/Target/X86/README.txt
parent1f2f31493e8bc97cdb9a9ff36c788503aec5718d (diff)
downloadexternal_llvm-3328adda6b9386c4442b5ec71eeaaf41e8df58b5.zip
external_llvm-3328adda6b9386c4442b5ec71eeaaf41e8df58b5.tar.gz
external_llvm-3328adda6b9386c4442b5ec71eeaaf41e8df58b5.tar.bz2
Add more information to the EFLAGS note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/README.txt')
-rw-r--r--lib/Target/X86/README.txt16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt
index 7713316..5d0446f 100644
--- a/lib/Target/X86/README.txt
+++ b/lib/Target/X86/README.txt
@@ -1820,18 +1820,26 @@ LBB1_1: ## bb1
//===---------------------------------------------------------------------===//
Test instructions can be eliminated by using EFLAGS values from arithmetic
-instructions. This is currently not done for and, or, xor, neg, shl, sra,
-srl, shld, shrd, atomic ops, and others. It is also currently not done for
-read-modify-write instructions.
+instructions. This is currently not done for mul, and, or, xor, neg, shl,
+sra, srl, shld, shrd, atomic ops, and others. It is also currently not done
+for read-modify-write instructions. It is also current not done if the
+OF or CF flags are needed.
The shift operators have the complication that when the shift count is
zero, EFLAGS is not set, so they can only subsume a test instruction if
-the shift count is known to be non-zero.
+the shift count is known to be non-zero. Also, using the EFLAGS value
+from a shift is apparently very slow on some x86 implementations.
In read-modify-write instructions, the root node in the isel match is
the store, and isel has no way for the use of the EFLAGS result of the
arithmetic to be remapped to the new node.
+Add and subtract instructions set OF on signed overflow and CF on unsiged
+overflow, while test instructions always clear OF and CF. In order to
+replace a test with an add or subtract in a situation where OF or CF is
+needed, codegen must be able to prove that the operation cannot see
+signed or unsigned overflow, respectively.
+
//===---------------------------------------------------------------------===//
test/CodeGen/X86/2009-03-07-FPConstSelect.ll compiles to: