Re: [PATCH] sim: tighten up generated decode tables
Mike Frysinger via Cgen <[email protected]> Fri, 22 Dec 2023 14:55:54 -0500
| Newsgroups | gmane.comp.tools.cgen.devel |
|---|---|
| Message-ID | <ZYXpysSUEdzrPKRt@vapier> |
--Rm6jpZMsVxFyoxer
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On 22 Dec 2023 11:12, Frank Ch. Eigler wrote:
> > The use of /* fall through */ with consective case statements doesn't
> > really add any value, and when generating large files, can take up a
> > lot of space. In the case of cris, it alone adds ~20k, or ~10%.
>=20
> A few kilobytes is basically zero cost, isn't it?
you're not necessarily wrong, although i find it easier to read without so
much noise. i get that it's generated output, but when trying to debug and
understand the steps, having them be a bit readable is helpful.
i'll note that it's ~20k per file. the sim tree has ~10 of these. having
these seems like it adds up when using git as everyone has to carry the cos=
t.
it's possible to compress the code even further if i was able to figure out
how the lisp works. we generate hundreds of case lines that could be shrunk
into 1. things like:
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14: itype =3D CRISV10F_INSN_ADDOQ; goto extract_sfmt_addoq;
could be:
case 0 ... 14: itype =3D CRISV10F_INSN_ADDOQ; goto extract_sfmt_a=
ddoq;
some switches have 0 ... 127.
-mike
--Rm6jpZMsVxFyoxer
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmWF6coACgkQQWM7n+g3
9YGgYw/9GMl1Qy+1ERB/Rs+gp14eOVEckREiqH08Ga5WD8WXbhoGGM5/VMXQ7PPk
5yFmaI6t2NClQH86w4EdETWB0SIdXeiP45Ke7Ab7QzdcUnkj2EmF/uOjF1hbnQSX
lW6s+pwIr5OalFltkkQlHxgXE4FMrvUieCuGsPjAx+62vryjoFTdkElkJSbORtel
2Kn+4Z5ovc22bKbvJb9Pw0OH4PbID7FrI0pD2cEVw5aHruQ6QD5UEE48nDTYSSZL
+gImSEYKVg+R7AK/19XXH46EtkQDx4bGwLGZYM8zEbRPIQjNmRSbGSqR7GijYWE0
ahfIVY0IEveNBKQEoBaTGux29B/3G6ZzpW7X8cgr90kHhSQ5yR6V0LK/5jElci6E
fljRZeeJalpb65howHH/qmw/bKzGnb4vNgXXUCDA1VBuqVMI23lI9ubyNB2IhXmH
A/kbG8Z19gFMgeogu7J+lPS80XCHP1pxqKdpNHjetQJvnjJzZEd/aO/iNxQp9gf6
AZITPNwfF5D8Zr+VU7/YVxRwqyn8gQQmU49eM3HTYxPVB8EpsjQRcB1GYx0LAavP
PWtqvrpO5OZnrnowKkn+S/QOKLbxtocTXYwyqEUUTONeF3g4Pa5o6h3BJR4nGxST
u0hcOQ8dFmQTF1XVHFNCMwERPMiKQXDNT8k+zmW1eYrut0V8zu0=
=+7xj
-----END PGP SIGNATURE-----
--Rm6jpZMsVxFyoxer--