qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [RFC PATCH] Hexagon (target/hexagon) Make generators object oriented


From: Brian Cain
Subject: RE: [RFC PATCH] Hexagon (target/hexagon) Make generators object oriented
Date: Wed, 15 Nov 2023 21:03:04 +0000

> -----Original Message-----
> From: qemu-devel-bounces+bcain=quicinc.com@nongnu.org <qemu-devel-
...
> AFAICT the keys for registers and new_registers can be derived from the values
> themselves.  Rather than worry about copy/paste errors causing these not to
> correspond, you can create a dictionary from an iterable like so:
> 
> registers = (
>     GprDest("R", "d"),
>     GprDest("R", "e"),
>     GprSource("R", "s"),
>     GprSource("R", "t"),
> ...
> )
> registers = { reg.regtype + reg.regid for reg in registers }

Sorry, forgot the value - that would yield a set and not a dict.

registers = { reg.regtype + reg.regid: reg for reg in registers }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]