* [Qemu-devel] [PULL 1/4] target-mips: Fix Loongson pandn instruction.
2016-12-04 2:00 [Qemu-devel] [PULL 0/4] target-mips queue Yongbok Kim
@ 2016-12-04 2:00 ` Yongbok Kim
2016-12-04 2:00 ` [Qemu-devel] [PULL 2/4] target-mips: Fix Loongson multimedia 'or' instruction Yongbok Kim
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Yongbok Kim @ 2016-12-04 2:00 UTC (permalink / raw)
To: qemu-devel
From: Heiher <wangr@lemote.com>
pandn FD, FS, FT
Operation: FD = ((NOT FS) AND FT)
Signed-off-by: Heiher <wangr@lemote.com>
Signed-off-by: Fuxin Zhang <zhangfx@lemote.com>
Reviewed-by: Yongbok Kim <yongbok.kim@imgtec.com>
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
---
target-mips/translate.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/target-mips/translate.c b/target-mips/translate.c
index d8dde7a..5ad97c7 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -3945,9 +3945,12 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt)
LMI_DIRECT(XOR_CP2, xor, xor);
LMI_DIRECT(NOR_CP2, nor, nor);
LMI_DIRECT(AND_CP2, and, and);
- LMI_DIRECT(PANDN, pandn, andc);
LMI_DIRECT(OR, or, or);
+ case OPC_PANDN:
+ tcg_gen_andc_i64(t0, t1, t0);
+ break;
+
case OPC_PINSRH_0:
tcg_gen_deposit_i64(t0, t0, t1, 0, 16);
break;
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 2/4] target-mips: Fix Loongson multimedia 'or' instruction.
2016-12-04 2:00 [Qemu-devel] [PULL 0/4] target-mips queue Yongbok Kim
2016-12-04 2:00 ` [Qemu-devel] [PULL 1/4] target-mips: Fix Loongson pandn instruction Yongbok Kim
@ 2016-12-04 2:00 ` Yongbok Kim
2016-12-04 2:00 ` [Qemu-devel] [PULL 3/4] target-mips: Fix Loongson multimedia instructions Yongbok Kim
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Yongbok Kim @ 2016-12-04 2:00 UTC (permalink / raw)
To: qemu-devel
From: Heiher <wangr@lemote.com>
Signed-off-by: Heiher <wangr@lemote.com>
Signed-off-by: Fuxin Zhang <zhangfx@lemote.com>
Reviewed-by: Yongbok Kim <yongbok.kim@imgtec.com>
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
---
target-mips/translate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 5ad97c7..e26f742 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -3945,7 +3945,7 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt)
LMI_DIRECT(XOR_CP2, xor, xor);
LMI_DIRECT(NOR_CP2, nor, nor);
LMI_DIRECT(AND_CP2, and, and);
- LMI_DIRECT(OR, or, or);
+ LMI_DIRECT(OR_CP2, or, or);
case OPC_PANDN:
tcg_gen_andc_i64(t0, t1, t0);
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 3/4] target-mips: Fix Loongson multimedia instructions.
2016-12-04 2:00 [Qemu-devel] [PULL 0/4] target-mips queue Yongbok Kim
2016-12-04 2:00 ` [Qemu-devel] [PULL 1/4] target-mips: Fix Loongson pandn instruction Yongbok Kim
2016-12-04 2:00 ` [Qemu-devel] [PULL 2/4] target-mips: Fix Loongson multimedia 'or' instruction Yongbok Kim
@ 2016-12-04 2:00 ` Yongbok Kim
2016-12-04 2:00 ` [Qemu-devel] [PULL 4/4] target-mips: fix bad shifts in {dextp|dextpdp} Yongbok Kim
2016-12-05 10:56 ` [Qemu-devel] [PULL 0/4] target-mips queue Stefan Hajnoczi
4 siblings, 0 replies; 6+ messages in thread
From: Yongbok Kim @ 2016-12-04 2:00 UTC (permalink / raw)
To: qemu-devel
From: Heiher <wangr@lemote.com>
Needed to emit FPU exception on Loongson multimedia instructions
executing if Status:CU1 is clear. or FPR changes may be missed
on Linux.
Signed-off-by: Heiher <wangr@lemote.com>
Signed-off-by: Fuxin Zhang <zhangfx@lemote.com>
Reviewed-by: Yongbok Kim <yongbok.kim@imgtec.com>
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
---
target-mips/translate.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target-mips/translate.c b/target-mips/translate.c
index e26f742..57b824f 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -3871,6 +3871,7 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt)
break;
}
+ check_cp1_enabled(ctx);
gen_load_fpr64(ctx, t0, rs);
gen_load_fpr64(ctx, t1, rt);
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 4/4] target-mips: fix bad shifts in {dextp|dextpdp}
2016-12-04 2:00 [Qemu-devel] [PULL 0/4] target-mips queue Yongbok Kim
` (2 preceding siblings ...)
2016-12-04 2:00 ` [Qemu-devel] [PULL 3/4] target-mips: Fix Loongson multimedia instructions Yongbok Kim
@ 2016-12-04 2:00 ` Yongbok Kim
2016-12-05 10:56 ` [Qemu-devel] [PULL 0/4] target-mips queue Stefan Hajnoczi
4 siblings, 0 replies; 6+ messages in thread
From: Yongbok Kim @ 2016-12-04 2:00 UTC (permalink / raw)
To: qemu-devel
Fixed issues in the MIPSDSP64 instructions dextp and dextpdp.
Shifting can go out of 32 bit range.
https://bugs.launchpad.net/qemu/+bug/1631625
Reported-by: Thomas Huth <thuth@redhat.com>
Reported-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
target-mips/dsp_helper.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target-mips/dsp_helper.c b/target-mips/dsp_helper.c
index df7d220..dc70793 100644
--- a/target-mips/dsp_helper.c
+++ b/target-mips/dsp_helper.c
@@ -3477,7 +3477,7 @@ target_ulong helper_dextp(target_ulong ac, target_ulong size, CPUMIPSState *env)
if (sub >= -1) {
temp = (tempB << (64 - len)) | (tempA >> len);
- temp = temp & ((0x01 << (size + 1)) - 1);
+ temp = temp & ((1ULL << (size + 1)) - 1);
set_DSPControl_efi(0, env);
} else {
set_DSPControl_efi(1, env);
@@ -3506,7 +3506,7 @@ target_ulong helper_dextpdp(target_ulong ac, target_ulong size,
if (sub >= -1) {
temp = (tempB << (64 - len)) | (tempA >> len);
- temp = temp & ((0x01 << (size + 1)) - 1);
+ temp = temp & ((1ULL << (size + 1)) - 1);
set_DSPControl_pos(sub, env);
set_DSPControl_efi(0, env);
} else {
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PULL 0/4] target-mips queue
2016-12-04 2:00 [Qemu-devel] [PULL 0/4] target-mips queue Yongbok Kim
` (3 preceding siblings ...)
2016-12-04 2:00 ` [Qemu-devel] [PULL 4/4] target-mips: fix bad shifts in {dextp|dextpdp} Yongbok Kim
@ 2016-12-05 10:56 ` Stefan Hajnoczi
4 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2016-12-05 10:56 UTC (permalink / raw)
To: Yongbok Kim; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1392 bytes --]
On Sun, Dec 04, 2016 at 02:00:13AM +0000, Yongbok Kim wrote:
> Hi,
>
> This is pull-req for target-mips.
>
> Regards,
> Yongbok
>
> The following changes since commit bd8ef5060dd2124a54578241da9a572faf7658dd:
>
> Merge remote-tracking branch 'dgibson/tags/ppc-for-2.8-20161201' into staging (2016-12-01 13:39:29 +0000)
>
> are available in the git repository at:
>
> git://github.com/yongbok/upstream-qemu.git tags/mips-20161204
>
> for you to fetch changes up to e6e2784cacd4cfec149a7690976b9ff15e541c4d:
>
> target-mips: fix bad shifts in {dextp|dextpdp} (2016-12-04 00:57:06 +0000)
>
> ----------------------------------------------------------------
> MIPS patches 2016-12-04
>
> Changes:
> * Fix Loongson instructions
> * Fix bad shifts in {dextp|dextpdp}
>
> ----------------------------------------------------------------
> Heiher (3):
> target-mips: Fix Loongson pandn instruction.
> target-mips: Fix Loongson multimedia 'or' instruction.
> target-mips: Fix Loongson multimedia instructions.
>
> Yongbok Kim (1):
> target-mips: fix bad shifts in {dextp|dextpdp}
>
> target-mips/dsp_helper.c | 4 ++--
> target-mips/translate.c | 8 ++++++--
> 2 files changed, 8 insertions(+), 4 deletions(-)
>
>
Thanks, applied to my staging tree:
https://github.com/stefanha/qemu/commits/staging
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread