1
From cb20c043fcf2bb963f9d1bda012fadc9af3e787d Mon Sep 17 00:00:00 2001
2
From: Will Newton <will.newton@linaro.org>
3
Date: Fri, 31 Jan 2014 14:47:35 +0000
4
Subject: [PATCH 131/158] target-arm: Add AArch32 SIMD VCVTA, VCVTN, VCVTP and
7
Add support for the AArch32 Advanced SIMD VCVTA, VCVTN, VCVTP
8
and VCVTM instructions.
10
Signed-off-by: Will Newton <will.newton@linaro.org>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
target-arm/translate.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++-
14
1 file changed, 52 insertions(+), 1 deletion(-)
16
diff --git a/target-arm/translate.c b/target-arm/translate.c
17
index 327f453..091db1b 100644
18
--- a/target-arm/translate.c
19
+++ b/target-arm/translate.c
20
@@ -4788,6 +4788,14 @@ static const uint8_t neon_3r_sizes[] = {
21
#define NEON_2RM_VRINTM 45
22
#define NEON_2RM_VCVT_F32_F16 46
23
#define NEON_2RM_VRINTP 47
24
+#define NEON_2RM_VCVTAU 48
25
+#define NEON_2RM_VCVTAS 49
26
+#define NEON_2RM_VCVTNU 50
27
+#define NEON_2RM_VCVTNS 51
28
+#define NEON_2RM_VCVTPU 52
29
+#define NEON_2RM_VCVTPS 53
30
+#define NEON_2RM_VCVTMU 54
31
+#define NEON_2RM_VCVTMS 55
32
#define NEON_2RM_VRECPE 56
33
#define NEON_2RM_VRSQRTE 57
34
#define NEON_2RM_VRECPE_F 58
35
@@ -4802,7 +4810,8 @@ static int neon_2rm_is_float_op(int op)
36
/* Return true if this neon 2reg-misc op is float-to-float */
37
return (op == NEON_2RM_VABS_F || op == NEON_2RM_VNEG_F ||
38
(op >= NEON_2RM_VRINTN && op <= NEON_2RM_VRINTZ) ||
39
- op == NEON_2RM_VRINTM || op == NEON_2RM_VRINTP ||
40
+ op == NEON_2RM_VRINTM ||
41
+ (op >= NEON_2RM_VRINTP && op <= NEON_2RM_VCVTMS) ||
42
op >= NEON_2RM_VRECPE_F);
45
@@ -4853,6 +4862,14 @@ static const uint8_t neon_2rm_sizes[] = {
46
[NEON_2RM_VRINTM] = 0x4,
47
[NEON_2RM_VCVT_F32_F16] = 0x2,
48
[NEON_2RM_VRINTP] = 0x4,
49
+ [NEON_2RM_VCVTAU] = 0x4,
50
+ [NEON_2RM_VCVTAS] = 0x4,
51
+ [NEON_2RM_VCVTNU] = 0x4,
52
+ [NEON_2RM_VCVTNS] = 0x4,
53
+ [NEON_2RM_VCVTPU] = 0x4,
54
+ [NEON_2RM_VCVTPS] = 0x4,
55
+ [NEON_2RM_VCVTMU] = 0x4,
56
+ [NEON_2RM_VCVTMS] = 0x4,
57
[NEON_2RM_VRECPE] = 0x4,
58
[NEON_2RM_VRSQRTE] = 0x4,
59
[NEON_2RM_VRECPE_F] = 0x4,
60
@@ -6574,6 +6591,40 @@ static int disas_neon_data_insn(CPUARMState * env, DisasContext *s, uint32_t ins
61
tcg_temp_free_ptr(fpstatus);
64
+ case NEON_2RM_VCVTAU:
65
+ case NEON_2RM_VCVTAS:
66
+ case NEON_2RM_VCVTNU:
67
+ case NEON_2RM_VCVTNS:
68
+ case NEON_2RM_VCVTPU:
69
+ case NEON_2RM_VCVTPS:
70
+ case NEON_2RM_VCVTMU:
71
+ case NEON_2RM_VCVTMS:
73
+ bool is_signed = !extract32(insn, 7, 1);
74
+ TCGv_ptr fpst = get_fpstatus_ptr(1);
75
+ TCGv_i32 tcg_rmode, tcg_shift;
76
+ int rmode = fp_decode_rm[extract32(insn, 8, 2)];
78
+ tcg_shift = tcg_const_i32(0);
79
+ tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode));
80
+ gen_helper_set_neon_rmode(tcg_rmode, tcg_rmode,
84
+ gen_helper_vfp_tosls(cpu_F0s, cpu_F0s,
87
+ gen_helper_vfp_touls(cpu_F0s, cpu_F0s,
91
+ gen_helper_set_neon_rmode(tcg_rmode, tcg_rmode,
93
+ tcg_temp_free_i32(tcg_rmode);
94
+ tcg_temp_free_i32(tcg_shift);
95
+ tcg_temp_free_ptr(fpst);
99
gen_helper_recpe_u32(tmp, tmp, cpu_env);