History | View | Annotate | Download (60.4 kB)
tcg-ppc64: More use of TAI and SAI helper macros
Finish conversion of all memory operations.
Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-ppc64: Use TCG_REG_Rn constants
Instead of bare N, for clarity. The only (intentional) exception madeis for insns that encode R|0, i.e. when R0 encoded into the insn isinterpreted as zero not the contents of the register.
tcg-ppc64: Use tcg_out64
tcg-ppc64: Reformat tcg-target.c
Whitespace and brace changes only.
tcg: Change tcg_out_ld/st offset to intptr_t
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>Signed-off-by: Richard Henderson <rth@twiddle.net>
exec: Split softmmu_defs.h
The _cmmu helpers can be moved to exec-all.h. The helpers that areused from TCG will shortly need access to tcg_target_long so movetheir declarations into tcg.h.
This requires minor include adjustments to all TCG backends....
tcg-ppc64: Implement muluh, mulsh
Using these instead of mulu2 and muls2 lets us avoid having to argumentoverlap analysis in the backend. Normal register allocation will DTRT.
tcg: Change relocation offsets to intptr_t
tcg-ppc64: Don't implement rem
Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-ppc64: bswap64 rotates output 32 bits
If our input and output is in the same register, bswap64 tries toundo a rotate of the input. This just ends up rotating the output.
Cc: qemu-stable@nongnu.orgSigned-off-by: Anton Blanchard <anton@samba.org>Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-ppc64: Fix add2_i64
add2_i64 was adding the lower double word to the upper double wordof each input. Fix this so we add the lower double words, then theupper double words with carry propagation.
Cc: qemu-stable@nongnu.orgSigned-off-by: Anton Blanchard <anton@samba.org>...
tcg-ppc64: rotr_i32 rotates wrong amount
rotr_i32 calculates the amount to left shift and puts it into atemporary, but then doesn't use it when doing the shift.
tcg-ppc64: Fix RLDCL opcode
The rldcl instruction doesn't have an sh field, so the minor opcodeis shifted 1 bit. We were using the XO30 macro which shifted theminor opcode 2 bits.
Remove XO30 and add MD30 and MDS30 macros which match thePower ISA categories....
tcg-ppc64: Handle deposit of zero
The TCG optimizer does great work when inserting constants, being ableto fold the open-coded deposit expansion to just an AND or an OR. Avoida bit the regression caused by having the deposit opcode by expandingdeposit of zero as an AND....
tcg-ppc64: Implement movcond
tcg-ppc64: Use getauxval for ISA detection
Glibc 2.16 includes an easy way to get feature bits previouslyburied in /proc or the program startup auxiliary vector. Use it.
tcg-ppc64: Implement add2/sub2_i64
tcg-ppc64: Implement mulu2/muls2_i64
tcg-ppc64: Cleanup i32 constants to tcg_out_cmp
Nothing else in the call chain ensures that theseconstants don't have garbage in the high bits.
tcg-ppc64: Use MFOCRF instead of MFCR
It takes half the cycles to read one CR register instead of all 8.This is a backward compatible addition to the ISA, so chips priorto Power 2.00 spec will simply continue to read the entire CR register.
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>...
tcg-ppc64: Use ISEL for setcond
There are a few simple special cases that should be handled first.Break these out to subroutines to avoid code duplication.
tcg-ppc64: Implement deposit
tcg-ppc64: Use I constraint for mul
The mul_i32 pattern was loading non-16-bit constants into a register,when we can get the middle-end to do that for us. The mul_i64 patternwas not considering that MULLI takes 64-bit inputs.
tcg-ppc64: Use TCGType throughout compares
The optimization/bug being fixed is that tcg_out_cmp was not applying theright type to loading a constant, in the case it can't be implementeddirectly. Rather than recomputing the TCGType enum from the arch64 bool,...
tcg-ppc64: Implement bswap64
tcg-ppc64: Implement compound logicals
Mostly copied from the ppc32 port.
tcg-ppc64: Handle constant inputs for some compound logicals
Since we have special code to handle and/or/xor with a constant,apply the same to andc/orc/eqv with a constant.
tcg-ppc64: Implement bswap16 and bswap32
tcg-ppc64: Implement rotates
tcg-ppc64: Streamline qemu_ld/st insn selection
Using a table to look up insns of the right width and sign.Include support for the Power 2.06 LDBRX and STDBRX insns.
tcg-ppc64: Use automatic implementation of ext32u_i64
The enhancements to and immediate obviate this.
tcg-ppc64: Improve and_i32 with constant
Use RLWINM
tcg-ppc64: Improve and_i64 with constant
Use RLDICL and RLDICR.
tcg-ppc64: Tidy or and xor patterns.
Handle constants in common code; we'll want to reuse that later.
tcg-ppc64: Allow constant first argument to sub
Using SUBFIC for 16-bit signed constants.
tcg-ppc64: Improve constant add and sub ops.
Improve constant addition -- previously we'd emit useless addi with 0.Use new constraints to force the driver to pull full 64-bit constantsinto a register.
tcg-ppc64: Rearrange integer constant constraints
We'll need a zero, and Z makes more sense for that. Make sure wehave a full compliment of signed and unsigned 16 and 32-bit tests.
tcg-ppc64: Cleanup tcg_out_movi
The test for using movi32 was sub-optimal for TCG_TYPE_I32, comparinga signed 32-bit quantity against an unsigned 32-bit quantity.
When possible, use addi+oris for 32-bit unsigned constants. Otherwise,standardize on addi+oris+ori instead of addis+ori+rldicl....
tcg-ppc64: Fix setcond_i32
We weren't ignoring the high 32 bits during a NE comparison.
tcg-ppc64: Introduce and use TAI and SAI
tcg-ppc64: Introduce and use tcg_out_shri64
tcg-ppc64: Introduce and use tcg_out_shli64
tcg-ppc64: Introduce and use tcg_out_ext32u
tcg-ppc64: Introduce and use tcg_out_rlw
tcg-ppc64: Use TCGReg everywhere
exec: move include files to include/exec/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tcg: Add TCG_COND_NEVER, TCG_COND_ALWAYS
There are several cases that can be handled easier inside bothtranslators and code generators if we have out-of-band valuesfor conditions. It's easy enough to handle ALWAYS and NEVER inthe natural way inside the tcg middle-end....
tcg: remove obsolete jmp op
The TCG jmp operation doesn't really make sense in the QEMU context, itis unused, it is not implemented by some targets, and it is wronglyimplemented by some others.
This patch simply removes it.
Reviewed-by: Richard Henderson <rth@twiddle.net>...
tcg: Remove tcg_target_get_call_iarg_regs_count
The TCG targets no longer need individual implementations.
Since commit 6a18ae2d2947532d5c26439548afa0481c4529f9,'flags' is no longer used in tcg_target_get_call_iarg_regs_count.
The remaining tcg_target_get_call_iarg_regs_count is trivial and only...
Remove unused CONFIG_TCG_PASS_AREG0 and dead code
Now that CONFIG_TCG_PASS_AREG0 is enabled for all targets,remove dead code and support for !CONFIG_TCG_PASS_AREG0 case.
Remove dyngen-exec.h and all references to it. Although included byhw/spapr_hcall.c, it does not seem to use it....
TCG: Fix compile breakage in tcg_dump_ops
Commit eeacee4d865 changed the syntax of tcg_dump_ops, but didn't convertall users (notably missing the ppc ones) to it. Fix them to the new syntax.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: malc <av1474@comtv.ru>
tcg/ppc64: Don't hardcode register numbers for qemu_ld/st
Facilitates using r3 for prepended AREG0.
Signed-off-by: Andreas F?rber <afaerber@suse.de>Signed-off-by: malc <av1474@comtv.ru>
tcg/ppc64: Fix CONFIG_TCG_PASS_AREG0
In qemu_ld/st load the registers for the helper calls directly ratherthan rotating them around afterwards for AREG0.
Also clobber the additional register.
Restore consistent formatting
Signed-off-by: malc <av1474@comtv.ru>
qemu tcg: Remove one entry of INDEX_op_ld_i64 from ppc_op_defs
There two entries of INDEX_op_ld_i64 in the ppc_op_defs. That causes anassertion failure in tcg_add_target_add_op_defs() when --enable-debug isused on a ppc64 backend (that's ppc64 host, not target)....
softmmu templates: optionally pass CPUState to memory access functions
Optionally, make memory access helpers take a parameter for CPUStateinstead of relying on global env.
On most targets, perform simple moves to reorder registers. On i386,switch from regparm(3) calling convention to standard stack-based...
Rename CPUState -> CPUArchState
Scripted conversion: for file in .[hc] hw/.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do sed -i "s/CPUState/CPUArchState/g" $file done...
Merge branch 's390-1.0' of git://repo.or.cz/qemu/agraf
tcg: Use TCGReg for standard tcg-target entry points.
Including tcg_out_ld, tcg_out_st, tcg_out_mov, tcg_out_movi.
Signed-off-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Stefan Weil <sw@weilnetz.de>...
tcg-ppc64: Fix compile errors for userspace only builds with gcc 4.6
tcg/ppc64/tcg-target.c has a couple of places where variables are setunconditionally, but otherwise used only for softmmu builds, notuserspace only builds. This causes compiler warnings (which are fatal...
tcg/ppc64: Only one call output register needed for 64 bit hosts
The second register is only needed for 32 bit hosts.
Cc: Vassili Karpov <av1474@comtv.ru>Fine-with-me'd-by: Vassili Karpov <av1474@comtv.ru>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
tcg/ppc64: Fix zero extension code generation bug for ppc64 host
The ppc64 code generation backend uses an rldicr (Rotate Left DoubleImmediate and Clear Right) instruction to implement zero extension ofa 32 bit quantity to a 64 bit quantity (INDEX_op_ext32u_i64). However...
tcg/ppc64: implement not_i32/64 and ext32u_i64
TCG/PPC: use stack for TCG temps
Use stack instead of temp_buf array in CPUState for TCG temps.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: malc <av1474@comtv.ru>
tcg/ppc64: Remove tcg_out_addi
The only user (within tcg.c) was removed
Delegate setup of TCG temporaries to targets
Delegate TCG temp_buf setup to targets, so that they can use a stackframe later instead.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
cpu-exec.c: avoid AREG0 use
Make functions take a parameter for CPUState instead of relyingon global env. Pass CPUState pointer to TCG prologue, which movesit to AREG0.
Thanks to Peter Maydell and Laurent Desnogues for the ARM prologuechange.
Revert the hacks to avoid AREG0 use on Sparc hosts....
TCG: Revert ppc64 tcg_out_movi32 change
3b6dac34161bc0a342336072643c2f6d17e0ec45 apparently broke the ppc64 TCG targetcompilation in the code path without guest base.
Reverting this line fixes the build.
Signed-off-by: Andreas F?rber <andreas.faerber@web.de>...
tcg-ppc: Conditionally reserve TCG_GUEST_BASE_REG.
We need not reserve the register unless we're going to use it.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: malc <av1474@comtv.ru>
tcg: Make some tcg-target.c routines static.
Both tcg_target_init and tcg_target_qemu_prologueare unused outside of tcg.c.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg: Add TYPE parameter to tcg_out_mov.
Mirror tcg_out_movi in having a TYPE parameter. This allows x86_64to perform the move at the proper width, which may elide a REX prefix.
Introduce a TCG_TYPE_REG enumerator to represent the "native width" of the host register, and to distinguish the usage from "pointer data"...
tcg/ppc64: Fix typo
Split TLB addend and target_phys_addr_t
Historically the qemu tlb "addend" field was used for both RAM and IO accesses,so needed to be able to hold both host addresses (unsigned long) and guestphysical addresses (target_phys_addr_t). However since the introduction of...
tcg: Disambiguate qemu_ld32u with 32-bit and 64-bit outputs.
Some targets (e.g. Alpha and MIPS64) need to keep 32-bit operandssign-extended in 64-bit registers (regardless of the "real" signof the operand). For that, we need to be able to distinguishbetween a 32-bit load with a 32-bit result and a 32-bit load with...
tcg: Use TCGCond where appropriate.
Use the TCGCond enumeration type in the brcond and setcondrelated prototypes in tcg-op.h and each code generator.
tcg: Name the opcode enumeration.
Give the enumeration formed from tcg-opc.h a name: TCGOpcode.Use that enumeration type instead of "int" whereever appropriate.
tcg/ppc64: Only define addend load helpers in softmmu case
tcg/ppc64: implement setcond
tcg/ppc64: Fix loading of 32bit constants
TCG: Mac OS X support for ppc64 target
Darwin/ppc64 does not use function descriptors,adapt prologue and tcg_out_call accordingly.GPR2 is available for general use, so let's use it.
http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/LowLevelABI/110-64-bit_PowerPC_Function_Calling_Conventions/64bitPowerPC.html...
tcg/ppc64,x86_64: fix constraints of op_qemu_st64
This op only takes two arguments, not two.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
PPC 32/64 GUEST_BASE support
Fix LHZX opcode value
Remove reserved registers from tcg_target_reg_alloc_order
Noticed by Andreas Faerber
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7082 c046a42c-6fe2-441c-8c8c-71466251a162
Whack [LS]MW
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7081 c046a42c-6fe2-441c-8c8c-71466251a162
Add missing r24..r26 to callee save registers
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6613 c046a42c-6fe2-441c-8c8c-71466251a162
Use the ARRAY_SIZE() macro where appropriate.
Change from v1: Avoid changing the existing coding style in certain files.
Signed-off-by: Stuart Brady <stuart.brady@gmail.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6120 c046a42c-6fe2-441c-8c8c-71466251a162
Avoid compiler warning
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5710 c046a42c-6fe2-441c-8c8c-71466251a162
Fix alignment problem with some 64bit load/store instructions
LD/STD/LWA require displacement to be multiple of 4, providetcg_out_ldsta which checks the supplied displacement and fallsback on indexed variant when the check fails. All uses ofLD/STD/LWA outside of tcg_out_ldst appear to be safe....
Add some missing static and const qualifiers, reg_names only used if NDEBUG set
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5421 c046a42c-6fe2-441c-8c8c-71466251a162
Optimize 64 bit bswap
Use rldimi instead of rldicr/or pair, saves us one instruction.Suggested by Hollis Blanchard.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5404 c046a42c-6fe2-441c-8c8c-71466251a162
Fix some warnings that would be generated by gcc -Wredundant-decls
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5115 c046a42c-6fe2-441c-8c8c-71466251a162
Relax qemu_ld/st constraints for !SOFTMMU case
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5034 c046a42c-6fe2-441c-8c8c-71466251a162
Avoid clobbering input/aliased registers in !SOFTMMU+64bit+bswap case
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5033 c046a42c-6fe2-441c-8c8c-71466251a162
Clear the upper 32 bits of addr_reg in TARGET_LONG_BITS == 32 case
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5032 c046a42c-6fe2-441c-8c8c-71466251a162
Move tcg_out_tlb_read into #ifdef CONFIG_SOFTMMU block to avoid compiler warning
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5031 c046a42c-6fe2-441c-8c8c-71466251a162
Immediate versions of some operations
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4962 c046a42c-6fe2-441c-8c8c-71466251a162
Do not try handle "special" arguments of and/or/xor/shl/shr, upper level does it
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4961 c046a42c-6fe2-441c-8c8c-71466251a162
Set the L field of CMP[L][I] when dealing with 64 bit quantities
This (along with previous 2 commits) makes X86_64 work on ppc64 too.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4960 c046a42c-6fe2-441c-8c8c-71466251a162
Fix preprocessor guard condition
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4959 c046a42c-6fe2-441c-8c8c-71466251a162