Patchwork [1/6] tcg-sparc: Fix imm13 check in movi.

login
register
mail settings
Submitter Richard Henderson
Date Dec. 17, 2009, 11:20 p.m.
Message ID <3cb11de0330b455b6cb2dfe95060148f3779f33d.1261256927.git.rth@twiddle.net>
Download mbox | patch
Permalink /patch/41475/
State New
Headers show

Comments

Richard Henderson - Dec. 17, 2009, 11:20 p.m.
We were unnecessarily restricting imm13 constants to 12 bits.
---
 tcg/sparc/tcg-target.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/tcg/sparc/tcg-target.c b/tcg/sparc/tcg-target.c
index 23cd9cd..b480ed6 100644
--- a/tcg/sparc/tcg-target.c
+++ b/tcg/sparc/tcg-target.c
@@ -302,7 +302,7 @@  static inline void tcg_out_movi_imm13(TCGContext *s, int ret, uint32_t arg)
 
 static inline void tcg_out_movi_imm32(TCGContext *s, int ret, uint32_t arg)
 {
-    if (check_fit_tl(arg, 12))
+    if (check_fit_tl(arg, 13))
         tcg_out_movi_imm13(s, ret, arg);
     else {
         tcg_out_sethi(s, ret, arg);