diff options
author | Martin Storsjö <martin@martin.st> | 2020-06-16 09:26:15 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2020-06-16 11:12:32 +0300 |
commit | 1e674fdb3338c137128eac6259bed85583b2925e (patch) | |
tree | 16b0e10720da6358e9b8edacd1eae9827c619153 | |
parent | 3d6d7683fa842103faf4ccf79e9663996d5bdd54 (diff) |
arm64: itx: Simplify and clarify the sub_sp macro a little bit
Add an .error case for windows if subtracting more than 8 KB, simplify
the generic subtraction case.
-rw-r--r-- | src/arm/64/itx.S | 10 | ||||
-rw-r--r-- | src/arm/64/itx16.S | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/arm/64/itx.S b/src/arm/64/itx.S index 29dec19..245af0e 100644 --- a/src/arm/64/itx.S +++ b/src/arm/64/itx.S @@ -3004,7 +3004,11 @@ endfunc .macro sub_sp space #ifdef _WIN32 -.if \space > 4096 +.if \space > 8192 + // Here, we'd need to touch two (or more) pages while decrementing + // the stack pointer. + .error "sub_sp_align doesn't support values over 8K at the moment" +.elseif \space > 4096 sub x16, sp, #4096 ldr xzr, [x16] sub sp, x16, #(\space - 4096) @@ -3014,12 +3018,10 @@ endfunc #else .if \space >= 4096 sub sp, sp, #(\space)/4096*4096 +.endif .if (\space % 4096) != 0 sub sp, sp, #(\space)%4096 .endif -.else - sub sp, sp, #\space -.endif #endif .endm diff --git a/src/arm/64/itx16.S b/src/arm/64/itx16.S index 0b948c7..266f57e 100644 --- a/src/arm/64/itx16.S +++ b/src/arm/64/itx16.S @@ -3242,7 +3242,11 @@ endfunc .macro sub_sp space #ifdef _WIN32 -.if \space > 4096 +.if \space > 8192 + // Here, we'd need to touch two (or more) pages while decrementing + // the stack pointer. + .error "sub_sp_align doesn't support values over 8K at the moment" +.elseif \space > 4096 sub x16, sp, #4096 ldr xzr, [x16] sub sp, x16, #(\space - 4096) @@ -3252,12 +3256,10 @@ endfunc #else .if \space >= 4096 sub sp, sp, #(\space)/4096*4096 +.endif .if (\space % 4096) != 0 sub sp, sp, #(\space)%4096 .endif -.else - sub sp, sp, #\space -.endif #endif .endm |