[PATCH] D88385: [TableGen][M68K] (Patch 1/8) Utilities for complex instruction addressing modes: CodeBeads and logical operand helper functions

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 2 15:09:31 PST 2021


jrtc27 added a comment.

In D88385#2476329 <https://reviews.llvm.org/D88385#2476329>, @Paul-C-Anagnostopoulos wrote:

> @jrtc27 Will some sort of union of a uint64_t and a pointer work? One of the Flags bits could specify which one it is.
>
> I agree that it would be cleaner to encode the information as flags, if possible.

That'd work, yes, so long as you either have the flag bit being _zero_ mean it's a pointer or you put the flag bit sufficiently low down (preferably bit 0) as otherwise you'll take the pointer way outside the bounds of the corresponding allocation by setting a high bit; in order to fit the bounds and 64-bit address in 128 bits we compress the bounds and rely on pointers not going "too far" out of bounds (anything other than one-past-the-end is UB in C/C++, but we relax that somewhat for compatibility, roughly in proportion to the size of the allocation), but if they do then they're marked invalid and won't work later even though you mask the bit out.


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

https://reviews.llvm.org/D88385



More information about the llvm-commits mailing list