summaryrefslogtreecommitdiffstats
path: root/target-s390x/translate.c
Commit message (Collapse)AuthorAgeFilesLines
* tcg: Change translator-side labels to a pointerRichard Henderson2015-03-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This is improved type checking for the translators -- it's no longer possible to accidentally swap arguments to the branch functions. Note that the code generating backends still manipulate labels as int. With notable exceptions, the scope of the change is just a few lines for each target, so it's not worth building extra machinery to do this change in per-target increments. Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com> Cc: Michael Walle <michael@walle.cc> Cc: Leon Alrae <leon.alrae@imgtec.com> Cc: Anthony Green <green@moxielogic.com> Cc: Jia Liu <proljc@gmail.com> Cc: Alexander Graf <agraf@suse.de> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Richard Henderson <rth@twiddle.net>
* tcg: Introduce tcg_op_buf_count and tcg_op_buf_fullRichard Henderson2015-02-121-6/+3
| | | | | | | | The method by which we count the number of ops emitted is going to change. Abstract that away into some inlines. Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Richard Henderson <rth@twiddle.net>
* tcg: Move emit of INDEX_op_end into gen_tb_endRichard Henderson2015-02-121-1/+1
| | | | | Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390x: Mark check_privileged() as !CONFIG_USER_ONLYPeter Maydell2015-02-031-1/+3
| | | | | | | | | | | | | | The function check_privileged() is only used in the softmmu configs; wrap it in an #ifndef CONFIG_USER_ONLY to avoid clang warnings on the linux-user builds. [rth: Remove inline marker too; it was only there to prevent exactly this warning in GCC.] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Weil <sw@weilnetz.de> Message-id: 1419373100-17690-2-git-send-email-peter.maydell@linaro.org Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement ECAGRichard Henderson2015-02-031-0/+7
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement LURA, LURAG, STURGRichard Henderson2015-02-031-0/+26
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Fix STIDPRichard Henderson2015-02-031-0/+6
| | | | | | | | The implementation had been incomplete, as we did not store the machine type. Note that the machine_type member is still unset during initialization, so this has no effect yet. Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement EPSWRichard Henderson2015-02-031-0/+18
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement SAM specification exceptionRichard Henderson2015-02-031-4/+27
| | | | | | | Also, these are user-mode instructions; allow their use in CONFIG_USER_ONLY. Signed-off-by: Richard Henderson <rth@twiddle.net>
* gen-icount: check cflags instead of use_icount globalPaolo Bonzini2015-01-031-1/+1
| | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* s390x: Implement SAM{24,31,64}Alexander Graf2014-11-051-0/+12
| | | | | | | | | | | | | | | | The SAM instructions simply change 2 bits in PSW.MASK to advertise the current memory mode. While we can't fully guarantee that 31 bit mode (or even remotely 24 bit mode) actually work correctly, we don't check whether lpswe modifies these bits, so we shouldn't keep the guest from executing SAM instructions either. This patch implements all SAM instrutions with their actual PSW changing semantics, making more recent Linux kernels boot properly which do issue a SAM31 call during early boot. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Reviewed-by: Richard Henderson <rth@twiddle.net>
* trace: [tcg] Include TCG-tracing header on all targetsLluís Vilanova2014-08-121-0/+2
| | | | | Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* target-s390x: Remove unused ld_code6() functionPeter Maydell2014-06-241-5/+0
| | | | | | | | The ld_code6() function is unused; remove it. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* softmmu: introduce cpu_ldst.hPaolo Bonzini2014-06-051-0/+1
| | | | | | | | | | This will collect all load and store helpers soon. For now it is just a replacement for softmmu_exec.h, which this patch stops including directly, but we also include it where this will be necessary in order to simplify the next patch. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* tcg: Invert the inclusion of helper.hRichard Henderson2014-05-281-3/+2
| | | | | | | | | | Rather than include helper.h with N values of GEN_HELPER, include a secondary file that sets up the macros to include helper.h. This minimizes the files that must be rebuilt when changing the macros for file N. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
* cpu: Move breakpoints field from CPU_COMMON to CPUStateAndreas Färber2014-03-131-2/+2
| | | | | | | | Most targets were using offsetof(CPUFooState, breakpoints) to determine how much of CPUFooState to clear on reset. Use the next field after CPU_COMMON instead, if any, or sizeof(CPUFooState) otherwise. Signed-off-by: Andreas Färber <afaerber@suse.de>
* tcg: Move helper registration into tcg_context_initRichard Henderson2013-10-101-4/+0
| | | | | | No longer needs to be done on a per-target basis. Signed-off-by: Richard Henderson <rth@twiddle.net>
* tcg: Change tcg_gen_exit_tb argument to uintptr_tRichard Henderson2013-09-021-4/+4
| | | | | | | And update all users. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
* cpu: Move singlestep_enabled field from CPU_COMMON to CPUStateAndreas Färber2013-07-231-2/+3
| | | | | | | Prepares for changing cpu_single_step() argument to CPUState. Acked-by: Michael Walle <michael@walle.cc> (for lm32) Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-s390x: Change gen_intermediate_code_internal() argument to S390CPUAndreas Färber2013-07-091-4/+5
| | | | | | | | | Also use bool type while at it. Prepares for moving singlestep_enabled field to CPUState. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Turn cpu_dump_{state,statistics}() into CPUState hooksAndreas Färber2013-06-281-2/+4
| | | | | | | | | Make cpustats monitor command available unconditionally. Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec() arguments to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
* Trivial grammar and spelling fixesStefan Weil2013-05-011-1/+1
| | | | | | | | | | | | | | | | similiar -> similar recieve -> receive transfered -> transferred preperation -> preparation Most changes are in comments, one modifies a parameter name in a function prototype. The spelling fixes were made using codespell. Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* target-s390: Fix SRNMTRichard Henderson2013-04-051-0/+1
| | | | | | | | | Fallthough into abort = oops. Cc: qemu-trivial@nongnu.org Cc: Alexander Graf <agraf@suse.de> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* Fix typos and misspellingsPeter Maydell2013-03-221-1/+1
| | | | | | | | | Fix various typos and misspellings. The bulk of these were found with codespell. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* gen-icount.h: Rename gen_icount_start/end to gen_tb_start/endPeter Maydell2013-03-031-2/+2
| | | | | | | | | | The gen_icount_start/end functions are now somewhat misnamed since they are useful for generic "start/end of TB" code, used for more than just icount. Rename them to gen_tb_start/end. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* target-s390x: Use mulu2 for mlgr insnRichard Henderson2013-02-231-2/+1
| | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* target-s390: Perform COMPARE AND SWAP inlineRichard Henderson2013-01-051-34/+118
| | | | | | | Still no proper solution for CONFIG_USER_ONLY, but the system version is significantly better. Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Optimize get_addressRichard Henderson2013-01-051-26/+18
| | | | | | | | | Don't load the displacement into a register first, add it second so that tcg_gen_addi_i64 can eliminate zeros. Don't mask the displacement first so that we don't turn small negative numbers into large positive numbers. Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Optimize ADDC/SUBBRichard Henderson2013-01-051-19/+37
| | | | | | | | | | | | | | | Giving the proper mask to disas_jcc allows us to generate an inline comparison generating the carry/borrow with setcond. In the very worst case, when we must use the external helper to compute a value for CC, we generate (cc > 1) instead of (cc >> 1), which is only very slightly slower on common cpus. In the very best case, when the CC comes from a COMPARE insn and the compiler is using ALCG with zero, everything folds out to become just the setcond that the compiler wanted. Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Optimize ADDU/SUBU CC testingRichard Henderson2013-01-051-0/+68
| | | | | | We can easily generate some masks for logical add/subtract inline. Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Tidy comparisonsRichard Henderson2013-01-051-22/+17
| | | | | | | | | | | After full conversion, we can audit the uses of LTGT cc ops and see that none of the instructions can ever set CC=3. Thus we can extend the table to treat that bit as ignored. This fixes a regression wrt the pre-conversion translation in which NE was used for both m=6 and m=7. Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Optmize emitting discardsRichard Henderson2013-01-051-6/+24
| | | | | | | While they aren't expensive, they aren't free to process. When we know that the three cc helper variables are dead, don't kill them. Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Optimize XCRichard Henderson2013-01-051-3/+47
| | | | | | Notice XC with same address and convert that to store of zero. Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement LOAD/SET FP AND SIGNALRichard Henderson2013-01-051-0/+6
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement SET ROUNDING MODERichard Henderson2013-01-051-0/+39
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Check insn operand specificationsRichard Henderson2013-01-051-36/+159
| | | | | | Removes all the fixmes for even register numbers, etc. Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement CPSDRRichard Henderson2013-01-051-0/+16
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement POPCNTRichard Henderson2013-01-051-0/+6
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement CONVERT FROM LOGICALRichard Henderson2013-01-051-0/+25
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement CONVERT TO LOGICALRichard Henderson2013-01-051-0/+54
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement STORE ON CONDITIONRichard Henderson2013-01-051-0/+29
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement LOAD ON CONDITIONRichard Henderson2013-01-051-0/+30
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement COMPARE AND TRAPRichard Henderson2013-01-051-0/+29
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement R[NOX]SBGRichard Henderson2013-01-051-0/+53
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement RISBGRichard Henderson2013-01-051-0/+83
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement COMPARE AND BRANCHRichard Henderson2013-01-051-0/+28
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Tidy s->op_cc handlingRichard Henderson2013-01-051-40/+55
| | | | | | | | | | | | There's no need to force computation of the true cc_op when taking an exception or single stepping. In either case we'll enter the next TB with s->cc_op = DYNAMIC and recompute anyway. Just make sure that s->cc_op is stored back to env->cc_op as needed. Delete some dead functions, avoid allocating unused TCG temps, drop the old s->is_jmp setting. Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Implement BRANCH ON INDEXRichard Henderson2013-01-051-0/+52
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Delete dead code from old translatorRichard Henderson2013-01-051-291/+27
| | | | | | | | The use of inline restricts detection of static functions that are no longer used. Limit the use of inline to those functions that are conditionally used based on CONFIG_USER_ONLY. Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-s390: Convert SERVCRichard Henderson2013-01-051-20/+9
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
OpenPOWER on IntegriCloud