~ubuntu-branches/ubuntu/vivid/qemu/vivid

« back to all changes in this revision

Viewing changes to debian/patches/ubuntu/arm64/0059-target-arm-A64-Add-decoder-skeleton-for-FP-instructi.patch

  • Committer: Package Import Robot
  • Author(s): dann frazier
  • Date: 2014-02-11 15:41:53 UTC
  • Revision ID: package-import@ubuntu.com-20140211154153-2d001tf0ium08u81
Tags: 1.7.0+dfsg-3ubuntu2
* Backport changes to enable qemu-user-static support for aarch64
* debian/control: add ppc64el to Architectures
* debian/rules: only install qemu-system-aarch64 on arm64.
  Fixes a FTBFS  when built twice in a row on non-arm64 due to a stale
  debian/qemu-system-aarch64 directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From cb6ed0796cea25b7c9613dd559c70432db653b27 Mon Sep 17 00:00:00 2001
 
2
From: Peter Maydell <peter.maydell@linaro.org>
 
3
Date: Mon, 23 Dec 2013 23:27:30 +0000
 
4
Subject: [PATCH 059/158] target-arm: A64: Add decoder skeleton for FP
 
5
 instructions
 
6
 
 
7
Add a top level decoder skeleton for FP instructions.
 
8
 
 
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 
10
Reviewed-by: Richard Henderson <rth@twiddle.net>
 
11
---
 
12
 target-arm/translate-a64.c | 170 ++++++++++++++++++++++++++++++++++++++++++++-
 
13
 1 file changed, 169 insertions(+), 1 deletion(-)
 
14
 
 
15
diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
 
16
index 9ca6460..079c2f7 100644
 
17
--- a/target-arm/translate-a64.c
 
18
+++ b/target-arm/translate-a64.c
 
19
@@ -2670,10 +2670,178 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn)
 
20
     }
 
21
 }
 
22
 
 
23
+/* C3.6.22 Floating point compare
 
24
+ *   31  30  29 28       24 23  22  21 20  16 15 14 13  10    9    5 4     0
 
25
+ * +---+---+---+-----------+------+---+------+-----+---------+------+-------+
 
26
+ * | M | 0 | S | 1 1 1 1 0 | type | 1 |  Rm  | op  | 1 0 0 0 |  Rn  |  op2  |
 
27
+ * +---+---+---+-----------+------+---+------+-----+---------+------+-------+
 
28
+ */
 
29
+static void disas_fp_compare(DisasContext *s, uint32_t insn)
 
30
+{
 
31
+    unsupported_encoding(s, insn);
 
32
+}
 
33
+
 
34
+/* C3.6.23 Floating point conditional compare
 
35
+ *   31  30  29 28       24 23  22  21 20  16 15  12 11 10 9    5  4   3    0
 
36
+ * +---+---+---+-----------+------+---+------+------+-----+------+----+------+
 
37
+ * | M | 0 | S | 1 1 1 1 0 | type | 1 |  Rm  | cond | 0 1 |  Rn  | op | nzcv |
 
38
+ * +---+---+---+-----------+------+---+------+------+-----+------+----+------+
 
39
+ */
 
40
+static void disas_fp_ccomp(DisasContext *s, uint32_t insn)
 
41
+{
 
42
+    unsupported_encoding(s, insn);
 
43
+}
 
44
+
 
45
+/* C3.6.24 Floating point conditional select
 
46
+ *   31  30  29 28       24 23  22  21 20  16 15  12 11 10 9    5 4    0
 
47
+ * +---+---+---+-----------+------+---+------+------+-----+------+------+
 
48
+ * | M | 0 | S | 1 1 1 1 0 | type | 1 |  Rm  | cond | 1 1 |  Rn  |  Rd  |
 
49
+ * +---+---+---+-----------+------+---+------+------+-----+------+------+
 
50
+ */
 
51
+static void disas_fp_csel(DisasContext *s, uint32_t insn)
 
