Re: [PATCH] sim: tighten up generated decode tables
Mike Frysinger via Cgen <[email protected]> Fri, 22 Dec 2023 14:58:08 -0500
| Newsgroups | gmane.comp.tools.cgen.devel |
|---|---|
| Message-ID | <ZYXqUP-SMB21NFbk@vapier> |
--9tPH/UPymWNR5bVb
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On 22 Dec 2023 11:55, Jose E. Marchesi 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
> I am a little concern this change may trigger implicit-fallthrough
> warnings when compiling the generated code. Not sure this is a problem
> in practice though, since nor binutils nor sim uses
> -Wimplicit-fallthrough for building as far as I can see.
pretty sure compilers don't warn about consecutive case statements that
don't have any non-case code inbetween. so we're talking about:
case 11:
case 12:
case 13:
case 14: itype =3D CRISV10F_INSN_ADDOQ; goto extract_sfmt_addoq;
since this is a very common scenario, compilers accept it without warning.
if you did something like:
case 13:
printf("");
case 14: itype =3D CRISV10F_INSN_ADDOQ; goto extract_sfmt_addoq;
then it'd warn.
i'm actually enabling -Wimplicit-fallthrough in sim now and none of these
trigger warnings.
-mike
--9tPH/UPymWNR5bVb
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmWF6lAACgkQQWM7n+g3
9YGAvBAAg5OU5mxBvxKYTo3SbK19AahWfrxncMBVcsSjYiZZeP1xCyzTmQ4KLXCs
+wO7ZRCyGZWTTUTogi0bXOhfJSJ1d4jYJgSn+MlHXNBEl4SnWoy7he1eEWjYtr4Z
TmICDP6rVnyEyMxpigs03LVkkgD87bdlsU1JcsMM+AIM3zIYVhOFOnXy42gF3zT3
47p4Ls2U8Joow4lSYx0/9e0VVpizG8OsyP5hm5zI+F0cG8PoAA2tlE4hirsHyjk+
mryLbHp44LVBx7F7I58HXpjqDadPTlqkGsXiaYUMA8pmnk2+StWbrzPYf7pZZxa1
/Y145yudBM6ZpwV2AKpcOhBzyI2mbovwG/xtmsnechsViWZnrkCk6FVIhVbeLEdX
iHbT6NsHAAmIPXOKoWFypFlwOeC24u2toK2qrLr4SWvscXXsL2OSGaYxunrnOVd9
PmVu9Fp3wfp8sWDFR4yp+v1Egw9cFQOm3U8lOIQvIFZQKAnhKioLTvXbjfY9eltd
uYXzlkEUYHMqlMCkO1FnjxguadM4g4AM2svq+mvYBAke5nr8KNKMU0K+cr4nkG27
AvXNAUVK2Tcn7dRhe6ra9FjFnQzv189pAI4tnmPp4DOoKT+XPcpAT7TFCPtSsp1I
ksZdkhPEW/6WX0yNjlLvXP2t8eroBRK6SAToasDSezXxazm/nzc=
=h2QZ
-----END PGP SIGNATURE-----
--9tPH/UPymWNR5bVb--