Skip to content

Commit

Permalink
aarch64: Set the right intended alignment for constants
Browse files Browse the repository at this point in the history
The align parameter to these macros is passed to the gas directive
.align. This directive is architecture dependent; on some
architectures, the given alignment is an alignment in bytes,
while on others, its the power of two to align to. On aarch64,
.align is for power of two alignment, see [1] for details; i.e.
it behaves the same as .p2align.

This means that when the macros are invoked with align=16, we
actually requested 64 KB alignment, not 16 byte alignment. Fix
this, setting the alignment to the intended 16 byte alignment.

This fixes building for aarch64-windows targets with assert enabled
versions of Clang; such versions of Clang error out with
"unsupported section alignment" on this case, while regular release
versions of Clang silently let this issue pass.

[1] https://sourceware.org/binutils/docs/as/Align.html
  • Loading branch information
mstorsjo committed Nov 12, 2024
1 parent 4df64d0 commit 159cefc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libass/aarch64/blend_bitmaps.S
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "asm.S"

const edge_mask, align=16
const edge_mask, align=4
.dcb.b 16, 0xFF
.dcb.b 16, 0x00
endconst
Expand Down
2 changes: 1 addition & 1 deletion libass/aarch64/blur.S
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "asm.S"

const words_zero, align=16
const words_zero, align=4
.dc.w 0, 0, 0, 0, 0, 0, 0, 0
endconst

Expand Down
2 changes: 1 addition & 1 deletion libass/aarch64/rasterizer.S
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#endif


const words_index, align=16
const words_index, align=4
.dc.w 0, 1, 2, 3, 4, 5, 6, 7
endconst

Expand Down

0 comments on commit 159cefc

Please sign in to comment.