Oh dear, it appears that git send-email ate the formatting, hang on. On Wed, Jun 3, 2020 at 12:47 AM <[email protected]> wrote: > > From: "Catherine A. Frederick" <[email protected]> > > --- > tcg/ppc/tcg-target.inc.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c > index ee1f9227c1..a5450a5e67 100644 > --- a/tcg/ppc/tcg-target.inc.c > +++ b/tcg/ppc/tcg-target.inc.c > @@ -790,21 +790,25 @@ static inline void tcg_out_ext32u(TCGContext *s, TCGReg > dst, TCGReg src) > > static inline void tcg_out_shli32(TCGContext *s, TCGReg dst, TCGReg src, int > c) > { > + c = ((unsigned)c > 32) ? 32 : c; > tcg_out_rlw(s, RLWINM, dst, src, c, 0, 31 - c); > } > > static inline void tcg_out_shli64(TCGContext *s, TCGReg dst, TCGReg src, int > c) > { > + c = ((unsigned)c > 64) ? 64 : c; > tcg_out_rld(s, RLDICR, dst, src, c, 63 - c); > } > > static inline void tcg_out_shri32(TCGContext *s, TCGReg dst, TCGReg src, int > c) > { > + c = ((unsigned)c > 32) ? 32 : c; > tcg_out_rlw(s, RLWINM, dst, src, 32 - c, c, 31); > } > > static inline void tcg_out_shri64(TCGContext *s, TCGReg dst, TCGReg src, int > c) > { > + c = ((unsigned)c > 64) ? 64 : c; > tcg_out_rld(s, RLDICL, dst, src, 64 - c, c); > } > > -- > 2.26.2 >
Re: [PATCH] tcg: Sanitize shift constants on ppc64le so that shift operations with large constants don't generate invalid instructions.
Catherine A. Frederick / mptcultist Tue, 02 Jun 2020 22:08:46 -0700
- [PATCH] tcg: Sanitize shift constants ... agrecascino123
- Re: [PATCH] tcg: Sanitize shift c... Catherine A. Frederick / mptcultist
- Re: [PATCH] tcg: Sanitize shift c... no-reply
- [PATCH] tcg: Sanitize shift const... agrecascino123
- Re: [PATCH] tcg: Sanitize shi... Philippe Mathieu-Daudé
- Re: [PATCH] tcg: Sanitize... Richard Henderson
