~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to debian/patches/arm64/0036-target-arm-A64-add-support-for-conditional-select.patch

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-04 12:13:08 UTC
  • mfrom: (10.1.45 sid)
  • Revision ID: package-import@ubuntu.com-20140204121308-1xq92lrfs75agw2g
Tags: 1.7.0+dfsg-3ubuntu1~ppa1
* Merge 1.7.0+dfsg-3 from debian.  Remaining changes:
  - debian/patches/ubuntu:
    * expose-vmx_qemu64cpu.patch
    * linaro (omap3) and arm64 patches
    * ubuntu/target-ppc-add-stubs-for-kvm-breakpoints: fix FTBFS
      on ppc
    * ubuntu/CVE-2013-4377.patch: fix denial of service via virtio
  - debian/qemu-system-x86.modprobe: set kvm_intel nested=1 options
  - debian/control:
    * add arm64 to Architectures
    * add qemu-common and qemu-system-aarch64 packages
  - debian/qemu-system-common.install: add debian/tmp/usr/lib
  - debian/qemu-system-common.preinst: add kvm group
  - debian/qemu-system-common.postinst: remove acl placed by udev,
    and add udevadm trigger.
  - qemu-system-x86.links: add eepro100.rom, remove pxe-virtio,
    pxe-e1000 and pxe-rtl8139.
  - add qemu-system-x86.qemu-kvm.upstart and .default
  - qemu-user-static.postinst-in: remove arm64 binfmt
  - debian/rules:
    * allow parallel build
    * add aarch64 to system_targets and sys_systems
    * add qemu-kvm-spice links
    * install qemu-system-x86.modprobe
  - add debian/qemu-system-common.links for OVMF.fd link
* Remove kvm-img, kvm-nbd, kvm-ifup and kvm-ifdown symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 538aa3819cc2868befb581ac13091b7a6d28c199 Mon Sep 17 00:00:00 2001
2
 
From: Claudio Fontana <claudio.fontana@linaro.org>
3
 
Date: Tue, 17 Dec 2013 19:42:33 +0000
4
 
Subject: [PATCH 36/49] target-arm: A64: add support for conditional select
5
 
 
6
 
This patch adds support for the instruction group "C3.5.6
7
 
Conditional select": CSEL, CSINC, CSINV, CSNEG.
8
 
 
9
 
Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
10
 
[PMM: Improved code generated in the nomatch case as per RTH suggestions]
11
 
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
 
Reviewed-by: Richard Henderson <rth@twiddle.net>
13
 
---
14
 
 target-arm/translate-a64.c | 67 ++++++++++++++++++++++++++++++++++++++++++++--
15
 
 1 file changed, 65 insertions(+), 2 deletions(-)
16
 
 
17
 
diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
18
 
index 5ae3a85..13eedf4 100644
19
 
--- a/target-arm/translate-a64.c
20
 
+++ b/target-arm/translate-a64.c
21
 
@@ -724,10 +724,73 @@ static void disas_cc_reg(DisasContext *s, uint32_t insn)
22
 
     unsupported_encoding(s, insn);
23
 
 }
24
 
 
25
 
-/* Conditional select */
26
 
+/* C3.5.6 Conditional select
27
 
+ *   31   30  29  28             21 20  16 15  12 11 10 9    5 4    0
28
 
+ * +----+----+---+-----------------+------+------+-----+------+------+
29
 
+ * | sf | op | S | 1 1 0 1 0 1 0 0 |  Rm  | cond | op2 |  Rn  |  Rd  |
30
 
+ * +----+----+---+-----------------+------+------+-----+------+------+
31
 
+ */
32
 
 static void disas_cond_select(DisasContext *s, uint32_t insn)
33
 
 {
34
 
-    unsupported_encoding(s, insn);
35
 
+    unsigned int sf, else_inv, rm, cond, else_inc, rn, rd;
36
 
+    TCGv_i64 tcg_rd, tcg_src;
37
 
+
38
 
+    if (extract32(insn, 29, 1) || extract32(insn, 11, 1)) {
39
 
+        /* S == 1 or op2<1> == 1 */
40
 
+        unallocated_encoding(s);
41
 
+        return;
42
 
+    }
43
 
+    sf = extract32(insn, 31, 1);
44
 
+    else_inv = extract32(insn, 30, 1);
45
 
+    rm = extract32(insn, 16, 5);
46
 
+    cond = extract32(insn, 12, 4);
47
 
+    else_inc = extract32(insn, 10, 1);
48
 
+    rn = extract32(insn, 5, 5);
49
 
+    rd = extract32(insn, 0, 5);
50
 
+
51
 
+    if (rd == 31) {
52
 
+        /* silly no-op write; until we use movcond we must special-case
53
 
+         * this to avoid a dead temporary across basic blocks.
54
 
+         */
55
 
+        return;
56
 
+    }
57
 
+
58
 
+    tcg_rd = cpu_reg(s, rd);
59
 
+
60
 
+    if (cond >= 0x0e) { /* condition "always" */
61
 
+        tcg_src = read_cpu_reg(s, rn, sf);
62
 
+        tcg_gen_mov_i64(tcg_rd, tcg_src);
63
 
+    } else {
64
 
+        /* OPTME: we could use movcond here, at the cost of duplicating
65
 
+         * a lot of the arm_gen_test_cc() logic.
66
 
+         */
67
 
+        int label_match = gen_new_label();
68
 
+        int label_continue = gen_new_label();
69
 
+
70
 
+        arm_gen_test_cc(cond, label_match);
71
 
+        /* nomatch: */
72
 
+        tcg_src = cpu_reg(s, rm);
73
 
+
74
 
+        if (else_inv && else_inc) {
75
 
+            tcg_gen_neg_i64(tcg_rd, tcg_src);
76
 
+        } else if (else_inv) {
77
 
+            tcg_gen_not_i64(tcg_rd, tcg_src);
78
 
+        } else if (else_inc) {
79
 
+            tcg_gen_addi_i64(tcg_rd, tcg_src, 1);
80
 
+        } else {
81
 
+            tcg_gen_mov_i64(tcg_rd, tcg_src);
82
 
+        }
83
 
+        if (!sf) {
84
 
+            tcg_gen_ext32u_i64(tcg_rd, tcg_rd);
85
 
+        }
86
 
+        tcg_gen_br(label_continue);
87
 
+        /* match: */
88
 
+        gen_set_label(label_match);
89
 
+        tcg_src = read_cpu_reg(s, rn, sf);
90
 
+        tcg_gen_mov_i64(tcg_rd, tcg_src);
91
 
+        /* continue: */
92
 
+        gen_set_label(label_continue);
93
 
+    }
94
 
 }
95
 
 
96
 
 /* Data-processing (1 source) */
97
 
1.8.5.2
98