summaryrefslogtreecommitdiff
path: root/target-s390x/helper.h
AgeCommit message (Collapse)AuthorFilesLines
2015-06-17target-s390x: PER instruction-fetch event supportAurelien Jarno1-0/+1
For the PER instruction-fetch, we can't use the QEMU breakpoint infrastructure as it triggers for a single address and not a full address range, and as it actually stop before the instruction and not before. We therefore call an helper with the just fetched instruction address, which check if the address is within the PER address range. If it is the case, an event is recorded and will be signaled through an exception. Note that we implement here the PER-3 behaviour, that is an invalid opcode is not considered as an instruction fetch. Without PER-3 this behavious is undefined. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2015-06-17target-s390x: PER successful-branching event supportAurelien Jarno1-0/+1
For the PER successful-branching event support, we can't rely on any QEMU infrastucture. We therefore call an helper in all places where a branch can be taken. We have to pay attention to the branch to next case, as it's still a taken branch. We don't need to care about the cases using goto_tb, as we have disabled them in the previous patch. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2015-06-17target-s390x: basic PER event handlingAurelien Jarno1-0/+1
This patch add basic support to generate PER exceptions. It adds two fields to the cpu structure to record for the PER address and PER code & ATMID values. When an exception is triggered and a PER event is pending, the two PER values are copied to the lowcore area. At the end of an instruction, an helper is checking for a possible pending PER event and triggers an exception in that case. For that to work with branches, we need to disable TB chaining when PER is activated. Fortunately it's already in the TB flags. Finally in case of a SERVICE CALL exception, we need to trigger the PER exception immediately after. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2015-06-17target-s390x: wire up I/O instructions in TCG modeAlexander Graf1-0/+11
The code handling the I/O instructions for KVM decodes the instruction itself. In TCG mode also pass the full instruction word to the helpers. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2015-06-17target-s390x: wire up DIAG IPL in TCG modeAurelien Jarno1-1/+1
DIAG IPL is already implemented for KVM, but not wired from TCG. For that change the format of the instruction so that we can get R1 and R3 numbers in addition to the function code. The diag function can change plenty of things, including CC, so we should enter with a static CC. Also it doesn't set the value of general register 2 to 0 as in the current code. We also need to exit the CPU loop after a reset, which means a new PSW. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2015-06-05target-s390x: implement TRANSLATE EXTENDED instructionAurelien Jarno1-0/+1
It is part of the basic zArchitecture instructions. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2015-06-05target-s390x: implement TRANSLATE AND TEST instructionAurelien Jarno1-0/+1
It is part of the basic zArchitecture instructions. Allow it to be call from EXECUTE. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2015-06-05target-s390x: implement LOAD FP INTEGER instructionsAurelien Jarno1-0/+3
This is needed to pass the gcc.c-torture/execute/ieee/20010114-2.c test in the gcc testsuite. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2015-06-05target-s390x: remove unused helpersAurelien Jarno1-2/+0
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2015-06-05target-s390x: optimize (negative-) abs computationAurelien Jarno1-2/+0
Now that movcond exists, it's easy to write (negative-) absolute value using TCG code instead of an helper. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2015-02-03target-s390: Implement LURA, LURAG, STURGRichard Henderson1-0/+3
Signed-off-by: Richard Henderson <rth@twiddle.net>
2014-05-28tcg: Invert the inclusion of helper.hRichard Henderson1-4/+0
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>
2013-02-23target-s390x: Use mulu2 for mlgr insnRichard Henderson1-1/+0
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-05target-s390: Use noreturn for exception and load_pswRichard Henderson1-2/+2
Both always exit the cpu loop. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Use TCG_CALL_NO_WG for misc helpersRichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Use TCG_CALL_NO_WG for integer helpersRichard Henderson1-4/+4
The division routines do not read or write tcg registers, but can raise fixed-point divide exceptions. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Use TCG_CALL_NO_WG for floating-point helpersRichard Henderson1-39/+39
None of them read or write tcg registers, but most can raise fp exceptions. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Use TCG_CALL_NO_WG for memory helpersRichard Henderson1-15/+15
Those that do not read or write tcg registers, but can raise exceptions via memory faults. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Perform COMPARE AND SWAP inlineRichard Henderson1-3/+0
Still no proper solution for CONFIG_USER_ONLY, but the system version is significantly better. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement LOAD/SET FP AND SIGNALRichard Henderson1-0/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement POPCNTRichard Henderson1-0/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement CONVERT FROM LOGICALRichard Henderson1-0/+3
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement CONVERT TO LOGICALRichard Henderson1-0/+6
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert SERVCRichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert STSIRichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert STCKERichard Henderson1-1/+0
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert CSPRichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert STURARichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert RRBERichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert SSKERichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert SPT, STPTRichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert SCKC, STCKCRichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert STCKRichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert SCKRichard Henderson1-1/+0
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert STIDPRichard Henderson1-1/+0
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert SRSTRichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert CLST, MVSTRichard Henderson1-2/+2
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert CKSMRichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert IPMRichard Henderson1-1/+0
Note that the previous placement of the PM field was incorrect. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert LFPC, SFPCRichard Henderson1-0/+1
Note that we were failing to set the rounding mode in fpu_status. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert FLOGRRichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert CONVERT FROM FIXEDRichard Henderson1-6/+3
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert CONVERT TO FIXEDRichard Henderson1-6/+6
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert LOAD ZERORichard Henderson1-3/+0
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert FP SQUARE ROOTRichard Henderson1-1/+3
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert FP LOAD COMPLIMENT, NEGATIVE, POSITIVERichard Henderson1-6/+0
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert TEST DATA CLASSRichard Henderson1-3/+3
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert MULTIPLY AND ADD, SUBTRACTRichard Henderson1-4/+4
Use the new float*_muladd interface to softfloat. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert FP MULTIPLYRichard Henderson1-5/+5
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert FP DIVIDERichard Henderson1-5/+3
Signed-off-by: Richard Henderson <rth@twiddle.net>