Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
s390x/tcg: Implement VECTOR LOAD TO BLOCK BOUNDARY
Very similar to LOAD COUNT TO BLOCK BOUNDARY, but instead of only calculating, the actual vector is loaded. Use a temporary vector to not modify the real vector on exceptions. Initialize that one to zero, to not leak any data. Provide a fast path if we're loading a full vector. As we don't have gvec ool handlers for single vectors, just calculate the vector address manually. We can reuse the helper later on for VECTOR LOAD WITH LENGTH. In fact, we are going to name it "vll" right from the beginning, because that's a better match. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20190307121539.12842-15-david@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
- Loading branch information
1 parent
0a85f82
commit 60e9e3f
Showing
5 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* QEMU TCG support -- s390x vector support instructions | ||
* | ||
* Copyright (C) 2019 Red Hat Inc | ||
* | ||
* Authors: | ||
* David Hildenbrand <david@redhat.com> | ||
* | ||
* This work is licensed under the terms of the GNU GPL, version 2 or later. | ||
* See the COPYING file in the top-level directory. | ||
*/ | ||
#include "qemu/osdep.h" | ||
#include "qemu-common.h" | ||
#include "cpu.h" | ||
#include "internal.h" | ||
#include "vec.h" | ||
#include "tcg/tcg.h" | ||
#include "exec/helper-proto.h" | ||
#include "exec/cpu_ldst.h" | ||
#include "exec/exec-all.h" | ||
|
||
void HELPER(vll)(CPUS390XState *env, void *v1, uint64_t addr, uint64_t bytes) | ||
{ | ||
if (likely(bytes >= 16)) { | ||
uint64_t t0, t1; | ||
|
||
t0 = cpu_ldq_data_ra(env, addr, GETPC()); | ||
addr = wrap_address(env, addr + 8); | ||
t1 = cpu_ldq_data_ra(env, addr, GETPC()); | ||
s390_vec_write_element64(v1, 0, t0); | ||
s390_vec_write_element64(v1, 1, t1); | ||
} else { | ||
S390Vector tmp = {}; | ||
int i; | ||
|
||
for (i = 0; i < bytes; i++) { | ||
uint8_t byte = cpu_ldub_data_ra(env, addr, GETPC()); | ||
|
||
s390_vec_write_element8(&tmp, i, byte); | ||
addr = wrap_address(env, addr + 1); | ||
} | ||
*(S390Vector *)v1 = tmp; | ||
} | ||
} |