diff mbox

[3/3] target-arm/translate-a64.c: Fix dead ?: in handle_simd_shift_fpint_conv()

Message ID 1402171881-14343-4-git-send-email-peter.maydell@linaro.org
State Superseded
Headers show

Commit Message

Peter Maydell June 7, 2014, 8:11 p.m. UTC
In handle_simd_shift_fpint_conv(), the combination of is_double == true,
is_scalar == false and is_q == false is an unallocated encoding; the
'both parts false' case of the nested ?: expression for calculating
maxpass is therefore unreachable and can be removed.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/translate-a64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Crosthwaite June 13, 2014, 11:52 p.m. UTC | #1
On Sun, Jun 8, 2014 at 6:11 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> In handle_simd_shift_fpint_conv(), the combination of is_double == true,
> is_scalar == false and is_q == false is an unallocated encoding; the
> 'both parts false' case of the nested ?: expression for calculating
> maxpass is therefore unreachable and can be removed.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

> ---
>  target-arm/translate-a64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
> index 4c9e237..5542d7d 100644
> --- a/target-arm/translate-a64.c
> +++ b/target-arm/translate-a64.c
> @@ -6484,7 +6484,7 @@ static void handle_simd_shift_fpint_conv(DisasContext *s, bool is_scalar,
>      tcg_shift = tcg_const_i32(fracbits);
>
>      if (is_double) {
> -        int maxpass = is_scalar ? 1 : is_q ? 2 : 1;
> +        int maxpass = is_scalar ? 1 : 2;
>
>          for (pass = 0; pass < maxpass; pass++) {
>              TCGv_i64 tcg_op = tcg_temp_new_i64();
> --
> 1.8.5.4
>
>
diff mbox

Patch

diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
index 4c9e237..5542d7d 100644
--- a/target-arm/translate-a64.c
+++ b/target-arm/translate-a64.c
@@ -6484,7 +6484,7 @@  static void handle_simd_shift_fpint_conv(DisasContext *s, bool is_scalar,
     tcg_shift = tcg_const_i32(fracbits);
 
     if (is_double) {
-        int maxpass = is_scalar ? 1 : is_q ? 2 : 1;
+        int maxpass = is_scalar ? 1 : 2;
 
         for (pass = 0; pass < maxpass; pass++) {
             TCGv_i64 tcg_op = tcg_temp_new_i64();