This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
alpha_emit_set_const optimization
- To: gcc-patches at gcc dot gnu dot org
- Subject: alpha_emit_set_const optimization
- From: Richard Henderson <rth at cygnus dot com>
- Date: Thu, 2 Mar 2000 22:24:15 -0800
Helps a lot with fixed address memory mapped register constants. E.g.
#define CIA_IOC_PCI_TBIA 0xfffffc87c0000100
r~
* alpha.c (alpha_emit_set_const_1): Also try c + small constant.
Index: alpha.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/alpha/alpha.c,v
retrieving revision 1.118
diff -c -p -d -r1.118 alpha.c
*** alpha.c 2000/02/26 20:46:12 1.118
--- alpha.c 2000/03/03 06:17:14
*************** alpha_emit_set_const_1 (target, mode, c,
*** 1400,1405 ****
--- 1400,1413 ----
target, 0, OPTAB_WIDEN);
}
+ /* Next, see if, minus some low bits, we've an easy load of high bits. */
+
+ new = ((c & 0xffff) ^ 0x8000) - 0x8000;
+ if (new != 0
+ && (temp = alpha_emit_set_const (subtarget, mode, c - new, n - 1)) != 0)
+ return expand_binop (mode, add_optab, temp, GEN_INT (new),
+ target, 0, OPTAB_WIDEN);
+
return 0;
}