diff options
author | Uros Bizjak <uros@gcc.gnu.org> | 2010-04-19 14:37:16 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2010-04-19 14:37:16 +0200 |
commit | 90f775a9c7afd62cbd338b973ec9711354440c6c (patch) | |
tree | 3293fef3a8eb2314035ab22fa75dc319550e2c90 /gcc/config/i386 | |
parent | 7e4fe2c3279c07c5b60e09cd9b9128fd94ccbb22 (diff) | |
download | gcc-90f775a9c7afd62cbd338b973ec9711354440c6c.zip gcc-90f775a9c7afd62cbd338b973ec9711354440c6c.tar.gz gcc-90f775a9c7afd62cbd338b973ec9711354440c6c.tar.bz2 |
re PR target/43766 (x86 prefetch doesn't use complex memory addressing)
PR target/43766
* config/i386/i386.c (ix86_decompose_address): Handle ASHIFT addends.
testsuite/ChangeLog:
PR target/43766
* gcc.target/i386/pr43766.c: New test.
From-SVN: r158515
Diffstat (limited to 'gcc/config/i386')
-rw-r--r-- | gcc/config/i386/i386.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 7376d1b..f91410a 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -9357,6 +9357,7 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) rtx base_reg, index_reg; HOST_WIDE_INT scale = 1; rtx scale_rtx = NULL_RTX; + rtx tmp; int retval = 1; enum ix86_address_seg seg = SEG_DEFAULT; @@ -9392,6 +9393,19 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) scale_rtx = XEXP (op, 1); break; + case ASHIFT: + if (index) + return 0; + index = XEXP (op, 0); + tmp = XEXP (op, 1); + if (!CONST_INT_P (tmp)) + return 0; + scale = INTVAL (tmp); + if ((unsigned HOST_WIDE_INT) scale > 3) + return 0; + scale = 1 << scale; + break; + case UNSPEC: if (XINT (op, 1) == UNSPEC_TP && TARGET_TLS_DIRECT_SEG_REFS @@ -9432,8 +9446,6 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) } else if (GET_CODE (addr) == ASHIFT) { - rtx tmp; - /* We're called for lea too, which implements ashift on occasion. */ index = XEXP (addr, 0); tmp = XEXP (addr, 1); |