[PATCH] D143602: Allow 32-bit pointers to be written in 64-bit slots

David M. Lloyd via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 16:02:55 PST 2023


dmlloyd added a comment.

> ".quad a" gives an error on many targets, including ARM and 32-bit x86.

My first test case was 32-bit x86 so I can confirm that this works, however you are otherwise correct. I did some detailed manual testing and in addition to 64-bit platforms (obviously), it also works on these (presumably) non-64-bit targets, which all appear to have syntax for writing a 64-bit value (I am not familiar with all of these so forgive me for any errors):

- aarch64_32
- avr
- i686
- loongarch32
- mips & mipsel
- riscv32
- wasm32

However it does fail with "Don't know how to emit this value" on these platforms:

- arm & armeb
- ppc32 & ppc32le
- sparc & sparcel
- thumb & thumbeb

Testing with plain integers in these cases reveals that they normally emit a 64-bit constant as a pair of 32-bit words (usually `.long`).

So I'm thinking that there is some logic which knows to lower i64 into two distinct values in endian-correct order. Thus my plan is now to locate this information and figure out a way to use it on these platforms to split and zero-extend the lowered constant appropriately.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143602/new/

https://reviews.llvm.org/D143602



More information about the llvm-commits mailing list