diff options
author | Taylor Simpson <ltaylorsimpson@gmail.com> | 2023-12-10 15:07:05 -0700 |
---|---|---|
committer | Brian Cain <bcain@quicinc.com> | 2024-01-21 22:01:59 -0800 |
commit | b44780740d4a1b70ff45a6e4d923e29880ce3c0e (patch) | |
tree | 01e745aca7353b492c2b5909db7d84ae3a632bff /ui/input-keymap.c | |
parent | 421b53d589e2a714b3f3175dddedda9755e83387 (diff) | |
download | qemu-b44780740d4a1b70ff45a6e4d923e29880ce3c0e.zip qemu-b44780740d4a1b70ff45a6e4d923e29880ce3c0e.tar.gz qemu-b44780740d4a1b70ff45a6e4d923e29880ce3c0e.tar.bz2 |
Hexagon (target/hexagon) Make generators object oriented - gen_tcg_funcs
The generators are generally a bunch of Python if-then-else
statements based on the regtype and regid. Encapsulate regtype/regid
into a class hierarchy. Clients lookup the register and invoke
methods.
This has several advantages for making the code easier to read,
understand, and maintain
- The class name makes it more clear what the operand does
- All the methods for a given type of operand are together
- Don't need hex_common.bad_register
If a regtype/regid is missing, the lookup in hex_common.get_register
will fail
- We can remove the functions in hex_common that use regtype/regid
(e.g., is_read)
This patch creates the class hierarchy in hex_common and converts
gen_tcg_funcs.py. The other scripts will be converted in subsequent
patches in this series.
Signed-off-by: Taylor Simpson <ltaylorsimpson@gmail.com>
Reviewed-by: Brian Cain <bcain@quicinc.com>
Message-Id: <20231210220712.491494-3-ltaylorsimpson@gmail.com>
Signed-off-by: Brian Cain <bcain@quicinc.com>
Diffstat (limited to 'ui/input-keymap.c')
0 files changed, 0 insertions, 0 deletions