Re: [PATCH] decodetree: Allow use of hex/bin format for argument field values

2020-12-01 Thread Philippe Mathieu-Daudé
On 11/30/20 7:22 PM, Richard Henderson wrote: > On 11/30/20 6:26 AM, Philippe Mathieu-Daudé wrote: >> # 'Foo=number' sets an argument field to a constant value >> -if re.fullmatch(re_C_ident + '=[+-]?[0-9]+', t): >> +if re.fullmatch(re_C_ident + '=[+-]?(0[bx])?[0-9]+', t):

Re: [PATCH] decodetree: Allow use of hex/bin format for argument field values

2020-11-30 Thread Richard Henderson
On 11/30/20 6:26 AM, Philippe Mathieu-Daudé wrote: > # 'Foo=number' sets an argument field to a constant value > -if re.fullmatch(re_C_ident + '=[+-]?[0-9]+', t): > +if re.fullmatch(re_C_ident + '=[+-]?(0[bx])?[0-9]+', t): > (fname, value) = t.split('=') > -

Re: [PATCH] decodetree: Allow use of hex/bin format for argument field values

2020-11-30 Thread Philippe Mathieu-Daudé
On Mon, Nov 30, 2020 at 1:26 PM Philippe Mathieu-Daudé wrote: > ISA datasheets often use binary or hexadecimal constant values. > By doing base conversion, we might introduce bugs. Safer is to > copy/paste the datasheet value. > Add support for bin/hex constants in argument field token. > > Signed

[PATCH] decodetree: Allow use of hex/bin format for argument field values

2020-11-30 Thread Philippe Mathieu-Daudé
ISA datasheets often use binary or hexadecimal constant values. By doing base conversion, we might introduce bugs. Safer is to copy/paste the datasheet value. Add support for bin/hex constants in argument field token. Signed-off-by: Philippe Mathieu-Daudé --- Is there a more pythonic way to write