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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 2 23:15:24 PST 2021


craig.topper added a comment.

In D88385#2476361 <https://reviews.llvm.org/D88385#2476361>, @myhsu wrote:

> In D88385#2476359 <https://reviews.llvm.org/D88385#2476359>, @Paul-C-Anagnostopoulos wrote:
>
>> I was thinking of using a bit in the other flags member, Flags, as opposed to TSFlags. Then there would be nothing sneaky going on in the union itself.
>>
>> Making it an anonymous union would mean that all current references to TSFlags would still work, correct?
>
>
>
> In D88385#2476330 <https://reviews.llvm.org/D88385#2476330>, @jrtc27 wrote:
>
>> 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.
>
> Sounds like a plan, I will update this patch accordingly
>
> Thanks for the brainstorming

I'm not sure I follow the plan. So we're going to change the TableGen InstrInfoEmitter to put out a pointer for this target instead of the normal TSFlags constant every other target uses?


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

https://reviews.llvm.org/D88385



More information about the llvm-commits mailing list