In optimising my memset routine, I'd really like to insert some assembler pre-processor directives to fail the assembler in the event that a given label is not aligned on a 32-byte boundary. I have tried the following:
.if (. & 31 != 0)
This produces an error from the assembler: Error: non-constant expression in ".if" statement. I guess that's because the actual value of '.' may vary depending on where the module is loaded (?) although if . is the offset from module start it really should be an absolute value.
The documentation for operators says "Apart from + or -, both arguments must be absolute, and the result is absolute". So I tried a different approach, assuming that the module entry point is 32-byte aligned:
.if ( (. - _moduleStart & 31) != 0)
This produces the expected abort and works if its aligned. However if I have a .align anywhere before this, I go back to the non-constant expression error. Anybody know if there's some other way to reliably check whether the current module offset is a multiple of 32 or not?