[LLVMdev] Tablegen binary literals

Sean Silva chisophugis at gmail.com
Thu Jul 31 11:46:38 PDT 2014


On Thu, Jul 31, 2014 at 12:42 PM, Pete Cooper <peter_cooper at apple.com>
wrote:

>
> On Jul 31, 2014, at 11:27 AM, Sean Silva <chisophugis at gmail.com> wrote:
>
>
>
>
> On Thu, Jul 31, 2014 at 12:31 AM, Tim Northover <t.p.northover at gmail.com>
> wrote:
>
>> > Yeah, exactly those 2 things.  I have them in separate patches, but I
>> think
>> > we only get the benefit from sized binary literals if we also allow
>> them to
>> > initialize multiple bits in another bits<n> type.
>>
>> It also allows type checking for single initializers. I've been caught
>> out a couple of times when I thought I'd given 17 digits in "let
>> Inst{16-0} = 0b1001000111011010" or similar.
>>
>
> Allowing underscores in the literal seems like it would help alleviate
> this somewhat (do we already allow that?). That is what VHDL does
> ("Underlines can be used to increase readability and have no impact on the
> value.").
>
> Yeah, _’s sounds like a good idea.  I was going to do that independently
> of all this other work if there’s no objections.
>
>
Go for it. Seems like a no-brainer (remember to update the docs in relevant
places; we want people to use this feature!).

-- Sean Silva



> Pete
>
>
> -- Sean Silva
>
>
>>
>> Cheers.
>>
>> Tim.
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140731/ba6af177/attachment.html>


More information about the llvm-dev mailing list