qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [5675] target-mips: optimize gen_save_pc()
@ 2008-11-11 11:36 Aurelien Jarno
  2008-11-11 16:59 ` Andreas Färber
  0 siblings, 1 reply; 3+ messages in thread
From: Aurelien Jarno @ 2008-11-11 11:36 UTC (permalink / raw)
  To: qemu-devel

Revision: 5675
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5675
Author:   aurel32
Date:     2008-11-11 11:36:04 +0000 (Tue, 11 Nov 2008)

Log Message:
-----------
target-mips: optimize gen_save_pc()

We obviously don't need to use a temporary variable to write PC.

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

Modified Paths:
--------------
    trunk/target-mips/translate.c

Modified: trunk/target-mips/translate.c
===================================================================
--- trunk/target-mips/translate.c	2008-11-11 11:34:39 UTC (rev 5674)
+++ trunk/target-mips/translate.c	2008-11-11 11:36:04 UTC (rev 5675)
@@ -827,11 +827,7 @@
 
 static inline void gen_save_pc(target_ulong pc)
 {
-    TCGv r_tmp = tcg_temp_new(TCG_TYPE_TL);
-
-    tcg_gen_movi_tl(r_tmp, pc);
-    tcg_gen_mov_tl(cpu_PC, r_tmp);
-    tcg_temp_free(r_tmp);
+    tcg_gen_movi_tl(cpu_PC, pc);
 }
 
 static inline void save_cpu_state (DisasContext *ctx, int do_save_pc)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [5675] target-mips: optimize gen_save_pc()
  2008-11-11 11:36 [Qemu-devel] [5675] target-mips: optimize gen_save_pc() Aurelien Jarno
@ 2008-11-11 16:59 ` Andreas Färber
  2008-11-12 10:04   ` Aurélien Jarno
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Färber @ 2008-11-11 16:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Aurélien Jarno


Am 11.11.2008 um 12:36 schrieb Aurelien Jarno:

> Revision: 5675
>          http://svn.sv.gnu.org/viewvc/? 
> view=rev&root=qemu&revision=5675
> Author:   aurel32
> Date:     2008-11-11 11:36:04 +0000 (Tue, 11 Nov 2008)
>
> Log Message:
> -----------
> target-mips: optimize gen_save_pc()
>
> We obviously don't need to use a temporary variable to write PC.

We probably don't need an inline helper for that either, while we're  
at it?

Andreas

> Modified: trunk/target-mips/translate.c
> ===================================================================
> --- trunk/target-mips/translate.c	2008-11-11 11:34:39 UTC (rev 5674)
> +++ trunk/target-mips/translate.c	2008-11-11 11:36:04 UTC (rev 5675)
> @@ -827,11 +827,7 @@
>
> static inline void gen_save_pc(target_ulong pc)
> {
> -    TCGv r_tmp = tcg_temp_new(TCG_TYPE_TL);
> -
> -    tcg_gen_movi_tl(r_tmp, pc);
> -    tcg_gen_mov_tl(cpu_PC, r_tmp);
> -    tcg_temp_free(r_tmp);
> +    tcg_gen_movi_tl(cpu_PC, pc);
> }
>
> static inline void save_cpu_state (DisasContext *ctx, int do_save_pc)
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [5675] target-mips: optimize gen_save_pc()
  2008-11-11 16:59 ` Andreas Färber
@ 2008-11-12 10:04   ` Aurélien Jarno
  0 siblings, 0 replies; 3+ messages in thread
From: Aurélien Jarno @ 2008-11-12 10:04 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-devel

On Tue, Nov 11, 2008 at 05:59:41PM +0100, Andreas Färber wrote:
>
> Am 11.11.2008 um 12:36 schrieb Aurelien Jarno:
>
>> Revision: 5675
>>          http://svn.sv.gnu.org/viewvc/? 
>> view=rev&root=qemu&revision=5675
>> Author:   aurel32
>> Date:     2008-11-11 11:36:04 +0000 (Tue, 11 Nov 2008)
>>
>> Log Message:
>> -----------
>> target-mips: optimize gen_save_pc()
>>
>> We obviously don't need to use a temporary variable to write PC.
>
> We probably don't need an inline helper for that either, while we're at 
> it?

Well, the fact that we have an helper doesn't change the TCG generated
code, and shouldn't change the host generated code if GCC is used with
optimisation.

I am not sure it worth removing this function, I'll let the decision to
Thiemo.

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-12 10:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-11 11:36 [Qemu-devel] [5675] target-mips: optimize gen_save_pc() Aurelien Jarno
2008-11-11 16:59 ` Andreas Färber
2008-11-12 10:04   ` Aurélien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).