qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] RFC: target-arm: vld1.64 and vst1.64 support
@ 2009-07-21 20:58 riku.voipio
  2009-07-21 20:58 ` [Qemu-devel] linux-user: add eventfd support riku.voipio
  0 siblings, 1 reply; 2+ messages in thread
From: riku.voipio @ 2009-07-21 20:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

From: Riku Voipio <riku.voipio@iki.fi>

The 64bit form of vld1/vst1 was not supported. This has
been tested to be compatible with the memcpy_neon tests
and neon-optimized pixman code.

the current patch doesn't indent the rest of the code
to minimize the patch for RFC purposes. I'd certainly
like a prettier way for this.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 target-arm/translate.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 4db8d0e..2012c23 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -854,6 +854,12 @@ static inline TCGv gen_ld32(TCGv addr, int index)
     tcg_gen_qemu_ld32u(tmp, addr, index);
     return tmp;
 }
+static inline TCGv_i64 gen_ld64(TCGv addr, int index)
+{
+    TCGv_i64 tmp = tcg_temp_new_i64();
+    tcg_gen_qemu_ld64(tmp, addr, index);
+    return tmp;
+}
 static inline void gen_st8(TCGv val, TCGv addr, int index)
 {
     tcg_gen_qemu_st8(val, addr, index);
@@ -869,6 +875,10 @@ static inline void gen_st32(TCGv val, TCGv addr, int index)
     tcg_gen_qemu_st32(val, addr, index);
     dead_tmp(val);
 }
+static inline void gen_st64(TCGv_i64 val, TCGv addr, int index)
+{
+    tcg_gen_qemu_st64(val, addr, index);
+}
 
 static inline void gen_movl_T0_reg(DisasContext *s, int reg)
 {
@@ -3705,7 +3715,7 @@ static int disas_neon_ls_insn(CPUState * env, DisasContext *s, uint32_t insn)
         /* Load store all elements.  */
         op = (insn >> 8) & 0xf;
         size = (insn >> 6) & 3;
-        if (op > 10 || size == 3)
+        if (op > 10)
             return 1;
         nregs = neon_ls_element_type[op].nregs;
         interleave = neon_ls_element_type[op].interleave;
@@ -3719,6 +3729,18 @@ static int disas_neon_ls_insn(CPUState * env, DisasContext *s, uint32_t insn)
                 gen_movl_T1_reg(s, rn);
                 gen_op_addl_T1_im(1 << size);
             }
+            if (size == 3) {
+                TCGv_i64 tmp64;
+                if (load) {
+                    tmp64 = gen_ld64(cpu_T[1], IS_USER(s));
+                    neon_store_reg64(tmp64, rd);
+                } else { /* bookmark */
+                    tmp64 = tcg_temp_new_i64();
+                    neon_load_reg64(tmp64, rd);
+                    gen_st64(tmp64, cpu_T[1], IS_USER(s));
+                }
+                gen_op_addl_T1_im(stride);
+            } else {
             for (pass = 0; pass < 2; pass++) {
                 if (size == 2) {
                     if (load) {
@@ -3776,7 +3798,7 @@ static int disas_neon_ls_insn(CPUState * env, DisasContext *s, uint32_t insn)
                         dead_tmp(tmp2);
                     }
                 }
-            }
+            } }
             rd += neon_ls_element_type[op].spacing;
         }
         stride = nregs * 8;
-- 
1.6.2.1

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

* [Qemu-devel] linux-user: add eventfd support
  2009-07-21 20:58 [Qemu-devel] RFC: target-arm: vld1.64 and vst1.64 support riku.voipio
@ 2009-07-21 20:58 ` riku.voipio
  0 siblings, 0 replies; 2+ messages in thread
From: riku.voipio @ 2009-07-21 20:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

From: Riku Voipio <riku.voipio@iki.fi>

Straightforward implementation. This syscall is rare enough that we
don't need to support the odder cases, just disable it if host glibc
is too old.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 configure            |   18 ++++++++++++++++++
 linux-user/syscall.c |   13 +++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 0db885b..8a7399f 100755
--- a/configure
+++ b/configure
@@ -1366,6 +1366,21 @@ if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
   splice=yes
 fi
 
+# check if eventfd is supported
+eventfd=no
+cat > $TMPC << EOF
+#include <sys/eventfd.h>
+
+int main(void)
+{
+    int efd = eventfd(0, 0);
+    return 0;
+}
+EOF
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
+  eventfd=yes
+fi
+
 # Check if tools are available to build documentation.
 if test "$build_docs" = "yes" -a \( ! -x "`which texi2html 2>/dev/null`" -o ! -x "`which pod2man 2>/dev/null`" \) ; then
   build_docs="no"
@@ -1715,6 +1730,9 @@ fi
 if test "$splice" = "yes" ; then
   echo "#define CONFIG_SPLICE 1" >> $config_host_h
 fi
+if test "$eventfd" = "yes" ; then
+  echo "#define CONFIG_EVENTFD 1" >> $config_host_h
+fi
 if test "$inotify" = "yes" ; then
   echo "#define CONFIG_INOTIFY 1" >> $config_host_h
 fi
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7b57323..081cb34 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6966,6 +6966,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         break;
 #endif
 #endif /* CONFIG_SPLICE */
+#ifdef CONFIG_EVENTFD
+#include <sys/eventfd.h>
+#if defined(TARGET_NR_eventfd)
+    case TARGET_NR_eventfd:
+        ret = get_errno(eventfd(arg1, 0));
+        break;
+#endif
+#if defined(TARGET_NR_eventfd2)
+    case TARGET_NR_eventfd2:
+        ret = get_errno(eventfd(arg1, arg2));
+        break;
+#endif
+#endif /* CONFIG_EVENTFD  */
     default:
     unimplemented:
         gemu_log("qemu: Unsupported syscall: %d\n", num);
-- 
1.6.2.1

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

end of thread, other threads:[~2009-07-21 20:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-21 20:58 [Qemu-devel] RFC: target-arm: vld1.64 and vst1.64 support riku.voipio
2009-07-21 20:58 ` [Qemu-devel] linux-user: add eventfd support riku.voipio

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).