This is the mail archive of the
mailing list for the GCC project.
pre_modify/post_modify with scaled register
- From: "Jon Beniston" <jon at beniston dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Sun, 17 May 2015 17:21:36 +0100
- Subject: pre_modify/post_modify with scaled register
- Authentication-results: sourceware.org; auth=none
The gccint docs for pre_modify/post_modify say that the address modifier
must be one of three forms:
(plus:m x z), (minus:m x z), or (plus:m x i), where z is an index register
and i is a constant.
Why isn?t (plus:m x (mult:m z i)) supported, for architectures that support
scaling of the index register (E.g. ARM?)
int *f(int *p, int x, int z)
p[z] = x;
return p + z;
For ARM results in:
str r1, [r0, r2, asl #2]
add r0, r0, r2, asl #2
Rather than just:
str r1, [r0, r2, asl #2]!
Should this be improved by expanding what pre/post_modify supports, as
above, or perhaps a peephole optimisation?