diff options
author | James Hogan <james.hogan@imgtec.com> | 2015-10-02 13:24:17 +0100 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2015-10-19 11:04:39 -1000 |
commit | 137d63902faf4960081856db9242cbaf234a23af (patch) | |
tree | cc7ddee084123779691a6722a20e440b54f8ff1a /qemu-log.c | |
parent | bc6d0c22b09a72897d9db4482076f89e7de97400 (diff) |
tcg/mips: Support r6 SEL{NE, EQ}Z instead of MOVN/MOVZ
Extend MIPS movcond implementation to support the SELNEZ/SELEQZ
instructions introduced in MIPS r6 (where MOVN/MOVZ have been removed).
Whereas the "MOVN/MOVZ rd, rs, rt" instructions have the following
semantics:
rd = [!]rt ? rs : rd
The "SELNEZ/SELEQZ rd, rs, rt" instructions are slightly different:
rd = [!]rt ? rs : 0
First we ensure that if one of the movcond input values is zero that it
comes last (we can swap the input arguments if we invert the condition).
This is so that it can exactly match one of the SELNEZ/SELEQZ
instructions and avoid the need to emit the other one.
Otherwise we emit the opposite instruction first into a temporary
register, and OR that into the result:
SELNEZ/SELEQZ TMP1, v2, c1
SELEQZ/SELNEZ ret, v1, c1
OR ret, ret, TMP1
Which does the following:
ret = cond ? v1 : v2
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Message-Id: <1443788657-14537-7-git-send-email-james.hogan@imgtec.com>
Diffstat (limited to 'qemu-log.c')
0 files changed, 0 insertions, 0 deletions