target-arm: A64: Fix decoding of iss_sf in disas_ld_lit
PATCH 1/1 target-arm: A64: Fix decoding of iss_sf in disas_ld_lit
From: "Edgar E. Iglesias" <[email protected]>
Fix the decoding of iss_sf in disas_ld_lit.
The SF (Sixty-Four) field in the ISS (Instruction Specific Syndrome) is a bit that specifies the width of the register that the instruction loads to.
If cleared it specifies 32 bits.
If set it specifies 64 bits.
--- target-arm/translate-a64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target-arm/translate-a64.c +1 -1
@@ -2025,7 +2025,7 @@ static void disas_ld_lit(DisasContext *s, uint32_t insn)do_fp_ld (s, rt, tcg_addr, size); }else {/* Only unsigned 32bit loads target 32bit registers. */ -bool iss_sf = opc ==0 ?32 :64 ; +bool iss_sf = opc ==0 ? false : true;do_gpr_ld (s, tcg_rt, tcg_addr, size, is_signed, false, true, rt, iss_sf, false);
Signature · 1 line
2.7.4
Quoted 20 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Fix the decoding of
iss_sfindisas_ld_lit.
The SF (Sixty-Four) field in the ISS (Instruction Specific Syndrome) is a bit that specifies the width of the register that the instruction loads to.If cleared it specifies 32 bits.
If set it specifies 64 bits.Signed-off-by Edgar E. Iglesias <[email protected]>--- target-arm/translate-a64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target-arm/translate-a64.c +0
-0
target-arm/translate-a64.c static void disas_ld_lit(DisasContext *s, uint32_t insn) · line 2028
Quoted 5 lines
target-arm/translate-a64.c +1
-1@@ -2025,7 +2025,7 @@ static void disas_ld_lit(DisasContext *s, uint32_t insn)do_fp_ld (s, rt, tcg_addr, size); }else {/* Only unsigned 32bit loads target 32bit registers. */ -bool iss_sf = opc ==0 ?32 :64 ; +bool iss_sf = opc ==0 ? false : true;
You could simplify that to:
bool iss_sf = !(opc == 0);
Thomas
Quoted 29 lines · Thomas Huth
Quoted 20 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Fix the decoding of
iss_sfindisas_ld_lit.
The SF (Sixty-Four) field in the ISS (Instruction Specific Syndrome) is a bit that specifies the width of the register that the instruction loads to.If cleared it specifies 32 bits.
If set it specifies 64 bits.Signed-off-by Edgar E. Iglesias <[email protected]>--- target-arm/translate-a64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target-arm/translate-a64.c +0
-0target-arm/translate-a64.c static void disas_ld_lit(DisasContext *s, uint32_t insn) · line 2028
Quoted 5 lines
target-arm/translate-a64.c +1
-1@@ -2025,7 +2025,7 @@ static void disas_ld_lit(DisasContext *s, uint32_t insn)do_fp_ld (s, rt, tcg_addr, size); }else {/* Only unsigned 32bit loads target 32bit registers. */ -bool iss_sf = opc ==0 ?32 :64 ; +bool iss_sf = opc ==0 ? false : true;You could simplify that to:
Quoted 1 line
bool iss_sf = !(opc == 0);
I don't really see how that is simpler/clearer.
I considered:
bool iss_sf = opc != 0;
but felt the expanded one was clearer in particular as a patch for review.
In any case, I have no strong opinion on the syntax.
Cheers,
Edgar
Quoted 30 lines · Edgar E. Iglesias
Quoted 29 lines · Thomas Huth
Quoted 20 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Fix the decoding of
iss_sfindisas_ld_lit.
The SF (Sixty-Four) field in the ISS (Instruction Specific Syndrome) is a bit that specifies the width of the register that the instruction loads to.If cleared it specifies 32 bits.
If set it specifies 64 bits.Signed-off-by Edgar E. Iglesias <[email protected]>--- target-arm/translate-a64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target-arm/translate-a64.c +0
-0target-arm/translate-a64.c static void disas_ld_lit(DisasContext *s, uint32_t insn) · line 2028
Quoted 5 lines
target-arm/translate-a64.c +1
-1@@ -2025,7 +2025,7 @@ static void disas_ld_lit(DisasContext *s, uint32_t insn)do_fp_ld (s, rt, tcg_addr, size); }else {/* Only unsigned 32bit loads target 32bit registers. */ -bool iss_sf = opc ==0 ?32 :64 ; +bool iss_sf = opc ==0 ? false : true;You could simplify that to:
Quoted 8 lines
Quoted 1 line
bool iss_sf = !(opc == 0);I don't really see how that is simpler/clearer.
I considered:
booliss_sf= opc != 0;but felt the expanded one was clearer in particular as a patch for review.
I would probably personally have written it without the ?:, but I don't think it's significant enough to bother respinning.
thanks
-- PMM
Quoted 1 line · Peter Maydell
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ bool
iss_sf= opc == 0 ? false : true;
Feels like a double negative.
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
You could simplify that to:
bool iss_sf = !(opc == 0);I don't really see how that is simpler/clearer.
I considered:
booliss_sf= opc != 0;
Or even shorter:
bool iss_sf = !opc;
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Peter, feel free to change the syntax to whatever you feel is best.
Cheers,
Edgar
---
Sent from my phone
-------- Original Message --------
Subject: Re: [Qemu-devel] [PATCH v1 1/1] target-arm: A64: Fix decoding of iss_sf in disas_ld_lit
From: Peter Maydell <[email protected]>
Date: 30 Sep 2016, 19:34
To: "Edgar E. Iglesias" <[email protected]>
Quoted 30 lines · Edgar E. Iglesias
Quoted 29 lines · Thomas Huth
Quoted 20 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Fix the decoding of
iss_sfindisas_ld_lit.
The SF (Sixty-Four) field in the ISS (Instruction Specific Syndrome) is a bit that specifies the width of the register that the instruction loads to.If cleared it specifies 32 bits.
If set it specifies 64 bits.Signed-off-by Edgar E. Iglesias <[email protected]>--- target-arm/translate-a64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target-arm/translate-a64.c +0
-0target-arm/translate-a64.c static void disas_ld_lit(DisasContext *s, uint32_t insn) · line 2028
Quoted 5 lines
target-arm/translate-a64.c +1
-1@@ -2025,7 +2025,7 @@ static void disas_ld_lit(DisasContext *s, uint32_t insn)do_fp_ld (s, rt, tcg_addr, size); }else {/* Only unsigned 32bit loads target 32bit registers. */ -bool iss_sf = opc ==0 ?32 :64 ; +bool iss_sf = opc ==0 ? false : true;You could simplify that to:
Quoted 8 lines
Quoted 1 line
bool iss_sf = !(opc == 0);I don't really see how that is simpler/clearer.
I considered:
booliss_sf= opc != 0;but felt the expanded one was clearer in particular as a patch for review.
I would probably personally have written it without the ?:, but I don't think it's significant enough to bother respinning.
thanks
-- PMM
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
Peter Maydell
AppliedQuoted 1 line · Edgar Iglesias
Peter, feel free to change the syntax to whatever you feel is best.
Applied to target-arm.next, thanks. I picked "iss_sf = opc != 0;"
-- PMM
Edgar Iglesias
AppliedThanks :-)
Edgar
---
Sent from my phone
-------- Original Message --------
Subject: Re: [Qemu-devel] [PATCH v1 1/1] target-arm: A64: Fix decoding of iss_sf in disas_ld_lit
From: Peter Maydell <[email protected]>
Date: 1 Oct 2016, 01:20
To: Edgar Iglesias <[email protected]>
Quoted 1 line · Edgar Iglesias
Peter, feel free to change the syntax to whatever you feel is best.
Applied to target-arm.next, thanks. I picked "iss_sf = opc != 0;"
-- PMM
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.