summaryrefslogtreecommitdiffstats
path: root/tcg
Commit message (Collapse)AuthorAgeFilesLines
* tcg/arm: merge the two sets of #define for optional opsAurelien Jarno2010-03-021-14/+5
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg/arm: accept immediate arguments for brcond/setcondAurelien Jarno2010-03-021-6/+20
| | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
* Add a missing breakAndrzej Zaborowski2010-03-021-0/+1
|
* tcg/arm: implement setcond2Aurelien Jarno2010-03-021-0/+11
| | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
* tcg/arm: implement setcondAurelien Jarno2010-03-021-0/+9
| | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
* tcg/arm: fix div2/divu2Aurelien Jarno2010-03-021-6/+24
| | | | | | | | When restoring register values, increase the stack register for skipped values. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
* tcg/ppc: Fix right rotationmalc2010-02-271-1/+2
| | | | Signed-off-by: malc <av1474@comtv.ru>
* tcg/ppc: Fix typomalc2010-02-231-1/+1
| | | | Signed-off-by: malc <av1474@comtv.ru>
* tcg/ppc64: Use C90 style commentsmalc2010-02-221-18/+18
| | | | Signed-off-by: malc <av1474@comtv.ru>
* tcg/ppc: Implement some of the optional opsmalc2010-02-222-8/+88
| | | | Signed-off-by: malc <av1474@comtv.ru>
* tcg: fix build on 32-bit hppa, ppc and sparc hostsJay Foad2010-02-223-3/+4
| | | | | | | The qemu_ld32s op is only defined if TCG_TARGET_REG_BITS == 64. Signed-off-by: Jay Foad <jay.foad@gmail.com> Signed-off-by: malc <av1474@comtv.ru>
* tcg: fix assertion with --enable-debugJay Foad2010-02-201-5/+0
| | | | | | | | | | | On 32-bit hosts op_qemu_ld32s is unused. Remove it to fix the following assertion failure: qemu-alpha: tcg/tcg.c:1055: tcg_add_target_add_op_defs: Assertion `tcg_op_defs[op].used' failed. Signed-off-by: Jay Foad <jay.foad@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg: Add comments for all optional instructions not implemented.Richard Henderson2010-02-208-17/+106
| | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg-sparc: Implement ORC.Richard Henderson2010-02-202-0/+7
| | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg-sparc: Implement ANDC.Richard Henderson2010-02-202-0/+8
| | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg: Optional target implementation of ORC.Richard Henderson2010-02-202-0/+17
| | | | | | | | Previously ORC was always implemented by tcg-op.h with an explicit NOT opcode. Allow a target implementation. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg: Optional target implementation of ANDC.Richard Henderson2010-02-202-0/+17
| | | | | | | | Previously ANDC was always implemented by tcg-op.h with an explicit NOT opcode. Allow a target implementation. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg-sparc: Implement not.Richard Henderson2010-02-202-0/+8
| | | | | | | | The fallback implementation of "ret = arg1 ^ -1" isn't ideal because of the extra tcg op to load the minus one. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg-sparc: Implement neg.Richard Henderson2010-02-202-2/+16
| | | | | | | | | The fallback implementation of "ret = 0 - arg1" isn't ideal, first because of the extra tcg op to load the zero, and second because we fail to handle zero as %g0 for arg1 of the sub. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg/ppc: Consistently use calling convention selection macrosmalc2010-02-201-12/+12
| | | | Signed-off-by: malc <av1474@comtv.ru>
* Use ppc host calling convention definitions to set ↵Juergen Lock2010-02-201-3/+3
| | | | | | | | | | | | | TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET}. New version after malc's comments. (This avoids having to do #if defined __linux__ || defined __FreeBSD__ || defined __FreeBSD_kernel__ for the third case.) Submitted by: Andreas Tobler <andreast@fgznet.ch> (original version) Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> Signed-off-by: malc <av1474@comtv.ru>
* tcg: Add consistency checks for op definitionsStefan Weil2010-02-182-0/+24
| | | | | | | | | | | | | | | When compiled with CONFIG_DEBUG_TCG, this code looks for missing, duplicate and wrong entries in the op definitions. Errors will raise an assertion at program start (all checks are done in the initial phase). The current code contains such errors, at least for i386 guest on i386 host. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg-sparc: Implement setcond, setcond2.Richard Henderson2010-02-161-0/+127
| | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg: Add tcg_swap_cond.Richard Henderson2010-02-161-0/+8
| | | | | | | Returns the condition as if with swapped comparison operands. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg/mips: fix crash in tcg_out_qemu_ld()Aurelien Jarno2010-02-091-2/+2
| | | | | | | | The address register is overriden when it corresponds to v0 and the fast path is taken, which leads to a crash. Fix that by using the a0 register instead. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg/mips: implement setcond2Aurelien Jarno2010-02-091-12/+80
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg/mips: implement setcondAurelien Jarno2010-02-081-0/+65
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg: move setcond* ops to non-optional sectionAurelien Jarno2010-02-081-35/+37
| | | | | | setcond is not an optional op, move it to the non-optional section. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg: add setcondi pseudo-opAurelien Jarno2010-02-081-0/+18
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg/ppc64: implement setcondmalc2010-02-071-0/+133
| | | | Signed-off-by: malc <av1474@comtv.ru>
* tcg/ppc32: proper setcond implementationmalc2010-02-071-25/+25
| | | | Signed-off-by: malc <av1474@comtv.ru>
* tcg/ppc32: implement setcond[2]malc2010-02-071-14/+157
| | | | Signed-off-by: malc <av1474@comtv.ru>
* tcg-i386: Implement setcond.Richard Henderson2010-02-061-3/+70
| | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg-i386: Implement small forward branches.Richard Henderson2010-02-061-38/+79
| | | | | | | | | | | | There are places, like brcond2, where we know that the destination of a forward branch will be within 127 bytes. Add the R_386_PC8 relocation type to support this. Add a flag to tcg_out_jxx and tcg_out_brcond* to enable it. Set the flag in the brcond2 label_next branches; pass along the input flag otherwise. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg-x86_64: implement setcondRichard Henderson2010-02-061-5/+33
| | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg: add tcg_invert_condRichard Henderson2010-02-061-0/+5
| | | | | | | It is very handy to have a reliable mapping of a condition to its inverse. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg: generic support for conditional setRichard Henderson2010-02-064-6/+78
| | | | | | | Defines setcond_{i32,i64} and setcond2_i32 for 64-on-32-bit. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg: document double-word support opcodes.Richard Henderson2010-02-061-0/+23
| | | | | | | | | The internal opcodes brcond2, add2, sub2, mulu2 were undocumented. Place these in a new section that clearly indicates that they are not to be emitted by translators. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg/x86_64: Avoid unnecessary REX.B prefixes.Richard Henderson2010-01-151-16/+30
| | | | | | | | | | | | | | The existing P_REXB internal opcode flag unconditionally emits the REX prefix. Technically it's not needed if the register in question is %al, %bl, %cl, %dl. Eliding the prefix requires splitting the P_REXB flag into two, in order to indicate whether the byte register in question is in the REG or the R/M field. Within TCG, the byte register is in the REG field only for stores. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg/x86_64: Special-case all 32-bit AND operands.Richard Henderson2010-01-141-18/+8
| | | | | | | | | | | This avoids an unnecessary REX.W prefix when dealing with AND operands that fit into a 32-bit quantity. The most common change actually seen is movz[wb]q -> movz[wb]l. Similarly, avoid REXW in ext{8,16}u_i64 tcg opcodes. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg-sparc: Implement ext32[su]_i64Richard Henderson2010-01-122-0/+21
| | | | | | | | | The 32-bit right-shift instructions is defined to extend the shifted output to 64-bits. A shift count of zero therefore is a simple extension without actually shifting. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg-sparc: Implement division properly.Richard Henderson2010-01-122-30/+55
| | | | | | | | | | | | | | | | | | | The {div,divu}2 opcodes are intended for systems for which the division instruction produces both quotient and remainder. Sparc is not such a system. Indeed, the remainder must be computed as quot = a / b rem = a - (quot * b) Split out a tcg_out_div32 function that properly initializes Y with the extension of the input to 64-bits. Discard the code that used the 64-bit DIVX on sparc9/sparcv8plus without extending the inputs to 64-bits. Implement remainders in terms of division followed by multiplication. Signed-off-by: Richard Henderson <rth@twiddle.net> [blauwirbel@gmail.com: applied rth's typo fix in tcg_out_div32] Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg-sparc: Do not remove %o[012] from 'r' constraint.Richard Henderson2010-01-121-0/+3
| | | | | | | Only 'L' constraint needs that. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg-sparc: Implement add2, sub2, mulu2.Richard Henderson2010-01-121-0/+27
| | | | | | | Add missing 32-bit double-word support opcodes. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg-sparc: Add tcg_out_arithc.Richard Henderson2010-01-121-43/+43
| | | | | | | | | | | Add a function to handle the register-vs-immediate test for arithmetic. Also, adjust the OP_32_64 macro so that it auto-indents properly. Rename the gen_arith32 label to gen_arith, since it handles 64-bit arithmetic as well. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg: Add tcg_unsigned_cond.Richard Henderson2009-12-271-0/+5
| | | | | | | | Returns an unsigned version of a signed condition; returns the original condition otherwise. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg-sparc: Implement brcond2.Richard Henderson2009-12-211-14/+69
| | | | | | | | | Split out tcg_out_cmp and properly handle immediate arguments. Fix constraints on brcond to match what SUBCC accepts. Add tcg_out_brcond2_i32 for 32-bit host. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg-sparc: Use TCG_TARGET_REG_BITS in conditional compilation.Richard Henderson2009-12-211-16/+16
| | | | | | | | | | The test TCG_TARGET_REG_BITS==64 is exactly the feature that we are checking for, whereas something involving __sparc_v9__ or __sparc_v8plus__ should be reserved for something ISA related, as with SMULX. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg-sparc: Improve tcg_out_movi for sparc64.Richard Henderson2009-12-211-12/+15
| | | | | | | | | Generate sign-extended 32-bit constants with SETHI+XOR. Otherwise tidy the routine to avoid the need for conditional compilation and code duplication with movi_imm32. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tcg-sparc: Fix imm13 check in movi.Richard Henderson2009-12-211-1/+1
| | | | | | | We were unnecessarily restricting imm13 constants to 12 bits. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
OpenPOWER on IntegriCloud