[llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.td
Evan Cheng
evan.cheng at apple.com
Mon Dec 12 17:02:58 PST 2005
Changes in directory llvm/lib/Target/X86:
X86InstrInfo.td updated: 1.159 -> 1.160
---
Log message:
Add inc + dec patterns which fold load + stores.
---
Diffs of the changes: (+12 -6)
X86InstrInfo.td | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
Index: llvm/lib/Target/X86/X86InstrInfo.td
diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.159 llvm/lib/Target/X86/X86InstrInfo.td:1.160
--- llvm/lib/Target/X86/X86InstrInfo.td:1.159 Mon Dec 12 18:54:44 2005
+++ llvm/lib/Target/X86/X86InstrInfo.td Mon Dec 12 19:02:47 2005
@@ -715,9 +715,12 @@
[(set R32:$dst, (add R32:$src, 1))]>;
}
let isTwoAddress = 0 in {
- def INC8m : I<0xFE, MRM0m, (ops i8mem :$dst), "inc{b} $dst", []>;
- def INC16m : I<0xFF, MRM0m, (ops i16mem:$dst), "inc{w} $dst", []>, OpSize;
- def INC32m : I<0xFF, MRM0m, (ops i32mem:$dst), "inc{l} $dst", []>;
+ def INC8m : I<0xFE, MRM0m, (ops i8mem :$dst), "inc{b} $dst",
+ [(store (add (i8 (load addr:$dst)), 1), addr:$dst)]>;
+ def INC16m : I<0xFF, MRM0m, (ops i16mem:$dst), "inc{w} $dst",
+ [(store (add (i16 (load addr:$dst)), 1), addr:$dst)]>, OpSize;
+ def INC32m : I<0xFF, MRM0m, (ops i32mem:$dst), "inc{l} $dst",
+ [(store (add (i32 (load addr:$dst)), 1), addr:$dst)]>;
}
def DEC8r : I<0xFE, MRM1r, (ops R8 :$dst, R8 :$src), "dec{b} $dst",
@@ -730,9 +733,12 @@
}
let isTwoAddress = 0 in {
- def DEC8m : I<0xFE, MRM1m, (ops i8mem :$dst), "dec{b} $dst", []>;
- def DEC16m : I<0xFF, MRM1m, (ops i16mem:$dst), "dec{w} $dst", []>, OpSize;
- def DEC32m : I<0xFF, MRM1m, (ops i32mem:$dst), "dec{l} $dst", []>;
+ def DEC8m : I<0xFE, MRM1m, (ops i8mem :$dst), "dec{b} $dst",
+ [(store (add (i8 (load addr:$dst)), -1), addr:$dst)]>;
+ def DEC16m : I<0xFF, MRM1m, (ops i16mem:$dst), "dec{w} $dst",
+ [(store (add (i16 (load addr:$dst)), -1), addr:$dst)]>, OpSize;
+ def DEC32m : I<0xFF, MRM1m, (ops i32mem:$dst), "dec{l} $dst",
+ [(store (add (i32 (load addr:$dst)), -1), addr:$dst)]>;
}
// Logical operators...
More information about the llvm-commits
mailing list