All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [5599] tcg-ops.h: add a subfi wrapper
@ 2008-11-02  8:23 Aurelien Jarno
  2008-11-02 13:30 ` Paul Brook
  0 siblings, 1 reply; 5+ messages in thread
From: Aurelien Jarno @ 2008-11-02  8:23 UTC (permalink / raw)
  To: qemu-devel

Revision: 5599
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5599
Author:   aurel32
Date:     2008-11-02 08:23:04 +0000 (Sun, 02 Nov 2008)

Log Message:
-----------
tcg-ops.h: add a subfi wrapper

Add a subfi (subtract from immediate) wrapper, useful for the PPC target.

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

Modified Paths:
--------------
    trunk/tcg/tcg-op.h

Modified: trunk/tcg/tcg-op.h
===================================================================
--- trunk/tcg/tcg-op.h	2008-11-02 08:22:54 UTC (rev 5598)
+++ trunk/tcg/tcg-op.h	2008-11-02 08:23:04 UTC (rev 5599)
@@ -377,6 +377,13 @@
     tcg_gen_op3(INDEX_op_sub_i32, ret, arg1, arg2);
 }
 
+static inline void tcg_gen_subfi_i32(TCGv ret, int32_t arg1, TCGv arg2)
+{
+    TCGv t0 = tcg_const_i32(arg1);
+    tcg_gen_sub_i32(ret, t0, arg2);
+    tcg_temp_free(t0);
+}
+
 static inline void tcg_gen_subi_i32(TCGv ret, TCGv arg1, int32_t arg2)
 {
     /* some cases can be optimized here */
@@ -1063,6 +1070,13 @@
     tcg_temp_free(t0);
 }
 
+static inline void tcg_gen_subfi_i64(TCGv ret, int64_t arg1, TCGv arg2)
+{
+    TCGv t0 = tcg_const_i64(arg1);
+    tcg_gen_sub_i64(ret, t0, arg2);
+    tcg_temp_free(t0);
+}
+
 static inline void tcg_gen_subi_i64(TCGv ret, TCGv arg1, int64_t arg2)
 {
     /* some cases can be optimized here */
@@ -1725,6 +1739,7 @@
 #define tcg_gen_addi_tl tcg_gen_addi_i64
 #define tcg_gen_sub_tl tcg_gen_sub_i64
 #define tcg_gen_neg_tl tcg_gen_neg_i64
+#define tcg_gen_subfi_tl tcg_gen_subi_i64
 #define tcg_gen_subi_tl tcg_gen_subi_i64
 #define tcg_gen_and_tl tcg_gen_and_i64
 #define tcg_gen_andi_tl tcg_gen_andi_i64
@@ -1783,6 +1798,7 @@
 #define tcg_gen_addi_tl tcg_gen_addi_i32
 #define tcg_gen_sub_tl tcg_gen_sub_i32
 #define tcg_gen_neg_tl tcg_gen_neg_i32
+#define tcg_gen_subfi_tl tcg_gen_subfi_i32
 #define tcg_gen_subi_tl tcg_gen_subi_i32
 #define tcg_gen_and_tl tcg_gen_and_i32
 #define tcg_gen_andi_tl tcg_gen_andi_i32

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

* Re: [Qemu-devel] [5599] tcg-ops.h: add a subfi wrapper
  2008-11-02  8:23 [Qemu-devel] [5599] tcg-ops.h: add a subfi wrapper Aurelien Jarno
@ 2008-11-02 13:30 ` Paul Brook
  2008-11-02 19:13   ` Aurelien Jarno
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Brook @ 2008-11-02 13:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Aurelien Jarno

On Sunday 02 November 2008, Aurelien Jarno wrote:
> +#define tcg_gen_subfi_tl tcg_gen_subi_i64

It's worth enabling DEBUG_TCGV to catch this sort of error (fixed in svn).

Paul

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

* Re: [Qemu-devel] [5599] tcg-ops.h: add a subfi wrapper
  2008-11-02 13:30 ` Paul Brook
@ 2008-11-02 19:13   ` Aurelien Jarno
  2008-11-02 20:14     ` Paul Brook
  0 siblings, 1 reply; 5+ messages in thread
From: Aurelien Jarno @ 2008-11-02 19:13 UTC (permalink / raw)
  To: qemu-devel

On Sun, Nov 02, 2008 at 02:30:09PM +0100, Paul Brook wrote:
> On Sunday 02 November 2008, Aurelien Jarno wrote:
> > +#define tcg_gen_subfi_tl tcg_gen_subi_i64
> 
> It's worth enabling DEBUG_TCGV to catch this sort of error (fixed in svn).

I have it enabled, but unfortunately it doesn't catch this kind of error...

-- 
  .''`.  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] 5+ messages in thread

* Re: [Qemu-devel] [5599] tcg-ops.h: add a subfi wrapper
  2008-11-02 19:13   ` Aurelien Jarno
@ 2008-11-02 20:14     ` Paul Brook
  2008-11-02 21:45       ` Aurelien Jarno
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Brook @ 2008-11-02 20:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: Aurelien Jarno

> > > +#define tcg_gen_subfi_tl tcg_gen_subi_i64
> >
> > It's worth enabling DEBUG_TCGV to catch this sort of error (fixed in
> > svn).
>
> I have it enabled, but unfortunately it doesn't catch this kind of error...

Really? It should have, and did for me. Obviously only when building a 64-bit 
target.

Paul

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

* Re: [Qemu-devel] [5599] tcg-ops.h: add a subfi wrapper
  2008-11-02 20:14     ` Paul Brook
@ 2008-11-02 21:45       ` Aurelien Jarno
  0 siblings, 0 replies; 5+ messages in thread
From: Aurelien Jarno @ 2008-11-02 21:45 UTC (permalink / raw)
  To: qemu-devel

On Sun, Nov 02, 2008 at 09:14:21PM +0100, Paul Brook wrote:
> > > > +#define tcg_gen_subfi_tl tcg_gen_subi_i64
> > >
> > > It's worth enabling DEBUG_TCGV to catch this sort of error (fixed in
> > > svn).
> >
> > I have it enabled, but unfortunately it doesn't catch this kind of error...
> 
> Really? It should have, and did for me. Obviously only when building a 64-bit 
> target.
> 

You are right, I have been able to reproduce it. I don't know how I 
manage to lose my patch enabling DEBUG_TCGV in my git tree...

-- 
  .''`.  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] 5+ messages in thread

end of thread, other threads:[~2008-11-02 21:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-02  8:23 [Qemu-devel] [5599] tcg-ops.h: add a subfi wrapper Aurelien Jarno
2008-11-02 13:30 ` Paul Brook
2008-11-02 19:13   ` Aurelien Jarno
2008-11-02 20:14     ` Paul Brook
2008-11-02 21:45       ` Aurelien Jarno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.