target-sparc: Add gen_load/store/dest_gpr

Infrastructure to be used to clean up handling of temporaries.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Conversion to gen_*_gpr, part 1

Only handle the easy cases directly within disas_sparc_insn.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Use gen_load_gpr in get_src[12]

This means we can avoid the incoming temporary, though the cleanup
of the existing temporaries is not performed in this patch.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Convert asi helpers to gen_*_gpr

Push the DisasContext down so that we can use gen_load/store_gpr
in sode gen_ldda_asi, gen_stda_ast, gen_cas_asi, gen_casx_asi.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Convert swap to gen_load/store_gpr

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Finish conversion to gen_load_gpr

All users of gen_movl_{reg_TN,TN_reg} are removed.  At the same time,
make cpu_val a local variable for load/store disassembly.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Cleanup cpu_src[12] allocation

Now that get_temp_tl is used for get_src[12], we don't need to
pre-allocate these temporaries.

Fallout from this is moving some assignments around cas/casx to
avoid uninitialized variable warnings.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Make the cpu_addr variable local to load/store handling

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Split out get_temp_i32

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Use get_temp_i32 in gen_dest_fpr_F

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Avoid cpu_tmp32 in Read Priv Register

We don't need another temporary here.  Load directly into the
register we want to set.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Avoid cpu_tmp32 in Write Priv Register

No need to copy to a temporary to store 32 bits.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Tidy ldfsr, stfsr

Remove the last uses of cpu_tmp32.  Unify the code between sparc64
and sparc32 by using the proper "tl" functions.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Remove usage of cpu_tmp64 from most helper functions

Use a locally allocated temporary instead.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Don't use a temporary for gen_dest_fpr_D

In all cases we don't have write-before-read problems.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Remove cpu_tmp64 use from softint insns

The use of "tl" functions and a tmp64 is logically incompatible.
Use cpu_tmp0 instead.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Remove last uses of cpu_tmp64

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Only use cpu_dst for eventual writes to a gpr

Use cpu_tmp0 for other stuff, like Write Priv Register.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Make cpu_dst local to OP=2 insns

And initialize it such that it (may) write directly to rd.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-sparc: Remove cpu_tmp0 as a global

Subroutines do their own local temporary management.
Within disas_sparc_insn we limit the existance of the variable
to OP=2 insns, and delay initialization as late as is reasonable
for the specific XOP.

Signed-off-by: Richard Henderson <rth@twiddle.net>