[PATCH] [compiler-rt] use .p2align instead of .align

Renato Golin renato.golin at linaro.org
Mon Dec 2 05:31:43 PST 2013


  Hi Saleem,

  On both GNU and ARM documentation [1,2], the align directive is guaranteed to be a power of two on ARM, as is the case on Darwin, too. However, this seems not to be the case in x86, do you really need to change the ARM functions because of that? I'd leave them alone.

  All I could find on .p2align is that its argument is *also* a power of two, and it fills the space with NOPs or zeros depending on the flag [3], while GNU [1] leaves it unspecified, and ARM [1] uses NOPs for code regions and zeroes for anything else. I haven't looked, but I'd be surprised if GAS would do something different in that case, on ARM.

  On i386, if the .align is the number itself and .p2align is the power, your change is moving the alignment from 4 to 16, which is wrong.

  [1] https://sourceware.org/binutils/docs/as/ARM-Directives.html
  [2] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489c/Babecdje.html
  [3] http://www.chemie.fu-berlin.de/chemnet/use/info/gas/gas_7.html

http://llvm-reviews.chandlerc.com/D2295



More information about the llvm-commits mailing list