diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-03-25 20:17:04 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-03-25 20:17:04 -0500 |
commit | c64ca3e9bebaad7cb5d47fb8891ec782788b1aef (patch) | |
tree | 84fd1b924db1c1379d27849c96e08127a11fb61f | |
parent | 682ba3a67b9c3d36ac4603fc3ad1dd10ea024974 (diff) | |
download | gcc-c64ca3e9bebaad7cb5d47fb8891ec782788b1aef.zip gcc-c64ca3e9bebaad7cb5d47fb8891ec782788b1aef.tar.gz gcc-c64ca3e9bebaad7cb5d47fb8891ec782788b1aef.tar.bz2 |
i386.md (movhi, movqi): Properly recognized unsigned forms of -1 for
dec[bw] insns.
From-SVN: r6909
-rw-r--r-- | gcc/config/i386/i386.md | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 5a87914..500fbbd 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -1,5 +1,5 @@ ;; GCC machine description for Intel 80386. -;; Copyright (C) 1988 Free Software Foundation, Inc. +;; Copyright (C) 1988, 1994 Free Software Foundation, Inc. ;; Mostly by William Schelter. ;; This file is part of GNU CC. @@ -2103,23 +2103,24 @@ && GET_CODE (operands[2]) == CONST_INT && (INTVAL (operands[2]) & 0xff) == 0) { + int byteval = (INTVAL (operands[2]) >> 8) & 0xff; CC_STATUS_INIT; - operands[2] = GEN_INT ((INTVAL (operands[2]) >> 8) & 0xff); - - if (operands[2] == const1_rtx) + if (byteval == 1) return AS1 (inc%B0,%h0); - - if (operands[2] == constm1_rtx) + else if (byteval == 255) return AS1 (dec%B0,%h0); + operands[2] = GEN_INT (byteval); return AS2 (add%B0,%2,%h0); } if (operands[2] == const1_rtx) return AS1 (inc%W0,%0); - if (operands[2] == constm1_rtx) + if (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 65535)) return AS1 (dec%W0,%0); return AS2 (add%W0,%2,%0); @@ -2135,7 +2136,9 @@ if (operands[2] == const1_rtx) return AS1 (inc%B0,%0); - if (operands[2] == constm1_rtx) + if (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)) return AS1 (dec%B0,%0); return AS2 (add%B0,%2,%0); |