Patchwork [45/48] target-arm: fix neon vcvt fixed-point

login
register
mail settings
Submitter Riku Voipio
Date March 26, 2010, 4:07 p.m.
Message ID <c42525bbbbc1c20ecbe9ee4ff66fae59410e67fe.1269617187.git.riku.voipio@nokia.com>
Download mbox | patch
Permalink /patch/48688/
State New
Headers show

Comments

Riku Voipio - March 26, 2010, 4:07 p.m.
From: Juha Riihimäki <juha.riihimaki@nokia.com>

Signed-Off-By: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
---
 target-arm/translate.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 92c8a1a..fd3a72e 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -4874,20 +4874,21 @@  static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
                 if (!(insn & (1 << 21)) || (q && ((rd | rm) & 1))) {
                     return 1;
                 }
+                shift = 64 - ((insn >> 16) & 0x3f);
                 for (pass = 0; pass < (q ? 4 : 2); pass++) {
                     tcg_gen_ld_f32(cpu_F0s, cpu_env,
                                    neon_reg_offset(rm, pass));
                     if (op & 1) {
                         if (u) {
-                            gen_vfp_ulto(0, shift);
+                            gen_vfp_toul(0, shift);
                         } else {
-                            gen_vfp_slto(0, shift);
+                            gen_vfp_tosl(0, shift);
                         }
                     } else {
                         if (u) {
-                            gen_vfp_toul(0, shift);
+                            gen_vfp_ulto(0, shift);
                         } else {
-                            gen_vfp_tosl(0, shift);
+                            gen_vfp_slto(0, shift);
                         }
                     }
                     tcg_gen_st_f32(cpu_F0s, cpu_env,