52
+{
 
53
+    unsupported_encoding(s, insn);
 
54
+}
 
55
+
 
56
+/* C3.6.25 Floating point data-processing (1 source)
 
57
+ *   31  30  29 28       24 23  22  21 20    15 14       10 9    5 4    0
 
58
+ * +---+---+---+-----------+------+---+--------+-----------+------+------+
 
59
+ * | M | 0 | S | 1 1 1 1 0 | type | 1 | opcode | 1 0 0 0 0 |  Rn  |  Rd  |
 
60
+ * +---+---+---+-----------+------+---+--------+-----------+------+------+
 
61
+ */
 
62
+static void disas_fp_1src(DisasContext *s, uint32_t insn)
 
63
+{
 
64
+    unsupported_encoding(s, insn);
 
65
+}
 
66
+
 
67
+/* C3.6.26 Floating point data-processing (2 source)
 
68
+ *   31  30  29 28       24 23  22  21 20  16 15    12 11 10 9    5 4    0
 
69
+ * +---+---+---+-----------+------+---+------+--------+-----+------+------+
 
70
+ * | M | 0 | S | 1 1 1 1 0 | type | 1 |  Rm  | opcode | 1 0 |  Rn  |  Rd  |
 
71
+ * +---+---+---+-----------+------+---+------+--------+-----+------+------+
 
72
+ */
 
73
+static void disas_fp_2src(DisasContext *s, uint32_t insn)
 
74
+{
 
75
+    unsupported_encoding(s, insn);
 
76
+}
 
77
+
 
78
+/* C3.6.27 Floating point data-processing (3 source)
 
79
+ *   31  30  29 28       24 23  22  21  20  16  15  14  10 9    5 4    0
 
80
+ * +---+---+---+-----------+------+----+------+----+------+------+------+
 
81
+ * | M | 0 | S | 1 1 1 1 1 | type | o1 |  Rm  | o0 |  Ra  |  Rn  |  Rd  |
 
82
+ * +---+---+---+-----------+------+----+------+----+------+------+------+
 
83
+ */
 
84
+static void disas_fp_3src(DisasContext *s, uint32_t insn)
 
85
+{
 
86
+    unsupported_encoding(s, insn);
 
87
+}
 
88
+
 
89
+/* C3.6.28 Floating point immediate
 
90
+ *   31  30  29 28       24 23  22  21 20        13 12   10 9    5 4    0
 
91
+ * +---+---+---+-----------+------+---+------------+-------+------+------+
 
92
+ * | M | 0 | S | 1 1 1 1 0 | type | 1 |    imm8    | 1 0 0 | imm5 |  Rd  |
 
93
+ * +---+---+---+-----------+------+---+------------+-------+------+------+
 
94
+ */
 
95
+static void disas_fp_imm(DisasContext *s, uint32_t insn)
 
96
+{
 
97
+    unsupported_encoding(s, insn);
 
98
+}
 
99
+
 
100
+/* C3.6.29 Floating point <-> fixed point conversions
 
101
+ *   31   30  29 28       24 23  22  21 20   19 18    16 15   10 9    5 4    0
 
102
+ * +----+---+---+-----------+------+---+-------+--------+-------+------+------+
 
103
+ * | sf | 0 | S | 1 1 1 1 0 | type | 0 | rmode | opcode | scale |  Rn  |  Rd  |
 
104
+ * +----+---+---+-----------+------+---+-------+--------+-------+------+------+
 
105
+ */
 
106
+static void disas_fp_fixed_conv(DisasContext *s, uint32_t insn)
 
107
+{
 
108
+    unsupported_encoding(s, insn);
 
109
+}
 
110
+
 
111
+/* C3.6.30 Floating point <-> integer conversions
 
112
+ *   31   30  29 28       24 23  22  21 20   19 18 16 15         10 9  5 4  0
 
113
+ * +----+---+---+-----------+------+---+-------+-----+-------------+----+----+
 
114
+ * | sf | 0 | S | 1 1 1 1 0 | type | 0 | rmode | opc | 0 0 0 0 0 0 | Rn | Rd |
 
115
+ * +----+---+---+-----------+------+---+-------+-----+-------------+----+----+
 
116
+ */
 
