On Wed, 12 Dec 2018 at 19:20, Richard Henderson <richard.hender...@linaro.org> wrote: > > On 12/11/18 9:40 AM, Peter Maydell wrote: > > On Fri, 7 Dec 2018 at 10:36, Richard Henderson > > <richard.hender...@linaro.org> wrote: > >> > >> This will enable PAuth decode in a subsequent patch. > >> > >> Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
> > This decode check should go before any code has been > > emittede (ie before the tcg_gen_ld_i64 above it). > > Well, it could, but only if we duplicate the ld_i64 in the various branches > that require it. E.g. > > if (op3 == 0 && op4 == 0) { > tcg_gen_ld_i64(...); > } else if (dc_ir_feature(aa64_pauth, s) && ...) { > tcg_gen_ld_i64(...); > if (s->pauth_active) { > gen_helper_auti*(...); > } > } else { > goto do_unallocated; > } > > which I suppose isn't so bad. > > What I have isn't an error because the ld_i64 will simply be deleted as dead > code by the tcg optimizer. But I'll rearrange anyway. You'd also need to manually free the 'dst' TCG temp before the goto. The A32/T32 decoder is full of (harmless) "leaked" TCG temps in error-exit paths, which is one reason I think it's nicer to fully decode before proceeding to codegen. thanks -- PMM