[PATCH] Add support for ARM modified immediate syntax
Tim Northover
t.p.northover at gmail.com
Thu Aug 22 03:46:47 PDT 2013
Hi Mihai,
I think the approach is interesting, but a dead end. It cements the
duplicated instructions rather than moving towards unification.
http://llvm-reviews.chandlerc.com/D1432 *does* move that way (and also
converts "add r0, #0, #0" back into "add r0, #0" automatically).
That said, I did have a look at the code and spotted this:
+ static inline bool isSOImmCanonical(unsigned Val, unsigned Rot) {
+ if (Rot == 0) return true;
+ if (Val == 0 && Rot != 0) return false;
+ return (Val % 4) != 0;
+ }
This isn't quite right. "#1, #30" is not canonical, for example (I
only know this because I made the same mistake in my patch at first).
Cheers.
Tim.
More information about the llvm-commits
mailing list