[PATCH v2] MIPS: add speculation_barrier support

2023-04-28 Thread YunQiang Su
speculation_barrier for MIPS needs sync+jr.hb (r2+), so we implement __speculation_barrier in libgcc, like arm32 does. gcc/ChangeLog: * config/mips/mips-protos.h (mips_emit_speculation_barrier): New prototype. * config/mips/mips.cc (speculation_barrier_libfunc): New static

Re: [PATCH v2] MIPS: add speculation_barrier support

2023-05-03 Thread Richard Sandiford via Gcc-patches
YunQiang Su writes: > speculation_barrier for MIPS needs sync+jr.hb (r2+), > so we implement __speculation_barrier in libgcc, like arm32 does. Looks reasonable, but do you have a source for the fallback pre-r2 handling? (Thanks for adding that btw, since I realise it's not your focus here.) Nit

Re: [PATCH v2] MIPS: add speculation_barrier support

2023-05-03 Thread Maciej W. Rozycki
On Wed, 3 May 2023, Richard Sandiford wrote: > > speculation_barrier for MIPS needs sync+jr.hb (r2+), > > so we implement __speculation_barrier in libgcc, like arm32 does. > > Looks reasonable, but do you have a source for the fallback > pre-r2 handling? (Thanks for adding that btw, since I real

Re: [PATCH v2] MIPS: add speculation_barrier support

2023-05-03 Thread Jiaxun Yang via Gcc-patches
> 2023年5月3日 22:04,Maciej W. Rozycki 写道: > > On Wed, 3 May 2023, Richard Sandiford wrote: > >>> speculation_barrier for MIPS needs sync+jr.hb (r2+), >>> so we implement __speculation_barrier in libgcc, like arm32 does. >> >> Looks reasonable, but do you have a source for the fallback >> pre-r

Re: [PATCH v2] MIPS: add speculation_barrier support

2023-05-07 Thread Maciej W. Rozycki
On Wed, 3 May 2023, Jiaxun Yang wrote: > Since it’s possible to run R2- binary on R2+ processor, we’d better find a > semantic that do eliminate speculation on all processors. While SSNOPs > on R2+ processors is pretty much undefined, there is no guarantee that > SSNOP sequence can eliminate specu

Re: [PATCH v2] MIPS: add speculation_barrier support

2023-05-07 Thread Jiaxun Yang via Gcc-patches
> 2023年5月7日 18:34,Maciej W. Rozycki 写道: > > On Wed, 3 May 2023, Jiaxun Yang wrote: > >> Since it’s possible to run R2- binary on R2+ processor, we’d better find a >> semantic that do eliminate speculation on all processors. While SSNOPs >> on R2+ processors is pretty much undefined, there is

Re: [PATCH v2] MIPS: add speculation_barrier support

2023-05-07 Thread Maciej W. Rozycki
On Sun, 7 May 2023, Jiaxun Yang wrote: > > Both EHB and J[AL]R.HB are backwards compatible however (except for an > > obscure 4Kc J[AL]R.HB erratum I came across once and which may be no > > longer relevant), so I think the legacy sequence ought to just return via > > JR.HB as well, therefore p