[PATCH] D41131: [AArch64] Implement stack probing for windows

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 14:11:47 PST 2017


mstorsjo added a comment.

In https://reviews.llvm.org/D41131#952864, @efriedma wrote:

> > How to work around this?? The intended instruction is sub sp, sp, x15, lsl #4
>
> I think you're using the wrong opcode?  Should be SUBXrs.


No, that ends up doing the wrong thing.

SP and XZR are different names for R31, and the interpretation depend on the kind of the instruction. It refers to SP in add/sub with immediates or extended registers, but not with shifted registers. So therefore I need to use SUBXrx, otherwise this ends up interpreted as `sub xzr, xzr, x15, lsl #4`, which gets simplified into `neg xzr, x15, lsl #4` or so.


https://reviews.llvm.org/D41131





More information about the llvm-commits mailing list