117
+static void disas_fp_int_conv(DisasContext *s, uint32_t insn)
 
118
+{
 
119
+    unsupported_encoding(s, insn);
 
120
+}
 
121
+
 
122
+/* FP-specific subcases of table C3-6 (SIMD and FP data processing)
 
123
+ *   31  30  29 28     25 24                          0
 
124
+ * +---+---+---+---------+-----------------------------+
 
125
+ * |   | 0 |   | 1 1 1 1 |                             |
 
126
+ * +---+---+---+---------+-----------------------------+
 
127
+ */
 
128
+static void disas_data_proc_fp(DisasContext *s, uint32_t insn)
 
129
+{
 
130
+    if (extract32(insn, 24, 1)) {
 
131
+        /* Floating point data-processing (3 source) */
 
132
+        disas_fp_3src(s, insn);
 
133
+    } else if (extract32(insn, 21, 1) == 0) {
 
134
+        /* Floating point to fixed point conversions */
 
135
+        disas_fp_fixed_conv(s, insn);
 
136
+    } else {
 
137
+        switch (extract32(insn, 10, 2)) {
 
138
+        case 1:
 
139
+            /* Floating point conditional compare */
 
140
+            disas_fp_ccomp(s, insn);
 
141
+            break;
 
142
+        case 2:
 
143
+            /* Floating point data-processing (2 source) */
 
144
+            disas_fp_2src(s, insn);
 
145
+            break;
 
146
+        case 3:
 
147
+            /* Floating point conditional select */
 
148
+            disas_fp_csel(s, insn);
 
149
+            break;
 
150
+        case 0:
 
151
+            switch (ctz32(extract32(insn, 12, 4))) {
 
152
+            case 0: /* [15:12] == xxx1 */
 
153
+                /* Floating point immediate */
 
154
+                disas_fp_imm(s, insn);
 
155
+                break;
 
156
+            case 1: /* [15:12] == xx10 */
 
157
+                /* Floating point compare */
 
158
+                disas_fp_compare(s, insn);
 
159
+                break;
 
160
+            case 2: /* [15:12] == x100 */
 
161
+                /* Floating point data-processing (1 source) */
 
162
+                disas_fp_1src(s, insn);
 
163
+                break;
 
164
+            case 3: /* [15:12] == 1000 */
 
165
+                unallocated_encoding(s);
 
166
+                break;
 
167
+            default: /* [15:12] == 0000 */
 
168
+                /* Floating point <-> integer conversions */
 
169
+                disas_fp_int_conv(s, insn);
 
170
+                break;
 
171
+            }
 
172
+            break;
 
173
+        }
 
174
+    }
 
175
+}
 
176
+
 
177
+static void disas_data_proc_simd(DisasContext *s, uint32_t insn)
 
178
+{
 
179
+    /* Note that this is called with all non-FP cases from
 
180
+     * table C3-6 so it must UNDEF for entries not specifically
 
181
+     * allocated to instructions in that table.
 
182
+     */
 
183
+    unsupported_encoding(s, insn);
 
184
+}
 
185
+
 
186
 /* C3.6 Data processing - SIMD and floating point */
 
187
 static void disas_data_proc_simd_fp(DisasContext *s, uint32_t insn)
 
188
 {
 
189
-    unsupported_encoding(s, insn);
 
190
+    if (extract32(insn, 28, 1) == 1 && extract32(insn, 30, 1) == 0) {
 
191
+        disas_data_proc_fp(s, insn);
 
192
+    } else {
 
193
+        /* SIMD, including crypto */
 
194
+        disas_data_proc_simd(s, insn);
 
195
+    }
 
196
 }
 
197
 
 
198
 /* C3.1 A64 instruction index by encoding */
 
199
-- 
 
200
1.9.rc1
 
201