[PATCH 2/2] [ARM] Add support for -mpure-code in thumb-1 (v6m)
Christophe Lyon
christophe.lyon@linaro.org
Wed Nov 13 14:49:00 GMT 2019
On Tue, 12 Nov 2019 at 12:17, Richard Earnshaw (lists)
<Richard.Earnshaw@arm.com> wrote:
>
> On 18/10/2019 14:18, Christophe Lyon wrote:
> > +thumb1_gen_const_int (rtx op0, HOST_WIDE_INT op1)
> > +{
> > + bool mov_done_p = false;
> > + int i;
> > +
> > + /* Emit upper 3 bytes if needed. */
> > + for (i = 0; i < 3; i++)
> > + {
> > + int byte = (op1 >> (8 * (3 - i))) & 0xff;
> > +
> > + if (byte)
> > + {
> > + emit_set_insn (op0, mov_done_p
> > + ? gen_rtx_PLUS (SImode,op0, GEN_INT (byte))
> > + : GEN_INT (byte));
> > + mov_done_p = true;
> > + }
> > +
> > + if (mov_done_p)
> > + emit_set_insn (op0, gen_rtx_ASHIFT (SImode, op0, GEN_INT (8)));
> > + }
> > +
> > + /* Emit lower byte if needed. */
> > + if (!mov_done_p)
> > + emit_set_insn (op0, GEN_INT (op1 & 0xff));
> > + else if (op1 & 0xff)
> > + emit_set_insn (op0, gen_rtx_PLUS (SImode, op0, GEN_INT (op1 & 0xff)));
> > +}
> > +
>
> What about Armv8-m.baseline, which has movw/movt?
>
This is already supported since r247585 (May 2017) "[ARM] Enable
Purecode for ARMv8-M Baseline" AFAICT.
Thanks,
Christophe
> R.
More information about the Gcc-patches
mailing list