Skip to content

Commit

Permalink
TCG: fix breakage by previous patch
Browse files Browse the repository at this point in the history
Fix incorrect logic and typos in previous commit
1bfd07b.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
  • Loading branch information
blueswirl committed Jul 30, 2011
1 parent 1bfd07b commit 2ec0065
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tcg/optimize.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ static TCGArg do_constant_folding_2(int op, TCGArg x, TCGArg y)
#if defined(TCG_TARGET_HAS_not_i32) || defined(TCG_TARGET_HAS_not_i64)
#ifdef TCG_TARGET_HAS_not_i32
case INDEX_op_not_i32:
#else
#endif
#ifdef TCG_TARGET_HAS_not_i64
case INDEX_op_not_i64:
#endif
return ~x;
Expand All @@ -327,7 +328,8 @@ static TCGArg do_constant_folding_2(int op, TCGArg x, TCGArg y)
#if defined(TCG_TARGET_HAS_ext8s_i32) || defined(TCG_TARGET_HAS_ext8s_i64)
#ifdef TCG_TARGET_HAS_ext8s_i32
case INDEX_op_ext8s_i32:
#else
#endif
#ifdef TCG_TARGET_HAS_ext8s_i64
case INDEX_op_ext8s_i64:
#endif
return (int8_t)x;
Expand All @@ -336,7 +338,8 @@ static TCGArg do_constant_folding_2(int op, TCGArg x, TCGArg y)
#if defined(TCG_TARGET_HAS_ext16s_i32) || defined(TCG_TARGET_HAS_ext16s_i64)
#ifdef TCG_TARGET_HAS_ext16s_i32
case INDEX_op_ext16s_i32:
#else
#endif
#ifdef TCG_TARGET_HAS_ext16s_i64
case INDEX_op_ext16s_i64:
#endif
return (int16_t)x;
Expand All @@ -345,7 +348,8 @@ static TCGArg do_constant_folding_2(int op, TCGArg x, TCGArg y)
#if defined(TCG_TARGET_HAS_ext8u_i32) || defined(TCG_TARGET_HAS_ext8u_i64)
#ifdef TCG_TARGET_HAS_ext8u_i32
case INDEX_op_ext8u_i32:
#else
#endif
#ifdef TCG_TARGET_HAS_ext8u_i64
case INDEX_op_ext8u_i64:
#endif
return (uint8_t)x;
Expand All @@ -354,19 +358,20 @@ static TCGArg do_constant_folding_2(int op, TCGArg x, TCGArg y)
#if defined(TCG_TARGET_HAS_ext16u_i32) || defined(TCG_TARGET_HAS_ext16u_i64)
#ifdef TCG_TARGET_HAS_ext16u_i32
case INDEX_op_ext16u_i32:
#else
#endif
#ifdef TCG_TARGET_HAS_ext16u_i64
case INDEX_op_ext16u_i64:
#endif
return (uint16_t)x;
#endif

#if TCG_TARGET_REG_BITS == 64
#ifdef TCG_TARGET_HAS_ext32s_i32
#ifdef TCG_TARGET_HAS_ext32s_i64
case INDEX_op_ext32s_i64:
return (int32_t)x;
#endif

#ifdef TCG_TARGET_HAS_ext32u_i32
#ifdef TCG_TARGET_HAS_ext32u_i64
case INDEX_op_ext32u_i64:
return (uint32_t)x;
#endif
Expand Down

0 comments on commit 2ec0065

Please sign in to comment.