Skip to content

Make default alignment configurable and/or platform dependent #1386

@hanno-becker

Description

@hanno-becker

mlkem-native uses a default alignment of 32 bytes for structures and buffers. This is necessary for AVX2-capable platforms as some AVX2 instructions will fault on addresses that are not 32-byte aligned. On other systems, however, esp. embedded ones, the alignment is unnecessary and wasteful.

Task:

  • Set the default alignment based on the target platform, e.g. 32 byte for AVX2 enabled platforms, 16 byte for AArch64, and nothing otherwise (leaving it to the compiler).

One can also consider allowing users to overwrite this in the config, but unless we have someone asking for it, I'd prefer not to do this as every new option increases the test burden.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions