[LLVMdev] Tablegen binary literals

Eric Christopher echristo at gmail.com
Thu Jul 31 11:55:00 PDT 2014


On Thu, Jul 31, 2014 at 11:42 AM, 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.
>

Sounds like a solid idea.

Thanks!

-eric

> 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
>
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list