Patchwork [15/22] tcg-i386: Tidy ret.

login
register
mail settings
Submitter Richard Henderson
Date April 14, 2010, 6:04 p.m.
Message ID <6755a46434c6501911b23df1a588afa1a2b4ea0e.1272479073.git.rth@twiddle.net>
Download mbox | patch
Permalink /patch/51207/
State New
Headers show

Comments

Richard Henderson - April 14, 2010, 6:04 p.m.
Define and use OPC_RET.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/i386/tcg-target.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Aurelien Jarno - May 21, 2010, 9:40 a.m.
On Wed, Apr 14, 2010 at 11:04:14AM -0700, Richard Henderson wrote:
> Define and use OPC_RET.
> 
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Acked-by: Aurelien Jarno <aurelien@aurel32.net>

> ---
>  tcg/i386/tcg-target.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c
> index e82788d..27e9e9e 100644
> --- a/tcg/i386/tcg-target.c
> +++ b/tcg/i386/tcg-target.c
> @@ -188,6 +188,7 @@ static inline int tcg_target_const_match(tcg_target_long val,
>  #define OPC_PUSH_r32	(0x50)
>  #define OPC_PUSH_Iv	(0x68)
>  #define OPC_PUSH_Ib	(0x6a)
> +#define OPC_RET		(0xc3)
>  #define OPC_SHIFT_1	(0xd1)
>  #define OPC_SHIFT_Ib	(0xc1)
>  #define OPC_SHIFT_cl	(0xd3)
> @@ -1426,7 +1427,7 @@ void tcg_target_qemu_prologue(TCGContext *s)
>      for(i = ARRAY_SIZE(tcg_target_callee_save_regs) - 1; i >= 0; i--) {
>          tcg_out_pop(s, tcg_target_callee_save_regs[i]);
>      }
> -    tcg_out8(s, 0xc3); /* ret */
> +    tcg_out_opc(s, OPC_RET);
>  }
>  
>  void tcg_target_init(TCGContext *s)
> -- 
> 1.6.6.1
> 
> 
> 
>

Patch

diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c
index e82788d..27e9e9e 100644
--- a/tcg/i386/tcg-target.c
+++ b/tcg/i386/tcg-target.c
@@ -188,6 +188,7 @@  static inline int tcg_target_const_match(tcg_target_long val,
 #define OPC_PUSH_r32	(0x50)
 #define OPC_PUSH_Iv	(0x68)
 #define OPC_PUSH_Ib	(0x6a)
+#define OPC_RET		(0xc3)
 #define OPC_SHIFT_1	(0xd1)
 #define OPC_SHIFT_Ib	(0xc1)
 #define OPC_SHIFT_cl	(0xd3)
@@ -1426,7 +1427,7 @@  void tcg_target_qemu_prologue(TCGContext *s)
     for(i = ARRAY_SIZE(tcg_target_callee_save_regs) - 1; i >= 0; i--) {
         tcg_out_pop(s, tcg_target_callee_save_regs[i]);
     }
-    tcg_out8(s, 0xc3); /* ret */
+    tcg_out_opc(s, OPC_RET);
 }
 
 void tcg_target_init(TCGContext *s)