1 | Hopefully last target-arm queue before softfreeze; | 1 | A largish pullreq but it's almost all docs fixes. |
---|---|---|---|
2 | this one's largest part is the remainder of the SVE patches, | ||
3 | but there are a selection of other minor things too. | ||
4 | 2 | ||
5 | thanks | ||
6 | -- PMM | 3 | -- PMM |
7 | 4 | ||
8 | The following changes since commit 109b25045b3651f9c5d02c3766c0b3ff63e6d193: | 5 | The following changes since commit 10a3c4a4b3e14208cfed274514d1911e5230935f: |
9 | 6 | ||
10 | Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2018-06-29 12:30:29 +0100) | 7 | Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2021-08-02 09:47:07 +0100) |
11 | 8 | ||
12 | are available in the Git repository at: | 9 | are available in the Git repository at: |
13 | 10 | ||
14 | git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20180629 | 11 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20210802 |
15 | 12 | ||
16 | for you to fetch changes up to 802abf4024d23e48d45373ac3f2b580124b54b47: | 13 | for you to fetch changes up to 4a64939db76b10d8d41d2af3c6aad8142da55450: |
17 | 14 | ||
18 | target/arm: Add ID_ISAR6 (2018-06-29 15:30:54 +0100) | 15 | docs: Move user-facing barrier docs into system manual (2021-08-02 12:55:51 +0100) |
19 | 16 | ||
20 | ---------------------------------------------------------------- | 17 | ---------------------------------------------------------------- |
21 | target-arm queue: | 18 | target-arm queue: |
22 | * last of the SVE patches; SVE is now enabled for aarch64 linux-user | 19 | * Add documentation of Arm 'mainstone', 'kzm', 'imx25-pdk' boards |
23 | * sd: Don't trace SDRequest crc field (coverity bugfix) | 20 | * MAINTAINERS: Don't list Andrzej Zaborowski for various components |
24 | * target/arm: Mark PMINTENSET accesses as possibly doing IO | 21 | * docs: Remove stale TODO comments about license and version |
25 | * clean up v7VE feature bit handling | 22 | * docs: Move licence/copyright from HTML output to rST comments |
26 | * i.mx7d: minor cleanups | 23 | * docs: Format literal text correctly |
27 | * target/arm: support reading of CNT[VCT|FRQ]_EL0 from user-space | 24 | * hw/arm/boot: Report error if there is no fw_cfg device in the machine |
28 | * target/arm: Implement ARMv8.2-DotProd | 25 | * docs: rSTify barrier.txt and bootindex.txt |
29 | * virt: add addresses to dt node names (which stops dtc from | ||
30 | complaining that they're not correctly named) | ||
31 | * cleanups: replace error_setg(&error_fatal) by error_report() + exit() | ||
32 | 26 | ||
33 | ---------------------------------------------------------------- | 27 | ---------------------------------------------------------------- |
34 | Aaron Lindsay (3): | 28 | Peter Maydell (21): |
35 | target/arm: Add ARM_FEATURE_V7VE for v7 Virtualization Extensions | 29 | docs: Add documentation of Arm 'mainstone' board |
36 | target/arm: Remove redundant DIV detection for KVM | 30 | docs: Add documentation of Arm 'kzm' board |
37 | target/arm: Mark PMINTENSET accesses as possibly doing IO | 31 | docs: Add documentation of Arm 'imx25-pdk' board |
32 | MAINTAINERS: Don't list Andrzej Zaborowski for various components | ||
33 | docs: Remove stale TODO comments about license and version | ||
34 | docs: Move licence/copyright from HTML output to rST comments | ||
35 | docs/devel/build-system.rst: Format literals correctly | ||
36 | docs/devel/build-system.rst: Correct typo in example code | ||
37 | docs/devel/ebpf_rss.rst: Format literals correctly | ||
38 | docs/devel/migration.rst: Format literals correctly | ||
39 | docs/devel: Format literals correctly | ||
40 | docs/system/s390x/protvirt.rst: Format literals correctly | ||
41 | docs/system/arm/cpu-features.rst: Format literals correctly | ||
42 | docs: Format literals correctly | ||
43 | docs/about/removed-features: Fix markup error | ||
44 | docs/tools/virtiofsd.rst: Delete stray backtick | ||
45 | hw/arm/boot: Report error if there is no fw_cfg device in the machine | ||
46 | docs: Move bootindex.txt into system section and rstify | ||
47 | docs: Move the protocol part of barrier.txt into interop | ||
48 | ui/input-barrier: Move TODOs from barrier.txt to a comment | ||
49 | docs: Move user-facing barrier docs into system manual | ||
38 | 50 | ||
39 | Alex Bennée (1): | 51 | docs/about/index.rst | 2 +- |
40 | target/arm: support reading of CNT[VCT|FRQ]_EL0 from user-space | 52 | docs/about/removed-features.rst | 2 +- |
53 | docs/barrier.txt | 370 ----------------------- | ||
54 | docs/bootindex.txt | 52 ---- | ||
55 | docs/devel/build-system.rst | 160 +++++----- | ||
56 | docs/devel/ebpf_rss.rst | 18 +- | ||
57 | docs/devel/migration.rst | 36 +-- | ||
58 | docs/devel/qgraph.rst | 8 +- | ||
59 | docs/devel/tcg-plugins.rst | 14 +- | ||
60 | docs/devel/testing.rst | 8 +- | ||
61 | docs/interop/barrier.rst | 426 +++++++++++++++++++++++++++ | ||
62 | docs/interop/index.rst | 1 + | ||
63 | docs/interop/live-block-operations.rst | 2 +- | ||
64 | docs/interop/qemu-ga-ref.rst | 9 - | ||
65 | docs/interop/qemu-qmp-ref.rst | 9 - | ||
66 | docs/interop/qemu-storage-daemon-qmp-ref.rst | 9 - | ||
67 | docs/interop/vhost-user-gpu.rst | 7 +- | ||
68 | docs/interop/vhost-user.rst | 12 +- | ||
69 | docs/system/arm/cpu-features.rst | 116 ++++---- | ||
70 | docs/system/arm/imx25-pdk.rst | 19 ++ | ||
71 | docs/system/arm/kzm.rst | 18 ++ | ||
72 | docs/system/arm/mainstone.rst | 25 ++ | ||
73 | docs/system/arm/nuvoton.rst | 2 +- | ||
74 | docs/system/arm/sbsa.rst | 4 +- | ||
75 | docs/system/arm/virt.rst | 2 +- | ||
76 | docs/system/barrier.rst | 44 +++ | ||
77 | docs/system/bootindex.rst | 76 +++++ | ||
78 | docs/system/cpu-hotplug.rst | 2 +- | ||
79 | docs/system/generic-loader.rst | 4 +- | ||
80 | docs/system/guest-loader.rst | 6 +- | ||
81 | docs/system/index.rst | 2 + | ||
82 | docs/system/ppc/powernv.rst | 8 +- | ||
83 | docs/system/riscv/microchip-icicle-kit.rst | 2 +- | ||
84 | docs/system/riscv/virt.rst | 2 +- | ||
85 | docs/system/s390x/protvirt.rst | 12 +- | ||
86 | docs/system/target-arm.rst | 3 + | ||
87 | docs/tools/virtiofsd.rst | 2 +- | ||
88 | hw/arm/boot.c | 9 + | ||
89 | hw/arm/sbsa-ref.c | 7 - | ||
90 | ui/input-barrier.c | 5 + | ||
91 | MAINTAINERS | 8 +- | ||
92 | 41 files changed, 849 insertions(+), 674 deletions(-) | ||
93 | delete mode 100644 docs/barrier.txt | ||
94 | delete mode 100644 docs/bootindex.txt | ||
95 | create mode 100644 docs/interop/barrier.rst | ||
96 | create mode 100644 docs/system/arm/imx25-pdk.rst | ||
97 | create mode 100644 docs/system/arm/kzm.rst | ||
98 | create mode 100644 docs/system/arm/mainstone.rst | ||
99 | create mode 100644 docs/system/barrier.rst | ||
100 | create mode 100644 docs/system/bootindex.rst | ||
41 | 101 | ||
42 | Eric Auger (3): | ||
43 | device_tree: Add qemu_fdt_node_unit_path | ||
44 | hw/arm/virt: Silence dtc /intc warnings | ||
45 | hw/arm/virt: Silence dtc /memory warning | ||
46 | |||
47 | Jean-Christophe Dubois (3): | ||
48 | i.mx7d: Remove unused header files | ||
49 | i.mx7d: Change SRC unimplemented device name from sdma to src | ||
50 | i.mx7d: Change IRQ number type from hwaddr to int | ||
51 | |||
52 | Peter Maydell (1): | ||
53 | sd: Don't trace SDRequest crc field | ||
54 | |||
55 | Philippe Mathieu-Daudé (4): | ||
56 | hw/block/fdc: Replace error_setg(&error_abort) by assert() | ||
57 | hw/arm/sysbus-fdt: Replace error_setg(&error_fatal) by error_report() + exit() | ||
58 | device_tree: Replace error_setg(&error_fatal) by error_report() + exit() | ||
59 | sdcard: Use the ldst API | ||
60 | |||
61 | Richard Henderson (40): | ||
62 | target/arm: Implement SVE Memory Contiguous Load Group | ||
63 | target/arm: Implement SVE Contiguous Load, first-fault and no-fault | ||
64 | target/arm: Implement SVE Memory Contiguous Store Group | ||
65 | target/arm: Implement SVE load and broadcast quadword | ||
66 | target/arm: Implement SVE integer convert to floating-point | ||
67 | target/arm: Implement SVE floating-point arithmetic (predicated) | ||
68 | target/arm: Implement SVE FP Multiply-Add Group | ||
69 | target/arm: Implement SVE Floating Point Accumulating Reduction Group | ||
70 | target/arm: Implement SVE load and broadcast element | ||
71 | target/arm: Implement SVE store vector/predicate register | ||
72 | target/arm: Implement SVE scatter stores | ||
73 | target/arm: Implement SVE prefetches | ||
74 | target/arm: Implement SVE gather loads | ||
75 | target/arm: Implement SVE first-fault gather loads | ||
76 | target/arm: Implement SVE scatter store vector immediate | ||
77 | target/arm: Implement SVE floating-point compare vectors | ||
78 | target/arm: Implement SVE floating-point arithmetic with immediate | ||
79 | target/arm: Implement SVE Floating Point Multiply Indexed Group | ||
80 | target/arm: Implement SVE FP Fast Reduction Group | ||
81 | target/arm: Implement SVE Floating Point Unary Operations - Unpredicated Group | ||
82 | target/arm: Implement SVE FP Compare with Zero Group | ||
83 | target/arm: Implement SVE floating-point trig multiply-add coefficient | ||
84 | target/arm: Implement SVE floating-point convert precision | ||
85 | target/arm: Implement SVE floating-point convert to integer | ||
86 | target/arm: Implement SVE floating-point round to integral value | ||
87 | target/arm: Implement SVE floating-point unary operations | ||
88 | target/arm: Implement SVE MOVPRFX | ||
89 | target/arm: Implement SVE floating-point complex add | ||
90 | target/arm: Implement SVE fp complex multiply add | ||
91 | target/arm: Pass index to AdvSIMD FCMLA (indexed) | ||
92 | target/arm: Implement SVE fp complex multiply add (indexed) | ||
93 | target/arm: Implement SVE dot product (vectors) | ||
94 | target/arm: Implement SVE dot product (indexed) | ||
95 | target/arm: Enable SVE for aarch64-linux-user | ||
96 | target/arm: Implement ARMv8.2-DotProd | ||
97 | target/arm: Fix SVE signed division vs x86 overflow exception | ||
98 | target/arm: Fix SVE system register access checks | ||
99 | target/arm: Prune a57 features from max | ||
100 | target/arm: Prune a15 features from max | ||
101 | target/arm: Add ID_ISAR6 | ||
102 | |||
103 | include/sysemu/device_tree.h | 16 + | ||
104 | target/arm/cpu.h | 3 + | ||
105 | target/arm/helper-sve.h | 682 +++++++++++++++ | ||
106 | target/arm/helper.h | 44 +- | ||
107 | device_tree.c | 78 +- | ||
108 | hw/arm/boot.c | 41 +- | ||
109 | hw/arm/fsl-imx7.c | 8 +- | ||
110 | hw/arm/mcimx7d-sabre.c | 2 - | ||
111 | hw/arm/sysbus-fdt.c | 53 +- | ||
112 | hw/arm/virt.c | 70 +- | ||
113 | hw/block/fdc.c | 9 +- | ||
114 | hw/sd/bcm2835_sdhost.c | 13 +- | ||
115 | hw/sd/core.c | 2 +- | ||
116 | hw/sd/milkymist-memcard.c | 3 +- | ||
117 | hw/sd/omap_mmc.c | 6 +- | ||
118 | hw/sd/pl181.c | 11 +- | ||
119 | hw/sd/sdhci.c | 15 +- | ||
120 | hw/sd/ssi-sd.c | 6 +- | ||
121 | linux-user/elfload.c | 2 + | ||
122 | target/arm/cpu.c | 36 +- | ||
123 | target/arm/cpu64.c | 13 +- | ||
124 | target/arm/helper.c | 44 +- | ||
125 | target/arm/kvm32.c | 27 +- | ||
126 | target/arm/sve_helper.c | 1875 +++++++++++++++++++++++++++++++++++++++++- | ||
127 | target/arm/translate-a64.c | 62 +- | ||
128 | target/arm/translate-sve.c | 1688 ++++++++++++++++++++++++++++++++++++- | ||
129 | target/arm/translate.c | 102 ++- | ||
130 | target/arm/vec_helper.c | 311 ++++++- | ||
131 | hw/sd/trace-events | 2 +- | ||
132 | target/arm/sve.decode | 427 ++++++++++ | ||
133 | 30 files changed, 5394 insertions(+), 257 deletions(-) | ||
134 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
2 | 1 | ||
3 | Use assert() instead of error_setg(&error_abort), | ||
4 | as suggested by the "qapi/error.h" documentation: | ||
5 | |||
6 | Please don't error_setg(&error_fatal, ...), use error_report() and | ||
7 | exit(), because that's more obvious. | ||
8 | Likewise, don't error_setg(&error_abort, ...), use assert(). | ||
9 | |||
10 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
11 | Acked-by: John Snow <jsnow@redhat.com> | ||
12 | Message-id: 20180625165749.3910-2-f4bug@amsat.org | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
14 | --- | ||
15 | hw/block/fdc.c | 9 +-------- | ||
16 | 1 file changed, 1 insertion(+), 8 deletions(-) | ||
17 | |||
18 | diff --git a/hw/block/fdc.c b/hw/block/fdc.c | ||
19 | index XXXXXXX..XXXXXXX 100644 | ||
20 | --- a/hw/block/fdc.c | ||
21 | +++ b/hw/block/fdc.c | ||
22 | @@ -XXX,XX +XXX,XX @@ static int pick_geometry(FDrive *drv) | ||
23 | nb_sectors, | ||
24 | FloppyDriveType_str(parse->drive)); | ||
25 | } | ||
26 | + assert(type_match != -1 && "misconfigured fd_format"); | ||
27 | match = type_match; | ||
28 | } | ||
29 | - | ||
30 | - /* No match of any kind found -- fd_format is misconfigured, abort. */ | ||
31 | - if (match == -1) { | ||
32 | - error_setg(&error_abort, "No candidate geometries present in table " | ||
33 | - " for floppy drive type '%s'", | ||
34 | - FloppyDriveType_str(drv->drive)); | ||
35 | - } | ||
36 | - | ||
37 | parse = &(fd_formats[match]); | ||
38 | |||
39 | out: | ||
40 | -- | ||
41 | 2.17.1 | ||
42 | |||
43 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
2 | 1 | ||
3 | Use error_report() + exit() instead of error_setg(&error_fatal), | ||
4 | as suggested by the "qapi/error.h" documentation: | ||
5 | |||
6 | Please don't error_setg(&error_fatal, ...), use error_report() and | ||
7 | exit(), because that's more obvious. | ||
8 | |||
9 | This fixes CID 1352173: | ||
10 | "Passing null pointer dt_name to qemu_fdt_node_path, which dereferences it." | ||
11 | |||
12 | And this also fixes: | ||
13 | |||
14 | hw/arm/sysbus-fdt.c:322:9: warning: Array access (from variable 'node_path') results in a null pointer dereference | ||
15 | if (node_path[1]) { | ||
16 | ^~~~~~~~~~~~ | ||
17 | |||
18 | Fixes: Coverity CID 1352173 (Dereference after null check) | ||
19 | Suggested-by: Eric Blake <eblake@redhat.com> | ||
20 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
21 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
22 | Message-id: 20180625165749.3910-3-f4bug@amsat.org | ||
23 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
24 | --- | ||
25 | hw/arm/sysbus-fdt.c | 53 +++++++++++++++++++++++++-------------------- | ||
26 | 1 file changed, 30 insertions(+), 23 deletions(-) | ||
27 | |||
28 | diff --git a/hw/arm/sysbus-fdt.c b/hw/arm/sysbus-fdt.c | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/hw/arm/sysbus-fdt.c | ||
31 | +++ b/hw/arm/sysbus-fdt.c | ||
32 | @@ -XXX,XX +XXX,XX @@ static void copy_properties_from_host(HostProperty *props, int nb_props, | ||
33 | r = qemu_fdt_getprop(host_fdt, node_path, | ||
34 | props[i].name, | ||
35 | &prop_len, | ||
36 | - props[i].optional ? &err : &error_fatal); | ||
37 | + &err); | ||
38 | if (r) { | ||
39 | qemu_fdt_setprop(guest_fdt, nodename, | ||
40 | props[i].name, r, prop_len); | ||
41 | } else { | ||
42 | - if (prop_len != -FDT_ERR_NOTFOUND) { | ||
43 | - /* optional property not returned although property exists */ | ||
44 | - error_report_err(err); | ||
45 | - } else { | ||
46 | + if (props[i].optional && prop_len == -FDT_ERR_NOTFOUND) { | ||
47 | + /* optional property does not exist */ | ||
48 | error_free(err); | ||
49 | + } else { | ||
50 | + error_report_err(err); | ||
51 | + } | ||
52 | + if (!props[i].optional) { | ||
53 | + /* mandatory property not found: bail out */ | ||
54 | + exit(1); | ||
55 | } | ||
56 | } | ||
57 | } | ||
58 | @@ -XXX,XX +XXX,XX @@ static void fdt_build_clock_node(void *host_fdt, void *guest_fdt, | ||
59 | |||
60 | node_offset = fdt_node_offset_by_phandle(host_fdt, host_phandle); | ||
61 | if (node_offset <= 0) { | ||
62 | - error_setg(&error_fatal, | ||
63 | - "not able to locate clock handle %d in host device tree", | ||
64 | - host_phandle); | ||
65 | + error_report("not able to locate clock handle %d in host device tree", | ||
66 | + host_phandle); | ||
67 | + exit(1); | ||
68 | } | ||
69 | node_path = g_malloc(path_len); | ||
70 | while ((ret = fdt_get_path(host_fdt, node_offset, node_path, path_len)) | ||
71 | @@ -XXX,XX +XXX,XX @@ static void fdt_build_clock_node(void *host_fdt, void *guest_fdt, | ||
72 | node_path = g_realloc(node_path, path_len); | ||
73 | } | ||
74 | if (ret < 0) { | ||
75 | - error_setg(&error_fatal, | ||
76 | - "not able to retrieve node path for clock handle %d", | ||
77 | - host_phandle); | ||
78 | + error_report("not able to retrieve node path for clock handle %d", | ||
79 | + host_phandle); | ||
80 | + exit(1); | ||
81 | } | ||
82 | |||
83 | r = qemu_fdt_getprop(host_fdt, node_path, "compatible", &prop_len, | ||
84 | &error_fatal); | ||
85 | if (strcmp(r, "fixed-clock")) { | ||
86 | - error_setg(&error_fatal, | ||
87 | - "clock handle %d is not a fixed clock", host_phandle); | ||
88 | + error_report("clock handle %d is not a fixed clock", host_phandle); | ||
89 | + exit(1); | ||
90 | } | ||
91 | |||
92 | nodename = strrchr(node_path, '/'); | ||
93 | @@ -XXX,XX +XXX,XX @@ static int add_amd_xgbe_fdt_node(SysBusDevice *sbdev, void *opaque) | ||
94 | |||
95 | dt_name = sysfs_to_dt_name(vbasedev->name); | ||
96 | if (!dt_name) { | ||
97 | - error_setg(&error_fatal, "%s incorrect sysfs device name %s", | ||
98 | - __func__, vbasedev->name); | ||
99 | + error_report("%s incorrect sysfs device name %s", | ||
100 | + __func__, vbasedev->name); | ||
101 | + exit(1); | ||
102 | } | ||
103 | node_path = qemu_fdt_node_path(host_fdt, dt_name, vdev->compat, | ||
104 | &error_fatal); | ||
105 | if (!node_path || !node_path[0]) { | ||
106 | - error_setg(&error_fatal, "%s unable to retrieve node path for %s/%s", | ||
107 | - __func__, dt_name, vdev->compat); | ||
108 | + error_report("%s unable to retrieve node path for %s/%s", | ||
109 | + __func__, dt_name, vdev->compat); | ||
110 | + exit(1); | ||
111 | } | ||
112 | |||
113 | if (node_path[1]) { | ||
114 | - error_setg(&error_fatal, "%s more than one node matching %s/%s!", | ||
115 | - __func__, dt_name, vdev->compat); | ||
116 | + error_report("%s more than one node matching %s/%s!", | ||
117 | + __func__, dt_name, vdev->compat); | ||
118 | + exit(1); | ||
119 | } | ||
120 | |||
121 | g_free(dt_name); | ||
122 | |||
123 | if (vbasedev->num_regions != 5) { | ||
124 | - error_setg(&error_fatal, "%s Does the host dt node combine XGBE/PHY?", | ||
125 | - __func__); | ||
126 | + error_report("%s Does the host dt node combine XGBE/PHY?", __func__); | ||
127 | + exit(1); | ||
128 | } | ||
129 | |||
130 | /* generate nodes for DMA_CLK and PTP_CLK */ | ||
131 | r = qemu_fdt_getprop(host_fdt, node_path[0], "clocks", | ||
132 | &prop_len, &error_fatal); | ||
133 | if (prop_len != 8) { | ||
134 | - error_setg(&error_fatal, "%s clocks property should contain 2 handles", | ||
135 | - __func__); | ||
136 | + error_report("%s clocks property should contain 2 handles", __func__); | ||
137 | + exit(1); | ||
138 | } | ||
139 | host_clock_phandles = (uint32_t *)r; | ||
140 | guest_clock_phandles[0] = qemu_fdt_alloc_phandle(guest_fdt); | ||
141 | -- | ||
142 | 2.17.1 | ||
143 | |||
144 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | Add brief documentation of the Arm 'mainstone' board. |
---|---|---|---|
2 | 2 | ||
3 | This register was added to aa32 state by ARMv8.2. | 3 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20210722175229.29065-2-peter.maydell@linaro.org | ||
6 | --- | ||
7 | docs/system/arm/mainstone.rst | 25 +++++++++++++++++++++++++ | ||
8 | docs/system/target-arm.rst | 1 + | ||
9 | MAINTAINERS | 1 + | ||
10 | 3 files changed, 27 insertions(+) | ||
11 | create mode 100644 docs/system/arm/mainstone.rst | ||
4 | 12 | ||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 13 | diff --git a/docs/system/arm/mainstone.rst b/docs/system/arm/mainstone.rst |
6 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 14 | new file mode 100644 |
7 | Message-id: 20180629001538.11415-6-richard.henderson@linaro.org | 15 | index XXXXXXX..XXXXXXX |
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 16 | --- /dev/null |
9 | --- | 17 | +++ b/docs/system/arm/mainstone.rst |
10 | target/arm/cpu.h | 1 + | 18 | @@ -XXX,XX +XXX,XX @@ |
11 | target/arm/cpu.c | 4 ++++ | 19 | +Intel Mainstone II board (``mainstone``) |
12 | target/arm/cpu64.c | 2 ++ | 20 | +======================================== |
13 | target/arm/helper.c | 5 ++--- | 21 | + |
14 | 4 files changed, 9 insertions(+), 3 deletions(-) | 22 | +The ``mainstone`` board emulates the Intel Mainstone II development |
15 | 23 | +board, which uses a PXA270 CPU. | |
16 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | 24 | + |
25 | +Emulated devices: | ||
26 | + | ||
27 | +- Flash memory | ||
28 | +- Keypad | ||
29 | +- MMC controller | ||
30 | +- 91C111 ethernet | ||
31 | +- PIC | ||
32 | +- Timer | ||
33 | +- DMA | ||
34 | +- GPIO | ||
35 | +- FIR | ||
36 | +- Serial | ||
37 | +- LCD controller | ||
38 | +- SSP | ||
39 | +- USB controller | ||
40 | +- RTC | ||
41 | +- PCMCIA | ||
42 | +- I2C | ||
43 | +- I2S | ||
44 | diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst | ||
17 | index XXXXXXX..XXXXXXX 100644 | 45 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/target/arm/cpu.h | 46 | --- a/docs/system/target-arm.rst |
19 | +++ b/target/arm/cpu.h | 47 | +++ b/docs/system/target-arm.rst |
20 | @@ -XXX,XX +XXX,XX @@ struct ARMCPU { | 48 | @@ -XXX,XX +XXX,XX @@ undocumented; you can get a complete list by running |
21 | uint32_t id_isar3; | 49 | arm/highbank |
22 | uint32_t id_isar4; | 50 | arm/musicpal |
23 | uint32_t id_isar5; | 51 | arm/gumstix |
24 | + uint32_t id_isar6; | 52 | + arm/mainstone |
25 | uint64_t id_aa64pfr0; | 53 | arm/nrf |
26 | uint64_t id_aa64pfr1; | 54 | arm/nseries |
27 | uint64_t id_aa64dfr0; | 55 | arm/nuvoton |
28 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 56 | diff --git a/MAINTAINERS b/MAINTAINERS |
29 | index XXXXXXX..XXXXXXX 100644 | 57 | index XXXXXXX..XXXXXXX 100644 |
30 | --- a/target/arm/cpu.c | 58 | --- a/MAINTAINERS |
31 | +++ b/target/arm/cpu.c | 59 | +++ b/MAINTAINERS |
32 | @@ -XXX,XX +XXX,XX @@ static void cortex_m3_initfn(Object *obj) | 60 | @@ -XXX,XX +XXX,XX @@ F: include/hw/arm/pxa.h |
33 | cpu->id_isar3 = 0x01111110; | 61 | F: include/hw/arm/sharpsl.h |
34 | cpu->id_isar4 = 0x01310102; | 62 | F: include/hw/display/tc6393xb.h |
35 | cpu->id_isar5 = 0x00000000; | 63 | F: docs/system/arm/xscale.rst |
36 | + cpu->id_isar6 = 0x00000000; | 64 | +F: docs/system/arm/mainstone.rst |
37 | } | 65 | |
38 | 66 | SABRELITE / i.MX6 | |
39 | static void cortex_m4_initfn(Object *obj) | 67 | M: Peter Maydell <peter.maydell@linaro.org> |
40 | @@ -XXX,XX +XXX,XX @@ static void cortex_m4_initfn(Object *obj) | ||
41 | cpu->id_isar3 = 0x01111110; | ||
42 | cpu->id_isar4 = 0x01310102; | ||
43 | cpu->id_isar5 = 0x00000000; | ||
44 | + cpu->id_isar6 = 0x00000000; | ||
45 | } | ||
46 | |||
47 | static void cortex_m33_initfn(Object *obj) | ||
48 | @@ -XXX,XX +XXX,XX @@ static void cortex_m33_initfn(Object *obj) | ||
49 | cpu->id_isar3 = 0x01111131; | ||
50 | cpu->id_isar4 = 0x01310132; | ||
51 | cpu->id_isar5 = 0x00000000; | ||
52 | + cpu->id_isar6 = 0x00000000; | ||
53 | cpu->clidr = 0x00000000; | ||
54 | cpu->ctr = 0x8000c000; | ||
55 | } | ||
56 | @@ -XXX,XX +XXX,XX @@ static void cortex_r5_initfn(Object *obj) | ||
57 | cpu->id_isar3 = 0x01112131; | ||
58 | cpu->id_isar4 = 0x0010142; | ||
59 | cpu->id_isar5 = 0x0; | ||
60 | + cpu->id_isar6 = 0x0; | ||
61 | cpu->mp_is_up = true; | ||
62 | cpu->pmsav7_dregion = 16; | ||
63 | define_arm_cp_regs(cpu, cortexr5_cp_reginfo); | ||
64 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | ||
65 | index XXXXXXX..XXXXXXX 100644 | ||
66 | --- a/target/arm/cpu64.c | ||
67 | +++ b/target/arm/cpu64.c | ||
68 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a57_initfn(Object *obj) | ||
69 | cpu->id_isar3 = 0x01112131; | ||
70 | cpu->id_isar4 = 0x00011142; | ||
71 | cpu->id_isar5 = 0x00011121; | ||
72 | + cpu->id_isar6 = 0; | ||
73 | cpu->id_aa64pfr0 = 0x00002222; | ||
74 | cpu->id_aa64dfr0 = 0x10305106; | ||
75 | cpu->pmceid0 = 0x00000000; | ||
76 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a53_initfn(Object *obj) | ||
77 | cpu->id_isar3 = 0x01112131; | ||
78 | cpu->id_isar4 = 0x00011142; | ||
79 | cpu->id_isar5 = 0x00011121; | ||
80 | + cpu->id_isar6 = 0; | ||
81 | cpu->id_aa64pfr0 = 0x00002222; | ||
82 | cpu->id_aa64dfr0 = 0x10305106; | ||
83 | cpu->id_aa64isar0 = 0x00011120; | ||
84 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
85 | index XXXXXXX..XXXXXXX 100644 | ||
86 | --- a/target/arm/helper.c | ||
87 | +++ b/target/arm/helper.c | ||
88 | @@ -XXX,XX +XXX,XX @@ void register_cp_regs_for_features(ARMCPU *cpu) | ||
89 | .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 6, | ||
90 | .access = PL1_R, .type = ARM_CP_CONST, | ||
91 | .resetvalue = cpu->id_mmfr4 }, | ||
92 | - /* 7 is as yet unallocated and must RAZ */ | ||
93 | - { .name = "ID_ISAR7_RESERVED", .state = ARM_CP_STATE_BOTH, | ||
94 | + { .name = "ID_ISAR6", .state = ARM_CP_STATE_BOTH, | ||
95 | .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 7, | ||
96 | .access = PL1_R, .type = ARM_CP_CONST, | ||
97 | - .resetvalue = 0 }, | ||
98 | + .resetvalue = cpu->id_isar6 }, | ||
99 | REGINFO_SENTINEL | ||
100 | }; | ||
101 | define_arm_cp_regs(cpu, v6_idregs); | ||
102 | -- | 68 | -- |
103 | 2.17.1 | 69 | 2.20.1 |
104 | 70 | ||
105 | 71 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | Add brief documentation of the Arm 'kzm' board. |
---|---|---|---|
2 | 2 | ||
3 | There is no need to re-set these 3 features already | 3 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
4 | implied by the call to aarch64_a15_initfn. | 4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
5 | Message-id: 20210722175229.29065-3-peter.maydell@linaro.org | ||
6 | --- | ||
7 | docs/system/arm/kzm.rst | 18 ++++++++++++++++++ | ||
8 | docs/system/target-arm.rst | 1 + | ||
9 | MAINTAINERS | 1 + | ||
10 | 3 files changed, 20 insertions(+) | ||
11 | create mode 100644 docs/system/arm/kzm.rst | ||
5 | 12 | ||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 13 | diff --git a/docs/system/arm/kzm.rst b/docs/system/arm/kzm.rst |
7 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 14 | new file mode 100644 |
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 15 | index XXXXXXX..XXXXXXX |
9 | Message-id: 20180629001538.11415-5-richard.henderson@linaro.org | 16 | --- /dev/null |
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 17 | +++ b/docs/system/arm/kzm.rst |
11 | --- | 18 | @@ -XXX,XX +XXX,XX @@ |
12 | target/arm/cpu.c | 3 --- | 19 | +Kyoto Microcomputer KZM-ARM11-01 (``kzm``) |
13 | 1 file changed, 3 deletions(-) | 20 | +========================================== |
14 | 21 | + | |
15 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 22 | +The ``kzm`` board emulates the Kyoto Microcomputer KZM-ARM11-01 |
23 | +evaluation board, which is based on an NXP i.MX32 SoC | ||
24 | +which uses an ARM1136 CPU. | ||
25 | + | ||
26 | +Emulated devices: | ||
27 | + | ||
28 | +- UARTs | ||
29 | +- LAN9118 ethernet | ||
30 | +- AVIC | ||
31 | +- CCM | ||
32 | +- GPT | ||
33 | +- EPIT timers | ||
34 | +- I2C | ||
35 | +- GPIO controllers | ||
36 | +- Watchdog timer | ||
37 | diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst | ||
16 | index XXXXXXX..XXXXXXX 100644 | 38 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/cpu.c | 39 | --- a/docs/system/target-arm.rst |
18 | +++ b/target/arm/cpu.c | 40 | +++ b/docs/system/target-arm.rst |
19 | @@ -XXX,XX +XXX,XX @@ static void arm_max_initfn(Object *obj) | 41 | @@ -XXX,XX +XXX,XX @@ undocumented; you can get a complete list by running |
20 | * since we don't correctly set the ID registers to advertise them, | 42 | arm/musicpal |
21 | */ | 43 | arm/gumstix |
22 | set_feature(&cpu->env, ARM_FEATURE_V8); | 44 | arm/mainstone |
23 | - set_feature(&cpu->env, ARM_FEATURE_VFP4); | 45 | + arm/kzm |
24 | - set_feature(&cpu->env, ARM_FEATURE_NEON); | 46 | arm/nrf |
25 | - set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); | 47 | arm/nseries |
26 | set_feature(&cpu->env, ARM_FEATURE_V8_AES); | 48 | arm/nuvoton |
27 | set_feature(&cpu->env, ARM_FEATURE_V8_SHA1); | 49 | diff --git a/MAINTAINERS b/MAINTAINERS |
28 | set_feature(&cpu->env, ARM_FEATURE_V8_SHA256); | 50 | index XXXXXXX..XXXXXXX 100644 |
51 | --- a/MAINTAINERS | ||
52 | +++ b/MAINTAINERS | ||
53 | @@ -XXX,XX +XXX,XX @@ F: hw/*/imx_* | ||
54 | F: hw/*/*imx31* | ||
55 | F: include/hw/*/imx_* | ||
56 | F: include/hw/*/*imx31* | ||
57 | +F: docs/system/arm/kzm.rst | ||
58 | |||
59 | Integrator CP | ||
60 | M: Peter Maydell <peter.maydell@linaro.org> | ||
29 | -- | 61 | -- |
30 | 2.17.1 | 62 | 2.20.1 |
31 | 63 | ||
32 | 64 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | Add brief documentation of the Arm 'imx25-pdk' board. |
---|---|---|---|
2 | 2 | ||
3 | There is no need to re-set these 9 features already | 3 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
4 | implied by the call to aarch64_a57_initfn. | 4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
5 | Message-id: 20210722175229.29065-4-peter.maydell@linaro.org | ||
6 | --- | ||
7 | docs/system/arm/imx25-pdk.rst | 19 +++++++++++++++++++ | ||
8 | docs/system/target-arm.rst | 1 + | ||
9 | MAINTAINERS | 1 + | ||
10 | 3 files changed, 21 insertions(+) | ||
11 | create mode 100644 docs/system/arm/imx25-pdk.rst | ||
5 | 12 | ||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 13 | diff --git a/docs/system/arm/imx25-pdk.rst b/docs/system/arm/imx25-pdk.rst |
7 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 14 | new file mode 100644 |
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 15 | index XXXXXXX..XXXXXXX |
9 | Message-id: 20180629001538.11415-4-richard.henderson@linaro.org | 16 | --- /dev/null |
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 17 | +++ b/docs/system/arm/imx25-pdk.rst |
11 | --- | 18 | @@ -XXX,XX +XXX,XX @@ |
12 | target/arm/cpu64.c | 9 --------- | 19 | +NXP i.MX25 PDK board (``imx25-pdk``) |
13 | 1 file changed, 9 deletions(-) | 20 | +==================================== |
14 | 21 | + | |
15 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 22 | +The ``imx25-pdk`` board emulates the NXP i.MX25 Product Development Kit |
23 | +board, which is based on an i.MX25 SoC which uses an ARM926 CPU. | ||
24 | + | ||
25 | +Emulated devices: | ||
26 | + | ||
27 | +- SD controller | ||
28 | +- AVIC | ||
29 | +- CCM | ||
30 | +- GPT | ||
31 | +- EPIT timers | ||
32 | +- FEC | ||
33 | +- RNGC | ||
34 | +- I2C | ||
35 | +- GPIO controllers | ||
36 | +- Watchdog timer | ||
37 | +- USB controllers | ||
38 | diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst | ||
16 | index XXXXXXX..XXXXXXX 100644 | 39 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/cpu64.c | 40 | --- a/docs/system/target-arm.rst |
18 | +++ b/target/arm/cpu64.c | 41 | +++ b/docs/system/target-arm.rst |
19 | @@ -XXX,XX +XXX,XX @@ static void aarch64_max_initfn(Object *obj) | 42 | @@ -XXX,XX +XXX,XX @@ undocumented; you can get a complete list by running |
20 | * whereas the architecture requires them to be present in both if | 43 | arm/nrf |
21 | * present in either. | 44 | arm/nseries |
22 | */ | 45 | arm/nuvoton |
23 | - set_feature(&cpu->env, ARM_FEATURE_V8); | 46 | + arm/imx25-pdk |
24 | - set_feature(&cpu->env, ARM_FEATURE_VFP4); | 47 | arm/orangepi |
25 | - set_feature(&cpu->env, ARM_FEATURE_NEON); | 48 | arm/palm |
26 | - set_feature(&cpu->env, ARM_FEATURE_AARCH64); | 49 | arm/raspi |
27 | - set_feature(&cpu->env, ARM_FEATURE_V8_AES); | 50 | diff --git a/MAINTAINERS b/MAINTAINERS |
28 | - set_feature(&cpu->env, ARM_FEATURE_V8_SHA1); | 51 | index XXXXXXX..XXXXXXX 100644 |
29 | - set_feature(&cpu->env, ARM_FEATURE_V8_SHA256); | 52 | --- a/MAINTAINERS |
30 | set_feature(&cpu->env, ARM_FEATURE_V8_SHA512); | 53 | +++ b/MAINTAINERS |
31 | set_feature(&cpu->env, ARM_FEATURE_V8_SHA3); | 54 | @@ -XXX,XX +XXX,XX @@ F: hw/watchdog/wdt_imx2.c |
32 | set_feature(&cpu->env, ARM_FEATURE_V8_SM3); | 55 | F: include/hw/arm/fsl-imx25.h |
33 | set_feature(&cpu->env, ARM_FEATURE_V8_SM4); | 56 | F: include/hw/misc/imx25_ccm.h |
34 | - set_feature(&cpu->env, ARM_FEATURE_V8_PMULL); | 57 | F: include/hw/watchdog/wdt_imx2.h |
35 | - set_feature(&cpu->env, ARM_FEATURE_CRC); | 58 | +F: docs/system/arm/imx25-pdk.rst |
36 | set_feature(&cpu->env, ARM_FEATURE_V8_ATOMICS); | 59 | |
37 | set_feature(&cpu->env, ARM_FEATURE_V8_RDM); | 60 | i.MX31 (kzm) |
38 | set_feature(&cpu->env, ARM_FEATURE_V8_DOTPROD); | 61 | M: Peter Maydell <peter.maydell@linaro.org> |
39 | -- | 62 | -- |
40 | 2.17.1 | 63 | 2.20.1 |
41 | 64 | ||
42 | 65 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | Andrzej Zaborowski is listed as an "Odd Fixes" maintainer for the |
---|---|---|---|
2 | nSeries, Palm and PXA2XX boards, as well as the "Maintained" status | ||
3 | Arm 32-bit TCG backend. | ||
2 | 4 | ||
3 | Leave ARM_CP_SVE, removing ARM_CP_FPU; the sve_access_check | 5 | Andrzej's last email to qemu-devel was back in 2017, and the email |
4 | produced by the flag already includes fp_access_check. If | 6 | before that was all the way back in 2013. We don't really need to |
5 | we also check ARM_CP_FPU the double fp_access_check asserts. | 7 | fill his email up with CCs on QEMU patches any more... |
6 | 8 | ||
7 | Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com> | 9 | Remove Andrzej from the various boards sections (leaving them still |
8 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 10 | Odd Fixes with me as the backup patch reviewer). Add Richard |
9 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 11 | Henderson as the maintainer for the Arm TCG backend, since removing |
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Andrzej would otherwise leave that section with no M: line at all. |
11 | Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com> | 13 | |
12 | Message-id: 20180629001538.11415-3-richard.henderson@linaro.org | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
15 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
16 | Message-id: 20210722180951.29802-1-peter.maydell@linaro.org | ||
14 | --- | 17 | --- |
15 | target/arm/helper.c | 8 ++++---- | 18 | MAINTAINERS | 5 +---- |
16 | target/arm/translate-a64.c | 5 ++--- | 19 | 1 file changed, 1 insertion(+), 4 deletions(-) |
17 | 2 files changed, 6 insertions(+), 7 deletions(-) | ||
18 | 20 | ||
19 | diff --git a/target/arm/helper.c b/target/arm/helper.c | 21 | diff --git a/MAINTAINERS b/MAINTAINERS |
20 | index XXXXXXX..XXXXXXX 100644 | 22 | index XXXXXXX..XXXXXXX 100644 |
21 | --- a/target/arm/helper.c | 23 | --- a/MAINTAINERS |
22 | +++ b/target/arm/helper.c | 24 | +++ b/MAINTAINERS |
23 | @@ -XXX,XX +XXX,XX @@ static void zcr_write(CPUARMState *env, const ARMCPRegInfo *ri, | 25 | @@ -XXX,XX +XXX,XX @@ F: roms/vbootrom |
24 | static const ARMCPRegInfo zcr_el1_reginfo = { | 26 | F: docs/system/arm/nuvoton.rst |
25 | .name = "ZCR_EL1", .state = ARM_CP_STATE_AA64, | 27 | |
26 | .opc0 = 3, .opc1 = 0, .crn = 1, .crm = 2, .opc2 = 0, | 28 | nSeries |
27 | - .access = PL1_RW, .type = ARM_CP_SVE | ARM_CP_FPU, | 29 | -M: Andrzej Zaborowski <balrogg@gmail.com> |
28 | + .access = PL1_RW, .type = ARM_CP_SVE, | 30 | M: Peter Maydell <peter.maydell@linaro.org> |
29 | .fieldoffset = offsetof(CPUARMState, vfp.zcr_el[1]), | 31 | L: qemu-arm@nongnu.org |
30 | .writefn = zcr_write, .raw_writefn = raw_write | 32 | S: Odd Fixes |
31 | }; | 33 | @@ -XXX,XX +XXX,XX @@ F: tests/acceptance/machine_arm_n8x0.py |
32 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo zcr_el1_reginfo = { | 34 | F: docs/system/arm/nseries.rst |
33 | static const ARMCPRegInfo zcr_el2_reginfo = { | 35 | |
34 | .name = "ZCR_EL2", .state = ARM_CP_STATE_AA64, | 36 | Palm |
35 | .opc0 = 3, .opc1 = 4, .crn = 1, .crm = 2, .opc2 = 0, | 37 | -M: Andrzej Zaborowski <balrogg@gmail.com> |
36 | - .access = PL2_RW, .type = ARM_CP_SVE | ARM_CP_FPU, | 38 | M: Peter Maydell <peter.maydell@linaro.org> |
37 | + .access = PL2_RW, .type = ARM_CP_SVE, | 39 | L: qemu-arm@nongnu.org |
38 | .fieldoffset = offsetof(CPUARMState, vfp.zcr_el[2]), | 40 | S: Odd Fixes |
39 | .writefn = zcr_write, .raw_writefn = raw_write | 41 | @@ -XXX,XX +XXX,XX @@ F: include/hw/intc/realview_gic.h |
40 | }; | 42 | F: docs/system/arm/realview.rst |
41 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo zcr_el2_reginfo = { | 43 | |
42 | static const ARMCPRegInfo zcr_no_el2_reginfo = { | 44 | PXA2XX |
43 | .name = "ZCR_EL2", .state = ARM_CP_STATE_AA64, | 45 | -M: Andrzej Zaborowski <balrogg@gmail.com> |
44 | .opc0 = 3, .opc1 = 4, .crn = 1, .crm = 2, .opc2 = 0, | 46 | M: Peter Maydell <peter.maydell@linaro.org> |
45 | - .access = PL2_RW, .type = ARM_CP_SVE | ARM_CP_FPU, | 47 | L: qemu-arm@nongnu.org |
46 | + .access = PL2_RW, .type = ARM_CP_SVE, | 48 | S: Odd Fixes |
47 | .readfn = arm_cp_read_zero, .writefn = arm_cp_write_ignore | 49 | @@ -XXX,XX +XXX,XX @@ F: disas/arm-a64.cc |
48 | }; | 50 | F: disas/libvixl/ |
49 | 51 | ||
50 | static const ARMCPRegInfo zcr_el3_reginfo = { | 52 | ARM TCG target |
51 | .name = "ZCR_EL3", .state = ARM_CP_STATE_AA64, | 53 | -M: Andrzej Zaborowski <balrogg@gmail.com> |
52 | .opc0 = 3, .opc1 = 6, .crn = 1, .crm = 2, .opc2 = 0, | 54 | +M: Richard Henderson <richard.henderson@linaro.org> |
53 | - .access = PL3_RW, .type = ARM_CP_SVE | ARM_CP_FPU, | 55 | S: Maintained |
54 | + .access = PL3_RW, .type = ARM_CP_SVE, | 56 | L: qemu-arm@nongnu.org |
55 | .fieldoffset = offsetof(CPUARMState, vfp.zcr_el[3]), | 57 | F: tcg/arm/ |
56 | .writefn = zcr_write, .raw_writefn = raw_write | ||
57 | }; | ||
58 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | ||
59 | index XXXXXXX..XXXXXXX 100644 | ||
60 | --- a/target/arm/translate-a64.c | ||
61 | +++ b/target/arm/translate-a64.c | ||
62 | @@ -XXX,XX +XXX,XX @@ static void handle_sys(DisasContext *s, uint32_t insn, bool isread, | ||
63 | default: | ||
64 | break; | ||
65 | } | ||
66 | - if ((ri->type & ARM_CP_SVE) && !sve_access_check(s)) { | ||
67 | - return; | ||
68 | - } | ||
69 | if ((ri->type & ARM_CP_FPU) && !fp_access_check(s)) { | ||
70 | return; | ||
71 | + } else if ((ri->type & ARM_CP_SVE) && !sve_access_check(s)) { | ||
72 | + return; | ||
73 | } | ||
74 | |||
75 | if ((tb_cflags(s->base.tb) & CF_USE_ICOUNT) && (ri->type & ARM_CP_IO)) { | ||
76 | -- | 58 | -- |
77 | 2.17.1 | 59 | 2.20.1 |
78 | 60 | ||
79 | 61 | diff view generated by jsdifflib |
1 | From: Alex Bennée <alex.bennee@linaro.org> | 1 | Since commits 13f934e79fa and 3a50c8f3067aaf, our HTML docs include a |
---|---|---|---|
2 | footer to all pages stating the license and version. We can | ||
3 | therefore delete the TODO comments suggesting we should do that from | ||
4 | our .rst files. | ||
2 | 5 | ||
3 | Since kernel commit a86bd139f2 (arm64: arch_timer: Enable CNTVCT_EL0 | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
4 | trap..), released in kernel version v4.12, user-space has been able | 7 | Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
5 | to read these system registers. As we can't use QEMUTimer's in | 8 | Reviewed-by: Cleber Rosa <crosa@redhat.com> |
6 | linux-user mode we just directly call cpu_get_clock(). | 9 | Reviewed-by: Markus Armbruster <armbru@redhat.com> |
10 | Message-id: 20210722192016.24915-2-peter.maydell@linaro.org | ||
11 | --- | ||
12 | docs/interop/qemu-ga-ref.rst | 9 --------- | ||
13 | docs/interop/qemu-qmp-ref.rst | 9 --------- | ||
14 | docs/interop/qemu-storage-daemon-qmp-ref.rst | 9 --------- | ||
15 | 3 files changed, 27 deletions(-) | ||
7 | 16 | ||
8 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | 17 | diff --git a/docs/interop/qemu-ga-ref.rst b/docs/interop/qemu-ga-ref.rst |
9 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
10 | Message-id: 20180625160009.17437-2-alex.bennee@linaro.org | ||
11 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | --- | ||
14 | target/arm/helper.c | 27 ++++++++++++++++++++++++--- | ||
15 | 1 file changed, 24 insertions(+), 3 deletions(-) | ||
16 | |||
17 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
18 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/target/arm/helper.c | 19 | --- a/docs/interop/qemu-ga-ref.rst |
20 | +++ b/target/arm/helper.c | 20 | +++ b/docs/interop/qemu-ga-ref.rst |
21 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo generic_timer_cp_reginfo[] = { | 21 | @@ -XXX,XX +XXX,XX @@ |
22 | }; | 22 | QEMU Guest Agent Protocol Reference |
23 | 23 | =================================== | |
24 | #else | 24 | |
25 | -/* In user-mode none of the generic timer registers are accessible, | 25 | -.. |
26 | - * and their implementation depends on QEMU_CLOCK_VIRTUAL and qdev gpio outputs, | 26 | - TODO: the old Texinfo manual used to note that this manual |
27 | - * so instead just don't register any of them. | 27 | - is GPL-v2-or-later. We should make that reader-visible |
28 | + | 28 | - both here and in our Sphinx manuals more generally. |
29 | +/* In user-mode most of the generic timer registers are inaccessible | 29 | - |
30 | + * however modern kernels (4.12+) allow access to cntvct_el0 | 30 | -.. |
31 | */ | 31 | - TODO: display the QEMU version, both here and in our Sphinx manuals |
32 | + | 32 | - more generally. |
33 | +static uint64_t gt_virt_cnt_read(CPUARMState *env, const ARMCPRegInfo *ri) | 33 | - |
34 | +{ | 34 | .. contents:: |
35 | + /* Currently we have no support for QEMUTimer in linux-user so we | 35 | :depth: 3 |
36 | + * can't call gt_get_countervalue(env), instead we directly | 36 | |
37 | + * call the lower level functions. | 37 | diff --git a/docs/interop/qemu-qmp-ref.rst b/docs/interop/qemu-qmp-ref.rst |
38 | + */ | 38 | index XXXXXXX..XXXXXXX 100644 |
39 | + return cpu_get_clock() / GTIMER_SCALE; | 39 | --- a/docs/interop/qemu-qmp-ref.rst |
40 | +} | 40 | +++ b/docs/interop/qemu-qmp-ref.rst |
41 | + | 41 | @@ -XXX,XX +XXX,XX @@ |
42 | static const ARMCPRegInfo generic_timer_cp_reginfo[] = { | 42 | QEMU QMP Reference Manual |
43 | + { .name = "CNTFRQ_EL0", .state = ARM_CP_STATE_AA64, | 43 | ========================= |
44 | + .opc0 = 3, .opc1 = 3, .crn = 14, .crm = 0, .opc2 = 0, | 44 | |
45 | + .type = ARM_CP_CONST, .access = PL0_R /* no PL1_RW in linux-user */, | 45 | -.. |
46 | + .fieldoffset = offsetof(CPUARMState, cp15.c14_cntfrq), | 46 | - TODO: the old Texinfo manual used to note that this manual |
47 | + .resetvalue = NANOSECONDS_PER_SECOND / GTIMER_SCALE, | 47 | - is GPL-v2-or-later. We should make that reader-visible |
48 | + }, | 48 | - both here and in our Sphinx manuals more generally. |
49 | + { .name = "CNTVCT_EL0", .state = ARM_CP_STATE_AA64, | 49 | - |
50 | + .opc0 = 3, .opc1 = 3, .crn = 14, .crm = 0, .opc2 = 2, | 50 | -.. |
51 | + .access = PL0_R, .type = ARM_CP_NO_RAW | ARM_CP_IO, | 51 | - TODO: display the QEMU version, both here and in our Sphinx manuals |
52 | + .readfn = gt_virt_cnt_read, | 52 | - more generally. |
53 | + }, | 53 | - |
54 | REGINFO_SENTINEL | 54 | .. contents:: |
55 | }; | 55 | :depth: 3 |
56 | |||
57 | diff --git a/docs/interop/qemu-storage-daemon-qmp-ref.rst b/docs/interop/qemu-storage-daemon-qmp-ref.rst | ||
58 | index XXXXXXX..XXXXXXX 100644 | ||
59 | --- a/docs/interop/qemu-storage-daemon-qmp-ref.rst | ||
60 | +++ b/docs/interop/qemu-storage-daemon-qmp-ref.rst | ||
61 | @@ -XXX,XX +XXX,XX @@ | ||
62 | QEMU Storage Daemon QMP Reference Manual | ||
63 | ======================================== | ||
64 | |||
65 | -.. | ||
66 | - TODO: the old Texinfo manual used to note that this manual | ||
67 | - is GPL-v2-or-later. We should make that reader-visible | ||
68 | - both here and in our Sphinx manuals more generally. | ||
69 | - | ||
70 | -.. | ||
71 | - TODO: display the QEMU version, both here and in our Sphinx manuals | ||
72 | - more generally. | ||
73 | - | ||
74 | .. contents:: | ||
75 | :depth: 3 | ||
56 | 76 | ||
57 | -- | 77 | -- |
58 | 2.17.1 | 78 | 2.20.1 |
59 | 79 | ||
60 | 80 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | Our built HTML documentation now has a standard footer which |
---|---|---|---|
2 | gives the license for QEMU (and its documentation as a whole). | ||
3 | In almost all pages, we either don't bother to state the | ||
4 | copyright/license for the individual rST sources, or we put | ||
5 | it in an rST comment. There are just three pages which render | ||
6 | copyright or license information into the user-visible HTML. | ||
2 | 7 | ||
3 | We already check for the same condition within the normal integer | 8 | Quoting a specific (different) license for an individual HTML |
4 | sdiv and sdiv64 helpers. Use a slightly different formation that | 9 | page within the manual is confusing. Downgrade the license |
5 | does not require deducing the expression type. | 10 | and copyright info to a comment within the rST source, bringing |
11 | these pages in line with the rest of our documents. | ||
6 | 12 | ||
7 | Fixes: f97cfd596ed | 13 | Suggested-by: Markus Armbruster <armbru@redhat.com> |
8 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | Message-id: 20180629001538.11415-2-richard.henderson@linaro.org | ||
12 | [PMM: reworded a comment] | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
15 | Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> | ||
16 | Reviewed-by: Cleber Rosa <crosa@redhat.com> | ||
17 | Reviewed-by: Markus Armbruster <armbru@redhat.com> | ||
18 | Acked-by: Michael S. Tsirkin <mst@redhat.com> | ||
19 | Message-id: 20210722192016.24915-3-peter.maydell@linaro.org | ||
14 | --- | 20 | --- |
15 | target/arm/sve_helper.c | 20 +++++++++++++++----- | 21 | docs/interop/vhost-user-gpu.rst | 7 ++++--- |
16 | 1 file changed, 15 insertions(+), 5 deletions(-) | 22 | docs/interop/vhost-user.rst | 12 +++++++----- |
23 | docs/system/generic-loader.rst | 4 ++-- | ||
24 | 3 files changed, 13 insertions(+), 10 deletions(-) | ||
17 | 25 | ||
18 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | 26 | diff --git a/docs/interop/vhost-user-gpu.rst b/docs/interop/vhost-user-gpu.rst |
19 | index XXXXXXX..XXXXXXX 100644 | 27 | index XXXXXXX..XXXXXXX 100644 |
20 | --- a/target/arm/sve_helper.c | 28 | --- a/docs/interop/vhost-user-gpu.rst |
21 | +++ b/target/arm/sve_helper.c | 29 | +++ b/docs/interop/vhost-user-gpu.rst |
22 | @@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *vg, uint32_t desc) \ | 30 | @@ -XXX,XX +XXX,XX @@ |
23 | #define DO_MIN(N, M) ((N) >= (M) ? (M) : (N)) | 31 | Vhost-user-gpu Protocol |
24 | #define DO_ABD(N, M) ((N) >= (M) ? (N) - (M) : (M) - (N)) | 32 | ======================= |
25 | #define DO_MUL(N, M) (N * M) | 33 | |
26 | -#define DO_DIV(N, M) (M ? N / M : 0) | 34 | -:Licence: This work is licensed under the terms of the GNU GPL, |
35 | - version 2 or later. See the COPYING file in the top-level | ||
36 | - directory. | ||
37 | +.. | ||
38 | + Licence: This work is licensed under the terms of the GNU GPL, | ||
39 | + version 2 or later. See the COPYING file in the top-level | ||
40 | + directory. | ||
41 | |||
42 | .. contents:: Table of Contents | ||
43 | |||
44 | diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst | ||
45 | index XXXXXXX..XXXXXXX 100644 | ||
46 | --- a/docs/interop/vhost-user.rst | ||
47 | +++ b/docs/interop/vhost-user.rst | ||
48 | @@ -XXX,XX +XXX,XX @@ | ||
49 | =================== | ||
50 | Vhost-user Protocol | ||
51 | =================== | ||
52 | -:Copyright: 2014 Virtual Open Systems Sarl. | ||
53 | -:Copyright: 2019 Intel Corporation | ||
54 | -:Licence: This work is licensed under the terms of the GNU GPL, | ||
55 | - version 2 or later. See the COPYING file in the top-level | ||
56 | - directory. | ||
27 | + | 57 | + |
28 | + | 58 | +.. |
29 | +/* | 59 | + Copyright 2014 Virtual Open Systems Sarl. |
30 | + * We must avoid the C undefined behaviour cases: division by | 60 | + Copyright 2019 Intel Corporation |
31 | + * zero and signed division of INT_MIN by -1. Both of these | 61 | + Licence: This work is licensed under the terms of the GNU GPL, |
32 | + * have architecturally defined required results for Arm. | 62 | + version 2 or later. See the COPYING file in the top-level |
33 | + * We special case all signed divisions by -1 to avoid having | 63 | + directory. |
34 | + * to deduce the minimum integer for the type involved. | 64 | |
35 | + */ | 65 | .. contents:: Table of Contents |
36 | +#define DO_SDIV(N, M) (unlikely(M == 0) ? 0 : unlikely(M == -1) ? -N : N / M) | 66 | |
37 | +#define DO_UDIV(N, M) (unlikely(M == 0) ? 0 : N / M) | 67 | diff --git a/docs/system/generic-loader.rst b/docs/system/generic-loader.rst |
38 | 68 | index XXXXXXX..XXXXXXX 100644 | |
39 | DO_ZPZZ(sve_and_zpzz_b, uint8_t, H1, DO_AND) | 69 | --- a/docs/system/generic-loader.rst |
40 | DO_ZPZZ(sve_and_zpzz_h, uint16_t, H1_2, DO_AND) | 70 | +++ b/docs/system/generic-loader.rst |
41 | @@ -XXX,XX +XXX,XX @@ DO_ZPZZ(sve_umulh_zpzz_h, uint16_t, H1_2, do_mulh_h) | 71 | @@ -XXX,XX +XXX,XX @@ |
42 | DO_ZPZZ(sve_umulh_zpzz_s, uint32_t, H1_4, do_mulh_s) | 72 | .. |
43 | DO_ZPZZ_D(sve_umulh_zpzz_d, uint64_t, do_umulh_d) | 73 | Copyright (c) 2016, Xilinx Inc. |
44 | 74 | ||
45 | -DO_ZPZZ(sve_sdiv_zpzz_s, int32_t, H1_4, DO_DIV) | 75 | -This work is licensed under the terms of the GNU GPL, version 2 or later. See |
46 | -DO_ZPZZ_D(sve_sdiv_zpzz_d, int64_t, DO_DIV) | 76 | -the COPYING file in the top-level directory. |
47 | +DO_ZPZZ(sve_sdiv_zpzz_s, int32_t, H1_4, DO_SDIV) | 77 | + This work is licensed under the terms of the GNU GPL, version 2 or later. See |
48 | +DO_ZPZZ_D(sve_sdiv_zpzz_d, int64_t, DO_SDIV) | 78 | + the COPYING file in the top-level directory. |
49 | 79 | ||
50 | -DO_ZPZZ(sve_udiv_zpzz_s, uint32_t, H1_4, DO_DIV) | 80 | Generic Loader |
51 | -DO_ZPZZ_D(sve_udiv_zpzz_d, uint64_t, DO_DIV) | 81 | -------------- |
52 | +DO_ZPZZ(sve_udiv_zpzz_s, uint32_t, H1_4, DO_UDIV) | ||
53 | +DO_ZPZZ_D(sve_udiv_zpzz_d, uint64_t, DO_UDIV) | ||
54 | |||
55 | /* Note that all bits of the shift are significant | ||
56 | and not modulo the element size. */ | ||
57 | -- | 82 | -- |
58 | 2.17.1 | 83 | 2.20.1 |
59 | 84 | ||
60 | 85 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | In rST markup, single backticks `like this` represent "interpreted |
---|---|---|---|
2 | 2 | text", which can be handled as a bunch of different things if tagged | |
3 | The load/store API will ease further code movement. | 3 | with a specific "role": |
4 | 4 | https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#interpreted-text | |
5 | Per the Physical Layer Simplified Spec. "3.6 Bus Protocol": | 5 | (the most common one for us is "reference to a URL, which gets |
6 | 6 | hyperlinked"). | |
7 | "In the CMD line the Most Significant Bit (MSB) is transmitted | 7 | |
8 | first, the Least Significant Bit (LSB) is the last." | 8 | The default "role" if none is specified is "title_reference", |
9 | 9 | intended for references to book or article titles, and it renders | |
10 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 10 | into the HTML as <cite>...</cite> (usually comes out as italics). |
11 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 11 | |
12 | build-system.rst seems to have been written under the mistaken | ||
13 | assumption that single-backticks mark up literal text (function | ||
14 | names, etc) which should be rendered in a fixed-width font. | ||
15 | The rST markup for this is ``double backticks``. | ||
16 | |||
17 | Update all the markup. | ||
18 | |||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 19 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
20 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
21 | Message-id: 20210726142338.31872-2-peter.maydell@linaro.org | ||
13 | --- | 22 | --- |
14 | hw/sd/bcm2835_sdhost.c | 13 +++++-------- | 23 | docs/devel/build-system.rst | 156 ++++++++++++++++++------------------ |
15 | hw/sd/milkymist-memcard.c | 3 +-- | 24 | 1 file changed, 78 insertions(+), 78 deletions(-) |
16 | hw/sd/omap_mmc.c | 6 ++---- | 25 | |
17 | hw/sd/pl181.c | 11 ++++------- | 26 | diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst |
18 | hw/sd/sdhci.c | 15 +++++---------- | ||
19 | hw/sd/ssi-sd.c | 6 ++---- | ||
20 | 6 files changed, 19 insertions(+), 35 deletions(-) | ||
21 | |||
22 | diff --git a/hw/sd/bcm2835_sdhost.c b/hw/sd/bcm2835_sdhost.c | ||
23 | index XXXXXXX..XXXXXXX 100644 | 27 | index XXXXXXX..XXXXXXX 100644 |
24 | --- a/hw/sd/bcm2835_sdhost.c | 28 | --- a/docs/devel/build-system.rst |
25 | +++ b/hw/sd/bcm2835_sdhost.c | 29 | +++ b/docs/devel/build-system.rst |
26 | @@ -XXX,XX +XXX,XX @@ static void bcm2835_sdhost_send_command(BCM2835SDHostState *s) | 30 | @@ -XXX,XX +XXX,XX @@ following tasks: |
27 | goto error; | 31 | - Add a Meson build option to meson_options.txt. |
28 | } | 32 | |
29 | if (!(s->cmd & SDCMD_NO_RESPONSE)) { | 33 | - Add support to the command line arg parser to handle any new |
30 | -#define RWORD(n) (((uint32_t)rsp[n] << 24) | (rsp[n + 1] << 16) \ | 34 | - `--enable-XXX`/`--disable-XXX` flags required by the feature. |
31 | - | (rsp[n + 2] << 8) | rsp[n + 3]) | 35 | + ``--enable-XXX``/``--disable-XXX`` flags required by the feature. |
32 | if (rlen == 0 || (rlen == 4 && (s->cmd & SDCMD_LONG_RESPONSE))) { | 36 | |
33 | goto error; | 37 | - Add information to the help output message to report on the new |
34 | } | 38 | feature flag. |
35 | @@ -XXX,XX +XXX,XX @@ static void bcm2835_sdhost_send_command(BCM2835SDHostState *s) | 39 | |
36 | goto error; | 40 | - Add code to perform the actual feature check. |
37 | } | 41 | |
38 | if (rlen == 4) { | 42 | - - Add code to include the feature status in `config-host.h` |
39 | - s->rsp[0] = RWORD(0); | 43 | + - Add code to include the feature status in ``config-host.h`` |
40 | + s->rsp[0] = ldl_be_p(&rsp[0]); | 44 | |
41 | s->rsp[1] = s->rsp[2] = s->rsp[3] = 0; | 45 | - Add code to print out the feature status in the configure summary |
42 | } else { | 46 | upon completion. |
43 | - s->rsp[0] = RWORD(12); | 47 | @@ -XXX,XX +XXX,XX @@ Helper functions |
44 | - s->rsp[1] = RWORD(8); | 48 | The configure script provides a variety of helper functions to assist |
45 | - s->rsp[2] = RWORD(4); | 49 | developers in checking for system features: |
46 | - s->rsp[3] = RWORD(0); | 50 | |
47 | + s->rsp[0] = ldl_be_p(&rsp[12]); | 51 | -`do_cc $ARGS...` |
48 | + s->rsp[1] = ldl_be_p(&rsp[8]); | 52 | +``do_cc $ARGS...`` |
49 | + s->rsp[2] = ldl_be_p(&rsp[4]); | 53 | Attempt to run the system C compiler passing it $ARGS... |
50 | + s->rsp[3] = ldl_be_p(&rsp[0]); | 54 | |
51 | } | 55 | -`do_cxx $ARGS...` |
52 | -#undef RWORD | 56 | +``do_cxx $ARGS...`` |
53 | } | 57 | Attempt to run the system C++ compiler passing it $ARGS... |
54 | /* We never really delay commands, so if this was a 'busywait' command | 58 | |
55 | * then we've completed it now and can raise the interrupt. | 59 | -`compile_object $CFLAGS` |
56 | diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c | 60 | +``compile_object $CFLAGS`` |
57 | index XXXXXXX..XXXXXXX 100644 | 61 | Attempt to compile a test program with the system C compiler using |
58 | --- a/hw/sd/milkymist-memcard.c | 62 | $CFLAGS. The test program must have been previously written to a file |
59 | +++ b/hw/sd/milkymist-memcard.c | 63 | - called $TMPC. The replacement in Meson is the compiler object `cc`, |
60 | @@ -XXX,XX +XXX,XX @@ static void memcard_sd_command(MilkymistMemcardState *s) | 64 | - which has methods such as `cc.compiles()`, |
61 | SDRequest req; | 65 | - `cc.check_header()`, `cc.has_function()`. |
62 | 66 | + called $TMPC. The replacement in Meson is the compiler object ``cc``, | |
63 | req.cmd = s->command[0] & 0x3f; | 67 | + which has methods such as ``cc.compiles()``, |
64 | - req.arg = (s->command[1] << 24) | (s->command[2] << 16) | 68 | + ``cc.check_header()``, ``cc.has_function()``. |
65 | - | (s->command[3] << 8) | s->command[4]; | 69 | |
66 | + req.arg = ldl_be_p(s->command + 1); | 70 | -`compile_prog $CFLAGS $LDFLAGS` |
67 | req.crc = s->command[5]; | 71 | +``compile_prog $CFLAGS $LDFLAGS`` |
68 | 72 | Attempt to compile a test program with the system C compiler using | |
69 | s->response[0] = req.cmd; | 73 | $CFLAGS and link it with the system linker using $LDFLAGS. The test |
70 | diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c | 74 | program must have been previously written to a file called $TMPC. |
71 | index XXXXXXX..XXXXXXX 100644 | 75 | - The replacement in Meson is `cc.find_library()` and `cc.links()`. |
72 | --- a/hw/sd/omap_mmc.c | 76 | + The replacement in Meson is ``cc.find_library()`` and ``cc.links()``. |
73 | +++ b/hw/sd/omap_mmc.c | 77 | |
74 | @@ -XXX,XX +XXX,XX @@ static void omap_mmc_command(struct omap_mmc_s *host, int cmd, int dir, | 78 | -`has $COMMAND` |
75 | CID_CSD_OVERWRITE; | 79 | +``has $COMMAND`` |
76 | if (host->sdio & (1 << 13)) | 80 | Determine if $COMMAND exists in the current environment, either as a |
77 | mask |= AKE_SEQ_ERROR; | 81 | shell builtin, or executable binary, returning 0 on success. The |
78 | - rspstatus = (response[0] << 24) | (response[1] << 16) | | 82 | - replacement in Meson is `find_program()`. |
79 | - (response[2] << 8) | (response[3] << 0); | 83 | + replacement in Meson is ``find_program()``. |
80 | + rspstatus = ldl_be_p(response); | 84 | |
81 | break; | 85 | -`check_define $NAME` |
82 | 86 | +``check_define $NAME`` | |
83 | case sd_r2: | 87 | Determine if the macro $NAME is defined by the system C compiler |
84 | @@ -XXX,XX +XXX,XX @@ static void omap_mmc_command(struct omap_mmc_s *host, int cmd, int dir, | 88 | |
85 | } | 89 | -`check_include $NAME` |
86 | rsplen = 4; | 90 | +``check_include $NAME`` |
87 | 91 | Determine if the include $NAME file is available to the system C | |
88 | - rspstatus = (response[0] << 24) | (response[1] << 16) | | 92 | - compiler. The replacement in Meson is `cc.has_header()`. |
89 | - (response[2] << 8) | (response[3] << 0); | 93 | + compiler. The replacement in Meson is ``cc.has_header()``. |
90 | + rspstatus = ldl_be_p(response); | 94 | |
91 | if (rspstatus & 0x80000000) | 95 | -`write_c_skeleton` |
92 | host->status &= 0xe000; | 96 | +``write_c_skeleton`` |
93 | else | 97 | Write a minimal C program main() function to the temporary file |
94 | diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c | 98 | indicated by $TMPC |
95 | index XXXXXXX..XXXXXXX 100644 | 99 | |
96 | --- a/hw/sd/pl181.c | 100 | -`feature_not_found $NAME $REMEDY` |
97 | +++ b/hw/sd/pl181.c | 101 | +``feature_not_found $NAME $REMEDY`` |
98 | @@ -XXX,XX +XXX,XX @@ static void pl181_send_command(PL181State *s) | 102 | Print a message to stderr that the feature $NAME was not available |
99 | if (rlen < 0) | 103 | on the system, suggesting the user try $REMEDY to address the |
100 | goto error; | 104 | problem. |
101 | if (s->cmd & PL181_CMD_RESPONSE) { | 105 | |
102 | -#define RWORD(n) (((uint32_t)response[n] << 24) | (response[n + 1] << 16) \ | 106 | -`error_exit $MESSAGE $MORE...` |
103 | - | (response[n + 2] << 8) | response[n + 3]) | 107 | +``error_exit $MESSAGE $MORE...`` |
104 | if (rlen == 0 || (rlen == 4 && (s->cmd & PL181_CMD_LONGRESP))) | 108 | Print $MESSAGE to stderr, followed by $MORE... and then exit from the |
105 | goto error; | 109 | configure script with non-zero status |
106 | if (rlen != 4 && rlen != 16) | 110 | |
107 | goto error; | 111 | -`query_pkg_config $ARGS...` |
108 | - s->response[0] = RWORD(0); | 112 | +``query_pkg_config $ARGS...`` |
109 | + s->response[0] = ldl_be_p(&response[0]); | 113 | Run pkg-config passing it $ARGS. If QEMU is doing a static build, |
110 | if (rlen == 4) { | 114 | then --static will be automatically added to $ARGS |
111 | s->response[1] = s->response[2] = s->response[3] = 0; | 115 | |
112 | } else { | 116 | @@ -XXX,XX +XXX,XX @@ process for: |
113 | - s->response[1] = RWORD(4); | 117 | |
114 | - s->response[2] = RWORD(8); | 118 | 4) other data files, such as icons or desktop files |
115 | - s->response[3] = RWORD(12) & ~1; | 119 | |
116 | + s->response[1] = ldl_be_p(&response[4]); | 120 | -All executables are built by default, except for some `contrib/` |
117 | + s->response[2] = ldl_be_p(&response[8]); | 121 | +All executables are built by default, except for some ``contrib/`` |
118 | + s->response[3] = ldl_be_p(&response[12]) & ~1; | 122 | binaries that are known to fail to build on some platforms (for example |
119 | } | 123 | 32-bit or big-endian platforms). Tests are also built by default, |
120 | DPRINTF("Response received\n"); | 124 | though that might change in the future. |
121 | s->status |= PL181_STATUS_CMDRESPEND; | 125 | @@ -XXX,XX +XXX,XX @@ though that might change in the future. |
122 | -#undef RWORD | 126 | The source code is highly modularized, split across many files to |
123 | } else { | 127 | facilitate building of all of these components with as little duplicated |
124 | DPRINTF("Command sent\n"); | 128 | compilation as possible. Using the Meson "sourceset" functionality, |
125 | s->status |= PL181_STATUS_CMDSENT; | 129 | -`meson.build` files group the source files in rules that are |
126 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | 130 | +``meson.build`` files group the source files in rules that are |
127 | index XXXXXXX..XXXXXXX 100644 | 131 | enabled according to the available system libraries and to various |
128 | --- a/hw/sd/sdhci.c | 132 | configuration symbols. Sourcesets belong to one of four groups: |
129 | +++ b/hw/sd/sdhci.c | 133 | |
130 | @@ -XXX,XX +XXX,XX @@ static void sdhci_send_command(SDHCIState *s) | 134 | Subsystem sourcesets: |
131 | 135 | Various subsystems that are common to both tools and emulators have | |
132 | if (s->cmdreg & SDHC_CMD_RESPONSE) { | 136 | - their own sourceset, for example `block_ss` for the block device subsystem, |
133 | if (rlen == 4) { | 137 | - `chardev_ss` for the character device subsystem, etc. These sourcesets |
134 | - s->rspreg[0] = (response[0] << 24) | (response[1] << 16) | | 138 | + their own sourceset, for example ``block_ss`` for the block device subsystem, |
135 | - (response[2] << 8) | response[3]; | 139 | + ``chardev_ss`` for the character device subsystem, etc. These sourcesets |
136 | + s->rspreg[0] = ldl_be_p(response); | 140 | are then turned into static libraries as follows:: |
137 | s->rspreg[1] = s->rspreg[2] = s->rspreg[3] = 0; | 141 | |
138 | trace_sdhci_response4(s->rspreg[0]); | 142 | libchardev = static_library('chardev', chardev_ss.sources(), |
139 | } else if (rlen == 16) { | 143 | @@ -XXX,XX +XXX,XX @@ Subsystem sourcesets: |
140 | - s->rspreg[0] = (response[11] << 24) | (response[12] << 16) | | 144 | |
141 | - (response[13] << 8) | response[14]; | 145 | chardev = declare_dependency(link_whole: libchardev) |
142 | - s->rspreg[1] = (response[7] << 24) | (response[8] << 16) | | 146 | |
143 | - (response[9] << 8) | response[10]; | 147 | - As of Meson 0.55.1, the special `.fa` suffix should be used for everything |
144 | - s->rspreg[2] = (response[3] << 24) | (response[4] << 16) | | 148 | - that is used with `link_whole`, to ensure that the link flags are placed |
145 | - (response[5] << 8) | response[6]; | 149 | + As of Meson 0.55.1, the special ``.fa`` suffix should be used for everything |
146 | + s->rspreg[0] = ldl_be_p(&response[11]); | 150 | + that is used with ``link_whole``, to ensure that the link flags are placed |
147 | + s->rspreg[1] = ldl_be_p(&response[7]); | 151 | correctly in the command line. |
148 | + s->rspreg[2] = ldl_be_p(&response[3]); | 152 | |
149 | s->rspreg[3] = (response[0] << 16) | (response[1] << 8) | | 153 | Target-independent emulator sourcesets: |
150 | response[2]; | 154 | @@ -XXX,XX +XXX,XX @@ Target-independent emulator sourcesets: |
151 | trace_sdhci_response16(s->rspreg[3], s->rspreg[2], | 155 | This includes error handling infrastructure, standard data structures, |
152 | @@ -XXX,XX +XXX,XX @@ static void sdhci_end_transfer(SDHCIState *s) | 156 | platform portability wrapper functions, etc. |
153 | trace_sdhci_end_transfer(request.cmd, request.arg); | 157 | |
154 | sdbus_do_command(&s->sdbus, &request, response); | 158 | - Target-independent code lives in the `common_ss`, `softmmu_ss` and |
155 | /* Auto CMD12 response goes to the upper Response register */ | 159 | - `user_ss` sourcesets. `common_ss` is linked into all emulators, |
156 | - s->rspreg[3] = (response[0] << 24) | (response[1] << 16) | | 160 | - `softmmu_ss` only in system emulators, `user_ss` only in user-mode |
157 | - (response[2] << 8) | response[3]; | 161 | + Target-independent code lives in the ``common_ss``, ``softmmu_ss`` and |
158 | + s->rspreg[3] = ldl_be_p(response); | 162 | + ``user_ss`` sourcesets. ``common_ss`` is linked into all emulators, |
159 | } | 163 | + ``softmmu_ss`` only in system emulators, ``user_ss`` only in user-mode |
160 | 164 | emulators. | |
161 | s->prnsts &= ~(SDHC_DOING_READ | SDHC_DOING_WRITE | | 165 | |
162 | diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c | 166 | Target-independent sourcesets must exercise particular care when using |
163 | index XXXXXXX..XXXXXXX 100644 | 167 | - `if_false` rules. The `if_false` rule will be used correctly when linking |
164 | --- a/hw/sd/ssi-sd.c | 168 | + ``if_false`` rules. The ``if_false`` rule will be used correctly when linking |
165 | +++ b/hw/sd/ssi-sd.c | 169 | emulator binaries; however, when *compiling* target-independent files |
166 | @@ -XXX,XX +XXX,XX @@ static uint32_t ssi_sd_transfer(SSISlave *dev, uint32_t val) | 170 | - into .o files, Meson may need to pick *both* the `if_true` and |
167 | uint8_t longresp[16]; | 171 | - `if_false` sides to cater for targets that want either side. To |
168 | /* FIXME: Check CRC. */ | 172 | + into .o files, Meson may need to pick *both* the ``if_true`` and |
169 | request.cmd = s->cmd; | 173 | + ``if_false`` sides to cater for targets that want either side. To |
170 | - request.arg = (s->cmdarg[0] << 24) | (s->cmdarg[1] << 16) | 174 | achieve that, you can add a special rule using the ``CONFIG_ALL`` |
171 | - | (s->cmdarg[2] << 8) | s->cmdarg[3]; | 175 | symbol:: |
172 | + request.arg = ldl_be_p(s->cmdarg); | 176 | |
173 | DPRINTF("CMD%d arg 0x%08x\n", s->cmd, request.arg); | 177 | @@ -XXX,XX +XXX,XX @@ Target-dependent emulator sourcesets: |
174 | s->arglen = sdbus_do_command(&s->sdbus, &request, longresp); | 178 | In the target-dependent set lives CPU emulation, some device emulation and |
175 | if (s->arglen <= 0) { | 179 | much glue code. This sometimes also has to be compiled multiple times, |
176 | @@ -XXX,XX +XXX,XX @@ static uint32_t ssi_sd_transfer(SSISlave *dev, uint32_t val) | 180 | once for each target being built. Target-dependent files are included |
177 | /* CMD13 returns a 2-byte statuse work. Other commands | 181 | - in the `specific_ss` sourceset. |
178 | only return the first byte. */ | 182 | + in the ``specific_ss`` sourceset. |
179 | s->arglen = (s->cmd == 13) ? 2 : 1; | 183 | |
180 | - cardstatus = (longresp[0] << 24) | (longresp[1] << 16) | 184 | - Each emulator also includes sources for files in the `hw/` and `target/` |
181 | - | (longresp[2] << 8) | longresp[3]; | 185 | + Each emulator also includes sources for files in the ``hw/`` and ``target/`` |
182 | + cardstatus = ldl_be_p(longresp); | 186 | subdirectories. The subdirectory used for each emulator comes |
183 | status = 0; | 187 | from the target's definition of ``TARGET_BASE_ARCH`` or (if missing) |
184 | if (((cardstatus >> 9) & 0xf) < 4) | 188 | - ``TARGET_ARCH``, as found in `default-configs/targets/*.mak`. |
185 | status |= SSI_SDR_IDLE; | 189 | + ``TARGET_ARCH``, as found in ``default-configs/targets/*.mak``. |
190 | |||
191 | - Each subdirectory in `hw/` adds one sourceset to the `hw_arch` dictionary, | ||
192 | + Each subdirectory in ``hw/`` adds one sourceset to the ``hw_arch`` dictionary, | ||
193 | for example:: | ||
194 | |||
195 | arm_ss = ss.source_set() | ||
196 | @@ -XXX,XX +XXX,XX @@ Target-dependent emulator sourcesets: | ||
197 | |||
198 | The sourceset is only used for system emulators. | ||
199 | |||
200 | - Each subdirectory in `target/` instead should add one sourceset to each | ||
201 | - of the `target_arch` and `target_softmmu_arch`, which are used respectively | ||
202 | + Each subdirectory in ``target/`` instead should add one sourceset to each | ||
203 | + of the ``target_arch`` and ``target_softmmu_arch``, which are used respectively | ||
204 | for all emulators and for system emulators only. For example:: | ||
205 | |||
206 | arm_ss = ss.source_set() | ||
207 | @@ -XXX,XX +XXX,XX @@ Target-dependent emulator sourcesets: | ||
208 | target_softmmu_arch += {'arm': arm_softmmu_ss} | ||
209 | |||
210 | Module sourcesets: | ||
211 | - There are two dictionaries for modules: `modules` is used for | ||
212 | - target-independent modules and `target_modules` is used for | ||
213 | - target-dependent modules. When modules are disabled the `module` | ||
214 | - source sets are added to `softmmu_ss` and the `target_modules` | ||
215 | - source sets are added to `specific_ss`. | ||
216 | + There are two dictionaries for modules: ``modules`` is used for | ||
217 | + target-independent modules and ``target_modules`` is used for | ||
218 | + target-dependent modules. When modules are disabled the ``module`` | ||
219 | + source sets are added to ``softmmu_ss`` and the ``target_modules`` | ||
220 | + source sets are added to ``specific_ss``. | ||
221 | |||
222 | Both dictionaries are nested. One dictionary is created per | ||
223 | subdirectory, and these per-subdirectory dictionaries are added to | ||
224 | @@ -XXX,XX +XXX,XX @@ Module sourcesets: | ||
225 | modules += { 'hw-display': hw_display_modules } | ||
226 | |||
227 | Utility sourcesets: | ||
228 | - All binaries link with a static library `libqemuutil.a`. This library | ||
229 | + All binaries link with a static library ``libqemuutil.a``. This library | ||
230 | is built from several sourcesets; most of them however host generated | ||
231 | - code, and the only two of general interest are `util_ss` and `stub_ss`. | ||
232 | + code, and the only two of general interest are ``util_ss`` and ``stub_ss``. | ||
233 | |||
234 | The separation between these two is purely for documentation purposes. | ||
235 | - `util_ss` contains generic utility files. Even though this code is only | ||
236 | + ``util_ss`` contains generic utility files. Even though this code is only | ||
237 | linked in some binaries, sometimes it requires hooks only in some of | ||
238 | these and depend on other functions that are not fully implemented by | ||
239 | - all QEMU binaries. `stub_ss` links dummy stubs that will only be linked | ||
240 | + all QEMU binaries. ``stub_ss`` links dummy stubs that will only be linked | ||
241 | into the binary if the real implementation is not present. In a way, | ||
242 | the stubs can be thought of as a portable implementation of the weak | ||
243 | symbols concept. | ||
244 | @@ -XXX,XX +XXX,XX @@ Utility sourcesets: | ||
245 | The following files concur in the definition of which files are linked | ||
246 | into each emulator: | ||
247 | |||
248 | -`default-configs/devices/*.mak` | ||
249 | - The files under `default-configs/devices/` control the boards and devices | ||
250 | +``default-configs/devices/*.mak`` | ||
251 | + The files under ``default-configs/devices/`` control the boards and devices | ||
252 | that are built into each QEMU system emulation targets. They merely contain | ||
253 | a list of config variable definitions such as:: | ||
254 | |||
255 | @@ -XXX,XX +XXX,XX @@ into each emulator: | ||
256 | CONFIG_XLNX_ZYNQMP_ARM=y | ||
257 | CONFIG_XLNX_VERSAL=y | ||
258 | |||
259 | -`*/Kconfig` | ||
260 | - These files are processed together with `default-configs/devices/*.mak` and | ||
261 | +``*/Kconfig`` | ||
262 | + These files are processed together with ``default-configs/devices/*.mak`` and | ||
263 | describe the dependencies between various features, subsystems and | ||
264 | device models. They are described in :ref:`kconfig` | ||
265 | |||
266 | -`default-configs/targets/*.mak` | ||
267 | - These files mostly define symbols that appear in the `*-config-target.h` | ||
268 | +``default-configs/targets/*.mak`` | ||
269 | + These files mostly define symbols that appear in the ``*-config-target.h`` | ||
270 | file for each emulator [#cfgtarget]_. However, the ``TARGET_ARCH`` | ||
271 | - and ``TARGET_BASE_ARCH`` will also be used to select the `hw/` and | ||
272 | - `target/` subdirectories that are compiled into each target. | ||
273 | + and ``TARGET_BASE_ARCH`` will also be used to select the ``hw/`` and | ||
274 | + ``target/`` subdirectories that are compiled into each target. | ||
275 | |||
276 | -.. [#cfgtarget] This header is included by `qemu/osdep.h` when | ||
277 | +.. [#cfgtarget] This header is included by ``qemu/osdep.h`` when | ||
278 | compiling files from the target-specific sourcesets. | ||
279 | |||
280 | These files rarely need changing unless you are adding a completely | ||
281 | @@ -XXX,XX +XXX,XX @@ Support scripts | ||
282 | --------------- | ||
283 | |||
284 | Meson has a special convention for invoking Python scripts: if their | ||
285 | -first line is `#! /usr/bin/env python3` and the file is *not* executable, | ||
286 | +first line is ``#! /usr/bin/env python3`` and the file is *not* executable, | ||
287 | find_program() arranges to invoke the script under the same Python | ||
288 | interpreter that was used to invoke Meson. This is the most common | ||
289 | and preferred way to invoke support scripts from Meson build files, | ||
290 | because it automatically uses the value of configure's --python= option. | ||
291 | |||
292 | -In case the script is not written in Python, use a `#! /usr/bin/env ...` | ||
293 | +In case the script is not written in Python, use a ``#! /usr/bin/env ...`` | ||
294 | line and make the script executable. | ||
295 | |||
296 | Scripts written in Python, where it is desirable to make the script | ||
297 | executable (for example for test scripts that developers may want to | ||
298 | invoke from the command line, such as tests/qapi-schema/test-qapi.py), | ||
299 | -should be invoked through the `python` variable in meson.build. For | ||
300 | +should be invoked through the ``python`` variable in meson.build. For | ||
301 | example:: | ||
302 | |||
303 | test('QAPI schema regression tests', python, | ||
304 | @@ -XXX,XX +XXX,XX @@ rules and wraps them so that e.g. submodules are built before QEMU. | ||
305 | The resulting build system is largely non-recursive in nature, in | ||
306 | contrast to common practices seen with automake. | ||
307 | |||
308 | -Tests are also ran by the Makefile with the traditional `make check` | ||
309 | -phony target, while benchmarks are run with `make bench`. Meson test | ||
310 | -suites such as `unit` can be ran with `make check-unit` too. It is also | ||
311 | -possible to run tests defined in meson.build with `meson test`. | ||
312 | +Tests are also ran by the Makefile with the traditional ``make check`` | ||
313 | +phony target, while benchmarks are run with ``make bench``. Meson test | ||
314 | +suites such as ``unit`` can be ran with ``make check-unit`` too. It is also | ||
315 | +possible to run tests defined in meson.build with ``meson test``. | ||
316 | |||
317 | Important files for the build system | ||
318 | ==================================== | ||
319 | @@ -XXX,XX +XXX,XX @@ The following key files are statically defined in the source tree, with | ||
320 | the rules needed to build QEMU. Their behaviour is influenced by a | ||
321 | number of dynamically created files listed later. | ||
322 | |||
323 | -`Makefile` | ||
324 | +``Makefile`` | ||
325 | The main entry point used when invoking make to build all the components | ||
326 | of QEMU. The default 'all' target will naturally result in the build of | ||
327 | every component. Makefile takes care of recursively building submodules | ||
328 | directly via a non-recursive set of rules. | ||
329 | |||
330 | -`*/meson.build` | ||
331 | +``*/meson.build`` | ||
332 | The meson.build file in the root directory is the main entry point for the | ||
333 | Meson build system, and it coordinates the configuration and build of all | ||
334 | executables. Build rules for various subdirectories are included in | ||
335 | other meson.build files spread throughout the QEMU source tree. | ||
336 | |||
337 | -`tests/Makefile.include` | ||
338 | +``tests/Makefile.include`` | ||
339 | Rules for external test harnesses. These include the TCG tests, | ||
340 | - `qemu-iotests` and the Avocado-based acceptance tests. | ||
341 | + ``qemu-iotests`` and the Avocado-based acceptance tests. | ||
342 | |||
343 | -`tests/docker/Makefile.include` | ||
344 | +``tests/docker/Makefile.include`` | ||
345 | Rules for Docker tests. Like tests/Makefile, this file is included | ||
346 | directly by the top level Makefile, anything defined in this file will | ||
347 | influence the entire build system. | ||
348 | |||
349 | -`tests/vm/Makefile.include` | ||
350 | +``tests/vm/Makefile.include`` | ||
351 | Rules for VM-based tests. Like tests/Makefile, this file is included | ||
352 | directly by the top level Makefile, anything defined in this file will | ||
353 | influence the entire build system. | ||
354 | @@ -XXX,XX +XXX,XX @@ Makefile. | ||
355 | |||
356 | Built by configure: | ||
357 | |||
358 | -`config-host.mak` | ||
359 | +``config-host.mak`` | ||
360 | When configure has determined the characteristics of the build host it | ||
361 | will write a long list of variables to config-host.mak file. This | ||
362 | provides the various install directories, compiler / linker flags and a | ||
363 | - variety of `CONFIG_*` variables related to optionally enabled features. | ||
364 | + variety of ``CONFIG_*`` variables related to optionally enabled features. | ||
365 | This is imported by the top level Makefile and meson.build in order to | ||
366 | tailor the build output. | ||
367 | |||
368 | @@ -XXX,XX +XXX,XX @@ Built by configure: | ||
369 | |||
370 | Built by Meson: | ||
371 | |||
372 | -`${TARGET-NAME}-config-devices.mak` | ||
373 | +``${TARGET-NAME}-config-devices.mak`` | ||
374 | TARGET-NAME is again the name of a system or userspace emulator. The | ||
375 | config-devices.mak file is automatically generated by make using the | ||
376 | scripts/make_device_config.sh program, feeding it the | ||
377 | default-configs/$TARGET-NAME file as input. | ||
378 | |||
379 | -`config-host.h`, `$TARGET-NAME/config-target.h`, `$TARGET-NAME/config-devices.h` | ||
380 | +``config-host.h``, ``$TARGET-NAME/config-target.h``, ``$TARGET-NAME/config-devices.h`` | ||
381 | These files are used by source code to determine what features | ||
382 | are enabled. They are generated from the contents of the corresponding | ||
383 | - `*.h` files using the scripts/create_config program. This extracts | ||
384 | + ``*.h`` files using the scripts/create_config program. This extracts | ||
385 | relevant variables and formats them as C preprocessor macros. | ||
386 | |||
387 | -`build.ninja` | ||
388 | +``build.ninja`` | ||
389 | The build rules. | ||
390 | |||
391 | |||
392 | Built by Makefile: | ||
393 | |||
394 | -`Makefile.ninja` | ||
395 | +``Makefile.ninja`` | ||
396 | A Makefile include that bridges to ninja for the actual build. The | ||
397 | Makefile is mostly a list of targets that Meson included in build.ninja. | ||
398 | |||
399 | -`Makefile.mtest` | ||
400 | +``Makefile.mtest`` | ||
401 | The Makefile definitions that let "make check" run tests defined in | ||
402 | meson.build. The rules are produced from Meson's JSON description of | ||
403 | tests (obtained with "meson introspect --tests") through the script | ||
404 | @@ -XXX,XX +XXX,XX @@ Built by Makefile: | ||
405 | Useful make targets | ||
406 | ------------------- | ||
407 | |||
408 | -`help` | ||
409 | +``help`` | ||
410 | Print a help message for the most common build targets. | ||
411 | |||
412 | -`print-VAR` | ||
413 | +``print-VAR`` | ||
414 | Print the value of the variable VAR. Useful for debugging the build | ||
415 | system. | ||
186 | -- | 416 | -- |
187 | 2.17.1 | 417 | 2.20.1 |
188 | 418 | ||
189 | 419 | diff view generated by jsdifflib |
1 | From: Aaron Lindsay <alindsay@codeaurora.org> | 1 | One of the example meson.build fragments incorrectly quotes some |
---|---|---|---|
2 | symbols as 'CONFIG_FOO`; the correct syntax here is 'CONFIG_FOO'. | ||
3 | (This isn't a rST formatting mistake because the example is displayed | ||
4 | literally; it's just the wrong kind of quote.) | ||
2 | 5 | ||
3 | This makes it match its AArch64 equivalent, PMINTENSET_EL1 | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20210726142338.31872-3-peter.maydell@linaro.org | ||
10 | --- | ||
11 | docs/devel/build-system.rst | 4 ++-- | ||
12 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
4 | 13 | ||
5 | Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> | 14 | diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst |
6 | Message-id: 1529699547-17044-13-git-send-email-alindsay@codeaurora.org | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | --- | ||
9 | target/arm/helper.c | 2 +- | ||
10 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
13 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/target/arm/helper.c | 16 | --- a/docs/devel/build-system.rst |
15 | +++ b/target/arm/helper.c | 17 | +++ b/docs/devel/build-system.rst |
16 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo v7_cp_reginfo[] = { | 18 | @@ -XXX,XX +XXX,XX @@ Target-independent emulator sourcesets: |
17 | .writefn = pmuserenr_write, .raw_writefn = raw_write }, | 19 | symbol:: |
18 | { .name = "PMINTENSET", .cp = 15, .crn = 9, .crm = 14, .opc1 = 0, .opc2 = 1, | 20 | |
19 | .access = PL1_RW, .accessfn = access_tpm, | 21 | # Some targets have CONFIG_ACPI, some don't, so this is not enough |
20 | - .type = ARM_CP_ALIAS, | 22 | - softmmu_ss.add(when: 'CONFIG_ACPI`, if_true: files('acpi.c'), |
21 | + .type = ARM_CP_ALIAS | ARM_CP_IO, | 23 | + softmmu_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi.c'), |
22 | .fieldoffset = offsetoflow32(CPUARMState, cp15.c9_pminten), | 24 | if_false: files('acpi-stub.c')) |
23 | .resetvalue = 0, | 25 | |
24 | .writefn = pmintenset_write, .raw_writefn = raw_write }, | 26 | # This is required as well: |
27 | - softmmu_ss.add(when: 'CONFIG_ALL`, if_true: files('acpi-stub.c')) | ||
28 | + softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('acpi-stub.c')) | ||
29 | |||
30 | Target-dependent emulator sourcesets: | ||
31 | In the target-dependent set lives CPU emulation, some device emulation and | ||
25 | -- | 32 | -- |
26 | 2.17.1 | 33 | 2.20.1 |
27 | 34 | ||
28 | 35 | diff view generated by jsdifflib |
1 | From: Aaron Lindsay <alindsay@codeaurora.org> | 1 | In rST markup, single backticks `like this` represent "interpreted |
---|---|---|---|
2 | text", which can be handled as a bunch of different things if tagged | ||
3 | with a specific "role": | ||
4 | https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#interpreted-text | ||
5 | (the most common one for us is "reference to a URL, which gets | ||
6 | hyperlinked"). | ||
2 | 7 | ||
3 | KVM implies V7VE, which implies ARM_DIV and THUMB_DIV. The conditional | 8 | The default "role" if none is specified is "title_reference", |
4 | detection here is therefore unnecessary. Because V7VE is already | 9 | intended for references to book or article titles, and it renders |
5 | unconditionally specified for all KVM hosts, ARM_DIV and THUMB_DIV are | 10 | into the HTML as <cite>...</cite> (usually comes out as italics). |
6 | already indirectly specified and do not need to be included here at all. | ||
7 | 11 | ||
8 | Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> | 12 | To format a literal (generally rendered as fixed-width font), |
9 | Message-id: 1529699547-17044-6-git-send-email-alindsay@codeaurora.org | 13 | double-backticks are required. |
14 | |||
15 | ebpf_rss.rst gets this wrong in a few places; correct them. | ||
16 | |||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 17 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
18 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
19 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
20 | Message-id: 20210726142338.31872-4-peter.maydell@linaro.org | ||
11 | --- | 21 | --- |
12 | target/arm/kvm32.c | 19 +------------------ | 22 | docs/devel/ebpf_rss.rst | 18 +++++++++--------- |
13 | 1 file changed, 1 insertion(+), 18 deletions(-) | 23 | 1 file changed, 9 insertions(+), 9 deletions(-) |
14 | 24 | ||
15 | diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c | 25 | diff --git a/docs/devel/ebpf_rss.rst b/docs/devel/ebpf_rss.rst |
16 | index XXXXXXX..XXXXXXX 100644 | 26 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/kvm32.c | 27 | --- a/docs/devel/ebpf_rss.rst |
18 | +++ b/target/arm/kvm32.c | 28 | +++ b/docs/devel/ebpf_rss.rst |
19 | @@ -XXX,XX +XXX,XX @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) | 29 | @@ -XXX,XX +XXX,XX @@ eBPF RSS implementation |
20 | * and then query that CPU for the relevant ID registers. | 30 | |
21 | */ | 31 | eBPF RSS loading functionality located in ebpf/ebpf_rss.c and ebpf/ebpf_rss.h. |
22 | int i, ret, fdarray[3]; | 32 | |
23 | - uint32_t midr, id_pfr0, id_isar0, mvfr1; | 33 | -The `struct EBPFRSSContext` structure that holds 4 file descriptors: |
24 | + uint32_t midr, id_pfr0, mvfr1; | 34 | +The ``struct EBPFRSSContext`` structure that holds 4 file descriptors: |
25 | uint64_t features = 0; | 35 | |
26 | /* Old kernels may not know about the PREFERRED_TARGET ioctl: however | 36 | - ctx - pointer of the libbpf context. |
27 | * we know these will only support creating one kind of guest CPU, | 37 | - program_fd - file descriptor of the eBPF RSS program. |
28 | @@ -XXX,XX +XXX,XX @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) | 38 | @@ -XXX,XX +XXX,XX @@ The `struct EBPFRSSContext` structure that holds 4 file descriptors: |
29 | | ENCODE_CP_REG(15, 0, 0, 0, 1, 0, 0), | 39 | - map_toeplitz_key - file descriptor of the 'Toeplitz key' map. One element of the 40byte key prepared for the hashing algorithm. |
30 | .addr = (uintptr_t)&id_pfr0, | 40 | - map_indirections_table - 128 elements of queue indexes. |
31 | }, | 41 | |
32 | - { | 42 | -`struct EBPFRSSConfig` fields: |
33 | - .id = KVM_REG_ARM | KVM_REG_SIZE_U32 | 43 | +``struct EBPFRSSConfig`` fields: |
34 | - | ENCODE_CP_REG(15, 0, 0, 0, 2, 0, 0), | 44 | |
35 | - .addr = (uintptr_t)&id_isar0, | 45 | -- redirect - "boolean" value, should the hash be calculated, on false - `default_queue` would be used as the final decision. |
36 | - }, | 46 | +- redirect - "boolean" value, should the hash be calculated, on false - ``default_queue`` would be used as the final decision. |
37 | { | 47 | - populate_hash - for now, not used. eBPF RSS doesn't support hash reporting. |
38 | .id = KVM_REG_ARM | KVM_REG_SIZE_U32 | 48 | -- hash_types - binary mask of different hash types. See `VIRTIO_NET_RSS_HASH_TYPE_*` defines. If for packet hash should not be calculated - `default_queue` would be used. |
39 | | KVM_REG_ARM_VFP | KVM_REG_ARM_VFP_MVFR1, | 49 | +- hash_types - binary mask of different hash types. See ``VIRTIO_NET_RSS_HASH_TYPE_*`` defines. If for packet hash should not be calculated - ``default_queue`` would be used. |
40 | @@ -XXX,XX +XXX,XX @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) | 50 | - indirections_len - length of the indirections table, maximum 128. |
41 | set_feature(&features, ARM_FEATURE_VFP3); | 51 | - default_queue - the queue index that used for packet that shouldn't be hashed. For some packets, the hash can't be calculated(g.e ARP). |
42 | set_feature(&features, ARM_FEATURE_GENERIC_TIMER); | 52 | |
43 | 53 | Functions: | |
44 | - switch (extract32(id_isar0, 24, 4)) { | 54 | |
45 | - case 1: | 55 | -- `ebpf_rss_init()` - sets ctx to NULL, which indicates that EBPFRSSContext is not loaded. |
46 | - set_feature(&features, ARM_FEATURE_THUMB_DIV); | 56 | -- `ebpf_rss_load()` - creates 3 maps and loads eBPF program from the rss.bpf.skeleton.h. Returns 'true' on success. After that, program_fd can be used to set steering for TAP. |
47 | - break; | 57 | -- `ebpf_rss_set_all()` - sets values for eBPF maps. `indirections_table` length is in EBPFRSSConfig. `toeplitz_key` is VIRTIO_NET_RSS_MAX_KEY_SIZE aka 40 bytes array. |
48 | - case 2: | 58 | -- `ebpf_rss_unload()` - close all file descriptors and set ctx to NULL. |
49 | - set_feature(&features, ARM_FEATURE_ARM_DIV); | 59 | +- ``ebpf_rss_init()`` - sets ctx to NULL, which indicates that EBPFRSSContext is not loaded. |
50 | - set_feature(&features, ARM_FEATURE_THUMB_DIV); | 60 | +- ``ebpf_rss_load()`` - creates 3 maps and loads eBPF program from the rss.bpf.skeleton.h. Returns 'true' on success. After that, program_fd can be used to set steering for TAP. |
51 | - break; | 61 | +- ``ebpf_rss_set_all()`` - sets values for eBPF maps. ``indirections_table`` length is in EBPFRSSConfig. ``toeplitz_key`` is VIRTIO_NET_RSS_MAX_KEY_SIZE aka 40 bytes array. |
52 | - default: | 62 | +- ``ebpf_rss_unload()`` - close all file descriptors and set ctx to NULL. |
53 | - break; | 63 | |
54 | - } | 64 | Simplified eBPF RSS workflow: |
55 | - | 65 | |
56 | if (extract32(id_pfr0, 12, 4) == 1) { | 66 | @@ -XXX,XX +XXX,XX @@ Simplified eBPF RSS workflow: |
57 | set_feature(&features, ARM_FEATURE_THUMB2EE); | 67 | NetClientState SetSteeringEBPF() |
58 | } | 68 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
69 | |||
70 | -For now, `set_steering_ebpf()` method supported by Linux TAP NetClientState. The method requires an eBPF program file descriptor as an argument. | ||
71 | +For now, ``set_steering_ebpf()`` method supported by Linux TAP NetClientState. The method requires an eBPF program file descriptor as an argument. | ||
59 | -- | 72 | -- |
60 | 2.17.1 | 73 | 2.20.1 |
61 | 74 | ||
62 | 75 | diff view generated by jsdifflib |
1 | From: Aaron Lindsay <alindsay@codeaurora.org> | 1 | In rST markup, single backticks `like this` represent "interpreted |
---|---|---|---|
2 | text", which can be handled as a bunch of different things if tagged | ||
3 | with a specific "role": | ||
4 | https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#interpreted-text | ||
5 | (the most common one for us is "reference to a URL, which gets | ||
6 | hyperlinked"). | ||
2 | 7 | ||
3 | Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> | 8 | The default "role" if none is specified is "title_reference", |
4 | Message-id: 1529699547-17044-5-git-send-email-alindsay@codeaurora.org | 9 | intended for references to book or article titles, and it renders |
10 | into the HTML as <cite>...</cite> (usually comes out as italics). | ||
11 | |||
12 | To format a literal (generally rendered as fixed-width font), | ||
13 | double-backticks are required. | ||
14 | |||
15 | Mostly migration.rst gets this right, but some places incorrectly use | ||
16 | single backticks where double backticks were intended; correct them. | ||
17 | |||
5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 18 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
19 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
20 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
21 | Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com> | ||
22 | Message-id: 20210726142338.31872-5-peter.maydell@linaro.org | ||
6 | --- | 23 | --- |
7 | target/arm/cpu.h | 1 + | 24 | docs/devel/migration.rst | 36 ++++++++++++++++++------------------ |
8 | target/arm/cpu.c | 21 ++++++++++++++------- | 25 | 1 file changed, 18 insertions(+), 18 deletions(-) |
9 | target/arm/kvm32.c | 8 ++++---- | ||
10 | 3 files changed, 19 insertions(+), 11 deletions(-) | ||
11 | 26 | ||
12 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | 27 | diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst |
13 | index XXXXXXX..XXXXXXX 100644 | 28 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/target/arm/cpu.h | 29 | --- a/docs/devel/migration.rst |
15 | +++ b/target/arm/cpu.h | 30 | +++ b/docs/devel/migration.rst |
16 | @@ -XXX,XX +XXX,XX @@ enum arm_features { | 31 | @@ -XXX,XX +XXX,XX @@ savevm/loadvm functionality. |
17 | ARM_FEATURE_OMAPCP, /* OMAP specific CP15 ops handling. */ | 32 | Debugging |
18 | ARM_FEATURE_THUMB2EE, | 33 | ========= |
19 | ARM_FEATURE_V7MP, /* v7 Multiprocessing Extensions */ | 34 | |
20 | + ARM_FEATURE_V7VE, /* v7 Virtualization Extensions (non-EL2 parts) */ | 35 | -The migration stream can be analyzed thanks to `scripts/analyze-migration.py`. |
21 | ARM_FEATURE_V4T, | 36 | +The migration stream can be analyzed thanks to ``scripts/analyze-migration.py``. |
22 | ARM_FEATURE_V5, | 37 | |
23 | ARM_FEATURE_STRONGARM, | 38 | Example usage: |
24 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 39 | |
25 | index XXXXXXX..XXXXXXX 100644 | 40 | @@ -XXX,XX +XXX,XX @@ Common infrastructure |
26 | --- a/target/arm/cpu.c | 41 | ===================== |
27 | +++ b/target/arm/cpu.c | 42 | |
28 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | 43 | The files, sockets or fd's that carry the migration stream are abstracted by |
29 | 44 | -the ``QEMUFile`` type (see `migration/qemu-file.h`). In most cases this | |
30 | /* Some features automatically imply others: */ | 45 | -is connected to a subtype of ``QIOChannel`` (see `io/`). |
31 | if (arm_feature(env, ARM_FEATURE_V8)) { | 46 | +the ``QEMUFile`` type (see ``migration/qemu-file.h``). In most cases this |
32 | - set_feature(env, ARM_FEATURE_V7); | 47 | +is connected to a subtype of ``QIOChannel`` (see ``io/``). |
33 | + set_feature(env, ARM_FEATURE_V7VE); | 48 | |
34 | + } | 49 | |
35 | + if (arm_feature(env, ARM_FEATURE_V7VE)) { | 50 | Saving the state of one device |
36 | + /* v7 Virtualization Extensions. In real hardware this implies | 51 | @@ -XXX,XX +XXX,XX @@ An example (from hw/input/pckbd.c) |
37 | + * EL2 and also the presence of the Security Extensions. | 52 | }; |
38 | + * For QEMU, for backwards-compatibility we implement some | 53 | |
39 | + * CPUs or CPU configs which have no actual EL2 or EL3 but do | 54 | We are declaring the state with name "pckbd". |
40 | + * include the various other features that V7VE implies. | 55 | -The `version_id` is 3, and the fields are 4 uint8_t in a KBDState structure. |
41 | + * Presence of EL2 itself is ARM_FEATURE_EL2, and of the | 56 | +The ``version_id`` is 3, and the fields are 4 uint8_t in a KBDState structure. |
42 | + * Security Extensions is ARM_FEATURE_EL3. | 57 | We registered this with: |
43 | + */ | 58 | |
44 | set_feature(env, ARM_FEATURE_ARM_DIV); | 59 | .. code:: c |
45 | set_feature(env, ARM_FEATURE_LPAE); | 60 | |
46 | + set_feature(env, ARM_FEATURE_V7); | 61 | vmstate_register(NULL, 0, &vmstate_kbd, s); |
47 | } | 62 | |
48 | if (arm_feature(env, ARM_FEATURE_V7)) { | 63 | -For devices that are `qdev` based, we can register the device in the class |
49 | set_feature(env, ARM_FEATURE_VAPA); | 64 | +For devices that are ``qdev`` based, we can register the device in the class |
50 | @@ -XXX,XX +XXX,XX @@ static void cortex_a7_initfn(Object *obj) | 65 | init function: |
51 | ARMCPU *cpu = ARM_CPU(obj); | 66 | |
52 | 67 | .. code:: c | |
53 | cpu->dtb_compatible = "arm,cortex-a7"; | 68 | @@ -XXX,XX +XXX,XX @@ another to load the state back. |
54 | - set_feature(&cpu->env, ARM_FEATURE_V7); | 69 | SaveVMHandlers *ops, |
55 | + set_feature(&cpu->env, ARM_FEATURE_V7VE); | 70 | void *opaque); |
56 | set_feature(&cpu->env, ARM_FEATURE_VFP4); | 71 | |
57 | set_feature(&cpu->env, ARM_FEATURE_NEON); | 72 | -Two functions in the ``ops`` structure are the `save_state` |
58 | set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); | 73 | -and `load_state` functions. Notice that `load_state` receives a version_id |
59 | - set_feature(&cpu->env, ARM_FEATURE_ARM_DIV); | 74 | -parameter to know what state format is receiving. `save_state` doesn't |
60 | set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); | 75 | +Two functions in the ``ops`` structure are the ``save_state`` |
61 | set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); | 76 | +and ``load_state`` functions. Notice that ``load_state`` receives a version_id |
62 | set_feature(&cpu->env, ARM_FEATURE_CBAR_RO); | 77 | +parameter to know what state format is receiving. ``save_state`` doesn't |
63 | - set_feature(&cpu->env, ARM_FEATURE_LPAE); | 78 | have a version_id parameter because it always uses the latest version. |
64 | set_feature(&cpu->env, ARM_FEATURE_EL3); | 79 | |
65 | cpu->kvm_target = QEMU_KVM_ARM_TARGET_CORTEX_A7; | 80 | Note that because the VMState macros still save the data in a raw |
66 | cpu->midr = 0x410fc075; | 81 | @@ -XXX,XX +XXX,XX @@ migration of a device, and using them breaks backward-migration |
67 | @@ -XXX,XX +XXX,XX @@ static void cortex_a15_initfn(Object *obj) | 82 | compatibility; in general most changes can be made by adding Subsections |
68 | ARMCPU *cpu = ARM_CPU(obj); | 83 | (see above) or _TEST macros (see above) which won't break compatibility. |
69 | 84 | ||
70 | cpu->dtb_compatible = "arm,cortex-a15"; | 85 | -Each version is associated with a series of fields saved. The `save_state` always saves |
71 | - set_feature(&cpu->env, ARM_FEATURE_V7); | 86 | -the state as the newer version. But `load_state` sometimes is able to |
72 | + set_feature(&cpu->env, ARM_FEATURE_V7VE); | 87 | +Each version is associated with a series of fields saved. The ``save_state`` always saves |
73 | set_feature(&cpu->env, ARM_FEATURE_VFP4); | 88 | +the state as the newer version. But ``load_state`` sometimes is able to |
74 | set_feature(&cpu->env, ARM_FEATURE_NEON); | 89 | load state from an older version. |
75 | set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); | 90 | |
76 | - set_feature(&cpu->env, ARM_FEATURE_ARM_DIV); | 91 | You can see that there are several version fields: |
77 | set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); | 92 | |
78 | set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); | 93 | -- `version_id`: the maximum version_id supported by VMState for that device. |
79 | set_feature(&cpu->env, ARM_FEATURE_CBAR_RO); | 94 | -- `minimum_version_id`: the minimum version_id that VMState is able to understand |
80 | - set_feature(&cpu->env, ARM_FEATURE_LPAE); | 95 | +- ``version_id``: the maximum version_id supported by VMState for that device. |
81 | set_feature(&cpu->env, ARM_FEATURE_EL3); | 96 | +- ``minimum_version_id``: the minimum version_id that VMState is able to understand |
82 | cpu->kvm_target = QEMU_KVM_ARM_TARGET_CORTEX_A15; | 97 | for that device. |
83 | cpu->midr = 0x412fc0f1; | 98 | -- `minimum_version_id_old`: For devices that were not able to port to vmstate, we can |
84 | diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c | 99 | +- ``minimum_version_id_old``: For devices that were not able to port to vmstate, we can |
85 | index XXXXXXX..XXXXXXX 100644 | 100 | assign a function that knows how to read this old state. This field is |
86 | --- a/target/arm/kvm32.c | 101 | - ignored if there is no `load_state_old` handler. |
87 | +++ b/target/arm/kvm32.c | 102 | + ignored if there is no ``load_state_old`` handler. |
88 | @@ -XXX,XX +XXX,XX @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) | 103 | |
89 | /* Now we've retrieved all the register information we can | 104 | VMState is able to read versions from minimum_version_id to |
90 | * set the feature bits based on the ID register fields. | 105 | version_id. And the function ``load_state_old()`` (if present) is able to |
91 | * We can assume any KVM supporting CPU is at least a v7 | 106 | @@ -XXX,XX +XXX,XX @@ data and then transferred to the main structure. |
92 | - * with VFPv3, LPAE and the generic timers; this in turn implies | 107 | |
93 | - * most of the other feature bits, but a few must be tested. | 108 | If you use memory API functions that update memory layout outside |
94 | + * with VFPv3, virtualization extensions, and the generic | 109 | initialization (i.e., in response to a guest action), this is a strong |
95 | + * timers; this in turn implies most of the other feature | 110 | -indication that you need to call these functions in a `post_load` callback. |
96 | + * bits, but a few must be tested. | 111 | +indication that you need to call these functions in a ``post_load`` callback. |
97 | */ | 112 | Examples of such memory API functions are: |
98 | - set_feature(&features, ARM_FEATURE_V7); | 113 | |
99 | + set_feature(&features, ARM_FEATURE_V7VE); | 114 | - memory_region_add_subregion() |
100 | set_feature(&features, ARM_FEATURE_VFP3); | 115 | @@ -XXX,XX +XXX,XX @@ Postcopy migration with shared memory needs explicit support from the other |
101 | - set_feature(&features, ARM_FEATURE_LPAE); | 116 | processes that share memory and from QEMU. There are restrictions on the type of |
102 | set_feature(&features, ARM_FEATURE_GENERIC_TIMER); | 117 | memory that userfault can support shared. |
103 | 118 | ||
104 | switch (extract32(id_isar0, 24, 4)) { | 119 | -The Linux kernel userfault support works on `/dev/shm` memory and on `hugetlbfs` |
120 | -(although the kernel doesn't provide an equivalent to `madvise(MADV_DONTNEED)` | ||
121 | +The Linux kernel userfault support works on ``/dev/shm`` memory and on ``hugetlbfs`` | ||
122 | +(although the kernel doesn't provide an equivalent to ``madvise(MADV_DONTNEED)`` | ||
123 | for hugetlbfs which may be a problem in some configurations). | ||
124 | |||
125 | The vhost-user code in QEMU supports clients that have Postcopy support, | ||
126 | -and the `vhost-user-bridge` (in `tests/`) and the DPDK package have changes | ||
127 | +and the ``vhost-user-bridge`` (in ``tests/``) and the DPDK package have changes | ||
128 | to support postcopy. | ||
129 | |||
130 | The client needs to open a userfaultfd and register the areas | ||
105 | -- | 131 | -- |
106 | 2.17.1 | 132 | 2.20.1 |
107 | 133 | ||
108 | 134 | diff view generated by jsdifflib |
1 | From: Jean-Christophe Dubois <jcd@tribudubois.net> | 1 | In rST markup, single backticks `like this` represent "interpreted |
---|---|---|---|
2 | text", which can be handled as a bunch of different things if tagged | ||
3 | with a specific "role": | ||
4 | https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#interpreted-text | ||
5 | (the most common one for us is "reference to a URL, which gets | ||
6 | hyperlinked"). | ||
2 | 7 | ||
3 | The qdev_get_gpio_in() function accept an int as second parameter. | 8 | The default "role" if none is specified is "title_reference", |
9 | intended for references to book or article titles, and it renders | ||
10 | into the HTML as <cite>...</cite> (usually comes out as italics). | ||
4 | 11 | ||
5 | Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net> | 12 | Fix various places in the devel section of the manual which were |
6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 13 | using single backticks when double backticks (for literal text) |
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 14 | were intended. |
15 | |||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 16 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
17 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
18 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
19 | Message-id: 20210726142338.31872-6-peter.maydell@linaro.org | ||
9 | --- | 20 | --- |
10 | hw/arm/fsl-imx7.c | 6 +++--- | 21 | docs/devel/qgraph.rst | 8 ++++---- |
11 | 1 file changed, 3 insertions(+), 3 deletions(-) | 22 | docs/devel/tcg-plugins.rst | 14 +++++++------- |
23 | docs/devel/testing.rst | 8 ++++---- | ||
24 | 3 files changed, 15 insertions(+), 15 deletions(-) | ||
12 | 25 | ||
13 | diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c | 26 | diff --git a/docs/devel/qgraph.rst b/docs/devel/qgraph.rst |
14 | index XXXXXXX..XXXXXXX 100644 | 27 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/hw/arm/fsl-imx7.c | 28 | --- a/docs/devel/qgraph.rst |
16 | +++ b/hw/arm/fsl-imx7.c | 29 | +++ b/docs/devel/qgraph.rst |
17 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp) | 30 | @@ -XXX,XX +XXX,XX @@ Notes for the nodes: |
18 | FSL_IMX7_ECSPI4_ADDR, | 31 | Edges |
19 | }; | 32 | ^^^^^^ |
20 | 33 | ||
21 | - static const hwaddr FSL_IMX7_SPIn_IRQ[FSL_IMX7_NUM_ECSPIS] = { | 34 | -An edge relation between two nodes (drivers or machines) `X` and `Y` can be: |
22 | + static const int FSL_IMX7_SPIn_IRQ[FSL_IMX7_NUM_ECSPIS] = { | 35 | +An edge relation between two nodes (drivers or machines) ``X`` and ``Y`` can be: |
23 | FSL_IMX7_ECSPI1_IRQ, | 36 | |
24 | FSL_IMX7_ECSPI2_IRQ, | 37 | -- ``X CONSUMES Y``: `Y` can be plugged into `X` |
25 | FSL_IMX7_ECSPI3_IRQ, | 38 | -- ``X PRODUCES Y``: `X` provides the interface `Y` |
26 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp) | 39 | -- ``X CONTAINS Y``: `Y` is part of `X` component |
27 | FSL_IMX7_I2C4_ADDR, | 40 | +- ``X CONSUMES Y``: ``Y`` can be plugged into ``X`` |
28 | }; | 41 | +- ``X PRODUCES Y``: ``X`` provides the interface ``Y`` |
29 | 42 | +- ``X CONTAINS Y``: ``Y`` is part of ``X`` component | |
30 | - static const hwaddr FSL_IMX7_I2Cn_IRQ[FSL_IMX7_NUM_I2CS] = { | 43 | |
31 | + static const int FSL_IMX7_I2Cn_IRQ[FSL_IMX7_NUM_I2CS] = { | 44 | Execution steps |
32 | FSL_IMX7_I2C1_IRQ, | 45 | ^^^^^^^^^^^^^^^ |
33 | FSL_IMX7_I2C2_IRQ, | 46 | diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst |
34 | FSL_IMX7_I2C3_IRQ, | 47 | index XXXXXXX..XXXXXXX 100644 |
35 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp) | 48 | --- a/docs/devel/tcg-plugins.rst |
36 | FSL_IMX7_USB3_ADDR, | 49 | +++ b/docs/devel/tcg-plugins.rst |
37 | }; | 50 | @@ -XXX,XX +XXX,XX @@ version they were built against. This can be done simply by:: |
38 | 51 | QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; | |
39 | - static const hwaddr FSL_IMX7_USBn_IRQ[FSL_IMX7_NUM_USBS] = { | 52 | |
40 | + static const int FSL_IMX7_USBn_IRQ[FSL_IMX7_NUM_USBS] = { | 53 | The core code will refuse to load a plugin that doesn't export a |
41 | FSL_IMX7_USB1_IRQ, | 54 | -`qemu_plugin_version` symbol or if plugin version is outside of QEMU's |
42 | FSL_IMX7_USB2_IRQ, | 55 | +``qemu_plugin_version`` symbol or if plugin version is outside of QEMU's |
43 | FSL_IMX7_USB3_IRQ, | 56 | supported range of API versions. |
57 | |||
58 | -Additionally the `qemu_info_t` structure which is passed to the | ||
59 | -`qemu_plugin_install` method of a plugin will detail the minimum and | ||
60 | +Additionally the ``qemu_info_t`` structure which is passed to the | ||
61 | +``qemu_plugin_install`` method of a plugin will detail the minimum and | ||
62 | current API versions supported by QEMU. The API version will be | ||
63 | incremented if new APIs are added. The minimum API version will be | ||
64 | incremented if existing APIs are changed or removed. | ||
65 | @@ -XXX,XX +XXX,XX @@ Example Plugins | ||
66 | |||
67 | There are a number of plugins included with QEMU and you are | ||
68 | encouraged to contribute your own plugins plugins upstream. There is a | ||
69 | -`contrib/plugins` directory where they can go. | ||
70 | +``contrib/plugins`` directory where they can go. | ||
71 | |||
72 | - tests/plugins | ||
73 | |||
74 | These are some basic plugins that are used to test and exercise the | ||
75 | -API during the `make check-tcg` target. | ||
76 | +API during the ``make check-tcg`` target. | ||
77 | |||
78 | - contrib/plugins/hotblocks.c | ||
79 | |||
80 | @@ -XXX,XX +XXX,XX @@ with linux-user execution as system emulation tends to generate | ||
81 | re-translations as blocks from different programs get swapped in and | ||
82 | out of system memory. | ||
83 | |||
84 | -If your program is single-threaded you can use the `inline` option for | ||
85 | +If your program is single-threaded you can use the ``inline`` option for | ||
86 | slightly faster (but not thread safe) counters. | ||
87 | |||
88 | Example:: | ||
89 | @@ -XXX,XX +XXX,XX @@ which will lead to a sorted list after the class breakdown:: | ||
90 | ... | ||
91 | |||
92 | To find the argument shorthand for the class you need to examine the | ||
93 | -source code of the plugin at the moment, specifically the `*opt` | ||
94 | +source code of the plugin at the moment, specifically the ``*opt`` | ||
95 | argument in the InsnClassExecCount tables. | ||
96 | |||
97 | - contrib/plugins/lockstep.c | ||
98 | diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst | ||
99 | index XXXXXXX..XXXXXXX 100644 | ||
100 | --- a/docs/devel/testing.rst | ||
101 | +++ b/docs/devel/testing.rst | ||
102 | @@ -XXX,XX +XXX,XX @@ The base test class has also support for tests with more than one | ||
103 | QEMUMachine. The way to get machines is through the ``self.get_vm()`` | ||
104 | method which will return a QEMUMachine instance. The ``self.get_vm()`` | ||
105 | method accepts arguments that will be passed to the QEMUMachine creation | ||
106 | -and also an optional `name` attribute so you can identify a specific | ||
107 | +and also an optional ``name`` attribute so you can identify a specific | ||
108 | machine and get it more than once through the tests methods. A simple | ||
109 | and hypothetical example follows: | ||
110 | |||
111 | @@ -XXX,XX +XXX,XX @@ Here is a list of the most used variables: | ||
112 | AVOCADO_ALLOW_LARGE_STORAGE | ||
113 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
114 | Tests which are going to fetch or produce assets considered *large* are not | ||
115 | -going to run unless that `AVOCADO_ALLOW_LARGE_STORAGE=1` is exported on | ||
116 | +going to run unless that ``AVOCADO_ALLOW_LARGE_STORAGE=1`` is exported on | ||
117 | the environment. | ||
118 | |||
119 | The definition of *large* is a bit arbitrary here, but it usually means an | ||
120 | @@ -XXX,XX +XXX,XX @@ skipped by default. The definition of *not safe* is also arbitrary but | ||
121 | usually it means a blob which either its source or build process aren't | ||
122 | public available. | ||
123 | |||
124 | -You should export `AVOCADO_ALLOW_UNTRUSTED_CODE=1` on the environment in | ||
125 | +You should export ``AVOCADO_ALLOW_UNTRUSTED_CODE=1`` on the environment in | ||
126 | order to allow tests which make use of those kind of assets. | ||
127 | |||
128 | AVOCADO_TIMEOUT_EXPECTED | ||
129 | @@ -XXX,XX +XXX,XX @@ property defined in the test class, for further details:: | ||
130 | Even though the timeout can be set by the test developer, there are some tests | ||
131 | that may not have a well-defined limit of time to finish under certain | ||
132 | conditions. For example, tests that take longer to execute when QEMU is | ||
133 | -compiled with debug flags. Therefore, the `AVOCADO_TIMEOUT_EXPECTED` variable | ||
134 | +compiled with debug flags. Therefore, the ``AVOCADO_TIMEOUT_EXPECTED`` variable | ||
135 | has been used to determine whether those tests should run or not. | ||
136 | |||
137 | GITLAB_CI | ||
44 | -- | 138 | -- |
45 | 2.17.1 | 139 | 2.20.1 |
46 | 140 | ||
47 | 141 | diff view generated by jsdifflib |
1 | From: Jean-Christophe Dubois <jcd@tribudubois.net> | 1 | In rST markup, single backticks `like this` represent "interpreted |
---|---|---|---|
2 | text", which can be handled as a bunch of different things if tagged | ||
3 | with a specific "role": | ||
4 | https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#interpreted-text | ||
5 | (the most common one for us is "reference to a URL, which gets | ||
6 | hyperlinked"). | ||
2 | 7 | ||
3 | Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net> | 8 | The default "role" if none is specified is "title_reference", |
4 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 9 | intended for references to book or article titles, and it renders |
10 | into the HTML as <cite>...</cite> (usually comes out as italics). | ||
11 | |||
12 | To format a literal (generally rendered as fixed-width font), | ||
13 | double-backticks are required. | ||
14 | |||
15 | protvirt.rst consistently uses single backticks when double backticks | ||
16 | are required; correct it. | ||
17 | |||
5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 18 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
19 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
20 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
21 | Acked-by: Cornelia Huck <cohuck@redhat.com> | ||
22 | Message-id: 20210726142338.31872-7-peter.maydell@linaro.org | ||
6 | --- | 23 | --- |
7 | hw/arm/mcimx7d-sabre.c | 2 -- | 24 | docs/system/s390x/protvirt.rst | 12 ++++++------ |
8 | 1 file changed, 2 deletions(-) | 25 | 1 file changed, 6 insertions(+), 6 deletions(-) |
9 | 26 | ||
10 | diff --git a/hw/arm/mcimx7d-sabre.c b/hw/arm/mcimx7d-sabre.c | 27 | diff --git a/docs/system/s390x/protvirt.rst b/docs/system/s390x/protvirt.rst |
11 | index XXXXXXX..XXXXXXX 100644 | 28 | index XXXXXXX..XXXXXXX 100644 |
12 | --- a/hw/arm/mcimx7d-sabre.c | 29 | --- a/docs/system/s390x/protvirt.rst |
13 | +++ b/hw/arm/mcimx7d-sabre.c | 30 | +++ b/docs/system/s390x/protvirt.rst |
14 | @@ -XXX,XX +XXX,XX @@ | 31 | @@ -XXX,XX +XXX,XX @@ Prerequisites |
15 | #include "hw/arm/fsl-imx7.h" | 32 | To run PVMs, a machine with the Protected Virtualization feature, as |
16 | #include "hw/boards.h" | 33 | indicated by the Ultravisor Call facility (stfle bit 158), is |
17 | #include "sysemu/sysemu.h" | 34 | required. The Ultravisor needs to be initialized at boot by setting |
18 | -#include "sysemu/device_tree.h" | 35 | -`prot_virt=1` on the host's kernel command line. |
19 | #include "qemu/error-report.h" | 36 | +``prot_virt=1`` on the host's kernel command line. |
20 | #include "sysemu/qtest.h" | 37 | |
21 | -#include "net/net.h" | 38 | Running PVMs requires using the KVM hypervisor. |
22 | 39 | ||
23 | typedef struct { | 40 | -If those requirements are met, the capability `KVM_CAP_S390_PROTECTED` |
24 | FslIMX7State soc; | 41 | +If those requirements are met, the capability ``KVM_CAP_S390_PROTECTED`` |
42 | will indicate that KVM can support PVMs on that LPAR. | ||
43 | |||
44 | |||
45 | @@ -XXX,XX +XXX,XX @@ Running a Protected Virtual Machine | ||
46 | ----------------------------------- | ||
47 | |||
48 | To run a PVM you will need to select a CPU model which includes the | ||
49 | -`Unpack facility` (stfle bit 161 represented by the feature | ||
50 | -`unpack`/`S390_FEAT_UNPACK`), and add these options to the command line:: | ||
51 | +``Unpack facility`` (stfle bit 161 represented by the feature | ||
52 | +``unpack``/``S390_FEAT_UNPACK``), and add these options to the command line:: | ||
53 | |||
54 | -object s390-pv-guest,id=pv0 \ | ||
55 | -machine confidential-guest-support=pv0 | ||
56 | |||
57 | Adding these options will: | ||
58 | |||
59 | -* Ensure the `unpack` facility is available | ||
60 | +* Ensure the ``unpack`` facility is available | ||
61 | * Enable the IOMMU by default for all I/O devices | ||
62 | * Initialize the PV mechanism | ||
63 | |||
64 | @@ -XXX,XX +XXX,XX @@ from the disk boot. This memory layout includes the encrypted | ||
65 | components (kernel, initrd, cmdline), the stage3a loader and | ||
66 | metadata. In case this boot method is used, the command line | ||
67 | options -initrd and -cmdline are ineffective. The preparation of a PVM | ||
68 | -image is done via the `genprotimg` tool from the s390-tools | ||
69 | +image is done via the ``genprotimg`` tool from the s390-tools | ||
70 | collection. | ||
25 | -- | 71 | -- |
26 | 2.17.1 | 72 | 2.20.1 |
27 | 73 | ||
28 | 74 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | In rST markup, single backticks `like this` represent "interpreted |
---|---|---|---|
2 | 2 | text", which can be handled as a bunch of different things if tagged | |
3 | We've already added the helpers with an SVE patch, all that remains | 3 | with a specific "role": |
4 | is to wire up the aa64 and aa32 translators. Enable the feature | 4 | https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#interpreted-text |
5 | within -cpu max for CONFIG_USER_ONLY. | 5 | (the most common one for us is "reference to a URL, which gets |
6 | 6 | hyperlinked"). | |
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 7 | |
8 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 8 | The default "role" if none is specified is "title_reference", |
9 | Message-id: 20180627043328.11531-36-richard.henderson@linaro.org | 9 | intended for references to book or article titles, and it renders |
10 | into the HTML as <cite>...</cite> (usually comes out as italics). | ||
11 | |||
12 | To format a literal (generally rendered as fixed-width font), | ||
13 | double-backticks are required. | ||
14 | |||
15 | cpu-features.rst consistently uses single backticks when double backticks | ||
16 | are required; correct it. | ||
17 | |||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 18 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
19 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
20 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
21 | Message-id: 20210726142338.31872-8-peter.maydell@linaro.org | ||
11 | --- | 22 | --- |
12 | target/arm/cpu.h | 1 + | 23 | docs/system/arm/cpu-features.rst | 116 +++++++++++++++---------------- |
13 | linux-user/elfload.c | 1 + | 24 | 1 file changed, 58 insertions(+), 58 deletions(-) |
14 | target/arm/cpu.c | 1 + | 25 | |
15 | target/arm/cpu64.c | 1 + | 26 | diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-features.rst |
16 | target/arm/translate-a64.c | 36 +++++++++++++++++++ | ||
17 | target/arm/translate.c | 74 +++++++++++++++++++++++++++----------- | ||
18 | 6 files changed, 93 insertions(+), 21 deletions(-) | ||
19 | |||
20 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
21 | index XXXXXXX..XXXXXXX 100644 | 27 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/target/arm/cpu.h | 28 | --- a/docs/system/arm/cpu-features.rst |
23 | +++ b/target/arm/cpu.h | 29 | +++ b/docs/system/arm/cpu-features.rst |
24 | @@ -XXX,XX +XXX,XX @@ enum arm_features { | 30 | @@ -XXX,XX +XXX,XX @@ is the Performance Monitoring Unit (PMU). CPU types such as the |
25 | ARM_FEATURE_V8_SM4, /* implements SM4 part of v8 Crypto Extensions */ | 31 | Cortex-A15 and the Cortex-A57, which respectively implement Arm |
26 | ARM_FEATURE_V8_ATOMICS, /* ARMv8.1-Atomics feature */ | 32 | architecture reference manuals ARMv7-A and ARMv8-A, may both optionally |
27 | ARM_FEATURE_V8_RDM, /* implements v8.1 simd round multiply */ | 33 | implement PMUs. For example, if a user wants to use a Cortex-A15 without |
28 | + ARM_FEATURE_V8_DOTPROD, /* implements v8.2 simd dot product */ | 34 | -a PMU, then the `-cpu` parameter should contain `pmu=off` on the QEMU |
29 | ARM_FEATURE_V8_FP16, /* implements v8.2 half-precision float */ | 35 | -command line, i.e. `-cpu cortex-a15,pmu=off`. |
30 | ARM_FEATURE_V8_FCMA, /* has complex number part of v8.3 extensions. */ | 36 | +a PMU, then the ``-cpu`` parameter should contain ``pmu=off`` on the QEMU |
31 | ARM_FEATURE_M_MAIN, /* M profile Main Extension */ | 37 | +command line, i.e. ``-cpu cortex-a15,pmu=off``. |
32 | diff --git a/linux-user/elfload.c b/linux-user/elfload.c | 38 | |
33 | index XXXXXXX..XXXXXXX 100644 | 39 | As not all CPU types support all optional CPU features, then whether or |
34 | --- a/linux-user/elfload.c | 40 | not a CPU property exists depends on the CPU type. For example, CPUs |
35 | +++ b/linux-user/elfload.c | 41 | that implement the ARMv8-A architecture reference manual may optionally |
36 | @@ -XXX,XX +XXX,XX @@ static uint32_t get_elf_hwcap(void) | 42 | support the AArch32 CPU feature, which may be enabled by disabling the |
37 | ARM_HWCAP_A64_FPHP | ARM_HWCAP_A64_ASIMDHP); | 43 | -`aarch64` CPU property. A CPU type such as the Cortex-A15, which does |
38 | GET_FEATURE(ARM_FEATURE_V8_ATOMICS, ARM_HWCAP_A64_ATOMICS); | 44 | -not implement ARMv8-A, will not have the `aarch64` CPU property. |
39 | GET_FEATURE(ARM_FEATURE_V8_RDM, ARM_HWCAP_A64_ASIMDRDM); | 45 | +``aarch64`` CPU property. A CPU type such as the Cortex-A15, which does |
40 | + GET_FEATURE(ARM_FEATURE_V8_DOTPROD, ARM_HWCAP_A64_ASIMDDP); | 46 | +not implement ARMv8-A, will not have the ``aarch64`` CPU property. |
41 | GET_FEATURE(ARM_FEATURE_V8_FCMA, ARM_HWCAP_A64_FCMA); | 47 | |
42 | GET_FEATURE(ARM_FEATURE_SVE, ARM_HWCAP_A64_SVE); | 48 | QEMU's support may be limited for some CPU features, only partially |
43 | #undef GET_FEATURE | 49 | supporting the feature or only supporting the feature under certain |
44 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 50 | -configurations. For example, the `aarch64` CPU feature, which, when |
45 | index XXXXXXX..XXXXXXX 100644 | 51 | +configurations. For example, the ``aarch64`` CPU feature, which, when |
46 | --- a/target/arm/cpu.c | 52 | disabled, enables the optional AArch32 CPU feature, is only supported |
47 | +++ b/target/arm/cpu.c | 53 | when using the KVM accelerator and when running on a host CPU type that |
48 | @@ -XXX,XX +XXX,XX @@ static void arm_max_initfn(Object *obj) | 54 | -supports the feature. While `aarch64` currently only works with KVM, |
49 | set_feature(&cpu->env, ARM_FEATURE_V8_PMULL); | 55 | +supports the feature. While ``aarch64`` currently only works with KVM, |
50 | set_feature(&cpu->env, ARM_FEATURE_CRC); | 56 | it could work with TCG. CPU features that are specific to KVM are |
51 | set_feature(&cpu->env, ARM_FEATURE_V8_RDM); | 57 | prefixed with "kvm-" and are described in "KVM VCPU Features". |
52 | + set_feature(&cpu->env, ARM_FEATURE_V8_DOTPROD); | 58 | |
53 | set_feature(&cpu->env, ARM_FEATURE_V8_FCMA); | 59 | @@ -XXX,XX +XXX,XX @@ CPU Feature Probing |
54 | #endif | 60 | =================== |
55 | } | 61 | |
56 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 62 | Determining which CPU features are available and functional for a given |
57 | index XXXXXXX..XXXXXXX 100644 | 63 | -CPU type is possible with the `query-cpu-model-expansion` QMP command. |
58 | --- a/target/arm/cpu64.c | 64 | -Below are some examples where `scripts/qmp/qmp-shell` (see the top comment |
59 | +++ b/target/arm/cpu64.c | 65 | +CPU type is possible with the ``query-cpu-model-expansion`` QMP command. |
60 | @@ -XXX,XX +XXX,XX @@ static void aarch64_max_initfn(Object *obj) | 66 | +Below are some examples where ``scripts/qmp/qmp-shell`` (see the top comment |
61 | set_feature(&cpu->env, ARM_FEATURE_CRC); | 67 | block in the script for usage) is used to issue the QMP commands. |
62 | set_feature(&cpu->env, ARM_FEATURE_V8_ATOMICS); | 68 | |
63 | set_feature(&cpu->env, ARM_FEATURE_V8_RDM); | 69 | -1. Determine which CPU features are available for the `max` CPU type |
64 | + set_feature(&cpu->env, ARM_FEATURE_V8_DOTPROD); | 70 | - (Note, we started QEMU with qemu-system-aarch64, so `max` is |
65 | set_feature(&cpu->env, ARM_FEATURE_V8_FP16); | 71 | +1. Determine which CPU features are available for the ``max`` CPU type |
66 | set_feature(&cpu->env, ARM_FEATURE_V8_FCMA); | 72 | + (Note, we started QEMU with qemu-system-aarch64, so ``max`` is |
67 | set_feature(&cpu->env, ARM_FEATURE_SVE); | 73 | implementing the ARMv8-A reference manual in this case):: |
68 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 74 | |
69 | index XXXXXXX..XXXXXXX 100644 | 75 | (QEMU) query-cpu-model-expansion type=full model={"name":"max"} |
70 | --- a/target/arm/translate-a64.c | 76 | @@ -XXX,XX +XXX,XX @@ block in the script for usage) is used to issue the QMP commands. |
71 | +++ b/target/arm/translate-a64.c | 77 | "sve896": true, "sve1280": true, "sve2048": true |
72 | @@ -XXX,XX +XXX,XX @@ static void gen_gvec_op3(DisasContext *s, bool is_q, int rd, | 78 | }}}} |
73 | vec_full_reg_size(s), gvec_op); | 79 | |
74 | } | 80 | -We see that the `max` CPU type has the `pmu`, `aarch64`, `sve`, and many |
75 | 81 | -`sve<N>` CPU features. We also see that all the CPU features are | |
76 | +/* Expand a 3-operand operation using an out-of-line helper. */ | 82 | -enabled, as they are all `true`. (The `sve<N>` CPU features are all |
77 | +static void gen_gvec_op3_ool(DisasContext *s, bool is_q, int rd, | 83 | +We see that the ``max`` CPU type has the ``pmu``, ``aarch64``, ``sve``, and many |
78 | + int rn, int rm, int data, gen_helper_gvec_3 *fn) | 84 | +``sve<N>`` CPU features. We also see that all the CPU features are |
79 | +{ | 85 | +enabled, as they are all ``true``. (The ``sve<N>`` CPU features are all |
80 | + tcg_gen_gvec_3_ool(vec_full_reg_offset(s, rd), | 86 | optional SVE vector lengths (see "SVE CPU Properties"). While with TCG |
81 | + vec_full_reg_offset(s, rn), | 87 | all SVE vector lengths can be supported, when KVM is in use it's more |
82 | + vec_full_reg_offset(s, rm), | 88 | likely that only a few lengths will be supported, if SVE is supported at |
83 | + is_q ? 16 : 8, vec_full_reg_size(s), data, fn); | 89 | @@ -XXX,XX +XXX,XX @@ all.) |
84 | +} | 90 | "sve896": true, "sve1280": true, "sve2048": true |
85 | + | 91 | }}}} |
86 | /* Expand a 3-operand + env pointer operation using | 92 | |
87 | * an out-of-line helper. | 93 | -We see it worked, as `pmu` is now `false`. |
88 | */ | 94 | +We see it worked, as ``pmu`` is now ``false``. |
89 | @@ -XXX,XX +XXX,XX @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) | 95 | |
90 | } | 96 | -(3) Let's try to disable `aarch64`, which enables the AArch32 CPU feature:: |
91 | feature = ARM_FEATURE_V8_RDM; | 97 | +(3) Let's try to disable ``aarch64``, which enables the AArch32 CPU feature:: |
92 | break; | 98 | |
93 | + case 0x02: /* SDOT (vector) */ | 99 | (QEMU) query-cpu-model-expansion type=full model={"name":"max","props":{"aarch64":false}} |
94 | + case 0x12: /* UDOT (vector) */ | 100 | {"error": { |
95 | + if (size != MO_32) { | 101 | @@ -XXX,XX +XXX,XX @@ We see it worked, as `pmu` is now `false`. |
96 | + unallocated_encoding(s); | 102 | It looks like this feature is limited to a configuration we do not |
97 | + return; | 103 | currently have. |
98 | + } | 104 | |
99 | + feature = ARM_FEATURE_V8_DOTPROD; | 105 | -(4) Let's disable `sve` and see what happens to all the optional SVE |
100 | + break; | 106 | +(4) Let's disable ``sve`` and see what happens to all the optional SVE |
101 | case 0x8: /* FCMLA, #0 */ | 107 | vector lengths:: |
102 | case 0x9: /* FCMLA, #90 */ | 108 | |
103 | case 0xa: /* FCMLA, #180 */ | 109 | (QEMU) query-cpu-model-expansion type=full model={"name":"max","props":{"sve":false}} |
104 | @@ -XXX,XX +XXX,XX @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) | 110 | @@ -XXX,XX +XXX,XX @@ currently have. |
105 | } | 111 | "sve896": false, "sve1280": false, "sve2048": false |
106 | return; | 112 | }}}} |
107 | 113 | ||
108 | + case 0x2: /* SDOT / UDOT */ | 114 | -As expected they are now all `false`. |
109 | + gen_gvec_op3_ool(s, is_q, rd, rn, rm, 0, | 115 | +As expected they are now all ``false``. |
110 | + u ? gen_helper_gvec_udot_b : gen_helper_gvec_sdot_b); | 116 | |
111 | + return; | 117 | (5) Let's try probing CPU features for the Cortex-A15 CPU type:: |
112 | + | 118 | |
113 | case 0x8: /* FCMLA, #0 */ | 119 | (QEMU) query-cpu-model-expansion type=full model={"name":"cortex-a15"} |
114 | case 0x9: /* FCMLA, #90 */ | 120 | {"return": {"model": {"name": "cortex-a15", "props": {"pmu": true}}}} |
115 | case 0xa: /* FCMLA, #180 */ | 121 | |
116 | @@ -XXX,XX +XXX,XX @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) | 122 | -Only the `pmu` CPU feature is available. |
117 | return; | 123 | +Only the ``pmu`` CPU feature is available. |
118 | } | 124 | |
119 | break; | 125 | A note about CPU feature dependencies |
120 | + case 0x0e: /* SDOT */ | 126 | ------------------------------------- |
121 | + case 0x1e: /* UDOT */ | 127 | @@ -XXX,XX +XXX,XX @@ A note about CPU models and KVM |
122 | + if (size != MO_32 || !arm_dc_feature(s, ARM_FEATURE_V8_DOTPROD)) { | 128 | ------------------------------- |
123 | + unallocated_encoding(s); | 129 | |
124 | + return; | 130 | Named CPU models generally do not work with KVM. There are a few cases |
125 | + } | 131 | -that do work, e.g. using the named CPU model `cortex-a57` with KVM on a |
126 | + break; | 132 | -seattle host, but mostly if KVM is enabled the `host` CPU type must be |
127 | case 0x11: /* FCMLA #0 */ | 133 | +that do work, e.g. using the named CPU model ``cortex-a57`` with KVM on a |
128 | case 0x13: /* FCMLA #90 */ | 134 | +seattle host, but mostly if KVM is enabled the ``host`` CPU type must be |
129 | case 0x15: /* FCMLA #180 */ | 135 | used. This means the guest is provided all the same CPU features as the |
130 | @@ -XXX,XX +XXX,XX @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) | 136 | -host CPU type has. And, for this reason, the `host` CPU type should |
131 | } | 137 | +host CPU type has. And, for this reason, the ``host`` CPU type should |
132 | 138 | enable all CPU features that the host has by default. Indeed it's even | |
133 | switch (16 * u + opcode) { | 139 | a bit strange to allow disabling CPU features that the host has when using |
134 | + case 0x0e: /* SDOT */ | 140 | -the `host` CPU type, but in the absence of CPU models it's the best we can |
135 | + case 0x1e: /* UDOT */ | 141 | +the ``host`` CPU type, but in the absence of CPU models it's the best we can |
136 | + gen_gvec_op3_ool(s, is_q, rd, rn, rm, index, | 142 | do if we want to launch guests without all the host's CPU features enabled. |
137 | + u ? gen_helper_gvec_udot_idx_b | 143 | |
138 | + : gen_helper_gvec_sdot_idx_b); | 144 | -Enabling KVM also affects the `query-cpu-model-expansion` QMP command. The |
139 | + return; | 145 | +Enabling KVM also affects the ``query-cpu-model-expansion`` QMP command. The |
140 | case 0x11: /* FCMLA #0 */ | 146 | affect is not only limited to specific features, as pointed out in example |
141 | case 0x13: /* FCMLA #90 */ | 147 | (3) of "CPU Feature Probing", but also to which CPU types may be expanded. |
142 | case 0x15: /* FCMLA #180 */ | 148 | -When KVM is enabled, only the `max`, `host`, and current CPU type may be |
143 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 149 | +When KVM is enabled, only the ``max``, ``host``, and current CPU type may be |
144 | index XXXXXXX..XXXXXXX 100644 | 150 | expanded. This restriction is necessary as it's not possible to know all |
145 | --- a/target/arm/translate.c | 151 | CPU types that may work with KVM, but it does impose a small risk of users |
146 | +++ b/target/arm/translate.c | 152 | experiencing unexpected errors. For example on a seattle, as mentioned |
147 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | 153 | -above, the `cortex-a57` CPU type is also valid when KVM is enabled. |
148 | */ | 154 | -Therefore a user could use the `host` CPU type for the current type, but |
149 | static int disas_neon_insn_3same_ext(DisasContext *s, uint32_t insn) | 155 | -then attempt to query `cortex-a57`, however that query will fail with our |
150 | { | 156 | +above, the ``cortex-a57`` CPU type is also valid when KVM is enabled. |
151 | - gen_helper_gvec_3_ptr *fn_gvec_ptr; | 157 | +Therefore a user could use the ``host`` CPU type for the current type, but |
152 | - int rd, rn, rm, rot, size, opr_sz; | 158 | +then attempt to query ``cortex-a57``, however that query will fail with our |
153 | - TCGv_ptr fpst; | 159 | restrictions. This shouldn't be an issue though as management layers and |
154 | + gen_helper_gvec_3 *fn_gvec = NULL; | 160 | -users have been preferring the `host` CPU type for use with KVM for quite |
155 | + gen_helper_gvec_3_ptr *fn_gvec_ptr = NULL; | 161 | +users have been preferring the ``host`` CPU type for use with KVM for quite |
156 | + int rd, rn, rm, opr_sz; | 162 | some time. Additionally, if the KVM-enabled QEMU instance running on a |
157 | + int data = 0; | 163 | -seattle host is using the `cortex-a57` CPU type, then querying `cortex-a57` |
158 | bool q; | 164 | +seattle host is using the ``cortex-a57`` CPU type, then querying ``cortex-a57`` |
159 | 165 | will work. | |
160 | q = extract32(insn, 6, 1); | 166 | |
161 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_insn_3same_ext(DisasContext *s, uint32_t insn) | 167 | Using CPU Features |
162 | 168 | @@ -XXX,XX +XXX,XX @@ QEMU command line with that CPU type:: | |
163 | if ((insn & 0xfe200f10) == 0xfc200800) { | 169 | $ qemu-system-aarch64 -M virt -cpu max,pmu=off,sve=on,sve128=on,sve256=on |
164 | /* VCMLA -- 1111 110R R.1S .... .... 1000 ...0 .... */ | 170 | |
165 | - size = extract32(insn, 20, 1); | 171 | The example above disables the PMU and enables the first two SVE vector |
166 | - rot = extract32(insn, 23, 2); | 172 | -lengths for the `max` CPU type. Note, the `sve=on` isn't actually |
167 | + int size = extract32(insn, 20, 1); | 173 | -necessary, because, as we observed above with our probe of the `max` CPU |
168 | + data = extract32(insn, 23, 2); /* rot */ | 174 | -type, `sve` is already on by default. Also, based on our probe of |
169 | if (!arm_dc_feature(s, ARM_FEATURE_V8_FCMA) | 175 | +lengths for the ``max`` CPU type. Note, the ``sve=on`` isn't actually |
170 | || (!size && !arm_dc_feature(s, ARM_FEATURE_V8_FP16))) { | 176 | +necessary, because, as we observed above with our probe of the ``max`` CPU |
171 | return 1; | 177 | +type, ``sve`` is already on by default. Also, based on our probe of |
172 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_insn_3same_ext(DisasContext *s, uint32_t insn) | 178 | defaults, it would seem we need to disable many SVE vector lengths, rather |
173 | fn_gvec_ptr = size ? gen_helper_gvec_fcmlas : gen_helper_gvec_fcmlah; | 179 | than only enabling the two we want. This isn't the case, because, as |
174 | } else if ((insn & 0xfea00f10) == 0xfc800800) { | 180 | -disabling many SVE vector lengths would be quite verbose, the `sve<N>` CPU |
175 | /* VCADD -- 1111 110R 1.0S .... .... 1000 ...0 .... */ | 181 | +disabling many SVE vector lengths would be quite verbose, the ``sve<N>`` CPU |
176 | - size = extract32(insn, 20, 1); | 182 | properties have special semantics (see "SVE CPU Property Parsing |
177 | - rot = extract32(insn, 24, 1); | 183 | Semantics"). |
178 | + int size = extract32(insn, 20, 1); | 184 | |
179 | + data = extract32(insn, 24, 1); /* rot */ | 185 | @@ -XXX,XX +XXX,XX @@ TCG VCPU Features |
180 | if (!arm_dc_feature(s, ARM_FEATURE_V8_FCMA) | 186 | TCG VCPU features are CPU features that are specific to TCG. |
181 | || (!size && !arm_dc_feature(s, ARM_FEATURE_V8_FP16))) { | 187 | Below is the list of TCG VCPU features and their descriptions. |
182 | return 1; | 188 | |
183 | } | 189 | - pauth Enable or disable `FEAT_Pauth`, pointer |
184 | fn_gvec_ptr = size ? gen_helper_gvec_fcadds : gen_helper_gvec_fcaddh; | 190 | + pauth Enable or disable ``FEAT_Pauth``, pointer |
185 | + } else if ((insn & 0xfeb00f00) == 0xfc200d00) { | 191 | authentication. By default, the feature is |
186 | + /* V[US]DOT -- 1111 1100 0.10 .... .... 1101 .Q.U .... */ | 192 | - enabled with `-cpu max`. |
187 | + bool u = extract32(insn, 4, 1); | 193 | + enabled with ``-cpu max``. |
188 | + if (!arm_dc_feature(s, ARM_FEATURE_V8_DOTPROD)) { | 194 | |
189 | + return 1; | 195 | - pauth-impdef When `FEAT_Pauth` is enabled, either the |
190 | + } | 196 | + pauth-impdef When ``FEAT_Pauth`` is enabled, either the |
191 | + fn_gvec = u ? gen_helper_gvec_udot_b : gen_helper_gvec_sdot_b; | 197 | *impdef* (Implementation Defined) algorithm |
192 | } else { | 198 | is enabled or the *architected* QARMA algorithm |
193 | return 1; | 199 | is enabled. By default the impdef algorithm |
194 | } | 200 | @@ -XXX,XX +XXX,XX @@ Below is the list of TCG VCPU features and their descriptions. |
195 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_insn_3same_ext(DisasContext *s, uint32_t insn) | 201 | SVE CPU Properties |
196 | } | 202 | ================== |
197 | 203 | ||
198 | opr_sz = (1 + q) * 8; | 204 | -There are two types of SVE CPU properties: `sve` and `sve<N>`. The first |
199 | - fpst = get_fpstatus_ptr(1); | 205 | -is used to enable or disable the entire SVE feature, just as the `pmu` |
200 | - tcg_gen_gvec_3_ptr(vfp_reg_offset(1, rd), | 206 | +There are two types of SVE CPU properties: ``sve`` and ``sve<N>``. The first |
201 | - vfp_reg_offset(1, rn), | 207 | +is used to enable or disable the entire SVE feature, just as the ``pmu`` |
202 | - vfp_reg_offset(1, rm), fpst, | 208 | CPU property completely enables or disables the PMU. The second type |
203 | - opr_sz, opr_sz, rot, fn_gvec_ptr); | 209 | -is used to enable or disable specific vector lengths, where `N` is the |
204 | - tcg_temp_free_ptr(fpst); | 210 | -number of bits of the length. The `sve<N>` CPU properties have special |
205 | + if (fn_gvec_ptr) { | 211 | +is used to enable or disable specific vector lengths, where ``N`` is the |
206 | + TCGv_ptr fpst = get_fpstatus_ptr(1); | 212 | +number of bits of the length. The ``sve<N>`` CPU properties have special |
207 | + tcg_gen_gvec_3_ptr(vfp_reg_offset(1, rd), | 213 | dependencies and constraints, see "SVE CPU Property Dependencies and |
208 | + vfp_reg_offset(1, rn), | 214 | Constraints" below. Additionally, as we want all supported vector lengths |
209 | + vfp_reg_offset(1, rm), fpst, | 215 | to be enabled by default, then, in order to avoid overly verbose command |
210 | + opr_sz, opr_sz, data, fn_gvec_ptr); | 216 | -lines (command lines full of `sve<N>=off`, for all `N` not wanted), we |
211 | + tcg_temp_free_ptr(fpst); | 217 | +lines (command lines full of ``sve<N>=off``, for all ``N`` not wanted), we |
212 | + } else { | 218 | provide the parsing semantics listed in "SVE CPU Property Parsing |
213 | + tcg_gen_gvec_3_ool(vfp_reg_offset(1, rd), | 219 | Semantics". |
214 | + vfp_reg_offset(1, rn), | 220 | |
215 | + vfp_reg_offset(1, rm), | 221 | SVE CPU Property Dependencies and Constraints |
216 | + opr_sz, opr_sz, data, fn_gvec); | 222 | --------------------------------------------- |
217 | + } | 223 | |
218 | return 0; | 224 | - 1) At least one vector length must be enabled when `sve` is enabled. |
219 | } | 225 | + 1) At least one vector length must be enabled when ``sve`` is enabled. |
220 | 226 | ||
221 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_insn_3same_ext(DisasContext *s, uint32_t insn) | 227 | - 2) If a vector length `N` is enabled, then, when KVM is enabled, all |
222 | 228 | + 2) If a vector length ``N`` is enabled, then, when KVM is enabled, all | |
223 | static int disas_neon_insn_2reg_scalar_ext(DisasContext *s, uint32_t insn) | 229 | smaller, host supported vector lengths must also be enabled. If |
224 | { | 230 | KVM is not enabled, then only all the smaller, power-of-two vector |
225 | - gen_helper_gvec_3_ptr *fn_gvec_ptr; | 231 | lengths must be enabled. E.g. with KVM if the host supports all |
226 | + gen_helper_gvec_3 *fn_gvec = NULL; | 232 | - vector lengths up to 512-bits (128, 256, 384, 512), then if `sve512` |
227 | + gen_helper_gvec_3_ptr *fn_gvec_ptr = NULL; | 233 | + vector lengths up to 512-bits (128, 256, 384, 512), then if ``sve512`` |
228 | int rd, rn, rm, opr_sz, data; | 234 | is enabled, the 128-bit vector length, 256-bit vector length, and |
229 | - TCGv_ptr fpst; | 235 | 384-bit vector length must also be enabled. Without KVM, the 384-bit |
230 | bool q; | 236 | vector length would not be required. |
231 | 237 | ||
232 | q = extract32(insn, 6, 1); | 238 | 3) If KVM is enabled then only vector lengths that the host CPU type |
233 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_insn_2reg_scalar_ext(DisasContext *s, uint32_t insn) | 239 | support may be enabled. If SVE is not supported by the host, then |
234 | data = (index << 2) | rot; | 240 | - no `sve*` properties may be enabled. |
235 | fn_gvec_ptr = (size ? gen_helper_gvec_fcmlas_idx | 241 | + no ``sve*`` properties may be enabled. |
236 | : gen_helper_gvec_fcmlah_idx); | 242 | |
237 | + } else if ((insn & 0xffb00f00) == 0xfe200d00) { | 243 | SVE CPU Property Parsing Semantics |
238 | + /* V[US]DOT -- 1111 1110 0.10 .... .... 1101 .Q.U .... */ | 244 | ---------------------------------- |
239 | + int u = extract32(insn, 4, 1); | 245 | |
240 | + if (!arm_dc_feature(s, ARM_FEATURE_V8_DOTPROD)) { | 246 | - 1) If SVE is disabled (`sve=off`), then which SVE vector lengths |
241 | + return 1; | 247 | + 1) If SVE is disabled (``sve=off``), then which SVE vector lengths |
242 | + } | 248 | are enabled or disabled is irrelevant to the guest, as the entire |
243 | + fn_gvec = u ? gen_helper_gvec_udot_idx_b : gen_helper_gvec_sdot_idx_b; | 249 | SVE feature is disabled and that disables all vector lengths for |
244 | + /* rm is just Vm, and index is M. */ | 250 | - the guest. However QEMU will still track any `sve<N>` CPU |
245 | + data = extract32(insn, 5, 1); /* index */ | 251 | - properties provided by the user. If later an `sve=on` is provided, |
246 | + rm = extract32(insn, 0, 4); | 252 | - then the guest will get only the enabled lengths. If no `sve=on` |
247 | } else { | 253 | + the guest. However QEMU will still track any ``sve<N>`` CPU |
248 | return 1; | 254 | + properties provided by the user. If later an ``sve=on`` is provided, |
249 | } | 255 | + then the guest will get only the enabled lengths. If no ``sve=on`` |
250 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_insn_2reg_scalar_ext(DisasContext *s, uint32_t insn) | 256 | is provided and there are explicitly enabled vector lengths, then |
251 | } | 257 | an error is generated. |
252 | 258 | ||
253 | opr_sz = (1 + q) * 8; | 259 | - 2) If SVE is enabled (`sve=on`), but no `sve<N>` CPU properties are |
254 | - fpst = get_fpstatus_ptr(1); | 260 | + 2) If SVE is enabled (``sve=on``), but no ``sve<N>`` CPU properties are |
255 | - tcg_gen_gvec_3_ptr(vfp_reg_offset(1, rd), | 261 | provided, then all supported vector lengths are enabled, which when |
256 | - vfp_reg_offset(1, rn), | 262 | KVM is not in use means including the non-power-of-two lengths, and, |
257 | - vfp_reg_offset(1, rm), fpst, | 263 | when KVM is in use, it means all vector lengths supported by the host |
258 | - opr_sz, opr_sz, data, fn_gvec_ptr); | 264 | @@ -XXX,XX +XXX,XX @@ SVE CPU Property Parsing Semantics |
259 | - tcg_temp_free_ptr(fpst); | 265 | constraint (2) of "SVE CPU Property Dependencies and Constraints"). |
260 | + if (fn_gvec_ptr) { | 266 | |
261 | + TCGv_ptr fpst = get_fpstatus_ptr(1); | 267 | 5) When KVM is enabled, if the host does not support SVE, then an error |
262 | + tcg_gen_gvec_3_ptr(vfp_reg_offset(1, rd), | 268 | - is generated when attempting to enable any `sve*` properties (see |
263 | + vfp_reg_offset(1, rn), | 269 | + is generated when attempting to enable any ``sve*`` properties (see |
264 | + vfp_reg_offset(1, rm), fpst, | 270 | constraint (3) of "SVE CPU Property Dependencies and Constraints"). |
265 | + opr_sz, opr_sz, data, fn_gvec_ptr); | 271 | |
266 | + tcg_temp_free_ptr(fpst); | 272 | 6) When KVM is enabled, if the host does support SVE, then an error is |
267 | + } else { | 273 | @@ -XXX,XX +XXX,XX @@ SVE CPU Property Parsing Semantics |
268 | + tcg_gen_gvec_3_ool(vfp_reg_offset(1, rd), | 274 | by the host (see constraint (3) of "SVE CPU Property Dependencies and |
269 | + vfp_reg_offset(1, rn), | 275 | Constraints"). |
270 | + vfp_reg_offset(1, rm), | 276 | |
271 | + opr_sz, opr_sz, data, fn_gvec); | 277 | - 7) If one or more `sve<N>` CPU properties are set `off`, but no `sve<N>`, |
272 | + } | 278 | - CPU properties are set `on`, then the specified vector lengths are |
273 | return 0; | 279 | + 7) If one or more ``sve<N>`` CPU properties are set ``off``, but no ``sve<N>``, |
274 | } | 280 | + CPU properties are set ``on``, then the specified vector lengths are |
281 | disabled but the default for any unspecified lengths remains enabled. | ||
282 | When KVM is not enabled, disabling a power-of-two vector length also | ||
283 | disables all vector lengths larger than the power-of-two length. | ||
284 | @@ -XXX,XX +XXX,XX @@ SVE CPU Property Parsing Semantics | ||
285 | disables all larger vector lengths (see constraint (2) of "SVE CPU | ||
286 | Property Dependencies and Constraints"). | ||
287 | |||
288 | - 8) If one or more `sve<N>` CPU properties are set to `on`, then they | ||
289 | + 8) If one or more ``sve<N>`` CPU properties are set to ``on``, then they | ||
290 | are enabled and all unspecified lengths default to disabled, except | ||
291 | for the required lengths per constraint (2) of "SVE CPU Property | ||
292 | Dependencies and Constraints", which will even be auto-enabled if | ||
293 | they were not explicitly enabled. | ||
294 | |||
295 | - 9) If SVE was disabled (`sve=off`), allowing all vector lengths to be | ||
296 | + 9) If SVE was disabled (``sve=off``), allowing all vector lengths to be | ||
297 | explicitly disabled (i.e. avoiding the error specified in (3) of | ||
298 | - "SVE CPU Property Parsing Semantics"), then if later an `sve=on` is | ||
299 | + "SVE CPU Property Parsing Semantics"), then if later an ``sve=on`` is | ||
300 | provided an error will be generated. To avoid this error, one must | ||
301 | enable at least one vector length prior to enabling SVE. | ||
302 | |||
303 | @@ -XXX,XX +XXX,XX @@ SVE CPU Property Examples | ||
304 | |||
305 | $ qemu-system-aarch64 -M virt -cpu max,sve=off | ||
306 | |||
307 | - 2) Implicitly enable all vector lengths for the `max` CPU type:: | ||
308 | + 2) Implicitly enable all vector lengths for the ``max`` CPU type:: | ||
309 | |||
310 | $ qemu-system-aarch64 -M virt -cpu max | ||
311 | |||
312 | 3) When KVM is enabled, implicitly enable all host CPU supported vector | ||
313 | - lengths with the `host` CPU type:: | ||
314 | + lengths with the ``host`` CPU type:: | ||
315 | |||
316 | $ qemu-system-aarch64 -M virt,accel=kvm -cpu host | ||
275 | 317 | ||
276 | -- | 318 | -- |
277 | 2.17.1 | 319 | 2.20.1 |
278 | 320 | ||
279 | 321 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | In rST markup, single backticks `like this` represent "interpreted |
---|---|---|---|
2 | text", which can be handled as a bunch of different things if tagged | ||
3 | with a specific "role": | ||
4 | https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#interpreted-text | ||
5 | (the most common one for us is "reference to a URL, which gets | ||
6 | hyperlinked"). | ||
2 | 7 | ||
3 | Use error_report() + exit() instead of error_setg(&error_fatal), | 8 | The default "role" if none is specified is "title_reference", |
4 | as suggested by the "qapi/error.h" documentation: | 9 | intended for references to book or article titles, and it renders |
10 | into the HTML as <cite>...</cite> (usually comes out as italics). | ||
5 | 11 | ||
6 | Please don't error_setg(&error_fatal, ...), use error_report() and | 12 | This commit fixes various places in the manual which were |
7 | exit(), because that's more obvious. | 13 | using single backticks when double backticks (for literal text) |
14 | were intended, and covers those files where only one or two | ||
15 | instances of these errors were made. | ||
8 | 16 | ||
9 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
10 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
11 | Reviewed-by: Markus Armbruster <armbru@redhat.com> | ||
12 | Reviewed-by: David Gibson <david@gibson.dropbear.id.au> | ||
13 | Message-id: 20180625165749.3910-4-f4bug@amsat.org | ||
14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 17 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
18 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
15 | --- | 19 | --- |
16 | device_tree.c | 23 +++++++++++++---------- | 20 | docs/about/index.rst | 2 +- |
17 | 1 file changed, 13 insertions(+), 10 deletions(-) | 21 | docs/interop/live-block-operations.rst | 2 +- |
22 | docs/system/arm/nuvoton.rst | 2 +- | ||
23 | docs/system/arm/sbsa.rst | 4 ++-- | ||
24 | docs/system/arm/virt.rst | 2 +- | ||
25 | docs/system/cpu-hotplug.rst | 2 +- | ||
26 | docs/system/guest-loader.rst | 6 +++--- | ||
27 | docs/system/ppc/powernv.rst | 8 ++++---- | ||
28 | docs/system/riscv/microchip-icicle-kit.rst | 2 +- | ||
29 | docs/system/riscv/virt.rst | 2 +- | ||
30 | 10 files changed, 16 insertions(+), 16 deletions(-) | ||
18 | 31 | ||
19 | diff --git a/device_tree.c b/device_tree.c | 32 | diff --git a/docs/about/index.rst b/docs/about/index.rst |
20 | index XXXXXXX..XXXXXXX 100644 | 33 | index XXXXXXX..XXXXXXX 100644 |
21 | --- a/device_tree.c | 34 | --- a/docs/about/index.rst |
22 | +++ b/device_tree.c | 35 | +++ b/docs/about/index.rst |
23 | @@ -XXX,XX +XXX,XX @@ static void read_fstree(void *fdt, const char *dirname) | 36 | @@ -XXX,XX +XXX,XX @@ where QEMU can launch processes compiled for one CPU on another CPU. |
24 | const char *parent_node; | 37 | In this mode the CPU is always emulated. |
25 | 38 | ||
26 | if (strstr(dirname, root_dir) != dirname) { | 39 | QEMU also provides a number of standalone commandline utilities, |
27 | - error_setg(&error_fatal, "%s: %s must be searched within %s", | 40 | -such as the `qemu-img` disk image utility that allows you to create, |
28 | - __func__, dirname, root_dir); | 41 | +such as the ``qemu-img`` disk image utility that allows you to create, |
29 | + error_report("%s: %s must be searched within %s", | 42 | convert and modify disk images. |
30 | + __func__, dirname, root_dir); | 43 | |
31 | + exit(1); | 44 | .. toctree:: |
32 | } | 45 | diff --git a/docs/interop/live-block-operations.rst b/docs/interop/live-block-operations.rst |
33 | parent_node = &dirname[strlen(SYSFS_DT_BASEDIR)]; | 46 | index XXXXXXX..XXXXXXX 100644 |
34 | 47 | --- a/docs/interop/live-block-operations.rst | |
35 | d = opendir(dirname); | 48 | +++ b/docs/interop/live-block-operations.rst |
36 | if (!d) { | 49 | @@ -XXX,XX +XXX,XX @@ the content of image [D]. |
37 | - error_setg(&error_fatal, "%s cannot open %s", __func__, dirname); | ||
38 | - return; | ||
39 | + error_report("%s cannot open %s", __func__, dirname); | ||
40 | + exit(1); | ||
41 | } | ||
42 | |||
43 | while ((de = readdir(d)) != NULL) { | ||
44 | @@ -XXX,XX +XXX,XX @@ static void read_fstree(void *fdt, const char *dirname) | ||
45 | tmpnam = g_strdup_printf("%s/%s", dirname, de->d_name); | ||
46 | |||
47 | if (lstat(tmpnam, &st) < 0) { | ||
48 | - error_setg(&error_fatal, "%s cannot lstat %s", __func__, tmpnam); | ||
49 | + error_report("%s cannot lstat %s", __func__, tmpnam); | ||
50 | + exit(1); | ||
51 | } | 50 | } |
52 | 51 | ||
53 | if (S_ISREG(st.st_mode)) { | 52 | (6) [On *destination* QEMU] Finally, resume the guest vCPUs by issuing the |
54 | @@ -XXX,XX +XXX,XX @@ static void read_fstree(void *fdt, const char *dirname) | 53 | - QMP command `cont`:: |
55 | gsize len; | 54 | + QMP command ``cont``:: |
56 | 55 | ||
57 | if (!g_file_get_contents(tmpnam, &val, &len, NULL)) { | 56 | (QEMU) cont |
58 | - error_setg(&error_fatal, "%s not able to extract info from %s", | 57 | { |
59 | - __func__, tmpnam); | 58 | diff --git a/docs/system/arm/nuvoton.rst b/docs/system/arm/nuvoton.rst |
60 | + error_report("%s not able to extract info from %s", | 59 | index XXXXXXX..XXXXXXX 100644 |
61 | + __func__, tmpnam); | 60 | --- a/docs/system/arm/nuvoton.rst |
62 | + exit(1); | 61 | +++ b/docs/system/arm/nuvoton.rst |
63 | } | 62 | @@ -XXX,XX +XXX,XX @@ Boot options |
64 | 63 | ------------ | |
65 | if (strlen(parent_node) > 0) { | 64 | |
66 | @@ -XXX,XX +XXX,XX @@ void *load_device_tree_from_sysfs(void) | 65 | The Nuvoton machines can boot from an OpenBMC firmware image, or directly into |
67 | host_fdt = create_device_tree(&host_fdt_size); | 66 | -a kernel using the ``-kernel`` option. OpenBMC images for `quanta-gsj` and |
68 | read_fstree(host_fdt, SYSFS_DT_BASEDIR); | 67 | +a kernel using the ``-kernel`` option. OpenBMC images for ``quanta-gsj`` and |
69 | if (fdt_check_header(host_fdt)) { | 68 | possibly others can be downloaded from the OpenPOWER jenkins : |
70 | - error_setg(&error_fatal, | 69 | |
71 | - "%s host device tree extracted into memory is invalid", | 70 | https://openpower.xyz/ |
72 | - __func__); | 71 | diff --git a/docs/system/arm/sbsa.rst b/docs/system/arm/sbsa.rst |
73 | + error_report("%s host device tree extracted into memory is invalid", | 72 | index XXXXXXX..XXXXXXX 100644 |
74 | + __func__); | 73 | --- a/docs/system/arm/sbsa.rst |
75 | + exit(1); | 74 | +++ b/docs/system/arm/sbsa.rst |
76 | } | 75 | @@ -XXX,XX +XXX,XX @@ |
77 | return host_fdt; | 76 | Arm Server Base System Architecture Reference board (``sbsa-ref``) |
78 | } | 77 | ================================================================== |
78 | |||
79 | -While the `virt` board is a generic board platform that doesn't match | ||
80 | -any real hardware the `sbsa-ref` board intends to look like real | ||
81 | +While the ``virt`` board is a generic board platform that doesn't match | ||
82 | +any real hardware the ``sbsa-ref`` board intends to look like real | ||
83 | hardware. The `Server Base System Architecture | ||
84 | <https://developer.arm.com/documentation/den0029/latest>`_ defines a | ||
85 | minimum base line of hardware support and importantly how the firmware | ||
86 | diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst | ||
87 | index XXXXXXX..XXXXXXX 100644 | ||
88 | --- a/docs/system/arm/virt.rst | ||
89 | +++ b/docs/system/arm/virt.rst | ||
90 | @@ -XXX,XX +XXX,XX @@ | ||
91 | 'virt' generic virtual platform (``virt``) | ||
92 | ========================================== | ||
93 | |||
94 | -The `virt` board is a platform which does not correspond to any | ||
95 | +The ``virt`` board is a platform which does not correspond to any | ||
96 | real hardware; it is designed for use in virtual machines. | ||
97 | It is the recommended board type if you simply want to run | ||
98 | a guest such as Linux and do not care about reproducing the | ||
99 | diff --git a/docs/system/cpu-hotplug.rst b/docs/system/cpu-hotplug.rst | ||
100 | index XXXXXXX..XXXXXXX 100644 | ||
101 | --- a/docs/system/cpu-hotplug.rst | ||
102 | +++ b/docs/system/cpu-hotplug.rst | ||
103 | @@ -XXX,XX +XXX,XX @@ vCPU hotplug | ||
104 | } | ||
105 | (QEMU) | ||
106 | |||
107 | -(5) Optionally, run QMP `query-cpus-fast` for some details about the | ||
108 | +(5) Optionally, run QMP ``query-cpus-fast`` for some details about the | ||
109 | vCPUs:: | ||
110 | |||
111 | (QEMU) query-cpus-fast | ||
112 | diff --git a/docs/system/guest-loader.rst b/docs/system/guest-loader.rst | ||
113 | index XXXXXXX..XXXXXXX 100644 | ||
114 | --- a/docs/system/guest-loader.rst | ||
115 | +++ b/docs/system/guest-loader.rst | ||
116 | @@ -XXX,XX +XXX,XX @@ | ||
117 | Guest Loader | ||
118 | ------------ | ||
119 | |||
120 | -The guest loader is similar to the `generic-loader` although it is | ||
121 | +The guest loader is similar to the ``generic-loader`` although it is | ||
122 | aimed at a particular use case of loading hypervisor guests. This is | ||
123 | useful for debugging hypervisors without having to jump through the | ||
124 | hoops of firmware and boot-loaders. | ||
125 | @@ -XXX,XX +XXX,XX @@ multi-boot capability. A typical example would look like: | ||
126 | In the above example the Xen hypervisor is loaded by the -kernel | ||
127 | parameter and passed it's boot arguments via -append. The Dom0 guest | ||
128 | is loaded into the areas of memory. Each blob will get | ||
129 | -`/chosen/module@<addr>` entry in the FDT to indicate it's location and | ||
130 | +``/chosen/module@<addr>`` entry in the FDT to indicate it's location and | ||
131 | size. Additional information can be passed with by using additional | ||
132 | arguments. | ||
133 | |||
134 | Currently the only supported machines which use FDT data to boot are | ||
135 | -the ARM and RiscV `virt` machines. | ||
136 | +the ARM and RiscV ``virt`` machines. | ||
137 | |||
138 | Arguments | ||
139 | ^^^^^^^^^ | ||
140 | diff --git a/docs/system/ppc/powernv.rst b/docs/system/ppc/powernv.rst | ||
141 | index XXXXXXX..XXXXXXX 100644 | ||
142 | --- a/docs/system/ppc/powernv.rst | ||
143 | +++ b/docs/system/ppc/powernv.rst | ||
144 | @@ -XXX,XX +XXX,XX @@ Firmware | ||
145 | -------- | ||
146 | |||
147 | The OPAL firmware (OpenPower Abstraction Layer) for OpenPower systems | ||
148 | -includes the runtime services `skiboot` and the bootloader kernel and | ||
149 | -initramfs `skiroot`. Source code can be found on GitHub: | ||
150 | +includes the runtime services ``skiboot`` and the bootloader kernel and | ||
151 | +initramfs ``skiroot``. Source code can be found on GitHub: | ||
152 | |||
153 | https://github.com/open-power. | ||
154 | |||
155 | -Prebuilt images of `skiboot` and `skiboot` are made available on the `OpenPOWER <https://openpower.xyz/job/openpower/job/openpower-op-build/>`__ site. To boot a POWER9 machine, use the `witherspoon <https://openpower.xyz/job/openpower/job/openpower-op-build/label=slave,target=witherspoon/lastSuccessfulBuild/>`__ images. For POWER8, use | ||
156 | +Prebuilt images of ``skiboot`` and ``skiboot`` are made available on the `OpenPOWER <https://openpower.xyz/job/openpower/job/openpower-op-build/>`__ site. To boot a POWER9 machine, use the `witherspoon <https://openpower.xyz/job/openpower/job/openpower-op-build/label=slave,target=witherspoon/lastSuccessfulBuild/>`__ images. For POWER8, use | ||
157 | the `palmetto <https://openpower.xyz/job/openpower/job/openpower-op-build/label=slave,target=palmetto/lastSuccessfulBuild/>`__ images. | ||
158 | |||
159 | -QEMU includes a prebuilt image of `skiboot` which is updated when a | ||
160 | +QEMU includes a prebuilt image of ``skiboot`` which is updated when a | ||
161 | more recent version is required by the models. | ||
162 | |||
163 | Boot options | ||
164 | diff --git a/docs/system/riscv/microchip-icicle-kit.rst b/docs/system/riscv/microchip-icicle-kit.rst | ||
165 | index XXXXXXX..XXXXXXX 100644 | ||
166 | --- a/docs/system/riscv/microchip-icicle-kit.rst | ||
167 | +++ b/docs/system/riscv/microchip-icicle-kit.rst | ||
168 | @@ -XXX,XX +XXX,XX @@ Then we can boot the machine by: | ||
169 | -serial chardev:serial1 | ||
170 | |||
171 | With above command line, current terminal session will be used for the first | ||
172 | -serial port. Open another terminal window, and use `minicom` to connect the | ||
173 | +serial port. Open another terminal window, and use ``minicom`` to connect the | ||
174 | second serial port. | ||
175 | |||
176 | .. code-block:: bash | ||
177 | diff --git a/docs/system/riscv/virt.rst b/docs/system/riscv/virt.rst | ||
178 | index XXXXXXX..XXXXXXX 100644 | ||
179 | --- a/docs/system/riscv/virt.rst | ||
180 | +++ b/docs/system/riscv/virt.rst | ||
181 | @@ -XXX,XX +XXX,XX @@ | ||
182 | 'virt' Generic Virtual Platform (``virt``) | ||
183 | ========================================== | ||
184 | |||
185 | -The `virt` board is a platform which does not correspond to any real hardware; | ||
186 | +The ``virt`` board is a platform which does not correspond to any real hardware; | ||
187 | it is designed for use in virtual machines. It is the recommended board type | ||
188 | if you simply want to run a guest such as Linux and do not care about | ||
189 | reproducing the idiosyncrasies and limitations of a particular bit of | ||
79 | -- | 190 | -- |
80 | 2.17.1 | 191 | 2.20.1 |
81 | 192 | ||
82 | 193 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Eric Auger <eric.auger@redhat.com> | ||
2 | 1 | ||
3 | This helper allows to retrieve the paths of nodes whose name | ||
4 | match node-name or node-name@unit-address patterns. | ||
5 | |||
6 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | ||
7 | Message-id: 1530044492-24921-2-git-send-email-eric.auger@redhat.com | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | include/sysemu/device_tree.h | 16 +++++++++++ | ||
12 | device_tree.c | 55 ++++++++++++++++++++++++++++++++++++ | ||
13 | 2 files changed, 71 insertions(+) | ||
14 | |||
15 | diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/include/sysemu/device_tree.h | ||
18 | +++ b/include/sysemu/device_tree.h | ||
19 | @@ -XXX,XX +XXX,XX @@ void *load_device_tree_from_sysfs(void); | ||
20 | char **qemu_fdt_node_path(void *fdt, const char *name, char *compat, | ||
21 | Error **errp); | ||
22 | |||
23 | +/** | ||
24 | + * qemu_fdt_node_unit_path: return the paths of nodes matching a given | ||
25 | + * node-name, ie. node-name and node-name@unit-address | ||
26 | + * @fdt: pointer to the dt blob | ||
27 | + * @name: node name | ||
28 | + * @errp: handle to an error object | ||
29 | + * | ||
30 | + * returns a newly allocated NULL-terminated array of node paths. | ||
31 | + * Use g_strfreev() to free it. If one or more nodes were found, the | ||
32 | + * array contains the path of each node and the last element equals to | ||
33 | + * NULL. If there is no error but no matching node was found, the | ||
34 | + * returned array contains a single element equal to NULL. If an error | ||
35 | + * was encountered when parsing the blob, the function returns NULL | ||
36 | + */ | ||
37 | +char **qemu_fdt_node_unit_path(void *fdt, const char *name, Error **errp); | ||
38 | + | ||
39 | int qemu_fdt_setprop(void *fdt, const char *node_path, | ||
40 | const char *property, const void *val, int size); | ||
41 | int qemu_fdt_setprop_cell(void *fdt, const char *node_path, | ||
42 | diff --git a/device_tree.c b/device_tree.c | ||
43 | index XXXXXXX..XXXXXXX 100644 | ||
44 | --- a/device_tree.c | ||
45 | +++ b/device_tree.c | ||
46 | @@ -XXX,XX +XXX,XX @@ static int findnode_nofail(void *fdt, const char *node_path) | ||
47 | return offset; | ||
48 | } | ||
49 | |||
50 | +char **qemu_fdt_node_unit_path(void *fdt, const char *name, Error **errp) | ||
51 | +{ | ||
52 | + char *prefix = g_strdup_printf("%s@", name); | ||
53 | + unsigned int path_len = 16, n = 0; | ||
54 | + GSList *path_list = NULL, *iter; | ||
55 | + const char *iter_name; | ||
56 | + int offset, len, ret; | ||
57 | + char **path_array; | ||
58 | + | ||
59 | + offset = fdt_next_node(fdt, -1, NULL); | ||
60 | + | ||
61 | + while (offset >= 0) { | ||
62 | + iter_name = fdt_get_name(fdt, offset, &len); | ||
63 | + if (!iter_name) { | ||
64 | + offset = len; | ||
65 | + break; | ||
66 | + } | ||
67 | + if (!strcmp(iter_name, name) || g_str_has_prefix(iter_name, prefix)) { | ||
68 | + char *path; | ||
69 | + | ||
70 | + path = g_malloc(path_len); | ||
71 | + while ((ret = fdt_get_path(fdt, offset, path, path_len)) | ||
72 | + == -FDT_ERR_NOSPACE) { | ||
73 | + path_len += 16; | ||
74 | + path = g_realloc(path, path_len); | ||
75 | + } | ||
76 | + path_list = g_slist_prepend(path_list, path); | ||
77 | + n++; | ||
78 | + } | ||
79 | + offset = fdt_next_node(fdt, offset, NULL); | ||
80 | + } | ||
81 | + g_free(prefix); | ||
82 | + | ||
83 | + if (offset < 0 && offset != -FDT_ERR_NOTFOUND) { | ||
84 | + error_setg(errp, "%s: abort parsing dt for %s node units: %s", | ||
85 | + __func__, name, fdt_strerror(offset)); | ||
86 | + for (iter = path_list; iter; iter = iter->next) { | ||
87 | + g_free(iter->data); | ||
88 | + } | ||
89 | + g_slist_free(path_list); | ||
90 | + return NULL; | ||
91 | + } | ||
92 | + | ||
93 | + path_array = g_new(char *, n + 1); | ||
94 | + path_array[n--] = NULL; | ||
95 | + | ||
96 | + for (iter = path_list; iter; iter = iter->next) { | ||
97 | + path_array[n--] = iter->data; | ||
98 | + } | ||
99 | + | ||
100 | + g_slist_free(path_list); | ||
101 | + | ||
102 | + return path_array; | ||
103 | +} | ||
104 | + | ||
105 | char **qemu_fdt_node_path(void *fdt, const char *name, char *compat, | ||
106 | Error **errp) | ||
107 | { | ||
108 | -- | ||
109 | 2.17.1 | ||
110 | |||
111 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Eric Auger <eric.auger@redhat.com> | ||
2 | 1 | ||
3 | When running dtc on the guest /proc/device-tree we get the | ||
4 | following warnings: "Warning (unit_address_vs_reg): Node <name> | ||
5 | has a reg or ranges property, but no unit name", with name: | ||
6 | /intc, /intc/its, /intc/v2m. | ||
7 | |||
8 | Nodes should have a name in the form <name>[@<unit-address>] where | ||
9 | unit-address is the primary address used to access the device, listed | ||
10 | in the node's reg property. This fix seems to make dtc happy. | ||
11 | |||
12 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | ||
13 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
14 | Message-id: 1530044492-24921-3-git-send-email-eric.auger@redhat.com | ||
15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
16 | --- | ||
17 | hw/arm/virt.c | 63 +++++++++++++++++++++++++++++++-------------------- | ||
18 | 1 file changed, 39 insertions(+), 24 deletions(-) | ||
19 | |||
20 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | ||
21 | index XXXXXXX..XXXXXXX 100644 | ||
22 | --- a/hw/arm/virt.c | ||
23 | +++ b/hw/arm/virt.c | ||
24 | @@ -XXX,XX +XXX,XX @@ static void fdt_add_cpu_nodes(const VirtMachineState *vms) | ||
25 | |||
26 | static void fdt_add_its_gic_node(VirtMachineState *vms) | ||
27 | { | ||
28 | + char *nodename; | ||
29 | + | ||
30 | vms->msi_phandle = qemu_fdt_alloc_phandle(vms->fdt); | ||
31 | - qemu_fdt_add_subnode(vms->fdt, "/intc/its"); | ||
32 | - qemu_fdt_setprop_string(vms->fdt, "/intc/its", "compatible", | ||
33 | + nodename = g_strdup_printf("/intc/its@%" PRIx64, | ||
34 | + vms->memmap[VIRT_GIC_ITS].base); | ||
35 | + qemu_fdt_add_subnode(vms->fdt, nodename); | ||
36 | + qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", | ||
37 | "arm,gic-v3-its"); | ||
38 | - qemu_fdt_setprop(vms->fdt, "/intc/its", "msi-controller", NULL, 0); | ||
39 | - qemu_fdt_setprop_sized_cells(vms->fdt, "/intc/its", "reg", | ||
40 | + qemu_fdt_setprop(vms->fdt, nodename, "msi-controller", NULL, 0); | ||
41 | + qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", | ||
42 | 2, vms->memmap[VIRT_GIC_ITS].base, | ||
43 | 2, vms->memmap[VIRT_GIC_ITS].size); | ||
44 | - qemu_fdt_setprop_cell(vms->fdt, "/intc/its", "phandle", vms->msi_phandle); | ||
45 | + qemu_fdt_setprop_cell(vms->fdt, nodename, "phandle", vms->msi_phandle); | ||
46 | + g_free(nodename); | ||
47 | } | ||
48 | |||
49 | static void fdt_add_v2m_gic_node(VirtMachineState *vms) | ||
50 | { | ||
51 | + char *nodename; | ||
52 | + | ||
53 | + nodename = g_strdup_printf("/intc/v2m@%" PRIx64, | ||
54 | + vms->memmap[VIRT_GIC_V2M].base); | ||
55 | vms->msi_phandle = qemu_fdt_alloc_phandle(vms->fdt); | ||
56 | - qemu_fdt_add_subnode(vms->fdt, "/intc/v2m"); | ||
57 | - qemu_fdt_setprop_string(vms->fdt, "/intc/v2m", "compatible", | ||
58 | + qemu_fdt_add_subnode(vms->fdt, nodename); | ||
59 | + qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", | ||
60 | "arm,gic-v2m-frame"); | ||
61 | - qemu_fdt_setprop(vms->fdt, "/intc/v2m", "msi-controller", NULL, 0); | ||
62 | - qemu_fdt_setprop_sized_cells(vms->fdt, "/intc/v2m", "reg", | ||
63 | + qemu_fdt_setprop(vms->fdt, nodename, "msi-controller", NULL, 0); | ||
64 | + qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", | ||
65 | 2, vms->memmap[VIRT_GIC_V2M].base, | ||
66 | 2, vms->memmap[VIRT_GIC_V2M].size); | ||
67 | - qemu_fdt_setprop_cell(vms->fdt, "/intc/v2m", "phandle", vms->msi_phandle); | ||
68 | + qemu_fdt_setprop_cell(vms->fdt, nodename, "phandle", vms->msi_phandle); | ||
69 | + g_free(nodename); | ||
70 | } | ||
71 | |||
72 | static void fdt_add_gic_node(VirtMachineState *vms) | ||
73 | { | ||
74 | + char *nodename; | ||
75 | + | ||
76 | vms->gic_phandle = qemu_fdt_alloc_phandle(vms->fdt); | ||
77 | qemu_fdt_setprop_cell(vms->fdt, "/", "interrupt-parent", vms->gic_phandle); | ||
78 | |||
79 | - qemu_fdt_add_subnode(vms->fdt, "/intc"); | ||
80 | - qemu_fdt_setprop_cell(vms->fdt, "/intc", "#interrupt-cells", 3); | ||
81 | - qemu_fdt_setprop(vms->fdt, "/intc", "interrupt-controller", NULL, 0); | ||
82 | - qemu_fdt_setprop_cell(vms->fdt, "/intc", "#address-cells", 0x2); | ||
83 | - qemu_fdt_setprop_cell(vms->fdt, "/intc", "#size-cells", 0x2); | ||
84 | - qemu_fdt_setprop(vms->fdt, "/intc", "ranges", NULL, 0); | ||
85 | + nodename = g_strdup_printf("/intc@%" PRIx64, | ||
86 | + vms->memmap[VIRT_GIC_DIST].base); | ||
87 | + qemu_fdt_add_subnode(vms->fdt, nodename); | ||
88 | + qemu_fdt_setprop_cell(vms->fdt, nodename, "#interrupt-cells", 3); | ||
89 | + qemu_fdt_setprop(vms->fdt, nodename, "interrupt-controller", NULL, 0); | ||
90 | + qemu_fdt_setprop_cell(vms->fdt, nodename, "#address-cells", 0x2); | ||
91 | + qemu_fdt_setprop_cell(vms->fdt, nodename, "#size-cells", 0x2); | ||
92 | + qemu_fdt_setprop(vms->fdt, nodename, "ranges", NULL, 0); | ||
93 | if (vms->gic_version == 3) { | ||
94 | int nb_redist_regions = virt_gicv3_redist_region_count(vms); | ||
95 | |||
96 | - qemu_fdt_setprop_string(vms->fdt, "/intc", "compatible", | ||
97 | + qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", | ||
98 | "arm,gic-v3"); | ||
99 | |||
100 | - qemu_fdt_setprop_cell(vms->fdt, "/intc", | ||
101 | + qemu_fdt_setprop_cell(vms->fdt, nodename, | ||
102 | "#redistributor-regions", nb_redist_regions); | ||
103 | |||
104 | if (nb_redist_regions == 1) { | ||
105 | - qemu_fdt_setprop_sized_cells(vms->fdt, "/intc", "reg", | ||
106 | + qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", | ||
107 | 2, vms->memmap[VIRT_GIC_DIST].base, | ||
108 | 2, vms->memmap[VIRT_GIC_DIST].size, | ||
109 | 2, vms->memmap[VIRT_GIC_REDIST].base, | ||
110 | 2, vms->memmap[VIRT_GIC_REDIST].size); | ||
111 | } else { | ||
112 | - qemu_fdt_setprop_sized_cells(vms->fdt, "/intc", "reg", | ||
113 | + qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", | ||
114 | 2, vms->memmap[VIRT_GIC_DIST].base, | ||
115 | 2, vms->memmap[VIRT_GIC_DIST].size, | ||
116 | 2, vms->memmap[VIRT_GIC_REDIST].base, | ||
117 | @@ -XXX,XX +XXX,XX @@ static void fdt_add_gic_node(VirtMachineState *vms) | ||
118 | } | ||
119 | |||
120 | if (vms->virt) { | ||
121 | - qemu_fdt_setprop_cells(vms->fdt, "/intc", "interrupts", | ||
122 | + qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts", | ||
123 | GIC_FDT_IRQ_TYPE_PPI, ARCH_GICV3_MAINT_IRQ, | ||
124 | GIC_FDT_IRQ_FLAGS_LEVEL_HI); | ||
125 | } | ||
126 | } else { | ||
127 | /* 'cortex-a15-gic' means 'GIC v2' */ | ||
128 | - qemu_fdt_setprop_string(vms->fdt, "/intc", "compatible", | ||
129 | + qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", | ||
130 | "arm,cortex-a15-gic"); | ||
131 | - qemu_fdt_setprop_sized_cells(vms->fdt, "/intc", "reg", | ||
132 | + qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", | ||
133 | 2, vms->memmap[VIRT_GIC_DIST].base, | ||
134 | 2, vms->memmap[VIRT_GIC_DIST].size, | ||
135 | 2, vms->memmap[VIRT_GIC_CPU].base, | ||
136 | 2, vms->memmap[VIRT_GIC_CPU].size); | ||
137 | } | ||
138 | |||
139 | - qemu_fdt_setprop_cell(vms->fdt, "/intc", "phandle", vms->gic_phandle); | ||
140 | + qemu_fdt_setprop_cell(vms->fdt, nodename, "phandle", vms->gic_phandle); | ||
141 | + g_free(nodename); | ||
142 | } | ||
143 | |||
144 | static void fdt_add_pmu_nodes(const VirtMachineState *vms) | ||
145 | -- | ||
146 | 2.17.1 | ||
147 | |||
148 | diff view generated by jsdifflib |
1 | From: Jean-Christophe Dubois <jcd@tribudubois.net> | 1 | The section describing the removed feature "-usbdevice ccid" had a |
---|---|---|---|
2 | typo so the markup started with single backtick and ended with double | ||
3 | backtick; fix it. | ||
2 | 4 | ||
3 | Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net> | ||
4 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
8 | Message-id: 20210726142338.31872-10-peter.maydell@linaro.org | ||
6 | --- | 9 | --- |
7 | hw/arm/fsl-imx7.c | 2 +- | 10 | docs/about/removed-features.rst | 2 +- |
8 | 1 file changed, 1 insertion(+), 1 deletion(-) | 11 | 1 file changed, 1 insertion(+), 1 deletion(-) |
9 | 12 | ||
10 | diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c | 13 | diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst |
11 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
12 | --- a/hw/arm/fsl-imx7.c | 15 | --- a/docs/about/removed-features.rst |
13 | +++ b/hw/arm/fsl-imx7.c | 16 | +++ b/docs/about/removed-features.rst |
14 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp) | 17 | @@ -XXX,XX +XXX,XX @@ devices. Drives the board doesn't pick up can no longer be used with |
15 | /* | 18 | ''''''''''''''''''''''''''''''''''''' |
16 | * SRC | 19 | |
17 | */ | 20 | This option was undocumented and not used in the field. |
18 | - create_unimplemented_device("sdma", FSL_IMX7_SRC_ADDR, FSL_IMX7_SRC_SIZE); | 21 | -Use `-device usb-ccid`` instead. |
19 | + create_unimplemented_device("src", FSL_IMX7_SRC_ADDR, FSL_IMX7_SRC_SIZE); | 22 | +Use ``-device usb-ccid`` instead. |
20 | 23 | ||
21 | /* | 24 | RISC-V firmware not booted by default (removed in 5.1) |
22 | * Watchdog | 25 | '''''''''''''''''''''''''''''''''''''''''''''''''''''' |
23 | -- | 26 | -- |
24 | 2.17.1 | 27 | 2.20.1 |
25 | 28 | ||
26 | 29 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | The documentation of the posix_acl option has a stray backtick |
---|---|---|---|
2 | at the end of the text (which is rendered literally into the HTML). | ||
3 | Delete it. | ||
2 | 4 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
5 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
6 | Message-id: 20180627043328.11531-14-richard.henderson@linaro.org | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
8 | Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com> | ||
9 | Message-id: 20210726142338.31872-11-peter.maydell@linaro.org | ||
8 | --- | 10 | --- |
9 | target/arm/helper-sve.h | 67 +++++++++++++++++++++++++ | 11 | docs/tools/virtiofsd.rst | 2 +- |
10 | target/arm/sve_helper.c | 77 ++++++++++++++++++++++++++++ | 12 | 1 file changed, 1 insertion(+), 1 deletion(-) |
11 | target/arm/translate-sve.c | 100 +++++++++++++++++++++++++++++++++++++ | ||
12 | target/arm/sve.decode | 57 +++++++++++++++++++++ | ||
13 | 4 files changed, 301 insertions(+) | ||
14 | 13 | ||
15 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | 14 | diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst |
16 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/helper-sve.h | 16 | --- a/docs/tools/virtiofsd.rst |
18 | +++ b/target/arm/helper-sve.h | 17 | +++ b/docs/tools/virtiofsd.rst |
19 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_4(sve_st1hd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | 18 | @@ -XXX,XX +XXX,XX @@ Options |
20 | 19 | default is ``no_xattr``. | |
21 | DEF_HELPER_FLAGS_4(sve_st1sd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | 20 | |
22 | 21 | * posix_acl|no_posix_acl - | |
23 | +DEF_HELPER_FLAGS_6(sve_ldbsu_zsu, TCG_CALL_NO_WG, | 22 | - Enable/disable posix acl support. Posix ACLs are disabled by default`. |
24 | + void, env, ptr, ptr, ptr, tl, i32) | 23 | + Enable/disable posix acl support. Posix ACLs are disabled by default. |
25 | +DEF_HELPER_FLAGS_6(sve_ldhsu_zsu, TCG_CALL_NO_WG, | 24 | |
26 | + void, env, ptr, ptr, ptr, tl, i32) | 25 | .. option:: --socket-path=PATH |
27 | +DEF_HELPER_FLAGS_6(sve_ldssu_zsu, TCG_CALL_NO_WG, | ||
28 | + void, env, ptr, ptr, ptr, tl, i32) | ||
29 | +DEF_HELPER_FLAGS_6(sve_ldbss_zsu, TCG_CALL_NO_WG, | ||
30 | + void, env, ptr, ptr, ptr, tl, i32) | ||
31 | +DEF_HELPER_FLAGS_6(sve_ldhss_zsu, TCG_CALL_NO_WG, | ||
32 | + void, env, ptr, ptr, ptr, tl, i32) | ||
33 | + | ||
34 | +DEF_HELPER_FLAGS_6(sve_ldbsu_zss, TCG_CALL_NO_WG, | ||
35 | + void, env, ptr, ptr, ptr, tl, i32) | ||
36 | +DEF_HELPER_FLAGS_6(sve_ldhsu_zss, TCG_CALL_NO_WG, | ||
37 | + void, env, ptr, ptr, ptr, tl, i32) | ||
38 | +DEF_HELPER_FLAGS_6(sve_ldssu_zss, TCG_CALL_NO_WG, | ||
39 | + void, env, ptr, ptr, ptr, tl, i32) | ||
40 | +DEF_HELPER_FLAGS_6(sve_ldbss_zss, TCG_CALL_NO_WG, | ||
41 | + void, env, ptr, ptr, ptr, tl, i32) | ||
42 | +DEF_HELPER_FLAGS_6(sve_ldhss_zss, TCG_CALL_NO_WG, | ||
43 | + void, env, ptr, ptr, ptr, tl, i32) | ||
44 | + | ||
45 | +DEF_HELPER_FLAGS_6(sve_ldbdu_zsu, TCG_CALL_NO_WG, | ||
46 | + void, env, ptr, ptr, ptr, tl, i32) | ||
47 | +DEF_HELPER_FLAGS_6(sve_ldhdu_zsu, TCG_CALL_NO_WG, | ||
48 | + void, env, ptr, ptr, ptr, tl, i32) | ||
49 | +DEF_HELPER_FLAGS_6(sve_ldsdu_zsu, TCG_CALL_NO_WG, | ||
50 | + void, env, ptr, ptr, ptr, tl, i32) | ||
51 | +DEF_HELPER_FLAGS_6(sve_ldddu_zsu, TCG_CALL_NO_WG, | ||
52 | + void, env, ptr, ptr, ptr, tl, i32) | ||
53 | +DEF_HELPER_FLAGS_6(sve_ldbds_zsu, TCG_CALL_NO_WG, | ||
54 | + void, env, ptr, ptr, ptr, tl, i32) | ||
55 | +DEF_HELPER_FLAGS_6(sve_ldhds_zsu, TCG_CALL_NO_WG, | ||
56 | + void, env, ptr, ptr, ptr, tl, i32) | ||
57 | +DEF_HELPER_FLAGS_6(sve_ldsds_zsu, TCG_CALL_NO_WG, | ||
58 | + void, env, ptr, ptr, ptr, tl, i32) | ||
59 | + | ||
60 | +DEF_HELPER_FLAGS_6(sve_ldbdu_zss, TCG_CALL_NO_WG, | ||
61 | + void, env, ptr, ptr, ptr, tl, i32) | ||
62 | +DEF_HELPER_FLAGS_6(sve_ldhdu_zss, TCG_CALL_NO_WG, | ||
63 | + void, env, ptr, ptr, ptr, tl, i32) | ||
64 | +DEF_HELPER_FLAGS_6(sve_ldsdu_zss, TCG_CALL_NO_WG, | ||
65 | + void, env, ptr, ptr, ptr, tl, i32) | ||
66 | +DEF_HELPER_FLAGS_6(sve_ldddu_zss, TCG_CALL_NO_WG, | ||
67 | + void, env, ptr, ptr, ptr, tl, i32) | ||
68 | +DEF_HELPER_FLAGS_6(sve_ldbds_zss, TCG_CALL_NO_WG, | ||
69 | + void, env, ptr, ptr, ptr, tl, i32) | ||
70 | +DEF_HELPER_FLAGS_6(sve_ldhds_zss, TCG_CALL_NO_WG, | ||
71 | + void, env, ptr, ptr, ptr, tl, i32) | ||
72 | +DEF_HELPER_FLAGS_6(sve_ldsds_zss, TCG_CALL_NO_WG, | ||
73 | + void, env, ptr, ptr, ptr, tl, i32) | ||
74 | + | ||
75 | +DEF_HELPER_FLAGS_6(sve_ldbdu_zd, TCG_CALL_NO_WG, | ||
76 | + void, env, ptr, ptr, ptr, tl, i32) | ||
77 | +DEF_HELPER_FLAGS_6(sve_ldhdu_zd, TCG_CALL_NO_WG, | ||
78 | + void, env, ptr, ptr, ptr, tl, i32) | ||
79 | +DEF_HELPER_FLAGS_6(sve_ldsdu_zd, TCG_CALL_NO_WG, | ||
80 | + void, env, ptr, ptr, ptr, tl, i32) | ||
81 | +DEF_HELPER_FLAGS_6(sve_ldddu_zd, TCG_CALL_NO_WG, | ||
82 | + void, env, ptr, ptr, ptr, tl, i32) | ||
83 | +DEF_HELPER_FLAGS_6(sve_ldbds_zd, TCG_CALL_NO_WG, | ||
84 | + void, env, ptr, ptr, ptr, tl, i32) | ||
85 | +DEF_HELPER_FLAGS_6(sve_ldhds_zd, TCG_CALL_NO_WG, | ||
86 | + void, env, ptr, ptr, ptr, tl, i32) | ||
87 | +DEF_HELPER_FLAGS_6(sve_ldsds_zd, TCG_CALL_NO_WG, | ||
88 | + void, env, ptr, ptr, ptr, tl, i32) | ||
89 | + | ||
90 | DEF_HELPER_FLAGS_6(sve_stbs_zsu, TCG_CALL_NO_WG, | ||
91 | void, env, ptr, ptr, ptr, tl, i32) | ||
92 | DEF_HELPER_FLAGS_6(sve_sths_zsu, TCG_CALL_NO_WG, | ||
93 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
94 | index XXXXXXX..XXXXXXX 100644 | ||
95 | --- a/target/arm/sve_helper.c | ||
96 | +++ b/target/arm/sve_helper.c | ||
97 | @@ -XXX,XX +XXX,XX @@ void HELPER(sve_st4dd_r)(CPUARMState *env, void *vg, | ||
98 | } | ||
99 | } | ||
100 | |||
101 | +/* Loads with a vector index. */ | ||
102 | + | ||
103 | +#define DO_LD1_ZPZ_S(NAME, TYPEI, TYPEM, FN) \ | ||
104 | +void HELPER(NAME)(CPUARMState *env, void *vd, void *vg, void *vm, \ | ||
105 | + target_ulong base, uint32_t desc) \ | ||
106 | +{ \ | ||
107 | + intptr_t i, oprsz = simd_oprsz(desc); \ | ||
108 | + unsigned scale = simd_data(desc); \ | ||
109 | + uintptr_t ra = GETPC(); \ | ||
110 | + for (i = 0; i < oprsz; i++) { \ | ||
111 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ | ||
112 | + do { \ | ||
113 | + TYPEM m = 0; \ | ||
114 | + if (pg & 1) { \ | ||
115 | + target_ulong off = *(TYPEI *)(vm + H1_4(i)); \ | ||
116 | + m = FN(env, base + (off << scale), ra); \ | ||
117 | + } \ | ||
118 | + *(uint32_t *)(vd + H1_4(i)) = m; \ | ||
119 | + i += 4, pg >>= 4; \ | ||
120 | + } while (i & 15); \ | ||
121 | + } \ | ||
122 | +} | ||
123 | + | ||
124 | +#define DO_LD1_ZPZ_D(NAME, TYPEI, TYPEM, FN) \ | ||
125 | +void HELPER(NAME)(CPUARMState *env, void *vd, void *vg, void *vm, \ | ||
126 | + target_ulong base, uint32_t desc) \ | ||
127 | +{ \ | ||
128 | + intptr_t i, oprsz = simd_oprsz(desc) / 8; \ | ||
129 | + unsigned scale = simd_data(desc); \ | ||
130 | + uintptr_t ra = GETPC(); \ | ||
131 | + uint64_t *d = vd, *m = vm; uint8_t *pg = vg; \ | ||
132 | + for (i = 0; i < oprsz; i++) { \ | ||
133 | + TYPEM mm = 0; \ | ||
134 | + if (pg[H1(i)] & 1) { \ | ||
135 | + target_ulong off = (TYPEI)m[i]; \ | ||
136 | + mm = FN(env, base + (off << scale), ra); \ | ||
137 | + } \ | ||
138 | + d[i] = mm; \ | ||
139 | + } \ | ||
140 | +} | ||
141 | + | ||
142 | +DO_LD1_ZPZ_S(sve_ldbsu_zsu, uint32_t, uint8_t, cpu_ldub_data_ra) | ||
143 | +DO_LD1_ZPZ_S(sve_ldhsu_zsu, uint32_t, uint16_t, cpu_lduw_data_ra) | ||
144 | +DO_LD1_ZPZ_S(sve_ldssu_zsu, uint32_t, uint32_t, cpu_ldl_data_ra) | ||
145 | +DO_LD1_ZPZ_S(sve_ldbss_zsu, uint32_t, int8_t, cpu_ldub_data_ra) | ||
146 | +DO_LD1_ZPZ_S(sve_ldhss_zsu, uint32_t, int16_t, cpu_lduw_data_ra) | ||
147 | + | ||
148 | +DO_LD1_ZPZ_S(sve_ldbsu_zss, int32_t, uint8_t, cpu_ldub_data_ra) | ||
149 | +DO_LD1_ZPZ_S(sve_ldhsu_zss, int32_t, uint16_t, cpu_lduw_data_ra) | ||
150 | +DO_LD1_ZPZ_S(sve_ldssu_zss, int32_t, uint32_t, cpu_ldl_data_ra) | ||
151 | +DO_LD1_ZPZ_S(sve_ldbss_zss, int32_t, int8_t, cpu_ldub_data_ra) | ||
152 | +DO_LD1_ZPZ_S(sve_ldhss_zss, int32_t, int16_t, cpu_lduw_data_ra) | ||
153 | + | ||
154 | +DO_LD1_ZPZ_D(sve_ldbdu_zsu, uint32_t, uint8_t, cpu_ldub_data_ra) | ||
155 | +DO_LD1_ZPZ_D(sve_ldhdu_zsu, uint32_t, uint16_t, cpu_lduw_data_ra) | ||
156 | +DO_LD1_ZPZ_D(sve_ldsdu_zsu, uint32_t, uint32_t, cpu_ldl_data_ra) | ||
157 | +DO_LD1_ZPZ_D(sve_ldddu_zsu, uint32_t, uint64_t, cpu_ldq_data_ra) | ||
158 | +DO_LD1_ZPZ_D(sve_ldbds_zsu, uint32_t, int8_t, cpu_ldub_data_ra) | ||
159 | +DO_LD1_ZPZ_D(sve_ldhds_zsu, uint32_t, int16_t, cpu_lduw_data_ra) | ||
160 | +DO_LD1_ZPZ_D(sve_ldsds_zsu, uint32_t, int32_t, cpu_ldl_data_ra) | ||
161 | + | ||
162 | +DO_LD1_ZPZ_D(sve_ldbdu_zss, int32_t, uint8_t, cpu_ldub_data_ra) | ||
163 | +DO_LD1_ZPZ_D(sve_ldhdu_zss, int32_t, uint16_t, cpu_lduw_data_ra) | ||
164 | +DO_LD1_ZPZ_D(sve_ldsdu_zss, int32_t, uint32_t, cpu_ldl_data_ra) | ||
165 | +DO_LD1_ZPZ_D(sve_ldddu_zss, int32_t, uint64_t, cpu_ldq_data_ra) | ||
166 | +DO_LD1_ZPZ_D(sve_ldbds_zss, int32_t, int8_t, cpu_ldub_data_ra) | ||
167 | +DO_LD1_ZPZ_D(sve_ldhds_zss, int32_t, int16_t, cpu_lduw_data_ra) | ||
168 | +DO_LD1_ZPZ_D(sve_ldsds_zss, int32_t, int32_t, cpu_ldl_data_ra) | ||
169 | + | ||
170 | +DO_LD1_ZPZ_D(sve_ldbdu_zd, uint64_t, uint8_t, cpu_ldub_data_ra) | ||
171 | +DO_LD1_ZPZ_D(sve_ldhdu_zd, uint64_t, uint16_t, cpu_lduw_data_ra) | ||
172 | +DO_LD1_ZPZ_D(sve_ldsdu_zd, uint64_t, uint32_t, cpu_ldl_data_ra) | ||
173 | +DO_LD1_ZPZ_D(sve_ldddu_zd, uint64_t, uint64_t, cpu_ldq_data_ra) | ||
174 | +DO_LD1_ZPZ_D(sve_ldbds_zd, uint64_t, int8_t, cpu_ldub_data_ra) | ||
175 | +DO_LD1_ZPZ_D(sve_ldhds_zd, uint64_t, int16_t, cpu_lduw_data_ra) | ||
176 | +DO_LD1_ZPZ_D(sve_ldsds_zd, uint64_t, int32_t, cpu_ldl_data_ra) | ||
177 | + | ||
178 | /* Stores with a vector index. */ | ||
179 | |||
180 | #define DO_ST1_ZPZ_S(NAME, TYPEI, FN) \ | ||
181 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
182 | index XXXXXXX..XXXXXXX 100644 | ||
183 | --- a/target/arm/translate-sve.c | ||
184 | +++ b/target/arm/translate-sve.c | ||
185 | @@ -XXX,XX +XXX,XX @@ static void do_mem_zpz(DisasContext *s, int zt, int pg, int zm, int scale, | ||
186 | tcg_temp_free_i32(desc); | ||
187 | } | ||
188 | |||
189 | +/* Indexed by [ff][xs][u][msz]. */ | ||
190 | +static gen_helper_gvec_mem_scatter * const gather_load_fn32[2][2][2][3] = { | ||
191 | + { { { gen_helper_sve_ldbss_zsu, | ||
192 | + gen_helper_sve_ldhss_zsu, | ||
193 | + NULL, }, | ||
194 | + { gen_helper_sve_ldbsu_zsu, | ||
195 | + gen_helper_sve_ldhsu_zsu, | ||
196 | + gen_helper_sve_ldssu_zsu, } }, | ||
197 | + { { gen_helper_sve_ldbss_zss, | ||
198 | + gen_helper_sve_ldhss_zss, | ||
199 | + NULL, }, | ||
200 | + { gen_helper_sve_ldbsu_zss, | ||
201 | + gen_helper_sve_ldhsu_zss, | ||
202 | + gen_helper_sve_ldssu_zss, } } }, | ||
203 | + /* TODO fill in first-fault handlers */ | ||
204 | +}; | ||
205 | + | ||
206 | +/* Note that we overload xs=2 to indicate 64-bit offset. */ | ||
207 | +static gen_helper_gvec_mem_scatter * const gather_load_fn64[2][3][2][4] = { | ||
208 | + { { { gen_helper_sve_ldbds_zsu, | ||
209 | + gen_helper_sve_ldhds_zsu, | ||
210 | + gen_helper_sve_ldsds_zsu, | ||
211 | + NULL, }, | ||
212 | + { gen_helper_sve_ldbdu_zsu, | ||
213 | + gen_helper_sve_ldhdu_zsu, | ||
214 | + gen_helper_sve_ldsdu_zsu, | ||
215 | + gen_helper_sve_ldddu_zsu, } }, | ||
216 | + { { gen_helper_sve_ldbds_zss, | ||
217 | + gen_helper_sve_ldhds_zss, | ||
218 | + gen_helper_sve_ldsds_zss, | ||
219 | + NULL, }, | ||
220 | + { gen_helper_sve_ldbdu_zss, | ||
221 | + gen_helper_sve_ldhdu_zss, | ||
222 | + gen_helper_sve_ldsdu_zss, | ||
223 | + gen_helper_sve_ldddu_zss, } }, | ||
224 | + { { gen_helper_sve_ldbds_zd, | ||
225 | + gen_helper_sve_ldhds_zd, | ||
226 | + gen_helper_sve_ldsds_zd, | ||
227 | + NULL, }, | ||
228 | + { gen_helper_sve_ldbdu_zd, | ||
229 | + gen_helper_sve_ldhdu_zd, | ||
230 | + gen_helper_sve_ldsdu_zd, | ||
231 | + gen_helper_sve_ldddu_zd, } } }, | ||
232 | + /* TODO fill in first-fault handlers */ | ||
233 | +}; | ||
234 | + | ||
235 | +static bool trans_LD1_zprz(DisasContext *s, arg_LD1_zprz *a, uint32_t insn) | ||
236 | +{ | ||
237 | + gen_helper_gvec_mem_scatter *fn = NULL; | ||
238 | + | ||
239 | + if (!sve_access_check(s)) { | ||
240 | + return true; | ||
241 | + } | ||
242 | + | ||
243 | + switch (a->esz) { | ||
244 | + case MO_32: | ||
245 | + fn = gather_load_fn32[a->ff][a->xs][a->u][a->msz]; | ||
246 | + break; | ||
247 | + case MO_64: | ||
248 | + fn = gather_load_fn64[a->ff][a->xs][a->u][a->msz]; | ||
249 | + break; | ||
250 | + } | ||
251 | + assert(fn != NULL); | ||
252 | + | ||
253 | + do_mem_zpz(s, a->rd, a->pg, a->rm, a->scale * a->msz, | ||
254 | + cpu_reg_sp(s, a->rn), fn); | ||
255 | + return true; | ||
256 | +} | ||
257 | + | ||
258 | +static bool trans_LD1_zpiz(DisasContext *s, arg_LD1_zpiz *a, uint32_t insn) | ||
259 | +{ | ||
260 | + gen_helper_gvec_mem_scatter *fn = NULL; | ||
261 | + TCGv_i64 imm; | ||
262 | + | ||
263 | + if (a->esz < a->msz || (a->esz == a->msz && !a->u)) { | ||
264 | + return false; | ||
265 | + } | ||
266 | + if (!sve_access_check(s)) { | ||
267 | + return true; | ||
268 | + } | ||
269 | + | ||
270 | + switch (a->esz) { | ||
271 | + case MO_32: | ||
272 | + fn = gather_load_fn32[a->ff][0][a->u][a->msz]; | ||
273 | + break; | ||
274 | + case MO_64: | ||
275 | + fn = gather_load_fn64[a->ff][2][a->u][a->msz]; | ||
276 | + break; | ||
277 | + } | ||
278 | + assert(fn != NULL); | ||
279 | + | ||
280 | + /* Treat LD1_zpiz (zn[x] + imm) the same way as LD1_zprz (rn + zm[x]) | ||
281 | + * by loading the immediate into the scalar parameter. | ||
282 | + */ | ||
283 | + imm = tcg_const_i64(a->imm << a->msz); | ||
284 | + do_mem_zpz(s, a->rd, a->pg, a->rn, 0, imm, fn); | ||
285 | + tcg_temp_free_i64(imm); | ||
286 | + return true; | ||
287 | +} | ||
288 | + | ||
289 | static bool trans_ST1_zprz(DisasContext *s, arg_ST1_zprz *a, uint32_t insn) | ||
290 | { | ||
291 | /* Indexed by [xs][msz]. */ | ||
292 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
293 | index XXXXXXX..XXXXXXX 100644 | ||
294 | --- a/target/arm/sve.decode | ||
295 | +++ b/target/arm/sve.decode | ||
296 | @@ -XXX,XX +XXX,XX @@ | ||
297 | &rpri_load rd pg rn imm dtype nreg | ||
298 | &rprr_store rd pg rn rm msz esz nreg | ||
299 | &rpri_store rd pg rn imm msz esz nreg | ||
300 | +&rprr_gather_load rd pg rn rm esz msz u ff xs scale | ||
301 | +&rpri_gather_load rd pg rn imm esz msz u ff | ||
302 | &rprr_scatter_store rd pg rn rm esz msz xs scale | ||
303 | |||
304 | ########################################################################### | ||
305 | @@ -XXX,XX +XXX,XX @@ | ||
306 | @rpri_load_msz ....... .... . imm:s4 ... pg:3 rn:5 rd:5 \ | ||
307 | &rpri_load dtype=%msz_dtype | ||
308 | |||
309 | +# Gather Loads. | ||
310 | +@rprr_g_load_u ....... .. . . rm:5 . u:1 ff:1 pg:3 rn:5 rd:5 \ | ||
311 | + &rprr_gather_load xs=2 | ||
312 | +@rprr_g_load_xs_u ....... .. xs:1 . rm:5 . u:1 ff:1 pg:3 rn:5 rd:5 \ | ||
313 | + &rprr_gather_load | ||
314 | +@rprr_g_load_xs_u_sc ....... .. xs:1 scale:1 rm:5 . u:1 ff:1 pg:3 rn:5 rd:5 \ | ||
315 | + &rprr_gather_load | ||
316 | +@rprr_g_load_xs_sc ....... .. xs:1 scale:1 rm:5 . . ff:1 pg:3 rn:5 rd:5 \ | ||
317 | + &rprr_gather_load | ||
318 | +@rprr_g_load_u_sc ....... .. . scale:1 rm:5 . u:1 ff:1 pg:3 rn:5 rd:5 \ | ||
319 | + &rprr_gather_load xs=2 | ||
320 | +@rprr_g_load_sc ....... .. . scale:1 rm:5 . . ff:1 pg:3 rn:5 rd:5 \ | ||
321 | + &rprr_gather_load xs=2 | ||
322 | +@rpri_g_load ....... msz:2 .. imm:5 . u:1 ff:1 pg:3 rn:5 rd:5 \ | ||
323 | + &rpri_gather_load | ||
324 | + | ||
325 | # Stores; user must fill in ESZ, MSZ, NREG as needed. | ||
326 | @rprr_store ....... .. .. rm:5 ... pg:3 rn:5 rd:5 &rprr_store | ||
327 | @rpri_store_msz ....... msz:2 .. . imm:s4 ... pg:3 rn:5 rd:5 &rpri_store | ||
328 | @@ -XXX,XX +XXX,XX @@ LDR_zri 10000101 10 ...... 010 ... ..... ..... @rd_rn_i9 | ||
329 | LD1R_zpri 1000010 .. 1 imm:6 1.. pg:3 rn:5 rd:5 \ | ||
330 | &rpri_load dtype=%dtype_23_13 nreg=0 | ||
331 | |||
332 | +# SVE 32-bit gather load (scalar plus 32-bit unscaled offsets) | ||
333 | +# SVE 32-bit gather load (scalar plus 32-bit scaled offsets) | ||
334 | +LD1_zprz 1000010 00 .0 ..... 0.. ... ..... ..... \ | ||
335 | + @rprr_g_load_xs_u esz=2 msz=0 scale=0 | ||
336 | +LD1_zprz 1000010 01 .. ..... 0.. ... ..... ..... \ | ||
337 | + @rprr_g_load_xs_u_sc esz=2 msz=1 | ||
338 | +LD1_zprz 1000010 10 .. ..... 01. ... ..... ..... \ | ||
339 | + @rprr_g_load_xs_sc esz=2 msz=2 u=1 | ||
340 | + | ||
341 | +# SVE 32-bit gather load (vector plus immediate) | ||
342 | +LD1_zpiz 1000010 .. 01 ..... 1.. ... ..... ..... \ | ||
343 | + @rpri_g_load esz=2 | ||
344 | + | ||
345 | ### SVE Memory Contiguous Load Group | ||
346 | |||
347 | # SVE contiguous load (scalar plus scalar) | ||
348 | @@ -XXX,XX +XXX,XX @@ PRF_rr 1000010 -- 00 rm:5 110 --- ----- 0 ---- | ||
349 | |||
350 | ### SVE Memory 64-bit Gather Group | ||
351 | |||
352 | +# SVE 64-bit gather load (scalar plus 32-bit unpacked unscaled offsets) | ||
353 | +# SVE 64-bit gather load (scalar plus 32-bit unpacked scaled offsets) | ||
354 | +LD1_zprz 1100010 00 .0 ..... 0.. ... ..... ..... \ | ||
355 | + @rprr_g_load_xs_u esz=3 msz=0 scale=0 | ||
356 | +LD1_zprz 1100010 01 .. ..... 0.. ... ..... ..... \ | ||
357 | + @rprr_g_load_xs_u_sc esz=3 msz=1 | ||
358 | +LD1_zprz 1100010 10 .. ..... 0.. ... ..... ..... \ | ||
359 | + @rprr_g_load_xs_u_sc esz=3 msz=2 | ||
360 | +LD1_zprz 1100010 11 .. ..... 01. ... ..... ..... \ | ||
361 | + @rprr_g_load_xs_sc esz=3 msz=3 u=1 | ||
362 | + | ||
363 | +# SVE 64-bit gather load (scalar plus 64-bit unscaled offsets) | ||
364 | +# SVE 64-bit gather load (scalar plus 64-bit scaled offsets) | ||
365 | +LD1_zprz 1100010 00 10 ..... 1.. ... ..... ..... \ | ||
366 | + @rprr_g_load_u esz=3 msz=0 scale=0 | ||
367 | +LD1_zprz 1100010 01 1. ..... 1.. ... ..... ..... \ | ||
368 | + @rprr_g_load_u_sc esz=3 msz=1 | ||
369 | +LD1_zprz 1100010 10 1. ..... 1.. ... ..... ..... \ | ||
370 | + @rprr_g_load_u_sc esz=3 msz=2 | ||
371 | +LD1_zprz 1100010 11 1. ..... 11. ... ..... ..... \ | ||
372 | + @rprr_g_load_sc esz=3 msz=3 u=1 | ||
373 | + | ||
374 | +# SVE 64-bit gather load (vector plus immediate) | ||
375 | +LD1_zpiz 1100010 .. 01 ..... 1.. ... ..... ..... \ | ||
376 | + @rpri_g_load esz=3 | ||
377 | + | ||
378 | # SVE 64-bit gather prefetch (scalar plus 64-bit scaled offsets) | ||
379 | PRF 1100010 00 11 ----- 1-- --- ----- 0 ---- | ||
380 | 26 | ||
381 | -- | 27 | -- |
382 | 2.17.1 | 28 | 2.20.1 |
383 | 29 | ||
384 | 30 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | 1 | If the user provides both a BIOS/firmware image and also a guest |
---|---|---|---|
2 | kernel filename, arm_setup_firmware_boot() will pass the | ||
3 | kernel image to the firmware via the fw_cfg device. However we | ||
4 | weren't checking whether there really was a fw_cfg device present, | ||
5 | and if there wasn't we would crash. | ||
2 | 6 | ||
3 | When running dtc on the guest /proc/device-tree we get the | 7 | This crash can be provoked with a command line such as |
4 | following warning: Warning (unit_address_vs_reg): Node /memory | 8 | qemu-system-aarch64 -M raspi3 -kernel /dev/null -bios /dev/null -display none |
5 | has a reg or ranges property, but no unit name". | ||
6 | 9 | ||
7 | Let's fix that by adding the unit address to the node name. We also | 10 | It is currently only possible on the raspi3 machine, because unless |
8 | don't create the /memory node anymore in create_fdt(). We directly | 11 | the machine sets info->firmware_loaded we won't call |
9 | create it in load_dtb. /chosen still needs to be created in create_fdt | 12 | arm_setup_firmware_boot(), and the only machines which set that are: |
10 | as the uart needs it. In case the user provided his own dtb, we nop | 13 | * virt (has a fw-cfg device) |
11 | all memory nodes found in root and create new one(s). | 14 | * sbsa-ref (checks itself for kernel_filename && firmware_loaded) |
15 | * raspi3 (crashes) | ||
12 | 16 | ||
13 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 17 | But this is an unfortunate beartrap to leave for future machine |
14 | Message-id: 1530044492-24921-4-git-send-email-eric.auger@redhat.com | 18 | model implementors, so we should handle this situation in boot.c. |
15 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 19 | |
20 | Check in arm_setup_firmware_boot() whether the fw-cfg device exists | ||
21 | before trying to load files into it, and if it doesn't exist then | ||
22 | exit with a hopefully helpful error message. | ||
23 | |||
24 | Because we now handle this check in a machine-agnostic way, we | ||
25 | can remove the check from sbsa-ref. | ||
26 | |||
27 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/503 | ||
16 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 28 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
29 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
30 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
31 | Message-id: 20210726163351.32086-1-peter.maydell@linaro.org | ||
17 | --- | 32 | --- |
18 | hw/arm/boot.c | 41 +++++++++++++++++++++++------------------ | 33 | hw/arm/boot.c | 9 +++++++++ |
19 | hw/arm/virt.c | 7 +------ | 34 | hw/arm/sbsa-ref.c | 7 ------- |
20 | 2 files changed, 24 insertions(+), 24 deletions(-) | 35 | 2 files changed, 9 insertions(+), 7 deletions(-) |
21 | 36 | ||
22 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | 37 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c |
23 | index XXXXXXX..XXXXXXX 100644 | 38 | index XXXXXXX..XXXXXXX 100644 |
24 | --- a/hw/arm/boot.c | 39 | --- a/hw/arm/boot.c |
25 | +++ b/hw/arm/boot.c | 40 | +++ b/hw/arm/boot.c |
26 | @@ -XXX,XX +XXX,XX @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo, | 41 | @@ -XXX,XX +XXX,XX @@ static void arm_setup_firmware_boot(ARMCPU *cpu, struct arm_boot_info *info) |
27 | hwaddr addr_limit, AddressSpace *as) | 42 | bool try_decompressing_kernel; |
28 | { | 43 | |
29 | void *fdt = NULL; | 44 | fw_cfg = fw_cfg_find(); |
30 | - int size, rc; | 45 | + |
31 | + int size, rc, n = 0; | 46 | + if (!fw_cfg) { |
32 | uint32_t acells, scells; | 47 | + error_report("This machine type does not support loading both " |
33 | char *nodename; | 48 | + "a guest firmware/BIOS image and a guest kernel at " |
34 | unsigned int i; | 49 | + "the same time. You should change your QEMU command " |
35 | hwaddr mem_base, mem_len; | 50 | + "line to specify one or the other, but not both."); |
36 | + char **node_path; | 51 | + exit(1); |
37 | + Error *err = NULL; | ||
38 | |||
39 | if (binfo->dtb_filename) { | ||
40 | char *filename; | ||
41 | @@ -XXX,XX +XXX,XX @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo, | ||
42 | goto fail; | ||
43 | } | ||
44 | |||
45 | + /* nop all root nodes matching /memory or /memory@unit-address */ | ||
46 | + node_path = qemu_fdt_node_unit_path(fdt, "memory", &err); | ||
47 | + if (err) { | ||
48 | + error_report_err(err); | ||
49 | + goto fail; | ||
50 | + } | ||
51 | + while (node_path[n]) { | ||
52 | + if (g_str_has_prefix(node_path[n], "/memory")) { | ||
53 | + qemu_fdt_nop_node(fdt, node_path[n]); | ||
54 | + } | 52 | + } |
55 | + n++; | ||
56 | + } | ||
57 | + g_strfreev(node_path); | ||
58 | + | 53 | + |
59 | if (nb_numa_nodes > 0) { | 54 | try_decompressing_kernel = arm_feature(&cpu->env, |
60 | - /* | 55 | ARM_FEATURE_AARCH64); |
61 | - * Turn the /memory node created before into a NOP node, then create | 56 | |
62 | - * /memory@addr nodes for all numa nodes respectively. | 57 | diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c |
63 | - */ | 58 | index XXXXXXX..XXXXXXX 100644 |
64 | - qemu_fdt_nop_node(fdt, "/memory"); | 59 | --- a/hw/arm/sbsa-ref.c |
65 | mem_base = binfo->loader_start; | 60 | +++ b/hw/arm/sbsa-ref.c |
66 | for (i = 0; i < nb_numa_nodes; i++) { | 61 | @@ -XXX,XX +XXX,XX @@ static void sbsa_ref_init(MachineState *machine) |
67 | mem_len = numa_info[i].node_mem; | 62 | |
68 | @@ -XXX,XX +XXX,XX @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo, | 63 | firmware_loaded = sbsa_firmware_init(sms, sysmem, secure_sysmem); |
69 | g_free(nodename); | 64 | |
70 | } | 65 | - if (machine->kernel_filename && firmware_loaded) { |
71 | } else { | 66 | - error_report("sbsa-ref: No fw_cfg device on this machine, " |
72 | - Error *err = NULL; | 67 | - "so -kernel option is not supported when firmware loaded, " |
73 | + nodename = g_strdup_printf("/memory@%" PRIx64, binfo->loader_start); | 68 | - "please load OS from hard disk instead"); |
74 | + qemu_fdt_add_subnode(fdt, nodename); | 69 | - exit(1); |
75 | + qemu_fdt_setprop_string(fdt, nodename, "device_type", "memory"); | 70 | - } |
76 | |||
77 | - rc = fdt_path_offset(fdt, "/memory"); | ||
78 | - if (rc < 0) { | ||
79 | - qemu_fdt_add_subnode(fdt, "/memory"); | ||
80 | - } | ||
81 | - | 71 | - |
82 | - if (!qemu_fdt_getprop(fdt, "/memory", "device_type", NULL, &err)) { | 72 | /* |
83 | - qemu_fdt_setprop_string(fdt, "/memory", "device_type", "memory"); | 73 | * This machine has EL3 enabled, external firmware should supply PSCI |
84 | - } | 74 | * implementation, so the QEMU's internal PSCI is disabled. |
85 | - | ||
86 | - rc = qemu_fdt_setprop_sized_cells(fdt, "/memory", "reg", | ||
87 | + rc = qemu_fdt_setprop_sized_cells(fdt, nodename, "reg", | ||
88 | acells, binfo->loader_start, | ||
89 | scells, binfo->ram_size); | ||
90 | if (rc < 0) { | ||
91 | - fprintf(stderr, "couldn't set /memory/reg\n"); | ||
92 | + fprintf(stderr, "couldn't set %s reg\n", nodename); | ||
93 | goto fail; | ||
94 | } | ||
95 | + g_free(nodename); | ||
96 | } | ||
97 | |||
98 | rc = fdt_path_offset(fdt, "/chosen"); | ||
99 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | ||
100 | index XXXXXXX..XXXXXXX 100644 | ||
101 | --- a/hw/arm/virt.c | ||
102 | +++ b/hw/arm/virt.c | ||
103 | @@ -XXX,XX +XXX,XX @@ static void create_fdt(VirtMachineState *vms) | ||
104 | qemu_fdt_setprop_cell(fdt, "/", "#address-cells", 0x2); | ||
105 | qemu_fdt_setprop_cell(fdt, "/", "#size-cells", 0x2); | ||
106 | |||
107 | - /* | ||
108 | - * /chosen and /memory nodes must exist for load_dtb | ||
109 | - * to fill in necessary properties later | ||
110 | - */ | ||
111 | + /* /chosen must exist for load_dtb to fill in necessary properties later */ | ||
112 | qemu_fdt_add_subnode(fdt, "/chosen"); | ||
113 | - qemu_fdt_add_subnode(fdt, "/memory"); | ||
114 | - qemu_fdt_setprop_string(fdt, "/memory", "device_type", "memory"); | ||
115 | |||
116 | /* Clock node, for the benefit of the UART. The kernel device tree | ||
117 | * binding documentation claims the PL011 node clock properties are | ||
118 | -- | 75 | -- |
119 | 2.17.1 | 76 | 2.20.1 |
120 | 77 | ||
121 | 78 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
4 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
6 | Message-id: 20180627043328.11531-2-richard.henderson@linaro.org | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | --- | ||
9 | target/arm/helper-sve.h | 35 +++++++++ | ||
10 | target/arm/sve_helper.c | 153 +++++++++++++++++++++++++++++++++++++ | ||
11 | target/arm/translate-sve.c | 121 +++++++++++++++++++++++++++++ | ||
12 | target/arm/sve.decode | 34 +++++++++ | ||
13 | 4 files changed, 343 insertions(+) | ||
14 | |||
15 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/target/arm/helper-sve.h | ||
18 | +++ b/target/arm/helper-sve.h | ||
19 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(gvec_rsqrts_s, TCG_CALL_NO_RWG, | ||
20 | void, ptr, ptr, ptr, ptr, i32) | ||
21 | DEF_HELPER_FLAGS_5(gvec_rsqrts_d, TCG_CALL_NO_RWG, | ||
22 | void, ptr, ptr, ptr, ptr, i32) | ||
23 | + | ||
24 | +DEF_HELPER_FLAGS_4(sve_ld1bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
25 | +DEF_HELPER_FLAGS_4(sve_ld2bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
26 | +DEF_HELPER_FLAGS_4(sve_ld3bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
27 | +DEF_HELPER_FLAGS_4(sve_ld4bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
28 | + | ||
29 | +DEF_HELPER_FLAGS_4(sve_ld1hh_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
30 | +DEF_HELPER_FLAGS_4(sve_ld2hh_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
31 | +DEF_HELPER_FLAGS_4(sve_ld3hh_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
32 | +DEF_HELPER_FLAGS_4(sve_ld4hh_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
33 | + | ||
34 | +DEF_HELPER_FLAGS_4(sve_ld1ss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
35 | +DEF_HELPER_FLAGS_4(sve_ld2ss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
36 | +DEF_HELPER_FLAGS_4(sve_ld3ss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
37 | +DEF_HELPER_FLAGS_4(sve_ld4ss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
38 | + | ||
39 | +DEF_HELPER_FLAGS_4(sve_ld1dd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
40 | +DEF_HELPER_FLAGS_4(sve_ld2dd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
41 | +DEF_HELPER_FLAGS_4(sve_ld3dd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
42 | +DEF_HELPER_FLAGS_4(sve_ld4dd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
43 | + | ||
44 | +DEF_HELPER_FLAGS_4(sve_ld1bhu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
45 | +DEF_HELPER_FLAGS_4(sve_ld1bsu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
46 | +DEF_HELPER_FLAGS_4(sve_ld1bdu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
47 | +DEF_HELPER_FLAGS_4(sve_ld1bhs_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
48 | +DEF_HELPER_FLAGS_4(sve_ld1bss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
49 | +DEF_HELPER_FLAGS_4(sve_ld1bds_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
50 | + | ||
51 | +DEF_HELPER_FLAGS_4(sve_ld1hsu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
52 | +DEF_HELPER_FLAGS_4(sve_ld1hdu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
53 | +DEF_HELPER_FLAGS_4(sve_ld1hss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
54 | +DEF_HELPER_FLAGS_4(sve_ld1hds_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
55 | + | ||
56 | +DEF_HELPER_FLAGS_4(sve_ld1sdu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
57 | +DEF_HELPER_FLAGS_4(sve_ld1sds_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
58 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
59 | index XXXXXXX..XXXXXXX 100644 | ||
60 | --- a/target/arm/sve_helper.c | ||
61 | +++ b/target/arm/sve_helper.c | ||
62 | @@ -XXX,XX +XXX,XX @@ uint32_t HELPER(sve_while)(void *vd, uint32_t count, uint32_t pred_desc) | ||
63 | |||
64 | return predtest_ones(d, oprsz, esz_mask); | ||
65 | } | ||
66 | + | ||
67 | +/* | ||
68 | + * Load contiguous data, protected by a governing predicate. | ||
69 | + */ | ||
70 | +#define DO_LD1(NAME, FN, TYPEE, TYPEM, H) \ | ||
71 | +static void do_##NAME(CPUARMState *env, void *vd, void *vg, \ | ||
72 | + target_ulong addr, intptr_t oprsz, \ | ||
73 | + uintptr_t ra) \ | ||
74 | +{ \ | ||
75 | + intptr_t i = 0; \ | ||
76 | + do { \ | ||
77 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ | ||
78 | + do { \ | ||
79 | + TYPEM m = 0; \ | ||
80 | + if (pg & 1) { \ | ||
81 | + m = FN(env, addr, ra); \ | ||
82 | + } \ | ||
83 | + *(TYPEE *)(vd + H(i)) = m; \ | ||
84 | + i += sizeof(TYPEE), pg >>= sizeof(TYPEE); \ | ||
85 | + addr += sizeof(TYPEM); \ | ||
86 | + } while (i & 15); \ | ||
87 | + } while (i < oprsz); \ | ||
88 | +} \ | ||
89 | +void HELPER(NAME)(CPUARMState *env, void *vg, \ | ||
90 | + target_ulong addr, uint32_t desc) \ | ||
91 | +{ \ | ||
92 | + do_##NAME(env, &env->vfp.zregs[simd_data(desc)], vg, \ | ||
93 | + addr, simd_oprsz(desc), GETPC()); \ | ||
94 | +} | ||
95 | + | ||
96 | +#define DO_LD2(NAME, FN, TYPEE, TYPEM, H) \ | ||
97 | +void HELPER(NAME)(CPUARMState *env, void *vg, \ | ||
98 | + target_ulong addr, uint32_t desc) \ | ||
99 | +{ \ | ||
100 | + intptr_t i, oprsz = simd_oprsz(desc); \ | ||
101 | + intptr_t ra = GETPC(); \ | ||
102 | + unsigned rd = simd_data(desc); \ | ||
103 | + void *d1 = &env->vfp.zregs[rd]; \ | ||
104 | + void *d2 = &env->vfp.zregs[(rd + 1) & 31]; \ | ||
105 | + for (i = 0; i < oprsz; ) { \ | ||
106 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ | ||
107 | + do { \ | ||
108 | + TYPEM m1 = 0, m2 = 0; \ | ||
109 | + if (pg & 1) { \ | ||
110 | + m1 = FN(env, addr, ra); \ | ||
111 | + m2 = FN(env, addr + sizeof(TYPEM), ra); \ | ||
112 | + } \ | ||
113 | + *(TYPEE *)(d1 + H(i)) = m1; \ | ||
114 | + *(TYPEE *)(d2 + H(i)) = m2; \ | ||
115 | + i += sizeof(TYPEE), pg >>= sizeof(TYPEE); \ | ||
116 | + addr += 2 * sizeof(TYPEM); \ | ||
117 | + } while (i & 15); \ | ||
118 | + } \ | ||
119 | +} | ||
120 | + | ||
121 | +#define DO_LD3(NAME, FN, TYPEE, TYPEM, H) \ | ||
122 | +void HELPER(NAME)(CPUARMState *env, void *vg, \ | ||
123 | + target_ulong addr, uint32_t desc) \ | ||
124 | +{ \ | ||
125 | + intptr_t i, oprsz = simd_oprsz(desc); \ | ||
126 | + intptr_t ra = GETPC(); \ | ||
127 | + unsigned rd = simd_data(desc); \ | ||
128 | + void *d1 = &env->vfp.zregs[rd]; \ | ||
129 | + void *d2 = &env->vfp.zregs[(rd + 1) & 31]; \ | ||
130 | + void *d3 = &env->vfp.zregs[(rd + 2) & 31]; \ | ||
131 | + for (i = 0; i < oprsz; ) { \ | ||
132 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ | ||
133 | + do { \ | ||
134 | + TYPEM m1 = 0, m2 = 0, m3 = 0; \ | ||
135 | + if (pg & 1) { \ | ||
136 | + m1 = FN(env, addr, ra); \ | ||
137 | + m2 = FN(env, addr + sizeof(TYPEM), ra); \ | ||
138 | + m3 = FN(env, addr + 2 * sizeof(TYPEM), ra); \ | ||
139 | + } \ | ||
140 | + *(TYPEE *)(d1 + H(i)) = m1; \ | ||
141 | + *(TYPEE *)(d2 + H(i)) = m2; \ | ||
142 | + *(TYPEE *)(d3 + H(i)) = m3; \ | ||
143 | + i += sizeof(TYPEE), pg >>= sizeof(TYPEE); \ | ||
144 | + addr += 3 * sizeof(TYPEM); \ | ||
145 | + } while (i & 15); \ | ||
146 | + } \ | ||
147 | +} | ||
148 | + | ||
149 | +#define DO_LD4(NAME, FN, TYPEE, TYPEM, H) \ | ||
150 | +void HELPER(NAME)(CPUARMState *env, void *vg, \ | ||
151 | + target_ulong addr, uint32_t desc) \ | ||
152 | +{ \ | ||
153 | + intptr_t i, oprsz = simd_oprsz(desc); \ | ||
154 | + intptr_t ra = GETPC(); \ | ||
155 | + unsigned rd = simd_data(desc); \ | ||
156 | + void *d1 = &env->vfp.zregs[rd]; \ | ||
157 | + void *d2 = &env->vfp.zregs[(rd + 1) & 31]; \ | ||
158 | + void *d3 = &env->vfp.zregs[(rd + 2) & 31]; \ | ||
159 | + void *d4 = &env->vfp.zregs[(rd + 3) & 31]; \ | ||
160 | + for (i = 0; i < oprsz; ) { \ | ||
161 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ | ||
162 | + do { \ | ||
163 | + TYPEM m1 = 0, m2 = 0, m3 = 0, m4 = 0; \ | ||
164 | + if (pg & 1) { \ | ||
165 | + m1 = FN(env, addr, ra); \ | ||
166 | + m2 = FN(env, addr + sizeof(TYPEM), ra); \ | ||
167 | + m3 = FN(env, addr + 2 * sizeof(TYPEM), ra); \ | ||
168 | + m4 = FN(env, addr + 3 * sizeof(TYPEM), ra); \ | ||
169 | + } \ | ||
170 | + *(TYPEE *)(d1 + H(i)) = m1; \ | ||
171 | + *(TYPEE *)(d2 + H(i)) = m2; \ | ||
172 | + *(TYPEE *)(d3 + H(i)) = m3; \ | ||
173 | + *(TYPEE *)(d4 + H(i)) = m4; \ | ||
174 | + i += sizeof(TYPEE), pg >>= sizeof(TYPEE); \ | ||
175 | + addr += 4 * sizeof(TYPEM); \ | ||
176 | + } while (i & 15); \ | ||
177 | + } \ | ||
178 | +} | ||
179 | + | ||
180 | +DO_LD1(sve_ld1bhu_r, cpu_ldub_data_ra, uint16_t, uint8_t, H1_2) | ||
181 | +DO_LD1(sve_ld1bhs_r, cpu_ldsb_data_ra, uint16_t, int8_t, H1_2) | ||
182 | +DO_LD1(sve_ld1bsu_r, cpu_ldub_data_ra, uint32_t, uint8_t, H1_4) | ||
183 | +DO_LD1(sve_ld1bss_r, cpu_ldsb_data_ra, uint32_t, int8_t, H1_4) | ||
184 | +DO_LD1(sve_ld1bdu_r, cpu_ldub_data_ra, uint64_t, uint8_t, ) | ||
185 | +DO_LD1(sve_ld1bds_r, cpu_ldsb_data_ra, uint64_t, int8_t, ) | ||
186 | + | ||
187 | +DO_LD1(sve_ld1hsu_r, cpu_lduw_data_ra, uint32_t, uint16_t, H1_4) | ||
188 | +DO_LD1(sve_ld1hss_r, cpu_ldsw_data_ra, uint32_t, int8_t, H1_4) | ||
189 | +DO_LD1(sve_ld1hdu_r, cpu_lduw_data_ra, uint64_t, uint16_t, ) | ||
190 | +DO_LD1(sve_ld1hds_r, cpu_ldsw_data_ra, uint64_t, int16_t, ) | ||
191 | + | ||
192 | +DO_LD1(sve_ld1sdu_r, cpu_ldl_data_ra, uint64_t, uint32_t, ) | ||
193 | +DO_LD1(sve_ld1sds_r, cpu_ldl_data_ra, uint64_t, int32_t, ) | ||
194 | + | ||
195 | +DO_LD1(sve_ld1bb_r, cpu_ldub_data_ra, uint8_t, uint8_t, H1) | ||
196 | +DO_LD2(sve_ld2bb_r, cpu_ldub_data_ra, uint8_t, uint8_t, H1) | ||
197 | +DO_LD3(sve_ld3bb_r, cpu_ldub_data_ra, uint8_t, uint8_t, H1) | ||
198 | +DO_LD4(sve_ld4bb_r, cpu_ldub_data_ra, uint8_t, uint8_t, H1) | ||
199 | + | ||
200 | +DO_LD1(sve_ld1hh_r, cpu_lduw_data_ra, uint16_t, uint16_t, H1_2) | ||
201 | +DO_LD2(sve_ld2hh_r, cpu_lduw_data_ra, uint16_t, uint16_t, H1_2) | ||
202 | +DO_LD3(sve_ld3hh_r, cpu_lduw_data_ra, uint16_t, uint16_t, H1_2) | ||
203 | +DO_LD4(sve_ld4hh_r, cpu_lduw_data_ra, uint16_t, uint16_t, H1_2) | ||
204 | + | ||
205 | +DO_LD1(sve_ld1ss_r, cpu_ldl_data_ra, uint32_t, uint32_t, H1_4) | ||
206 | +DO_LD2(sve_ld2ss_r, cpu_ldl_data_ra, uint32_t, uint32_t, H1_4) | ||
207 | +DO_LD3(sve_ld3ss_r, cpu_ldl_data_ra, uint32_t, uint32_t, H1_4) | ||
208 | +DO_LD4(sve_ld4ss_r, cpu_ldl_data_ra, uint32_t, uint32_t, H1_4) | ||
209 | + | ||
210 | +DO_LD1(sve_ld1dd_r, cpu_ldq_data_ra, uint64_t, uint64_t, ) | ||
211 | +DO_LD2(sve_ld2dd_r, cpu_ldq_data_ra, uint64_t, uint64_t, ) | ||
212 | +DO_LD3(sve_ld3dd_r, cpu_ldq_data_ra, uint64_t, uint64_t, ) | ||
213 | +DO_LD4(sve_ld4dd_r, cpu_ldq_data_ra, uint64_t, uint64_t, ) | ||
214 | + | ||
215 | +#undef DO_LD1 | ||
216 | +#undef DO_LD2 | ||
217 | +#undef DO_LD3 | ||
218 | +#undef DO_LD4 | ||
219 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
220 | index XXXXXXX..XXXXXXX 100644 | ||
221 | --- a/target/arm/translate-sve.c | ||
222 | +++ b/target/arm/translate-sve.c | ||
223 | @@ -XXX,XX +XXX,XX @@ typedef void gen_helper_gvec_flags_3(TCGv_i32, TCGv_ptr, TCGv_ptr, | ||
224 | typedef void gen_helper_gvec_flags_4(TCGv_i32, TCGv_ptr, TCGv_ptr, | ||
225 | TCGv_ptr, TCGv_ptr, TCGv_i32); | ||
226 | |||
227 | +typedef void gen_helper_gvec_mem(TCGv_env, TCGv_ptr, TCGv_i64, TCGv_i32); | ||
228 | + | ||
229 | /* | ||
230 | * Helpers for extracting complex instruction fields. | ||
231 | */ | ||
232 | @@ -XXX,XX +XXX,XX @@ static inline int expand_imm_sh8u(int x) | ||
233 | return (uint8_t)x << (x & 0x100 ? 8 : 0); | ||
234 | } | ||
235 | |||
236 | +/* Convert a 2-bit memory size (msz) to a 4-bit data type (dtype) | ||
237 | + * with unsigned data. C.f. SVE Memory Contiguous Load Group. | ||
238 | + */ | ||
239 | +static inline int msz_dtype(int msz) | ||
240 | +{ | ||
241 | + static const uint8_t dtype[4] = { 0, 5, 10, 15 }; | ||
242 | + return dtype[msz]; | ||
243 | +} | ||
244 | + | ||
245 | /* | ||
246 | * Include the generated decoder. | ||
247 | */ | ||
248 | @@ -XXX,XX +XXX,XX @@ static bool trans_LDR_pri(DisasContext *s, arg_rri *a, uint32_t insn) | ||
249 | } | ||
250 | return true; | ||
251 | } | ||
252 | + | ||
253 | +/* | ||
254 | + *** SVE Memory - Contiguous Load Group | ||
255 | + */ | ||
256 | + | ||
257 | +/* The memory mode of the dtype. */ | ||
258 | +static const TCGMemOp dtype_mop[16] = { | ||
259 | + MO_UB, MO_UB, MO_UB, MO_UB, | ||
260 | + MO_SL, MO_UW, MO_UW, MO_UW, | ||
261 | + MO_SW, MO_SW, MO_UL, MO_UL, | ||
262 | + MO_SB, MO_SB, MO_SB, MO_Q | ||
263 | +}; | ||
264 | + | ||
265 | +#define dtype_msz(x) (dtype_mop[x] & MO_SIZE) | ||
266 | + | ||
267 | +/* The vector element size of dtype. */ | ||
268 | +static const uint8_t dtype_esz[16] = { | ||
269 | + 0, 1, 2, 3, | ||
270 | + 3, 1, 2, 3, | ||
271 | + 3, 2, 2, 3, | ||
272 | + 3, 2, 1, 3 | ||
273 | +}; | ||
274 | + | ||
275 | +static void do_mem_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, | ||
276 | + gen_helper_gvec_mem *fn) | ||
277 | +{ | ||
278 | + unsigned vsz = vec_full_reg_size(s); | ||
279 | + TCGv_ptr t_pg; | ||
280 | + TCGv_i32 desc; | ||
281 | + | ||
282 | + /* For e.g. LD4, there are not enough arguments to pass all 4 | ||
283 | + * registers as pointers, so encode the regno into the data field. | ||
284 | + * For consistency, do this even for LD1. | ||
285 | + */ | ||
286 | + desc = tcg_const_i32(simd_desc(vsz, vsz, zt)); | ||
287 | + t_pg = tcg_temp_new_ptr(); | ||
288 | + | ||
289 | + tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg)); | ||
290 | + fn(cpu_env, t_pg, addr, desc); | ||
291 | + | ||
292 | + tcg_temp_free_ptr(t_pg); | ||
293 | + tcg_temp_free_i32(desc); | ||
294 | +} | ||
295 | + | ||
296 | +static void do_ld_zpa(DisasContext *s, int zt, int pg, | ||
297 | + TCGv_i64 addr, int dtype, int nreg) | ||
298 | +{ | ||
299 | + static gen_helper_gvec_mem * const fns[16][4] = { | ||
300 | + { gen_helper_sve_ld1bb_r, gen_helper_sve_ld2bb_r, | ||
301 | + gen_helper_sve_ld3bb_r, gen_helper_sve_ld4bb_r }, | ||
302 | + { gen_helper_sve_ld1bhu_r, NULL, NULL, NULL }, | ||
303 | + { gen_helper_sve_ld1bsu_r, NULL, NULL, NULL }, | ||
304 | + { gen_helper_sve_ld1bdu_r, NULL, NULL, NULL }, | ||
305 | + | ||
306 | + { gen_helper_sve_ld1sds_r, NULL, NULL, NULL }, | ||
307 | + { gen_helper_sve_ld1hh_r, gen_helper_sve_ld2hh_r, | ||
308 | + gen_helper_sve_ld3hh_r, gen_helper_sve_ld4hh_r }, | ||
309 | + { gen_helper_sve_ld1hsu_r, NULL, NULL, NULL }, | ||
310 | + { gen_helper_sve_ld1hdu_r, NULL, NULL, NULL }, | ||
311 | + | ||
312 | + { gen_helper_sve_ld1hds_r, NULL, NULL, NULL }, | ||
313 | + { gen_helper_sve_ld1hss_r, NULL, NULL, NULL }, | ||
314 | + { gen_helper_sve_ld1ss_r, gen_helper_sve_ld2ss_r, | ||
315 | + gen_helper_sve_ld3ss_r, gen_helper_sve_ld4ss_r }, | ||
316 | + { gen_helper_sve_ld1sdu_r, NULL, NULL, NULL }, | ||
317 | + | ||
318 | + { gen_helper_sve_ld1bds_r, NULL, NULL, NULL }, | ||
319 | + { gen_helper_sve_ld1bss_r, NULL, NULL, NULL }, | ||
320 | + { gen_helper_sve_ld1bhs_r, NULL, NULL, NULL }, | ||
321 | + { gen_helper_sve_ld1dd_r, gen_helper_sve_ld2dd_r, | ||
322 | + gen_helper_sve_ld3dd_r, gen_helper_sve_ld4dd_r }, | ||
323 | + }; | ||
324 | + gen_helper_gvec_mem *fn = fns[dtype][nreg]; | ||
325 | + | ||
326 | + /* While there are holes in the table, they are not | ||
327 | + * accessible via the instruction encoding. | ||
328 | + */ | ||
329 | + assert(fn != NULL); | ||
330 | + do_mem_zpa(s, zt, pg, addr, fn); | ||
331 | +} | ||
332 | + | ||
333 | +static bool trans_LD_zprr(DisasContext *s, arg_rprr_load *a, uint32_t insn) | ||
334 | +{ | ||
335 | + if (a->rm == 31) { | ||
336 | + return false; | ||
337 | + } | ||
338 | + if (sve_access_check(s)) { | ||
339 | + TCGv_i64 addr = new_tmp_a64(s); | ||
340 | + tcg_gen_muli_i64(addr, cpu_reg(s, a->rm), | ||
341 | + (a->nreg + 1) << dtype_msz(a->dtype)); | ||
342 | + tcg_gen_add_i64(addr, addr, cpu_reg_sp(s, a->rn)); | ||
343 | + do_ld_zpa(s, a->rd, a->pg, addr, a->dtype, a->nreg); | ||
344 | + } | ||
345 | + return true; | ||
346 | +} | ||
347 | + | ||
348 | +static bool trans_LD_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn) | ||
349 | +{ | ||
350 | + if (sve_access_check(s)) { | ||
351 | + int vsz = vec_full_reg_size(s); | ||
352 | + int elements = vsz >> dtype_esz[a->dtype]; | ||
353 | + TCGv_i64 addr = new_tmp_a64(s); | ||
354 | + | ||
355 | + tcg_gen_addi_i64(addr, cpu_reg_sp(s, a->rn), | ||
356 | + (a->imm * elements * (a->nreg + 1)) | ||
357 | + << dtype_msz(a->dtype)); | ||
358 | + do_ld_zpa(s, a->rd, a->pg, addr, a->dtype, a->nreg); | ||
359 | + } | ||
360 | + return true; | ||
361 | +} | ||
362 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
363 | index XXXXXXX..XXXXXXX 100644 | ||
364 | --- a/target/arm/sve.decode | ||
365 | +++ b/target/arm/sve.decode | ||
366 | @@ -XXX,XX +XXX,XX @@ | ||
367 | # Unsigned 8-bit immediate, optionally shifted left by 8. | ||
368 | %sh8_i8u 5:9 !function=expand_imm_sh8u | ||
369 | |||
370 | +# Unsigned load of msz into esz=2, represented as a dtype. | ||
371 | +%msz_dtype 23:2 !function=msz_dtype | ||
372 | + | ||
373 | # Either a copy of rd (at bit 0), or a different source | ||
374 | # as propagated via the MOVPRFX instruction. | ||
375 | %reg_movprfx 0:5 | ||
376 | @@ -XXX,XX +XXX,XX @@ | ||
377 | &incdec2_cnt rd rn pat esz imm d u | ||
378 | &incdec_pred rd pg esz d u | ||
379 | &incdec2_pred rd rn pg esz d u | ||
380 | +&rprr_load rd pg rn rm dtype nreg | ||
381 | +&rpri_load rd pg rn imm dtype nreg | ||
382 | |||
383 | ########################################################################### | ||
384 | # Named instruction formats. These are generally used to | ||
385 | @@ -XXX,XX +XXX,XX @@ | ||
386 | @incdec2_pred ........ esz:2 .... .. ..... .. pg:4 rd:5 \ | ||
387 | &incdec2_pred rn=%reg_movprfx | ||
388 | |||
389 | +# Loads; user must fill in NREG. | ||
390 | +@rprr_load_dt ....... dtype:4 rm:5 ... pg:3 rn:5 rd:5 &rprr_load | ||
391 | +@rpri_load_dt ....... dtype:4 . imm:s4 ... pg:3 rn:5 rd:5 &rpri_load | ||
392 | + | ||
393 | +@rprr_load_msz ....... .... rm:5 ... pg:3 rn:5 rd:5 \ | ||
394 | + &rprr_load dtype=%msz_dtype | ||
395 | +@rpri_load_msz ....... .... . imm:s4 ... pg:3 rn:5 rd:5 \ | ||
396 | + &rpri_load dtype=%msz_dtype | ||
397 | + | ||
398 | ########################################################################### | ||
399 | # Instruction patterns. Grouped according to the SVE encodingindex.xhtml. | ||
400 | |||
401 | @@ -XXX,XX +XXX,XX @@ LDR_pri 10000101 10 ...... 000 ... ..... 0 .... @pd_rn_i9 | ||
402 | |||
403 | # SVE load vector register | ||
404 | LDR_zri 10000101 10 ...... 010 ... ..... ..... @rd_rn_i9 | ||
405 | + | ||
406 | +### SVE Memory Contiguous Load Group | ||
407 | + | ||
408 | +# SVE contiguous load (scalar plus scalar) | ||
409 | +LD_zprr 1010010 .... ..... 010 ... ..... ..... @rprr_load_dt nreg=0 | ||
410 | + | ||
411 | +# SVE contiguous load (scalar plus immediate) | ||
412 | +LD_zpri 1010010 .... 0.... 101 ... ..... ..... @rpri_load_dt nreg=0 | ||
413 | + | ||
414 | +# SVE contiguous non-temporal load (scalar plus scalar) | ||
415 | +# LDNT1B, LDNT1H, LDNT1W, LDNT1D | ||
416 | +# SVE load multiple structures (scalar plus scalar) | ||
417 | +# LD2B, LD2H, LD2W, LD2D; etc. | ||
418 | +LD_zprr 1010010 .. nreg:2 ..... 110 ... ..... ..... @rprr_load_msz | ||
419 | + | ||
420 | +# SVE contiguous non-temporal load (scalar plus immediate) | ||
421 | +# LDNT1B, LDNT1H, LDNT1W, LDNT1D | ||
422 | +# SVE load multiple structures (scalar plus immediate) | ||
423 | +# LD2B, LD2H, LD2W, LD2D; etc. | ||
424 | +LD_zpri 1010010 .. nreg:2 0.... 111 ... ..... ..... @rpri_load_msz | ||
425 | -- | ||
426 | 2.17.1 | ||
427 | |||
428 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
5 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
6 | Message-id: 20180627043328.11531-3-richard.henderson@linaro.org | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | --- | ||
9 | target/arm/helper-sve.h | 40 ++++++++++ | ||
10 | target/arm/sve_helper.c | 157 +++++++++++++++++++++++++++++++++++++ | ||
11 | target/arm/translate-sve.c | 69 ++++++++++++++++ | ||
12 | target/arm/sve.decode | 6 ++ | ||
13 | 4 files changed, 272 insertions(+) | ||
14 | |||
15 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/target/arm/helper-sve.h | ||
18 | +++ b/target/arm/helper-sve.h | ||
19 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_4(sve_ld1hds_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
20 | |||
21 | DEF_HELPER_FLAGS_4(sve_ld1sdu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
22 | DEF_HELPER_FLAGS_4(sve_ld1sds_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
23 | + | ||
24 | +DEF_HELPER_FLAGS_4(sve_ldff1bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
25 | +DEF_HELPER_FLAGS_4(sve_ldff1bhu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
26 | +DEF_HELPER_FLAGS_4(sve_ldff1bsu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
27 | +DEF_HELPER_FLAGS_4(sve_ldff1bdu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
28 | +DEF_HELPER_FLAGS_4(sve_ldff1bhs_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
29 | +DEF_HELPER_FLAGS_4(sve_ldff1bss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
30 | +DEF_HELPER_FLAGS_4(sve_ldff1bds_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
31 | + | ||
32 | +DEF_HELPER_FLAGS_4(sve_ldff1hh_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
33 | +DEF_HELPER_FLAGS_4(sve_ldff1hsu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
34 | +DEF_HELPER_FLAGS_4(sve_ldff1hdu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
35 | +DEF_HELPER_FLAGS_4(sve_ldff1hss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
36 | +DEF_HELPER_FLAGS_4(sve_ldff1hds_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
37 | + | ||
38 | +DEF_HELPER_FLAGS_4(sve_ldff1ss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
39 | +DEF_HELPER_FLAGS_4(sve_ldff1sdu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
40 | +DEF_HELPER_FLAGS_4(sve_ldff1sds_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
41 | + | ||
42 | +DEF_HELPER_FLAGS_4(sve_ldff1dd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
43 | + | ||
44 | +DEF_HELPER_FLAGS_4(sve_ldnf1bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
45 | +DEF_HELPER_FLAGS_4(sve_ldnf1bhu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
46 | +DEF_HELPER_FLAGS_4(sve_ldnf1bsu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
47 | +DEF_HELPER_FLAGS_4(sve_ldnf1bdu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
48 | +DEF_HELPER_FLAGS_4(sve_ldnf1bhs_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
49 | +DEF_HELPER_FLAGS_4(sve_ldnf1bss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
50 | +DEF_HELPER_FLAGS_4(sve_ldnf1bds_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
51 | + | ||
52 | +DEF_HELPER_FLAGS_4(sve_ldnf1hh_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
53 | +DEF_HELPER_FLAGS_4(sve_ldnf1hsu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
54 | +DEF_HELPER_FLAGS_4(sve_ldnf1hdu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
55 | +DEF_HELPER_FLAGS_4(sve_ldnf1hss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
56 | +DEF_HELPER_FLAGS_4(sve_ldnf1hds_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
57 | + | ||
58 | +DEF_HELPER_FLAGS_4(sve_ldnf1ss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
59 | +DEF_HELPER_FLAGS_4(sve_ldnf1sdu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
60 | +DEF_HELPER_FLAGS_4(sve_ldnf1sds_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
61 | + | ||
62 | +DEF_HELPER_FLAGS_4(sve_ldnf1dd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
63 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
64 | index XXXXXXX..XXXXXXX 100644 | ||
65 | --- a/target/arm/sve_helper.c | ||
66 | +++ b/target/arm/sve_helper.c | ||
67 | @@ -XXX,XX +XXX,XX @@ DO_LD4(sve_ld4dd_r, cpu_ldq_data_ra, uint64_t, uint64_t, ) | ||
68 | #undef DO_LD2 | ||
69 | #undef DO_LD3 | ||
70 | #undef DO_LD4 | ||
71 | + | ||
72 | +/* | ||
73 | + * Load contiguous data, first-fault and no-fault. | ||
74 | + */ | ||
75 | + | ||
76 | +#ifdef CONFIG_USER_ONLY | ||
77 | + | ||
78 | +/* Fault on byte I. All bits in FFR from I are cleared. The vector | ||
79 | + * result from I is CONSTRAINED UNPREDICTABLE; we choose the MERGE | ||
80 | + * option, which leaves subsequent data unchanged. | ||
81 | + */ | ||
82 | +static void record_fault(CPUARMState *env, uintptr_t i, uintptr_t oprsz) | ||
83 | +{ | ||
84 | + uint64_t *ffr = env->vfp.pregs[FFR_PRED_NUM].p; | ||
85 | + | ||
86 | + if (i & 63) { | ||
87 | + ffr[i / 64] &= MAKE_64BIT_MASK(0, i & 63); | ||
88 | + i = ROUND_UP(i, 64); | ||
89 | + } | ||
90 | + for (; i < oprsz; i += 64) { | ||
91 | + ffr[i / 64] = 0; | ||
92 | + } | ||
93 | +} | ||
94 | + | ||
95 | +/* Hold the mmap lock during the operation so that there is no race | ||
96 | + * between page_check_range and the load operation. We expect the | ||
97 | + * usual case to have no faults at all, so we check the whole range | ||
98 | + * first and if successful defer to the normal load operation. | ||
99 | + * | ||
100 | + * TODO: Change mmap_lock to a rwlock so that multiple readers | ||
101 | + * can run simultaneously. This will probably help other uses | ||
102 | + * within QEMU as well. | ||
103 | + */ | ||
104 | +#define DO_LDFF1(PART, FN, TYPEE, TYPEM, H) \ | ||
105 | +static void do_sve_ldff1##PART(CPUARMState *env, void *vd, void *vg, \ | ||
106 | + target_ulong addr, intptr_t oprsz, \ | ||
107 | + bool first, uintptr_t ra) \ | ||
108 | +{ \ | ||
109 | + intptr_t i = 0; \ | ||
110 | + do { \ | ||
111 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ | ||
112 | + do { \ | ||
113 | + TYPEM m = 0; \ | ||
114 | + if (pg & 1) { \ | ||
115 | + if (!first && \ | ||
116 | + unlikely(page_check_range(addr, sizeof(TYPEM), \ | ||
117 | + PAGE_READ))) { \ | ||
118 | + record_fault(env, i, oprsz); \ | ||
119 | + return; \ | ||
120 | + } \ | ||
121 | + m = FN(env, addr, ra); \ | ||
122 | + first = false; \ | ||
123 | + } \ | ||
124 | + *(TYPEE *)(vd + H(i)) = m; \ | ||
125 | + i += sizeof(TYPEE), pg >>= sizeof(TYPEE); \ | ||
126 | + addr += sizeof(TYPEM); \ | ||
127 | + } while (i & 15); \ | ||
128 | + } while (i < oprsz); \ | ||
129 | +} \ | ||
130 | +void HELPER(sve_ldff1##PART)(CPUARMState *env, void *vg, \ | ||
131 | + target_ulong addr, uint32_t desc) \ | ||
132 | +{ \ | ||
133 | + intptr_t oprsz = simd_oprsz(desc); \ | ||
134 | + unsigned rd = simd_data(desc); \ | ||
135 | + void *vd = &env->vfp.zregs[rd]; \ | ||
136 | + mmap_lock(); \ | ||
137 | + if (likely(page_check_range(addr, oprsz, PAGE_READ) == 0)) { \ | ||
138 | + do_sve_ld1##PART(env, vd, vg, addr, oprsz, GETPC()); \ | ||
139 | + } else { \ | ||
140 | + do_sve_ldff1##PART(env, vd, vg, addr, oprsz, true, GETPC()); \ | ||
141 | + } \ | ||
142 | + mmap_unlock(); \ | ||
143 | +} | ||
144 | + | ||
145 | +/* No-fault loads are like first-fault loads without the | ||
146 | + * first faulting special case. | ||
147 | + */ | ||
148 | +#define DO_LDNF1(PART) \ | ||
149 | +void HELPER(sve_ldnf1##PART)(CPUARMState *env, void *vg, \ | ||
150 | + target_ulong addr, uint32_t desc) \ | ||
151 | +{ \ | ||
152 | + intptr_t oprsz = simd_oprsz(desc); \ | ||
153 | + unsigned rd = simd_data(desc); \ | ||
154 | + void *vd = &env->vfp.zregs[rd]; \ | ||
155 | + mmap_lock(); \ | ||
156 | + if (likely(page_check_range(addr, oprsz, PAGE_READ) == 0)) { \ | ||
157 | + do_sve_ld1##PART(env, vd, vg, addr, oprsz, GETPC()); \ | ||
158 | + } else { \ | ||
159 | + do_sve_ldff1##PART(env, vd, vg, addr, oprsz, false, GETPC()); \ | ||
160 | + } \ | ||
161 | + mmap_unlock(); \ | ||
162 | +} | ||
163 | + | ||
164 | +#else | ||
165 | + | ||
166 | +/* TODO: System mode is not yet supported. | ||
167 | + * This would probably use tlb_vaddr_to_host. | ||
168 | + */ | ||
169 | +#define DO_LDFF1(PART, FN, TYPEE, TYPEM, H) \ | ||
170 | +void HELPER(sve_ldff1##PART)(CPUARMState *env, void *vg, \ | ||
171 | + target_ulong addr, uint32_t desc) \ | ||
172 | +{ \ | ||
173 | + g_assert_not_reached(); \ | ||
174 | +} | ||
175 | + | ||
176 | +#define DO_LDNF1(PART) \ | ||
177 | +void HELPER(sve_ldnf1##PART)(CPUARMState *env, void *vg, \ | ||
178 | + target_ulong addr, uint32_t desc) \ | ||
179 | +{ \ | ||
180 | + g_assert_not_reached(); \ | ||
181 | +} | ||
182 | + | ||
183 | +#endif | ||
184 | + | ||
185 | +DO_LDFF1(bb_r, cpu_ldub_data_ra, uint8_t, uint8_t, H1) | ||
186 | +DO_LDFF1(bhu_r, cpu_ldub_data_ra, uint16_t, uint8_t, H1_2) | ||
187 | +DO_LDFF1(bhs_r, cpu_ldsb_data_ra, uint16_t, int8_t, H1_2) | ||
188 | +DO_LDFF1(bsu_r, cpu_ldub_data_ra, uint32_t, uint8_t, H1_4) | ||
189 | +DO_LDFF1(bss_r, cpu_ldsb_data_ra, uint32_t, int8_t, H1_4) | ||
190 | +DO_LDFF1(bdu_r, cpu_ldub_data_ra, uint64_t, uint8_t, ) | ||
191 | +DO_LDFF1(bds_r, cpu_ldsb_data_ra, uint64_t, int8_t, ) | ||
192 | + | ||
193 | +DO_LDFF1(hh_r, cpu_lduw_data_ra, uint16_t, uint16_t, H1_2) | ||
194 | +DO_LDFF1(hsu_r, cpu_lduw_data_ra, uint32_t, uint16_t, H1_4) | ||
195 | +DO_LDFF1(hss_r, cpu_ldsw_data_ra, uint32_t, int8_t, H1_4) | ||
196 | +DO_LDFF1(hdu_r, cpu_lduw_data_ra, uint64_t, uint16_t, ) | ||
197 | +DO_LDFF1(hds_r, cpu_ldsw_data_ra, uint64_t, int16_t, ) | ||
198 | + | ||
199 | +DO_LDFF1(ss_r, cpu_ldl_data_ra, uint32_t, uint32_t, H1_4) | ||
200 | +DO_LDFF1(sdu_r, cpu_ldl_data_ra, uint64_t, uint32_t, ) | ||
201 | +DO_LDFF1(sds_r, cpu_ldl_data_ra, uint64_t, int32_t, ) | ||
202 | + | ||
203 | +DO_LDFF1(dd_r, cpu_ldq_data_ra, uint64_t, uint64_t, ) | ||
204 | + | ||
205 | +#undef DO_LDFF1 | ||
206 | + | ||
207 | +DO_LDNF1(bb_r) | ||
208 | +DO_LDNF1(bhu_r) | ||
209 | +DO_LDNF1(bhs_r) | ||
210 | +DO_LDNF1(bsu_r) | ||
211 | +DO_LDNF1(bss_r) | ||
212 | +DO_LDNF1(bdu_r) | ||
213 | +DO_LDNF1(bds_r) | ||
214 | + | ||
215 | +DO_LDNF1(hh_r) | ||
216 | +DO_LDNF1(hsu_r) | ||
217 | +DO_LDNF1(hss_r) | ||
218 | +DO_LDNF1(hdu_r) | ||
219 | +DO_LDNF1(hds_r) | ||
220 | + | ||
221 | +DO_LDNF1(ss_r) | ||
222 | +DO_LDNF1(sdu_r) | ||
223 | +DO_LDNF1(sds_r) | ||
224 | + | ||
225 | +DO_LDNF1(dd_r) | ||
226 | + | ||
227 | +#undef DO_LDNF1 | ||
228 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
229 | index XXXXXXX..XXXXXXX 100644 | ||
230 | --- a/target/arm/translate-sve.c | ||
231 | +++ b/target/arm/translate-sve.c | ||
232 | @@ -XXX,XX +XXX,XX @@ static bool trans_LD_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn) | ||
233 | } | ||
234 | return true; | ||
235 | } | ||
236 | + | ||
237 | +static bool trans_LDFF1_zprr(DisasContext *s, arg_rprr_load *a, uint32_t insn) | ||
238 | +{ | ||
239 | + static gen_helper_gvec_mem * const fns[16] = { | ||
240 | + gen_helper_sve_ldff1bb_r, | ||
241 | + gen_helper_sve_ldff1bhu_r, | ||
242 | + gen_helper_sve_ldff1bsu_r, | ||
243 | + gen_helper_sve_ldff1bdu_r, | ||
244 | + | ||
245 | + gen_helper_sve_ldff1sds_r, | ||
246 | + gen_helper_sve_ldff1hh_r, | ||
247 | + gen_helper_sve_ldff1hsu_r, | ||
248 | + gen_helper_sve_ldff1hdu_r, | ||
249 | + | ||
250 | + gen_helper_sve_ldff1hds_r, | ||
251 | + gen_helper_sve_ldff1hss_r, | ||
252 | + gen_helper_sve_ldff1ss_r, | ||
253 | + gen_helper_sve_ldff1sdu_r, | ||
254 | + | ||
255 | + gen_helper_sve_ldff1bds_r, | ||
256 | + gen_helper_sve_ldff1bss_r, | ||
257 | + gen_helper_sve_ldff1bhs_r, | ||
258 | + gen_helper_sve_ldff1dd_r, | ||
259 | + }; | ||
260 | + | ||
261 | + if (sve_access_check(s)) { | ||
262 | + TCGv_i64 addr = new_tmp_a64(s); | ||
263 | + tcg_gen_shli_i64(addr, cpu_reg(s, a->rm), dtype_msz(a->dtype)); | ||
264 | + tcg_gen_add_i64(addr, addr, cpu_reg_sp(s, a->rn)); | ||
265 | + do_mem_zpa(s, a->rd, a->pg, addr, fns[a->dtype]); | ||
266 | + } | ||
267 | + return true; | ||
268 | +} | ||
269 | + | ||
270 | +static bool trans_LDNF1_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn) | ||
271 | +{ | ||
272 | + static gen_helper_gvec_mem * const fns[16] = { | ||
273 | + gen_helper_sve_ldnf1bb_r, | ||
274 | + gen_helper_sve_ldnf1bhu_r, | ||
275 | + gen_helper_sve_ldnf1bsu_r, | ||
276 | + gen_helper_sve_ldnf1bdu_r, | ||
277 | + | ||
278 | + gen_helper_sve_ldnf1sds_r, | ||
279 | + gen_helper_sve_ldnf1hh_r, | ||
280 | + gen_helper_sve_ldnf1hsu_r, | ||
281 | + gen_helper_sve_ldnf1hdu_r, | ||
282 | + | ||
283 | + gen_helper_sve_ldnf1hds_r, | ||
284 | + gen_helper_sve_ldnf1hss_r, | ||
285 | + gen_helper_sve_ldnf1ss_r, | ||
286 | + gen_helper_sve_ldnf1sdu_r, | ||
287 | + | ||
288 | + gen_helper_sve_ldnf1bds_r, | ||
289 | + gen_helper_sve_ldnf1bss_r, | ||
290 | + gen_helper_sve_ldnf1bhs_r, | ||
291 | + gen_helper_sve_ldnf1dd_r, | ||
292 | + }; | ||
293 | + | ||
294 | + if (sve_access_check(s)) { | ||
295 | + int vsz = vec_full_reg_size(s); | ||
296 | + int elements = vsz >> dtype_esz[a->dtype]; | ||
297 | + int off = (a->imm * elements) << dtype_msz(a->dtype); | ||
298 | + TCGv_i64 addr = new_tmp_a64(s); | ||
299 | + | ||
300 | + tcg_gen_addi_i64(addr, cpu_reg_sp(s, a->rn), off); | ||
301 | + do_mem_zpa(s, a->rd, a->pg, addr, fns[a->dtype]); | ||
302 | + } | ||
303 | + return true; | ||
304 | +} | ||
305 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
306 | index XXXXXXX..XXXXXXX 100644 | ||
307 | --- a/target/arm/sve.decode | ||
308 | +++ b/target/arm/sve.decode | ||
309 | @@ -XXX,XX +XXX,XX @@ LDR_zri 10000101 10 ...... 010 ... ..... ..... @rd_rn_i9 | ||
310 | # SVE contiguous load (scalar plus scalar) | ||
311 | LD_zprr 1010010 .... ..... 010 ... ..... ..... @rprr_load_dt nreg=0 | ||
312 | |||
313 | +# SVE contiguous first-fault load (scalar plus scalar) | ||
314 | +LDFF1_zprr 1010010 .... ..... 011 ... ..... ..... @rprr_load_dt nreg=0 | ||
315 | + | ||
316 | # SVE contiguous load (scalar plus immediate) | ||
317 | LD_zpri 1010010 .... 0.... 101 ... ..... ..... @rpri_load_dt nreg=0 | ||
318 | |||
319 | +# SVE contiguous non-fault load (scalar plus immediate) | ||
320 | +LDNF1_zpri 1010010 .... 1.... 101 ... ..... ..... @rpri_load_dt nreg=0 | ||
321 | + | ||
322 | # SVE contiguous non-temporal load (scalar plus scalar) | ||
323 | # LDNT1B, LDNT1H, LDNT1W, LDNT1D | ||
324 | # SVE load multiple structures (scalar plus scalar) | ||
325 | -- | ||
326 | 2.17.1 | ||
327 | |||
328 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-4-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 29 +++++ | ||
9 | target/arm/sve_helper.c | 211 +++++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 65 ++++++++++++ | ||
11 | target/arm/sve.decode | 38 +++++++ | ||
12 | 4 files changed, 343 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_4(sve_ldnf1sdu_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
19 | DEF_HELPER_FLAGS_4(sve_ldnf1sds_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
20 | |||
21 | DEF_HELPER_FLAGS_4(sve_ldnf1dd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
22 | + | ||
23 | +DEF_HELPER_FLAGS_4(sve_st1bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
24 | +DEF_HELPER_FLAGS_4(sve_st2bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
25 | +DEF_HELPER_FLAGS_4(sve_st3bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
26 | +DEF_HELPER_FLAGS_4(sve_st4bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
27 | + | ||
28 | +DEF_HELPER_FLAGS_4(sve_st1hh_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
29 | +DEF_HELPER_FLAGS_4(sve_st2hh_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
30 | +DEF_HELPER_FLAGS_4(sve_st3hh_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
31 | +DEF_HELPER_FLAGS_4(sve_st4hh_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
32 | + | ||
33 | +DEF_HELPER_FLAGS_4(sve_st1ss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
34 | +DEF_HELPER_FLAGS_4(sve_st2ss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
35 | +DEF_HELPER_FLAGS_4(sve_st3ss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
36 | +DEF_HELPER_FLAGS_4(sve_st4ss_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
37 | + | ||
38 | +DEF_HELPER_FLAGS_4(sve_st1dd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
39 | +DEF_HELPER_FLAGS_4(sve_st2dd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
40 | +DEF_HELPER_FLAGS_4(sve_st3dd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
41 | +DEF_HELPER_FLAGS_4(sve_st4dd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
42 | + | ||
43 | +DEF_HELPER_FLAGS_4(sve_st1bh_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
44 | +DEF_HELPER_FLAGS_4(sve_st1bs_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
45 | +DEF_HELPER_FLAGS_4(sve_st1bd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
46 | + | ||
47 | +DEF_HELPER_FLAGS_4(sve_st1hs_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
48 | +DEF_HELPER_FLAGS_4(sve_st1hd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
49 | + | ||
50 | +DEF_HELPER_FLAGS_4(sve_st1sd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
51 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
52 | index XXXXXXX..XXXXXXX 100644 | ||
53 | --- a/target/arm/sve_helper.c | ||
54 | +++ b/target/arm/sve_helper.c | ||
55 | @@ -XXX,XX +XXX,XX @@ DO_LDNF1(sds_r) | ||
56 | DO_LDNF1(dd_r) | ||
57 | |||
58 | #undef DO_LDNF1 | ||
59 | + | ||
60 | +/* | ||
61 | + * Store contiguous data, protected by a governing predicate. | ||
62 | + */ | ||
63 | +#define DO_ST1(NAME, FN, TYPEE, TYPEM, H) \ | ||
64 | +void HELPER(NAME)(CPUARMState *env, void *vg, \ | ||
65 | + target_ulong addr, uint32_t desc) \ | ||
66 | +{ \ | ||
67 | + intptr_t i, oprsz = simd_oprsz(desc); \ | ||
68 | + intptr_t ra = GETPC(); \ | ||
69 | + unsigned rd = simd_data(desc); \ | ||
70 | + void *vd = &env->vfp.zregs[rd]; \ | ||
71 | + for (i = 0; i < oprsz; ) { \ | ||
72 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ | ||
73 | + do { \ | ||
74 | + if (pg & 1) { \ | ||
75 | + TYPEM m = *(TYPEE *)(vd + H(i)); \ | ||
76 | + FN(env, addr, m, ra); \ | ||
77 | + } \ | ||
78 | + i += sizeof(TYPEE), pg >>= sizeof(TYPEE); \ | ||
79 | + addr += sizeof(TYPEM); \ | ||
80 | + } while (i & 15); \ | ||
81 | + } \ | ||
82 | +} | ||
83 | + | ||
84 | +#define DO_ST1_D(NAME, FN, TYPEM) \ | ||
85 | +void HELPER(NAME)(CPUARMState *env, void *vg, \ | ||
86 | + target_ulong addr, uint32_t desc) \ | ||
87 | +{ \ | ||
88 | + intptr_t i, oprsz = simd_oprsz(desc) / 8; \ | ||
89 | + intptr_t ra = GETPC(); \ | ||
90 | + unsigned rd = simd_data(desc); \ | ||
91 | + uint64_t *d = &env->vfp.zregs[rd].d[0]; \ | ||
92 | + uint8_t *pg = vg; \ | ||
93 | + for (i = 0; i < oprsz; i += 1) { \ | ||
94 | + if (pg[H1(i)] & 1) { \ | ||
95 | + FN(env, addr, d[i], ra); \ | ||
96 | + } \ | ||
97 | + addr += sizeof(TYPEM); \ | ||
98 | + } \ | ||
99 | +} | ||
100 | + | ||
101 | +#define DO_ST2(NAME, FN, TYPEE, TYPEM, H) \ | ||
102 | +void HELPER(NAME)(CPUARMState *env, void *vg, \ | ||
103 | + target_ulong addr, uint32_t desc) \ | ||
104 | +{ \ | ||
105 | + intptr_t i, oprsz = simd_oprsz(desc); \ | ||
106 | + intptr_t ra = GETPC(); \ | ||
107 | + unsigned rd = simd_data(desc); \ | ||
108 | + void *d1 = &env->vfp.zregs[rd]; \ | ||
109 | + void *d2 = &env->vfp.zregs[(rd + 1) & 31]; \ | ||
110 | + for (i = 0; i < oprsz; ) { \ | ||
111 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ | ||
112 | + do { \ | ||
113 | + if (pg & 1) { \ | ||
114 | + TYPEM m1 = *(TYPEE *)(d1 + H(i)); \ | ||
115 | + TYPEM m2 = *(TYPEE *)(d2 + H(i)); \ | ||
116 | + FN(env, addr, m1, ra); \ | ||
117 | + FN(env, addr + sizeof(TYPEM), m2, ra); \ | ||
118 | + } \ | ||
119 | + i += sizeof(TYPEE), pg >>= sizeof(TYPEE); \ | ||
120 | + addr += 2 * sizeof(TYPEM); \ | ||
121 | + } while (i & 15); \ | ||
122 | + } \ | ||
123 | +} | ||
124 | + | ||
125 | +#define DO_ST3(NAME, FN, TYPEE, TYPEM, H) \ | ||
126 | +void HELPER(NAME)(CPUARMState *env, void *vg, \ | ||
127 | + target_ulong addr, uint32_t desc) \ | ||
128 | +{ \ | ||
129 | + intptr_t i, oprsz = simd_oprsz(desc); \ | ||
130 | + intptr_t ra = GETPC(); \ | ||
131 | + unsigned rd = simd_data(desc); \ | ||
132 | + void *d1 = &env->vfp.zregs[rd]; \ | ||
133 | + void *d2 = &env->vfp.zregs[(rd + 1) & 31]; \ | ||
134 | + void *d3 = &env->vfp.zregs[(rd + 2) & 31]; \ | ||
135 | + for (i = 0; i < oprsz; ) { \ | ||
136 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ | ||
137 | + do { \ | ||
138 | + if (pg & 1) { \ | ||
139 | + TYPEM m1 = *(TYPEE *)(d1 + H(i)); \ | ||
140 | + TYPEM m2 = *(TYPEE *)(d2 + H(i)); \ | ||
141 | + TYPEM m3 = *(TYPEE *)(d3 + H(i)); \ | ||
142 | + FN(env, addr, m1, ra); \ | ||
143 | + FN(env, addr + sizeof(TYPEM), m2, ra); \ | ||
144 | + FN(env, addr + 2 * sizeof(TYPEM), m3, ra); \ | ||
145 | + } \ | ||
146 | + i += sizeof(TYPEE), pg >>= sizeof(TYPEE); \ | ||
147 | + addr += 3 * sizeof(TYPEM); \ | ||
148 | + } while (i & 15); \ | ||
149 | + } \ | ||
150 | +} | ||
151 | + | ||
152 | +#define DO_ST4(NAME, FN, TYPEE, TYPEM, H) \ | ||
153 | +void HELPER(NAME)(CPUARMState *env, void *vg, \ | ||
154 | + target_ulong addr, uint32_t desc) \ | ||
155 | +{ \ | ||
156 | + intptr_t i, oprsz = simd_oprsz(desc); \ | ||
157 | + intptr_t ra = GETPC(); \ | ||
158 | + unsigned rd = simd_data(desc); \ | ||
159 | + void *d1 = &env->vfp.zregs[rd]; \ | ||
160 | + void *d2 = &env->vfp.zregs[(rd + 1) & 31]; \ | ||
161 | + void *d3 = &env->vfp.zregs[(rd + 2) & 31]; \ | ||
162 | + void *d4 = &env->vfp.zregs[(rd + 3) & 31]; \ | ||
163 | + for (i = 0; i < oprsz; ) { \ | ||
164 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ | ||
165 | + do { \ | ||
166 | + if (pg & 1) { \ | ||
167 | + TYPEM m1 = *(TYPEE *)(d1 + H(i)); \ | ||
168 | + TYPEM m2 = *(TYPEE *)(d2 + H(i)); \ | ||
169 | + TYPEM m3 = *(TYPEE *)(d3 + H(i)); \ | ||
170 | + TYPEM m4 = *(TYPEE *)(d4 + H(i)); \ | ||
171 | + FN(env, addr, m1, ra); \ | ||
172 | + FN(env, addr + sizeof(TYPEM), m2, ra); \ | ||
173 | + FN(env, addr + 2 * sizeof(TYPEM), m3, ra); \ | ||
174 | + FN(env, addr + 3 * sizeof(TYPEM), m4, ra); \ | ||
175 | + } \ | ||
176 | + i += sizeof(TYPEE), pg >>= sizeof(TYPEE); \ | ||
177 | + addr += 4 * sizeof(TYPEM); \ | ||
178 | + } while (i & 15); \ | ||
179 | + } \ | ||
180 | +} | ||
181 | + | ||
182 | +DO_ST1(sve_st1bh_r, cpu_stb_data_ra, uint16_t, uint8_t, H1_2) | ||
183 | +DO_ST1(sve_st1bs_r, cpu_stb_data_ra, uint32_t, uint8_t, H1_4) | ||
184 | +DO_ST1_D(sve_st1bd_r, cpu_stb_data_ra, uint8_t) | ||
185 | + | ||
186 | +DO_ST1(sve_st1hs_r, cpu_stw_data_ra, uint32_t, uint16_t, H1_4) | ||
187 | +DO_ST1_D(sve_st1hd_r, cpu_stw_data_ra, uint16_t) | ||
188 | + | ||
189 | +DO_ST1_D(sve_st1sd_r, cpu_stl_data_ra, uint32_t) | ||
190 | + | ||
191 | +DO_ST1(sve_st1bb_r, cpu_stb_data_ra, uint8_t, uint8_t, H1) | ||
192 | +DO_ST2(sve_st2bb_r, cpu_stb_data_ra, uint8_t, uint8_t, H1) | ||
193 | +DO_ST3(sve_st3bb_r, cpu_stb_data_ra, uint8_t, uint8_t, H1) | ||
194 | +DO_ST4(sve_st4bb_r, cpu_stb_data_ra, uint8_t, uint8_t, H1) | ||
195 | + | ||
196 | +DO_ST1(sve_st1hh_r, cpu_stw_data_ra, uint16_t, uint16_t, H1_2) | ||
197 | +DO_ST2(sve_st2hh_r, cpu_stw_data_ra, uint16_t, uint16_t, H1_2) | ||
198 | +DO_ST3(sve_st3hh_r, cpu_stw_data_ra, uint16_t, uint16_t, H1_2) | ||
199 | +DO_ST4(sve_st4hh_r, cpu_stw_data_ra, uint16_t, uint16_t, H1_2) | ||
200 | + | ||
201 | +DO_ST1(sve_st1ss_r, cpu_stl_data_ra, uint32_t, uint32_t, H1_4) | ||
202 | +DO_ST2(sve_st2ss_r, cpu_stl_data_ra, uint32_t, uint32_t, H1_4) | ||
203 | +DO_ST3(sve_st3ss_r, cpu_stl_data_ra, uint32_t, uint32_t, H1_4) | ||
204 | +DO_ST4(sve_st4ss_r, cpu_stl_data_ra, uint32_t, uint32_t, H1_4) | ||
205 | + | ||
206 | +DO_ST1_D(sve_st1dd_r, cpu_stq_data_ra, uint64_t) | ||
207 | + | ||
208 | +void HELPER(sve_st2dd_r)(CPUARMState *env, void *vg, | ||
209 | + target_ulong addr, uint32_t desc) | ||
210 | +{ | ||
211 | + intptr_t i, oprsz = simd_oprsz(desc) / 8; | ||
212 | + intptr_t ra = GETPC(); | ||
213 | + unsigned rd = simd_data(desc); | ||
214 | + uint64_t *d1 = &env->vfp.zregs[rd].d[0]; | ||
215 | + uint64_t *d2 = &env->vfp.zregs[(rd + 1) & 31].d[0]; | ||
216 | + uint8_t *pg = vg; | ||
217 | + | ||
218 | + for (i = 0; i < oprsz; i += 1) { | ||
219 | + if (pg[H1(i)] & 1) { | ||
220 | + cpu_stq_data_ra(env, addr, d1[i], ra); | ||
221 | + cpu_stq_data_ra(env, addr + 8, d2[i], ra); | ||
222 | + } | ||
223 | + addr += 2 * 8; | ||
224 | + } | ||
225 | +} | ||
226 | + | ||
227 | +void HELPER(sve_st3dd_r)(CPUARMState *env, void *vg, | ||
228 | + target_ulong addr, uint32_t desc) | ||
229 | +{ | ||
230 | + intptr_t i, oprsz = simd_oprsz(desc) / 8; | ||
231 | + intptr_t ra = GETPC(); | ||
232 | + unsigned rd = simd_data(desc); | ||
233 | + uint64_t *d1 = &env->vfp.zregs[rd].d[0]; | ||
234 | + uint64_t *d2 = &env->vfp.zregs[(rd + 1) & 31].d[0]; | ||
235 | + uint64_t *d3 = &env->vfp.zregs[(rd + 2) & 31].d[0]; | ||
236 | + uint8_t *pg = vg; | ||
237 | + | ||
238 | + for (i = 0; i < oprsz; i += 1) { | ||
239 | + if (pg[H1(i)] & 1) { | ||
240 | + cpu_stq_data_ra(env, addr, d1[i], ra); | ||
241 | + cpu_stq_data_ra(env, addr + 8, d2[i], ra); | ||
242 | + cpu_stq_data_ra(env, addr + 16, d3[i], ra); | ||
243 | + } | ||
244 | + addr += 3 * 8; | ||
245 | + } | ||
246 | +} | ||
247 | + | ||
248 | +void HELPER(sve_st4dd_r)(CPUARMState *env, void *vg, | ||
249 | + target_ulong addr, uint32_t desc) | ||
250 | +{ | ||
251 | + intptr_t i, oprsz = simd_oprsz(desc) / 8; | ||
252 | + intptr_t ra = GETPC(); | ||
253 | + unsigned rd = simd_data(desc); | ||
254 | + uint64_t *d1 = &env->vfp.zregs[rd].d[0]; | ||
255 | + uint64_t *d2 = &env->vfp.zregs[(rd + 1) & 31].d[0]; | ||
256 | + uint64_t *d3 = &env->vfp.zregs[(rd + 2) & 31].d[0]; | ||
257 | + uint64_t *d4 = &env->vfp.zregs[(rd + 3) & 31].d[0]; | ||
258 | + uint8_t *pg = vg; | ||
259 | + | ||
260 | + for (i = 0; i < oprsz; i += 1) { | ||
261 | + if (pg[H1(i)] & 1) { | ||
262 | + cpu_stq_data_ra(env, addr, d1[i], ra); | ||
263 | + cpu_stq_data_ra(env, addr + 8, d2[i], ra); | ||
264 | + cpu_stq_data_ra(env, addr + 16, d3[i], ra); | ||
265 | + cpu_stq_data_ra(env, addr + 24, d4[i], ra); | ||
266 | + } | ||
267 | + addr += 4 * 8; | ||
268 | + } | ||
269 | +} | ||
270 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
271 | index XXXXXXX..XXXXXXX 100644 | ||
272 | --- a/target/arm/translate-sve.c | ||
273 | +++ b/target/arm/translate-sve.c | ||
274 | @@ -XXX,XX +XXX,XX @@ static bool trans_LDNF1_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn) | ||
275 | } | ||
276 | return true; | ||
277 | } | ||
278 | + | ||
279 | +static void do_st_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, | ||
280 | + int msz, int esz, int nreg) | ||
281 | +{ | ||
282 | + static gen_helper_gvec_mem * const fn_single[4][4] = { | ||
283 | + { gen_helper_sve_st1bb_r, gen_helper_sve_st1bh_r, | ||
284 | + gen_helper_sve_st1bs_r, gen_helper_sve_st1bd_r }, | ||
285 | + { NULL, gen_helper_sve_st1hh_r, | ||
286 | + gen_helper_sve_st1hs_r, gen_helper_sve_st1hd_r }, | ||
287 | + { NULL, NULL, | ||
288 | + gen_helper_sve_st1ss_r, gen_helper_sve_st1sd_r }, | ||
289 | + { NULL, NULL, NULL, gen_helper_sve_st1dd_r }, | ||
290 | + }; | ||
291 | + static gen_helper_gvec_mem * const fn_multiple[3][4] = { | ||
292 | + { gen_helper_sve_st2bb_r, gen_helper_sve_st2hh_r, | ||
293 | + gen_helper_sve_st2ss_r, gen_helper_sve_st2dd_r }, | ||
294 | + { gen_helper_sve_st3bb_r, gen_helper_sve_st3hh_r, | ||
295 | + gen_helper_sve_st3ss_r, gen_helper_sve_st3dd_r }, | ||
296 | + { gen_helper_sve_st4bb_r, gen_helper_sve_st4hh_r, | ||
297 | + gen_helper_sve_st4ss_r, gen_helper_sve_st4dd_r }, | ||
298 | + }; | ||
299 | + gen_helper_gvec_mem *fn; | ||
300 | + | ||
301 | + if (nreg == 0) { | ||
302 | + /* ST1 */ | ||
303 | + fn = fn_single[msz][esz]; | ||
304 | + } else { | ||
305 | + /* ST2, ST3, ST4 -- msz == esz, enforced by encoding */ | ||
306 | + assert(msz == esz); | ||
307 | + fn = fn_multiple[nreg - 1][msz]; | ||
308 | + } | ||
309 | + assert(fn != NULL); | ||
310 | + do_mem_zpa(s, zt, pg, addr, fn); | ||
311 | +} | ||
312 | + | ||
313 | +static bool trans_ST_zprr(DisasContext *s, arg_rprr_store *a, uint32_t insn) | ||
314 | +{ | ||
315 | + if (a->rm == 31 || a->msz > a->esz) { | ||
316 | + return false; | ||
317 | + } | ||
318 | + if (sve_access_check(s)) { | ||
319 | + TCGv_i64 addr = new_tmp_a64(s); | ||
320 | + tcg_gen_muli_i64(addr, cpu_reg(s, a->rm), (a->nreg + 1) << a->msz); | ||
321 | + tcg_gen_add_i64(addr, addr, cpu_reg_sp(s, a->rn)); | ||
322 | + do_st_zpa(s, a->rd, a->pg, addr, a->msz, a->esz, a->nreg); | ||
323 | + } | ||
324 | + return true; | ||
325 | +} | ||
326 | + | ||
327 | +static bool trans_ST_zpri(DisasContext *s, arg_rpri_store *a, uint32_t insn) | ||
328 | +{ | ||
329 | + if (a->msz > a->esz) { | ||
330 | + return false; | ||
331 | + } | ||
332 | + if (sve_access_check(s)) { | ||
333 | + int vsz = vec_full_reg_size(s); | ||
334 | + int elements = vsz >> a->esz; | ||
335 | + TCGv_i64 addr = new_tmp_a64(s); | ||
336 | + | ||
337 | + tcg_gen_addi_i64(addr, cpu_reg_sp(s, a->rn), | ||
338 | + (a->imm * elements * (a->nreg + 1)) << a->msz); | ||
339 | + do_st_zpa(s, a->rd, a->pg, addr, a->msz, a->esz, a->nreg); | ||
340 | + } | ||
341 | + return true; | ||
342 | +} | ||
343 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
344 | index XXXXXXX..XXXXXXX 100644 | ||
345 | --- a/target/arm/sve.decode | ||
346 | +++ b/target/arm/sve.decode | ||
347 | @@ -XXX,XX +XXX,XX @@ | ||
348 | %imm7_22_16 22:2 16:5 | ||
349 | %imm8_16_10 16:5 10:3 | ||
350 | %imm9_16_10 16:s6 10:3 | ||
351 | +%size_23 23:2 | ||
352 | |||
353 | # A combination of tsz:imm3 -- extract esize. | ||
354 | %tszimm_esz 22:2 5:5 !function=tszimm_esz | ||
355 | @@ -XXX,XX +XXX,XX @@ | ||
356 | &incdec2_pred rd rn pg esz d u | ||
357 | &rprr_load rd pg rn rm dtype nreg | ||
358 | &rpri_load rd pg rn imm dtype nreg | ||
359 | +&rprr_store rd pg rn rm msz esz nreg | ||
360 | +&rpri_store rd pg rn imm msz esz nreg | ||
361 | |||
362 | ########################################################################### | ||
363 | # Named instruction formats. These are generally used to | ||
364 | @@ -XXX,XX +XXX,XX @@ | ||
365 | @rpri_load_msz ....... .... . imm:s4 ... pg:3 rn:5 rd:5 \ | ||
366 | &rpri_load dtype=%msz_dtype | ||
367 | |||
368 | +# Stores; user must fill in ESZ, MSZ, NREG as needed. | ||
369 | +@rprr_store ....... .. .. rm:5 ... pg:3 rn:5 rd:5 &rprr_store | ||
370 | +@rpri_store_msz ....... msz:2 .. . imm:s4 ... pg:3 rn:5 rd:5 &rpri_store | ||
371 | +@rprr_store_esz_n0 ....... .. esz:2 rm:5 ... pg:3 rn:5 rd:5 \ | ||
372 | + &rprr_store nreg=0 | ||
373 | + | ||
374 | ########################################################################### | ||
375 | # Instruction patterns. Grouped according to the SVE encodingindex.xhtml. | ||
376 | |||
377 | @@ -XXX,XX +XXX,XX @@ LD_zprr 1010010 .. nreg:2 ..... 110 ... ..... ..... @rprr_load_msz | ||
378 | # SVE load multiple structures (scalar plus immediate) | ||
379 | # LD2B, LD2H, LD2W, LD2D; etc. | ||
380 | LD_zpri 1010010 .. nreg:2 0.... 111 ... ..... ..... @rpri_load_msz | ||
381 | + | ||
382 | +### SVE Memory Store Group | ||
383 | + | ||
384 | +# SVE contiguous store (scalar plus immediate) | ||
385 | +# ST1B, ST1H, ST1W, ST1D; require msz <= esz | ||
386 | +ST_zpri 1110010 .. esz:2 0.... 111 ... ..... ..... \ | ||
387 | + @rpri_store_msz nreg=0 | ||
388 | + | ||
389 | +# SVE contiguous store (scalar plus scalar) | ||
390 | +# ST1B, ST1H, ST1W, ST1D; require msz <= esz | ||
391 | +# Enumerate msz lest we conflict with STR_zri. | ||
392 | +ST_zprr 1110010 00 .. ..... 010 ... ..... ..... \ | ||
393 | + @rprr_store_esz_n0 msz=0 | ||
394 | +ST_zprr 1110010 01 .. ..... 010 ... ..... ..... \ | ||
395 | + @rprr_store_esz_n0 msz=1 | ||
396 | +ST_zprr 1110010 10 .. ..... 010 ... ..... ..... \ | ||
397 | + @rprr_store_esz_n0 msz=2 | ||
398 | +ST_zprr 1110010 11 11 ..... 010 ... ..... ..... \ | ||
399 | + @rprr_store msz=3 esz=3 nreg=0 | ||
400 | + | ||
401 | +# SVE contiguous non-temporal store (scalar plus immediate) (nreg == 0) | ||
402 | +# SVE store multiple structures (scalar plus immediate) (nreg != 0) | ||
403 | +ST_zpri 1110010 .. nreg:2 1.... 111 ... ..... ..... \ | ||
404 | + @rpri_store_msz esz=%size_23 | ||
405 | + | ||
406 | +# SVE contiguous non-temporal store (scalar plus scalar) (nreg == 0) | ||
407 | +# SVE store multiple structures (scalar plus scalar) (nreg != 0) | ||
408 | +ST_zprr 1110010 msz:2 nreg:2 ..... 011 ... ..... ..... \ | ||
409 | + @rprr_store esz=%size_23 | ||
410 | -- | ||
411 | 2.17.1 | ||
412 | |||
413 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-5-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 52 ++++++++++++++++++++++++++++++++++++++ | ||
9 | target/arm/sve.decode | 9 +++++++ | ||
10 | 2 files changed, 61 insertions(+) | ||
11 | |||
12 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
13 | index XXXXXXX..XXXXXXX 100644 | ||
14 | --- a/target/arm/translate-sve.c | ||
15 | +++ b/target/arm/translate-sve.c | ||
16 | @@ -XXX,XX +XXX,XX @@ static bool trans_LDNF1_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn) | ||
17 | return true; | ||
18 | } | ||
19 | |||
20 | +static void do_ldrq(DisasContext *s, int zt, int pg, TCGv_i64 addr, int msz) | ||
21 | +{ | ||
22 | + static gen_helper_gvec_mem * const fns[4] = { | ||
23 | + gen_helper_sve_ld1bb_r, gen_helper_sve_ld1hh_r, | ||
24 | + gen_helper_sve_ld1ss_r, gen_helper_sve_ld1dd_r, | ||
25 | + }; | ||
26 | + unsigned vsz = vec_full_reg_size(s); | ||
27 | + TCGv_ptr t_pg; | ||
28 | + TCGv_i32 desc; | ||
29 | + | ||
30 | + /* Load the first quadword using the normal predicated load helpers. */ | ||
31 | + desc = tcg_const_i32(simd_desc(16, 16, zt)); | ||
32 | + t_pg = tcg_temp_new_ptr(); | ||
33 | + | ||
34 | + tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg)); | ||
35 | + fns[msz](cpu_env, t_pg, addr, desc); | ||
36 | + | ||
37 | + tcg_temp_free_ptr(t_pg); | ||
38 | + tcg_temp_free_i32(desc); | ||
39 | + | ||
40 | + /* Replicate that first quadword. */ | ||
41 | + if (vsz > 16) { | ||
42 | + unsigned dofs = vec_full_reg_offset(s, zt); | ||
43 | + tcg_gen_gvec_dup_mem(4, dofs + 16, dofs, vsz - 16, vsz - 16); | ||
44 | + } | ||
45 | +} | ||
46 | + | ||
47 | +static bool trans_LD1RQ_zprr(DisasContext *s, arg_rprr_load *a, uint32_t insn) | ||
48 | +{ | ||
49 | + if (a->rm == 31) { | ||
50 | + return false; | ||
51 | + } | ||
52 | + if (sve_access_check(s)) { | ||
53 | + int msz = dtype_msz(a->dtype); | ||
54 | + TCGv_i64 addr = new_tmp_a64(s); | ||
55 | + tcg_gen_shli_i64(addr, cpu_reg(s, a->rm), msz); | ||
56 | + tcg_gen_add_i64(addr, addr, cpu_reg_sp(s, a->rn)); | ||
57 | + do_ldrq(s, a->rd, a->pg, addr, msz); | ||
58 | + } | ||
59 | + return true; | ||
60 | +} | ||
61 | + | ||
62 | +static bool trans_LD1RQ_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn) | ||
63 | +{ | ||
64 | + if (sve_access_check(s)) { | ||
65 | + TCGv_i64 addr = new_tmp_a64(s); | ||
66 | + tcg_gen_addi_i64(addr, cpu_reg_sp(s, a->rn), a->imm * 16); | ||
67 | + do_ldrq(s, a->rd, a->pg, addr, dtype_msz(a->dtype)); | ||
68 | + } | ||
69 | + return true; | ||
70 | +} | ||
71 | + | ||
72 | static void do_st_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, | ||
73 | int msz, int esz, int nreg) | ||
74 | { | ||
75 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
76 | index XXXXXXX..XXXXXXX 100644 | ||
77 | --- a/target/arm/sve.decode | ||
78 | +++ b/target/arm/sve.decode | ||
79 | @@ -XXX,XX +XXX,XX @@ LD_zprr 1010010 .. nreg:2 ..... 110 ... ..... ..... @rprr_load_msz | ||
80 | # LD2B, LD2H, LD2W, LD2D; etc. | ||
81 | LD_zpri 1010010 .. nreg:2 0.... 111 ... ..... ..... @rpri_load_msz | ||
82 | |||
83 | +# SVE load and broadcast quadword (scalar plus scalar) | ||
84 | +LD1RQ_zprr 1010010 .. 00 ..... 000 ... ..... ..... \ | ||
85 | + @rprr_load_msz nreg=0 | ||
86 | + | ||
87 | +# SVE load and broadcast quadword (scalar plus immediate) | ||
88 | +# LD1RQB, LD1RQH, LD1RQS, LD1RQD | ||
89 | +LD1RQ_zpri 1010010 .. 00 0.... 001 ... ..... ..... \ | ||
90 | + @rpri_load_msz nreg=0 | ||
91 | + | ||
92 | ### SVE Memory Store Group | ||
93 | |||
94 | # SVE contiguous store (scalar plus immediate) | ||
95 | -- | ||
96 | 2.17.1 | ||
97 | |||
98 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | [PMM: fixed typo] | ||
6 | Message-id: 20180627043328.11531-6-richard.henderson@linaro.org | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | --- | ||
9 | target/arm/helper-sve.h | 30 +++++++++++++ | ||
10 | target/arm/sve_helper.c | 38 ++++++++++++++++ | ||
11 | target/arm/translate-sve.c | 90 ++++++++++++++++++++++++++++++++++++++ | ||
12 | target/arm/sve.decode | 22 ++++++++++ | ||
13 | 4 files changed, 180 insertions(+) | ||
14 | |||
15 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/target/arm/helper-sve.h | ||
18 | +++ b/target/arm/helper-sve.h | ||
19 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(gvec_rsqrts_s, TCG_CALL_NO_RWG, | ||
20 | DEF_HELPER_FLAGS_5(gvec_rsqrts_d, TCG_CALL_NO_RWG, | ||
21 | void, ptr, ptr, ptr, ptr, i32) | ||
22 | |||
23 | +DEF_HELPER_FLAGS_5(sve_scvt_hh, TCG_CALL_NO_RWG, | ||
24 | + void, ptr, ptr, ptr, ptr, i32) | ||
25 | +DEF_HELPER_FLAGS_5(sve_scvt_sh, TCG_CALL_NO_RWG, | ||
26 | + void, ptr, ptr, ptr, ptr, i32) | ||
27 | +DEF_HELPER_FLAGS_5(sve_scvt_dh, TCG_CALL_NO_RWG, | ||
28 | + void, ptr, ptr, ptr, ptr, i32) | ||
29 | +DEF_HELPER_FLAGS_5(sve_scvt_ss, TCG_CALL_NO_RWG, | ||
30 | + void, ptr, ptr, ptr, ptr, i32) | ||
31 | +DEF_HELPER_FLAGS_5(sve_scvt_sd, TCG_CALL_NO_RWG, | ||
32 | + void, ptr, ptr, ptr, ptr, i32) | ||
33 | +DEF_HELPER_FLAGS_5(sve_scvt_ds, TCG_CALL_NO_RWG, | ||
34 | + void, ptr, ptr, ptr, ptr, i32) | ||
35 | +DEF_HELPER_FLAGS_5(sve_scvt_dd, TCG_CALL_NO_RWG, | ||
36 | + void, ptr, ptr, ptr, ptr, i32) | ||
37 | + | ||
38 | +DEF_HELPER_FLAGS_5(sve_ucvt_hh, TCG_CALL_NO_RWG, | ||
39 | + void, ptr, ptr, ptr, ptr, i32) | ||
40 | +DEF_HELPER_FLAGS_5(sve_ucvt_sh, TCG_CALL_NO_RWG, | ||
41 | + void, ptr, ptr, ptr, ptr, i32) | ||
42 | +DEF_HELPER_FLAGS_5(sve_ucvt_dh, TCG_CALL_NO_RWG, | ||
43 | + void, ptr, ptr, ptr, ptr, i32) | ||
44 | +DEF_HELPER_FLAGS_5(sve_ucvt_ss, TCG_CALL_NO_RWG, | ||
45 | + void, ptr, ptr, ptr, ptr, i32) | ||
46 | +DEF_HELPER_FLAGS_5(sve_ucvt_sd, TCG_CALL_NO_RWG, | ||
47 | + void, ptr, ptr, ptr, ptr, i32) | ||
48 | +DEF_HELPER_FLAGS_5(sve_ucvt_ds, TCG_CALL_NO_RWG, | ||
49 | + void, ptr, ptr, ptr, ptr, i32) | ||
50 | +DEF_HELPER_FLAGS_5(sve_ucvt_dd, TCG_CALL_NO_RWG, | ||
51 | + void, ptr, ptr, ptr, ptr, i32) | ||
52 | + | ||
53 | DEF_HELPER_FLAGS_4(sve_ld1bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
54 | DEF_HELPER_FLAGS_4(sve_ld2bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
55 | DEF_HELPER_FLAGS_4(sve_ld3bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
56 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
57 | index XXXXXXX..XXXXXXX 100644 | ||
58 | --- a/target/arm/sve_helper.c | ||
59 | +++ b/target/arm/sve_helper.c | ||
60 | @@ -XXX,XX +XXX,XX @@ uint32_t HELPER(sve_while)(void *vd, uint32_t count, uint32_t pred_desc) | ||
61 | return predtest_ones(d, oprsz, esz_mask); | ||
62 | } | ||
63 | |||
64 | +/* Fully general two-operand expander, controlled by a predicate, | ||
65 | + * With the extra float_status parameter. | ||
66 | + */ | ||
67 | +#define DO_ZPZ_FP(NAME, TYPE, H, OP) \ | ||
68 | +void HELPER(NAME)(void *vd, void *vn, void *vg, void *status, uint32_t desc) \ | ||
69 | +{ \ | ||
70 | + intptr_t i = simd_oprsz(desc); \ | ||
71 | + uint64_t *g = vg; \ | ||
72 | + do { \ | ||
73 | + uint64_t pg = g[(i - 1) >> 6]; \ | ||
74 | + do { \ | ||
75 | + i -= sizeof(TYPE); \ | ||
76 | + if (likely((pg >> (i & 63)) & 1)) { \ | ||
77 | + TYPE nn = *(TYPE *)(vn + H(i)); \ | ||
78 | + *(TYPE *)(vd + H(i)) = OP(nn, status); \ | ||
79 | + } \ | ||
80 | + } while (i & 63); \ | ||
81 | + } while (i != 0); \ | ||
82 | +} | ||
83 | + | ||
84 | +DO_ZPZ_FP(sve_scvt_hh, uint16_t, H1_2, int16_to_float16) | ||
85 | +DO_ZPZ_FP(sve_scvt_sh, uint32_t, H1_4, int32_to_float16) | ||
86 | +DO_ZPZ_FP(sve_scvt_ss, uint32_t, H1_4, int32_to_float32) | ||
87 | +DO_ZPZ_FP(sve_scvt_sd, uint64_t, , int32_to_float64) | ||
88 | +DO_ZPZ_FP(sve_scvt_dh, uint64_t, , int64_to_float16) | ||
89 | +DO_ZPZ_FP(sve_scvt_ds, uint64_t, , int64_to_float32) | ||
90 | +DO_ZPZ_FP(sve_scvt_dd, uint64_t, , int64_to_float64) | ||
91 | + | ||
92 | +DO_ZPZ_FP(sve_ucvt_hh, uint16_t, H1_2, uint16_to_float16) | ||
93 | +DO_ZPZ_FP(sve_ucvt_sh, uint32_t, H1_4, uint32_to_float16) | ||
94 | +DO_ZPZ_FP(sve_ucvt_ss, uint32_t, H1_4, uint32_to_float32) | ||
95 | +DO_ZPZ_FP(sve_ucvt_sd, uint64_t, , uint32_to_float64) | ||
96 | +DO_ZPZ_FP(sve_ucvt_dh, uint64_t, , uint64_to_float16) | ||
97 | +DO_ZPZ_FP(sve_ucvt_ds, uint64_t, , uint64_to_float32) | ||
98 | +DO_ZPZ_FP(sve_ucvt_dd, uint64_t, , uint64_to_float64) | ||
99 | + | ||
100 | +#undef DO_ZPZ_FP | ||
101 | + | ||
102 | /* | ||
103 | * Load contiguous data, protected by a governing predicate. | ||
104 | */ | ||
105 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
106 | index XXXXXXX..XXXXXXX 100644 | ||
107 | --- a/target/arm/translate-sve.c | ||
108 | +++ b/target/arm/translate-sve.c | ||
109 | @@ -XXX,XX +XXX,XX @@ DO_FP3(FRSQRTS, rsqrts) | ||
110 | |||
111 | #undef DO_FP3 | ||
112 | |||
113 | + | ||
114 | +/* | ||
115 | + *** SVE Floating Point Unary Operations Predicated Group | ||
116 | + */ | ||
117 | + | ||
118 | +static bool do_zpz_ptr(DisasContext *s, int rd, int rn, int pg, | ||
119 | + bool is_fp16, gen_helper_gvec_3_ptr *fn) | ||
120 | +{ | ||
121 | + if (sve_access_check(s)) { | ||
122 | + unsigned vsz = vec_full_reg_size(s); | ||
123 | + TCGv_ptr status = get_fpstatus_ptr(is_fp16); | ||
124 | + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, rd), | ||
125 | + vec_full_reg_offset(s, rn), | ||
126 | + pred_full_reg_offset(s, pg), | ||
127 | + status, vsz, vsz, 0, fn); | ||
128 | + tcg_temp_free_ptr(status); | ||
129 | + } | ||
130 | + return true; | ||
131 | +} | ||
132 | + | ||
133 | +static bool trans_SCVTF_hh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
134 | +{ | ||
135 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_scvt_hh); | ||
136 | +} | ||
137 | + | ||
138 | +static bool trans_SCVTF_sh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
139 | +{ | ||
140 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_scvt_sh); | ||
141 | +} | ||
142 | + | ||
143 | +static bool trans_SCVTF_dh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
144 | +{ | ||
145 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_scvt_dh); | ||
146 | +} | ||
147 | + | ||
148 | +static bool trans_SCVTF_ss(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
149 | +{ | ||
150 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_scvt_ss); | ||
151 | +} | ||
152 | + | ||
153 | +static bool trans_SCVTF_ds(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
154 | +{ | ||
155 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_scvt_ds); | ||
156 | +} | ||
157 | + | ||
158 | +static bool trans_SCVTF_sd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
159 | +{ | ||
160 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_scvt_sd); | ||
161 | +} | ||
162 | + | ||
163 | +static bool trans_SCVTF_dd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
164 | +{ | ||
165 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_scvt_dd); | ||
166 | +} | ||
167 | + | ||
168 | +static bool trans_UCVTF_hh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
169 | +{ | ||
170 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_ucvt_hh); | ||
171 | +} | ||
172 | + | ||
173 | +static bool trans_UCVTF_sh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
174 | +{ | ||
175 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_ucvt_sh); | ||
176 | +} | ||
177 | + | ||
178 | +static bool trans_UCVTF_dh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
179 | +{ | ||
180 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_ucvt_dh); | ||
181 | +} | ||
182 | + | ||
183 | +static bool trans_UCVTF_ss(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
184 | +{ | ||
185 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_ucvt_ss); | ||
186 | +} | ||
187 | + | ||
188 | +static bool trans_UCVTF_ds(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
189 | +{ | ||
190 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_ucvt_ds); | ||
191 | +} | ||
192 | + | ||
193 | +static bool trans_UCVTF_sd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
194 | +{ | ||
195 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_ucvt_sd); | ||
196 | +} | ||
197 | + | ||
198 | +static bool trans_UCVTF_dd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
199 | +{ | ||
200 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_ucvt_dd); | ||
201 | +} | ||
202 | + | ||
203 | /* | ||
204 | *** SVE Memory - 32-bit Gather and Unsized Contiguous Group | ||
205 | */ | ||
206 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
207 | index XXXXXXX..XXXXXXX 100644 | ||
208 | --- a/target/arm/sve.decode | ||
209 | +++ b/target/arm/sve.decode | ||
210 | @@ -XXX,XX +XXX,XX @@ | ||
211 | @rd_pg_rn ........ esz:2 ... ... ... pg:3 rn:5 rd:5 &rpr_esz | ||
212 | @rd_pg4_pn ........ esz:2 ... ... .. pg:4 . rn:4 rd:5 &rpr_esz | ||
213 | |||
214 | +# One register operand, with governing predicate, no vector element size | ||
215 | +@rd_pg_rn_e0 ........ .. ... ... ... pg:3 rn:5 rd:5 &rpr_esz esz=0 | ||
216 | + | ||
217 | # Two register operands with a 6-bit signed immediate. | ||
218 | @rd_rn_i6 ........ ... rn:5 ..... imm:s6 rd:5 &rri | ||
219 | |||
220 | @@ -XXX,XX +XXX,XX @@ FTSMUL 01100101 .. 0 ..... 000 011 ..... ..... @rd_rn_rm | ||
221 | FRECPS 01100101 .. 0 ..... 000 110 ..... ..... @rd_rn_rm | ||
222 | FRSQRTS 01100101 .. 0 ..... 000 111 ..... ..... @rd_rn_rm | ||
223 | |||
224 | +### SVE FP Unary Operations Predicated Group | ||
225 | + | ||
226 | +# SVE integer convert to floating-point | ||
227 | +SCVTF_hh 01100101 01 010 01 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
228 | +SCVTF_sh 01100101 01 010 10 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
229 | +SCVTF_dh 01100101 01 010 11 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
230 | +SCVTF_ss 01100101 10 010 10 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
231 | +SCVTF_sd 01100101 11 010 00 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
232 | +SCVTF_ds 01100101 11 010 10 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
233 | +SCVTF_dd 01100101 11 010 11 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
234 | + | ||
235 | +UCVTF_hh 01100101 01 010 01 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
236 | +UCVTF_sh 01100101 01 010 10 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
237 | +UCVTF_dh 01100101 01 010 11 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
238 | +UCVTF_ss 01100101 10 010 10 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
239 | +UCVTF_sd 01100101 11 010 00 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
240 | +UCVTF_ds 01100101 11 010 10 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
241 | +UCVTF_dd 01100101 11 010 11 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
242 | + | ||
243 | ### SVE Memory - 32-bit Gather and Unsized Contiguous Group | ||
244 | |||
245 | # SVE load predicate register | ||
246 | -- | ||
247 | 2.17.1 | ||
248 | |||
249 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-7-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 77 +++++++++++++++++++++++++++++++++ | ||
9 | target/arm/sve_helper.c | 89 ++++++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 46 ++++++++++++++++++++ | ||
11 | target/arm/sve.decode | 17 ++++++++ | ||
12 | 4 files changed, 229 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(gvec_rsqrts_s, TCG_CALL_NO_RWG, | ||
19 | DEF_HELPER_FLAGS_5(gvec_rsqrts_d, TCG_CALL_NO_RWG, | ||
20 | void, ptr, ptr, ptr, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_6(sve_fadd_h, TCG_CALL_NO_RWG, | ||
23 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_6(sve_fadd_s, TCG_CALL_NO_RWG, | ||
25 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
26 | +DEF_HELPER_FLAGS_6(sve_fadd_d, TCG_CALL_NO_RWG, | ||
27 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
28 | + | ||
29 | +DEF_HELPER_FLAGS_6(sve_fsub_h, TCG_CALL_NO_RWG, | ||
30 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
31 | +DEF_HELPER_FLAGS_6(sve_fsub_s, TCG_CALL_NO_RWG, | ||
32 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
33 | +DEF_HELPER_FLAGS_6(sve_fsub_d, TCG_CALL_NO_RWG, | ||
34 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
35 | + | ||
36 | +DEF_HELPER_FLAGS_6(sve_fmul_h, TCG_CALL_NO_RWG, | ||
37 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
38 | +DEF_HELPER_FLAGS_6(sve_fmul_s, TCG_CALL_NO_RWG, | ||
39 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
40 | +DEF_HELPER_FLAGS_6(sve_fmul_d, TCG_CALL_NO_RWG, | ||
41 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
42 | + | ||
43 | +DEF_HELPER_FLAGS_6(sve_fdiv_h, TCG_CALL_NO_RWG, | ||
44 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
45 | +DEF_HELPER_FLAGS_6(sve_fdiv_s, TCG_CALL_NO_RWG, | ||
46 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
47 | +DEF_HELPER_FLAGS_6(sve_fdiv_d, TCG_CALL_NO_RWG, | ||
48 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
49 | + | ||
50 | +DEF_HELPER_FLAGS_6(sve_fmin_h, TCG_CALL_NO_RWG, | ||
51 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
52 | +DEF_HELPER_FLAGS_6(sve_fmin_s, TCG_CALL_NO_RWG, | ||
53 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
54 | +DEF_HELPER_FLAGS_6(sve_fmin_d, TCG_CALL_NO_RWG, | ||
55 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
56 | + | ||
57 | +DEF_HELPER_FLAGS_6(sve_fmax_h, TCG_CALL_NO_RWG, | ||
58 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
59 | +DEF_HELPER_FLAGS_6(sve_fmax_s, TCG_CALL_NO_RWG, | ||
60 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
61 | +DEF_HELPER_FLAGS_6(sve_fmax_d, TCG_CALL_NO_RWG, | ||
62 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
63 | + | ||
64 | +DEF_HELPER_FLAGS_6(sve_fminnum_h, TCG_CALL_NO_RWG, | ||
65 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
66 | +DEF_HELPER_FLAGS_6(sve_fminnum_s, TCG_CALL_NO_RWG, | ||
67 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
68 | +DEF_HELPER_FLAGS_6(sve_fminnum_d, TCG_CALL_NO_RWG, | ||
69 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
70 | + | ||
71 | +DEF_HELPER_FLAGS_6(sve_fmaxnum_h, TCG_CALL_NO_RWG, | ||
72 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
73 | +DEF_HELPER_FLAGS_6(sve_fmaxnum_s, TCG_CALL_NO_RWG, | ||
74 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
75 | +DEF_HELPER_FLAGS_6(sve_fmaxnum_d, TCG_CALL_NO_RWG, | ||
76 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
77 | + | ||
78 | +DEF_HELPER_FLAGS_6(sve_fabd_h, TCG_CALL_NO_RWG, | ||
79 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
80 | +DEF_HELPER_FLAGS_6(sve_fabd_s, TCG_CALL_NO_RWG, | ||
81 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
82 | +DEF_HELPER_FLAGS_6(sve_fabd_d, TCG_CALL_NO_RWG, | ||
83 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
84 | + | ||
85 | +DEF_HELPER_FLAGS_6(sve_fscalbn_h, TCG_CALL_NO_RWG, | ||
86 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
87 | +DEF_HELPER_FLAGS_6(sve_fscalbn_s, TCG_CALL_NO_RWG, | ||
88 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
89 | +DEF_HELPER_FLAGS_6(sve_fscalbn_d, TCG_CALL_NO_RWG, | ||
90 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
91 | + | ||
92 | +DEF_HELPER_FLAGS_6(sve_fmulx_h, TCG_CALL_NO_RWG, | ||
93 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
94 | +DEF_HELPER_FLAGS_6(sve_fmulx_s, TCG_CALL_NO_RWG, | ||
95 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
96 | +DEF_HELPER_FLAGS_6(sve_fmulx_d, TCG_CALL_NO_RWG, | ||
97 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
98 | + | ||
99 | DEF_HELPER_FLAGS_5(sve_scvt_hh, TCG_CALL_NO_RWG, | ||
100 | void, ptr, ptr, ptr, ptr, i32) | ||
101 | DEF_HELPER_FLAGS_5(sve_scvt_sh, TCG_CALL_NO_RWG, | ||
102 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
103 | index XXXXXXX..XXXXXXX 100644 | ||
104 | --- a/target/arm/sve_helper.c | ||
105 | +++ b/target/arm/sve_helper.c | ||
106 | @@ -XXX,XX +XXX,XX @@ uint32_t HELPER(sve_while)(void *vd, uint32_t count, uint32_t pred_desc) | ||
107 | return predtest_ones(d, oprsz, esz_mask); | ||
108 | } | ||
109 | |||
110 | +/* Fully general three-operand expander, controlled by a predicate, | ||
111 | + * With the extra float_status parameter. | ||
112 | + */ | ||
113 | +#define DO_ZPZZ_FP(NAME, TYPE, H, OP) \ | ||
114 | +void HELPER(NAME)(void *vd, void *vn, void *vm, void *vg, \ | ||
115 | + void *status, uint32_t desc) \ | ||
116 | +{ \ | ||
117 | + intptr_t i = simd_oprsz(desc); \ | ||
118 | + uint64_t *g = vg; \ | ||
119 | + do { \ | ||
120 | + uint64_t pg = g[(i - 1) >> 6]; \ | ||
121 | + do { \ | ||
122 | + i -= sizeof(TYPE); \ | ||
123 | + if (likely((pg >> (i & 63)) & 1)) { \ | ||
124 | + TYPE nn = *(TYPE *)(vn + H(i)); \ | ||
125 | + TYPE mm = *(TYPE *)(vm + H(i)); \ | ||
126 | + *(TYPE *)(vd + H(i)) = OP(nn, mm, status); \ | ||
127 | + } \ | ||
128 | + } while (i & 63); \ | ||
129 | + } while (i != 0); \ | ||
130 | +} | ||
131 | + | ||
132 | +DO_ZPZZ_FP(sve_fadd_h, uint16_t, H1_2, float16_add) | ||
133 | +DO_ZPZZ_FP(sve_fadd_s, uint32_t, H1_4, float32_add) | ||
134 | +DO_ZPZZ_FP(sve_fadd_d, uint64_t, , float64_add) | ||
135 | + | ||
136 | +DO_ZPZZ_FP(sve_fsub_h, uint16_t, H1_2, float16_sub) | ||
137 | +DO_ZPZZ_FP(sve_fsub_s, uint32_t, H1_4, float32_sub) | ||
138 | +DO_ZPZZ_FP(sve_fsub_d, uint64_t, , float64_sub) | ||
139 | + | ||
140 | +DO_ZPZZ_FP(sve_fmul_h, uint16_t, H1_2, float16_mul) | ||
141 | +DO_ZPZZ_FP(sve_fmul_s, uint32_t, H1_4, float32_mul) | ||
142 | +DO_ZPZZ_FP(sve_fmul_d, uint64_t, , float64_mul) | ||
143 | + | ||
144 | +DO_ZPZZ_FP(sve_fdiv_h, uint16_t, H1_2, float16_div) | ||
145 | +DO_ZPZZ_FP(sve_fdiv_s, uint32_t, H1_4, float32_div) | ||
146 | +DO_ZPZZ_FP(sve_fdiv_d, uint64_t, , float64_div) | ||
147 | + | ||
148 | +DO_ZPZZ_FP(sve_fmin_h, uint16_t, H1_2, float16_min) | ||
149 | +DO_ZPZZ_FP(sve_fmin_s, uint32_t, H1_4, float32_min) | ||
150 | +DO_ZPZZ_FP(sve_fmin_d, uint64_t, , float64_min) | ||
151 | + | ||
152 | +DO_ZPZZ_FP(sve_fmax_h, uint16_t, H1_2, float16_max) | ||
153 | +DO_ZPZZ_FP(sve_fmax_s, uint32_t, H1_4, float32_max) | ||
154 | +DO_ZPZZ_FP(sve_fmax_d, uint64_t, , float64_max) | ||
155 | + | ||
156 | +DO_ZPZZ_FP(sve_fminnum_h, uint16_t, H1_2, float16_minnum) | ||
157 | +DO_ZPZZ_FP(sve_fminnum_s, uint32_t, H1_4, float32_minnum) | ||
158 | +DO_ZPZZ_FP(sve_fminnum_d, uint64_t, , float64_minnum) | ||
159 | + | ||
160 | +DO_ZPZZ_FP(sve_fmaxnum_h, uint16_t, H1_2, float16_maxnum) | ||
161 | +DO_ZPZZ_FP(sve_fmaxnum_s, uint32_t, H1_4, float32_maxnum) | ||
162 | +DO_ZPZZ_FP(sve_fmaxnum_d, uint64_t, , float64_maxnum) | ||
163 | + | ||
164 | +static inline float16 abd_h(float16 a, float16 b, float_status *s) | ||
165 | +{ | ||
166 | + return float16_abs(float16_sub(a, b, s)); | ||
167 | +} | ||
168 | + | ||
169 | +static inline float32 abd_s(float32 a, float32 b, float_status *s) | ||
170 | +{ | ||
171 | + return float32_abs(float32_sub(a, b, s)); | ||
172 | +} | ||
173 | + | ||
174 | +static inline float64 abd_d(float64 a, float64 b, float_status *s) | ||
175 | +{ | ||
176 | + return float64_abs(float64_sub(a, b, s)); | ||
177 | +} | ||
178 | + | ||
179 | +DO_ZPZZ_FP(sve_fabd_h, uint16_t, H1_2, abd_h) | ||
180 | +DO_ZPZZ_FP(sve_fabd_s, uint32_t, H1_4, abd_s) | ||
181 | +DO_ZPZZ_FP(sve_fabd_d, uint64_t, , abd_d) | ||
182 | + | ||
183 | +static inline float64 scalbn_d(float64 a, int64_t b, float_status *s) | ||
184 | +{ | ||
185 | + int b_int = MIN(MAX(b, INT_MIN), INT_MAX); | ||
186 | + return float64_scalbn(a, b_int, s); | ||
187 | +} | ||
188 | + | ||
189 | +DO_ZPZZ_FP(sve_fscalbn_h, int16_t, H1_2, float16_scalbn) | ||
190 | +DO_ZPZZ_FP(sve_fscalbn_s, int32_t, H1_4, float32_scalbn) | ||
191 | +DO_ZPZZ_FP(sve_fscalbn_d, int64_t, , scalbn_d) | ||
192 | + | ||
193 | +DO_ZPZZ_FP(sve_fmulx_h, uint16_t, H1_2, helper_advsimd_mulxh) | ||
194 | +DO_ZPZZ_FP(sve_fmulx_s, uint32_t, H1_4, helper_vfp_mulxs) | ||
195 | +DO_ZPZZ_FP(sve_fmulx_d, uint64_t, , helper_vfp_mulxd) | ||
196 | + | ||
197 | +#undef DO_ZPZZ_FP | ||
198 | + | ||
199 | /* Fully general two-operand expander, controlled by a predicate, | ||
200 | * With the extra float_status parameter. | ||
201 | */ | ||
202 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
203 | index XXXXXXX..XXXXXXX 100644 | ||
204 | --- a/target/arm/translate-sve.c | ||
205 | +++ b/target/arm/translate-sve.c | ||
206 | @@ -XXX,XX +XXX,XX @@ DO_FP3(FRSQRTS, rsqrts) | ||
207 | |||
208 | #undef DO_FP3 | ||
209 | |||
210 | +/* | ||
211 | + *** SVE Floating Point Arithmetic - Predicated Group | ||
212 | + */ | ||
213 | + | ||
214 | +static bool do_zpzz_fp(DisasContext *s, arg_rprr_esz *a, | ||
215 | + gen_helper_gvec_4_ptr *fn) | ||
216 | +{ | ||
217 | + if (fn == NULL) { | ||
218 | + return false; | ||
219 | + } | ||
220 | + if (sve_access_check(s)) { | ||
221 | + unsigned vsz = vec_full_reg_size(s); | ||
222 | + TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); | ||
223 | + tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), | ||
224 | + vec_full_reg_offset(s, a->rn), | ||
225 | + vec_full_reg_offset(s, a->rm), | ||
226 | + pred_full_reg_offset(s, a->pg), | ||
227 | + status, vsz, vsz, 0, fn); | ||
228 | + tcg_temp_free_ptr(status); | ||
229 | + } | ||
230 | + return true; | ||
231 | +} | ||
232 | + | ||
233 | +#define DO_FP3(NAME, name) \ | ||
234 | +static bool trans_##NAME(DisasContext *s, arg_rprr_esz *a, uint32_t insn) \ | ||
235 | +{ \ | ||
236 | + static gen_helper_gvec_4_ptr * const fns[4] = { \ | ||
237 | + NULL, gen_helper_sve_##name##_h, \ | ||
238 | + gen_helper_sve_##name##_s, gen_helper_sve_##name##_d \ | ||
239 | + }; \ | ||
240 | + return do_zpzz_fp(s, a, fns[a->esz]); \ | ||
241 | +} | ||
242 | + | ||
243 | +DO_FP3(FADD_zpzz, fadd) | ||
244 | +DO_FP3(FSUB_zpzz, fsub) | ||
245 | +DO_FP3(FMUL_zpzz, fmul) | ||
246 | +DO_FP3(FMIN_zpzz, fmin) | ||
247 | +DO_FP3(FMAX_zpzz, fmax) | ||
248 | +DO_FP3(FMINNM_zpzz, fminnum) | ||
249 | +DO_FP3(FMAXNM_zpzz, fmaxnum) | ||
250 | +DO_FP3(FABD, fabd) | ||
251 | +DO_FP3(FSCALE, fscalbn) | ||
252 | +DO_FP3(FDIV, fdiv) | ||
253 | +DO_FP3(FMULX, fmulx) | ||
254 | + | ||
255 | +#undef DO_FP3 | ||
256 | |||
257 | /* | ||
258 | *** SVE Floating Point Unary Operations Predicated Group | ||
259 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
260 | index XXXXXXX..XXXXXXX 100644 | ||
261 | --- a/target/arm/sve.decode | ||
262 | +++ b/target/arm/sve.decode | ||
263 | @@ -XXX,XX +XXX,XX @@ FTSMUL 01100101 .. 0 ..... 000 011 ..... ..... @rd_rn_rm | ||
264 | FRECPS 01100101 .. 0 ..... 000 110 ..... ..... @rd_rn_rm | ||
265 | FRSQRTS 01100101 .. 0 ..... 000 111 ..... ..... @rd_rn_rm | ||
266 | |||
267 | +### SVE FP Arithmetic Predicated Group | ||
268 | + | ||
269 | +# SVE floating-point arithmetic (predicated) | ||
270 | +FADD_zpzz 01100101 .. 00 0000 100 ... ..... ..... @rdn_pg_rm | ||
271 | +FSUB_zpzz 01100101 .. 00 0001 100 ... ..... ..... @rdn_pg_rm | ||
272 | +FMUL_zpzz 01100101 .. 00 0010 100 ... ..... ..... @rdn_pg_rm | ||
273 | +FSUB_zpzz 01100101 .. 00 0011 100 ... ..... ..... @rdm_pg_rn # FSUBR | ||
274 | +FMAXNM_zpzz 01100101 .. 00 0100 100 ... ..... ..... @rdn_pg_rm | ||
275 | +FMINNM_zpzz 01100101 .. 00 0101 100 ... ..... ..... @rdn_pg_rm | ||
276 | +FMAX_zpzz 01100101 .. 00 0110 100 ... ..... ..... @rdn_pg_rm | ||
277 | +FMIN_zpzz 01100101 .. 00 0111 100 ... ..... ..... @rdn_pg_rm | ||
278 | +FABD 01100101 .. 00 1000 100 ... ..... ..... @rdn_pg_rm | ||
279 | +FSCALE 01100101 .. 00 1001 100 ... ..... ..... @rdn_pg_rm | ||
280 | +FMULX 01100101 .. 00 1010 100 ... ..... ..... @rdn_pg_rm | ||
281 | +FDIV 01100101 .. 00 1100 100 ... ..... ..... @rdm_pg_rn # FDIVR | ||
282 | +FDIV 01100101 .. 00 1101 100 ... ..... ..... @rdn_pg_rm | ||
283 | + | ||
284 | ### SVE FP Unary Operations Predicated Group | ||
285 | |||
286 | # SVE integer convert to floating-point | ||
287 | -- | ||
288 | 2.17.1 | ||
289 | |||
290 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
5 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
6 | Message-id: 20180627043328.11531-8-richard.henderson@linaro.org | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | --- | ||
9 | target/arm/helper-sve.h | 16 ++++ | ||
10 | target/arm/sve_helper.c | 158 +++++++++++++++++++++++++++++++++++++ | ||
11 | target/arm/translate-sve.c | 49 ++++++++++++ | ||
12 | target/arm/sve.decode | 18 +++++ | ||
13 | 4 files changed, 241 insertions(+) | ||
14 | |||
15 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/target/arm/helper-sve.h | ||
18 | +++ b/target/arm/helper-sve.h | ||
19 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(sve_ucvt_ds, TCG_CALL_NO_RWG, | ||
20 | DEF_HELPER_FLAGS_5(sve_ucvt_dd, TCG_CALL_NO_RWG, | ||
21 | void, ptr, ptr, ptr, ptr, i32) | ||
22 | |||
23 | +DEF_HELPER_FLAGS_3(sve_fmla_zpzzz_h, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_3(sve_fmla_zpzzz_s, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
25 | +DEF_HELPER_FLAGS_3(sve_fmla_zpzzz_d, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
26 | + | ||
27 | +DEF_HELPER_FLAGS_3(sve_fmls_zpzzz_h, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
28 | +DEF_HELPER_FLAGS_3(sve_fmls_zpzzz_s, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
29 | +DEF_HELPER_FLAGS_3(sve_fmls_zpzzz_d, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
30 | + | ||
31 | +DEF_HELPER_FLAGS_3(sve_fnmla_zpzzz_h, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
32 | +DEF_HELPER_FLAGS_3(sve_fnmla_zpzzz_s, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
33 | +DEF_HELPER_FLAGS_3(sve_fnmla_zpzzz_d, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
34 | + | ||
35 | +DEF_HELPER_FLAGS_3(sve_fnmls_zpzzz_h, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
36 | +DEF_HELPER_FLAGS_3(sve_fnmls_zpzzz_s, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
37 | +DEF_HELPER_FLAGS_3(sve_fnmls_zpzzz_d, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
38 | + | ||
39 | DEF_HELPER_FLAGS_4(sve_ld1bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
40 | DEF_HELPER_FLAGS_4(sve_ld2bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
41 | DEF_HELPER_FLAGS_4(sve_ld3bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
42 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
43 | index XXXXXXX..XXXXXXX 100644 | ||
44 | --- a/target/arm/sve_helper.c | ||
45 | +++ b/target/arm/sve_helper.c | ||
46 | @@ -XXX,XX +XXX,XX @@ DO_ZPZ_FP(sve_ucvt_dd, uint64_t, , uint64_to_float64) | ||
47 | |||
48 | #undef DO_ZPZ_FP | ||
49 | |||
50 | +/* 4-operand predicated multiply-add. This requires 7 operands to pass | ||
51 | + * "properly", so we need to encode some of the registers into DESC. | ||
52 | + */ | ||
53 | +QEMU_BUILD_BUG_ON(SIMD_DATA_SHIFT + 20 > 32); | ||
54 | + | ||
55 | +static void do_fmla_zpzzz_h(CPUARMState *env, void *vg, uint32_t desc, | ||
56 | + uint16_t neg1, uint16_t neg3) | ||
57 | +{ | ||
58 | + intptr_t i = simd_oprsz(desc); | ||
59 | + unsigned rd = extract32(desc, SIMD_DATA_SHIFT, 5); | ||
60 | + unsigned rn = extract32(desc, SIMD_DATA_SHIFT + 5, 5); | ||
61 | + unsigned rm = extract32(desc, SIMD_DATA_SHIFT + 10, 5); | ||
62 | + unsigned ra = extract32(desc, SIMD_DATA_SHIFT + 15, 5); | ||
63 | + void *vd = &env->vfp.zregs[rd]; | ||
64 | + void *vn = &env->vfp.zregs[rn]; | ||
65 | + void *vm = &env->vfp.zregs[rm]; | ||
66 | + void *va = &env->vfp.zregs[ra]; | ||
67 | + uint64_t *g = vg; | ||
68 | + | ||
69 | + do { | ||
70 | + uint64_t pg = g[(i - 1) >> 6]; | ||
71 | + do { | ||
72 | + i -= 2; | ||
73 | + if (likely((pg >> (i & 63)) & 1)) { | ||
74 | + float16 e1, e2, e3, r; | ||
75 | + | ||
76 | + e1 = *(uint16_t *)(vn + H1_2(i)) ^ neg1; | ||
77 | + e2 = *(uint16_t *)(vm + H1_2(i)); | ||
78 | + e3 = *(uint16_t *)(va + H1_2(i)) ^ neg3; | ||
79 | + r = float16_muladd(e1, e2, e3, 0, &env->vfp.fp_status); | ||
80 | + *(uint16_t *)(vd + H1_2(i)) = r; | ||
81 | + } | ||
82 | + } while (i & 63); | ||
83 | + } while (i != 0); | ||
84 | +} | ||
85 | + | ||
86 | +void HELPER(sve_fmla_zpzzz_h)(CPUARMState *env, void *vg, uint32_t desc) | ||
87 | +{ | ||
88 | + do_fmla_zpzzz_h(env, vg, desc, 0, 0); | ||
89 | +} | ||
90 | + | ||
91 | +void HELPER(sve_fmls_zpzzz_h)(CPUARMState *env, void *vg, uint32_t desc) | ||
92 | +{ | ||
93 | + do_fmla_zpzzz_h(env, vg, desc, 0x8000, 0); | ||
94 | +} | ||
95 | + | ||
96 | +void HELPER(sve_fnmla_zpzzz_h)(CPUARMState *env, void *vg, uint32_t desc) | ||
97 | +{ | ||
98 | + do_fmla_zpzzz_h(env, vg, desc, 0x8000, 0x8000); | ||
99 | +} | ||
100 | + | ||
101 | +void HELPER(sve_fnmls_zpzzz_h)(CPUARMState *env, void *vg, uint32_t desc) | ||
102 | +{ | ||
103 | + do_fmla_zpzzz_h(env, vg, desc, 0, 0x8000); | ||
104 | +} | ||
105 | + | ||
106 | +static void do_fmla_zpzzz_s(CPUARMState *env, void *vg, uint32_t desc, | ||
107 | + uint32_t neg1, uint32_t neg3) | ||
108 | +{ | ||
109 | + intptr_t i = simd_oprsz(desc); | ||
110 | + unsigned rd = extract32(desc, SIMD_DATA_SHIFT, 5); | ||
111 | + unsigned rn = extract32(desc, SIMD_DATA_SHIFT + 5, 5); | ||
112 | + unsigned rm = extract32(desc, SIMD_DATA_SHIFT + 10, 5); | ||
113 | + unsigned ra = extract32(desc, SIMD_DATA_SHIFT + 15, 5); | ||
114 | + void *vd = &env->vfp.zregs[rd]; | ||
115 | + void *vn = &env->vfp.zregs[rn]; | ||
116 | + void *vm = &env->vfp.zregs[rm]; | ||
117 | + void *va = &env->vfp.zregs[ra]; | ||
118 | + uint64_t *g = vg; | ||
119 | + | ||
120 | + do { | ||
121 | + uint64_t pg = g[(i - 1) >> 6]; | ||
122 | + do { | ||
123 | + i -= 4; | ||
124 | + if (likely((pg >> (i & 63)) & 1)) { | ||
125 | + float32 e1, e2, e3, r; | ||
126 | + | ||
127 | + e1 = *(uint32_t *)(vn + H1_4(i)) ^ neg1; | ||
128 | + e2 = *(uint32_t *)(vm + H1_4(i)); | ||
129 | + e3 = *(uint32_t *)(va + H1_4(i)) ^ neg3; | ||
130 | + r = float32_muladd(e1, e2, e3, 0, &env->vfp.fp_status); | ||
131 | + *(uint32_t *)(vd + H1_4(i)) = r; | ||
132 | + } | ||
133 | + } while (i & 63); | ||
134 | + } while (i != 0); | ||
135 | +} | ||
136 | + | ||
137 | +void HELPER(sve_fmla_zpzzz_s)(CPUARMState *env, void *vg, uint32_t desc) | ||
138 | +{ | ||
139 | + do_fmla_zpzzz_s(env, vg, desc, 0, 0); | ||
140 | +} | ||
141 | + | ||
142 | +void HELPER(sve_fmls_zpzzz_s)(CPUARMState *env, void *vg, uint32_t desc) | ||
143 | +{ | ||
144 | + do_fmla_zpzzz_s(env, vg, desc, 0x80000000, 0); | ||
145 | +} | ||
146 | + | ||
147 | +void HELPER(sve_fnmla_zpzzz_s)(CPUARMState *env, void *vg, uint32_t desc) | ||
148 | +{ | ||
149 | + do_fmla_zpzzz_s(env, vg, desc, 0x80000000, 0x80000000); | ||
150 | +} | ||
151 | + | ||
152 | +void HELPER(sve_fnmls_zpzzz_s)(CPUARMState *env, void *vg, uint32_t desc) | ||
153 | +{ | ||
154 | + do_fmla_zpzzz_s(env, vg, desc, 0, 0x80000000); | ||
155 | +} | ||
156 | + | ||
157 | +static void do_fmla_zpzzz_d(CPUARMState *env, void *vg, uint32_t desc, | ||
158 | + uint64_t neg1, uint64_t neg3) | ||
159 | +{ | ||
160 | + intptr_t i = simd_oprsz(desc); | ||
161 | + unsigned rd = extract32(desc, SIMD_DATA_SHIFT, 5); | ||
162 | + unsigned rn = extract32(desc, SIMD_DATA_SHIFT + 5, 5); | ||
163 | + unsigned rm = extract32(desc, SIMD_DATA_SHIFT + 10, 5); | ||
164 | + unsigned ra = extract32(desc, SIMD_DATA_SHIFT + 15, 5); | ||
165 | + void *vd = &env->vfp.zregs[rd]; | ||
166 | + void *vn = &env->vfp.zregs[rn]; | ||
167 | + void *vm = &env->vfp.zregs[rm]; | ||
168 | + void *va = &env->vfp.zregs[ra]; | ||
169 | + uint64_t *g = vg; | ||
170 | + | ||
171 | + do { | ||
172 | + uint64_t pg = g[(i - 1) >> 6]; | ||
173 | + do { | ||
174 | + i -= 8; | ||
175 | + if (likely((pg >> (i & 63)) & 1)) { | ||
176 | + float64 e1, e2, e3, r; | ||
177 | + | ||
178 | + e1 = *(uint64_t *)(vn + i) ^ neg1; | ||
179 | + e2 = *(uint64_t *)(vm + i); | ||
180 | + e3 = *(uint64_t *)(va + i) ^ neg3; | ||
181 | + r = float64_muladd(e1, e2, e3, 0, &env->vfp.fp_status); | ||
182 | + *(uint64_t *)(vd + i) = r; | ||
183 | + } | ||
184 | + } while (i & 63); | ||
185 | + } while (i != 0); | ||
186 | +} | ||
187 | + | ||
188 | +void HELPER(sve_fmla_zpzzz_d)(CPUARMState *env, void *vg, uint32_t desc) | ||
189 | +{ | ||
190 | + do_fmla_zpzzz_d(env, vg, desc, 0, 0); | ||
191 | +} | ||
192 | + | ||
193 | +void HELPER(sve_fmls_zpzzz_d)(CPUARMState *env, void *vg, uint32_t desc) | ||
194 | +{ | ||
195 | + do_fmla_zpzzz_d(env, vg, desc, INT64_MIN, 0); | ||
196 | +} | ||
197 | + | ||
198 | +void HELPER(sve_fnmla_zpzzz_d)(CPUARMState *env, void *vg, uint32_t desc) | ||
199 | +{ | ||
200 | + do_fmla_zpzzz_d(env, vg, desc, INT64_MIN, INT64_MIN); | ||
201 | +} | ||
202 | + | ||
203 | +void HELPER(sve_fnmls_zpzzz_d)(CPUARMState *env, void *vg, uint32_t desc) | ||
204 | +{ | ||
205 | + do_fmla_zpzzz_d(env, vg, desc, 0, INT64_MIN); | ||
206 | +} | ||
207 | + | ||
208 | /* | ||
209 | * Load contiguous data, protected by a governing predicate. | ||
210 | */ | ||
211 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
212 | index XXXXXXX..XXXXXXX 100644 | ||
213 | --- a/target/arm/translate-sve.c | ||
214 | +++ b/target/arm/translate-sve.c | ||
215 | @@ -XXX,XX +XXX,XX @@ DO_FP3(FMULX, fmulx) | ||
216 | |||
217 | #undef DO_FP3 | ||
218 | |||
219 | +typedef void gen_helper_sve_fmla(TCGv_env, TCGv_ptr, TCGv_i32); | ||
220 | + | ||
221 | +static bool do_fmla(DisasContext *s, arg_rprrr_esz *a, gen_helper_sve_fmla *fn) | ||
222 | +{ | ||
223 | + if (fn == NULL) { | ||
224 | + return false; | ||
225 | + } | ||
226 | + if (!sve_access_check(s)) { | ||
227 | + return true; | ||
228 | + } | ||
229 | + | ||
230 | + unsigned vsz = vec_full_reg_size(s); | ||
231 | + unsigned desc; | ||
232 | + TCGv_i32 t_desc; | ||
233 | + TCGv_ptr pg = tcg_temp_new_ptr(); | ||
234 | + | ||
235 | + /* We would need 7 operands to pass these arguments "properly". | ||
236 | + * So we encode all the register numbers into the descriptor. | ||
237 | + */ | ||
238 | + desc = deposit32(a->rd, 5, 5, a->rn); | ||
239 | + desc = deposit32(desc, 10, 5, a->rm); | ||
240 | + desc = deposit32(desc, 15, 5, a->ra); | ||
241 | + desc = simd_desc(vsz, vsz, desc); | ||
242 | + | ||
243 | + t_desc = tcg_const_i32(desc); | ||
244 | + tcg_gen_addi_ptr(pg, cpu_env, pred_full_reg_offset(s, a->pg)); | ||
245 | + fn(cpu_env, pg, t_desc); | ||
246 | + tcg_temp_free_i32(t_desc); | ||
247 | + tcg_temp_free_ptr(pg); | ||
248 | + return true; | ||
249 | +} | ||
250 | + | ||
251 | +#define DO_FMLA(NAME, name) \ | ||
252 | +static bool trans_##NAME(DisasContext *s, arg_rprrr_esz *a, uint32_t insn) \ | ||
253 | +{ \ | ||
254 | + static gen_helper_sve_fmla * const fns[4] = { \ | ||
255 | + NULL, gen_helper_sve_##name##_h, \ | ||
256 | + gen_helper_sve_##name##_s, gen_helper_sve_##name##_d \ | ||
257 | + }; \ | ||
258 | + return do_fmla(s, a, fns[a->esz]); \ | ||
259 | +} | ||
260 | + | ||
261 | +DO_FMLA(FMLA_zpzzz, fmla_zpzzz) | ||
262 | +DO_FMLA(FMLS_zpzzz, fmls_zpzzz) | ||
263 | +DO_FMLA(FNMLA_zpzzz, fnmla_zpzzz) | ||
264 | +DO_FMLA(FNMLS_zpzzz, fnmls_zpzzz) | ||
265 | + | ||
266 | +#undef DO_FMLA | ||
267 | + | ||
268 | /* | ||
269 | *** SVE Floating Point Unary Operations Predicated Group | ||
270 | */ | ||
271 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
272 | index XXXXXXX..XXXXXXX 100644 | ||
273 | --- a/target/arm/sve.decode | ||
274 | +++ b/target/arm/sve.decode | ||
275 | @@ -XXX,XX +XXX,XX @@ | ||
276 | &rprrr_esz ra=%reg_movprfx | ||
277 | @rdn_pg_ra_rm ........ esz:2 . rm:5 ... pg:3 ra:5 rd:5 \ | ||
278 | &rprrr_esz rn=%reg_movprfx | ||
279 | +@rdn_pg_rm_ra ........ esz:2 . ra:5 ... pg:3 rm:5 rd:5 \ | ||
280 | + &rprrr_esz rn=%reg_movprfx | ||
281 | |||
282 | # One register operand, with governing predicate, vector element size | ||
283 | @rd_pg_rn ........ esz:2 ... ... ... pg:3 rn:5 rd:5 &rpr_esz | ||
284 | @@ -XXX,XX +XXX,XX @@ FMULX 01100101 .. 00 1010 100 ... ..... ..... @rdn_pg_rm | ||
285 | FDIV 01100101 .. 00 1100 100 ... ..... ..... @rdm_pg_rn # FDIVR | ||
286 | FDIV 01100101 .. 00 1101 100 ... ..... ..... @rdn_pg_rm | ||
287 | |||
288 | +### SVE FP Multiply-Add Group | ||
289 | + | ||
290 | +# SVE floating-point multiply-accumulate writing addend | ||
291 | +FMLA_zpzzz 01100101 .. 1 ..... 000 ... ..... ..... @rda_pg_rn_rm | ||
292 | +FMLS_zpzzz 01100101 .. 1 ..... 001 ... ..... ..... @rda_pg_rn_rm | ||
293 | +FNMLA_zpzzz 01100101 .. 1 ..... 010 ... ..... ..... @rda_pg_rn_rm | ||
294 | +FNMLS_zpzzz 01100101 .. 1 ..... 011 ... ..... ..... @rda_pg_rn_rm | ||
295 | + | ||
296 | +# SVE floating-point multiply-accumulate writing multiplicand | ||
297 | +# Alter the operand extraction order and reuse the helpers from above. | ||
298 | +# FMAD, FMSB, FNMAD, FNMS | ||
299 | +FMLA_zpzzz 01100101 .. 1 ..... 100 ... ..... ..... @rdn_pg_rm_ra | ||
300 | +FMLS_zpzzz 01100101 .. 1 ..... 101 ... ..... ..... @rdn_pg_rm_ra | ||
301 | +FNMLA_zpzzz 01100101 .. 1 ..... 110 ... ..... ..... @rdn_pg_rm_ra | ||
302 | +FNMLS_zpzzz 01100101 .. 1 ..... 111 ... ..... ..... @rdn_pg_rm_ra | ||
303 | + | ||
304 | ### SVE FP Unary Operations Predicated Group | ||
305 | |||
306 | # SVE integer convert to floating-point | ||
307 | -- | ||
308 | 2.17.1 | ||
309 | |||
310 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-9-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 7 +++++ | ||
9 | target/arm/sve_helper.c | 56 ++++++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 45 ++++++++++++++++++++++++++++++ | ||
11 | target/arm/sve.decode | 5 ++++ | ||
12 | 4 files changed, 113 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(gvec_rsqrts_s, TCG_CALL_NO_RWG, | ||
19 | DEF_HELPER_FLAGS_5(gvec_rsqrts_d, TCG_CALL_NO_RWG, | ||
20 | void, ptr, ptr, ptr, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_5(sve_fadda_h, TCG_CALL_NO_RWG, | ||
23 | + i64, i64, ptr, ptr, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_5(sve_fadda_s, TCG_CALL_NO_RWG, | ||
25 | + i64, i64, ptr, ptr, ptr, i32) | ||
26 | +DEF_HELPER_FLAGS_5(sve_fadda_d, TCG_CALL_NO_RWG, | ||
27 | + i64, i64, ptr, ptr, ptr, i32) | ||
28 | + | ||
29 | DEF_HELPER_FLAGS_6(sve_fadd_h, TCG_CALL_NO_RWG, | ||
30 | void, ptr, ptr, ptr, ptr, ptr, i32) | ||
31 | DEF_HELPER_FLAGS_6(sve_fadd_s, TCG_CALL_NO_RWG, | ||
32 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
33 | index XXXXXXX..XXXXXXX 100644 | ||
34 | --- a/target/arm/sve_helper.c | ||
35 | +++ b/target/arm/sve_helper.c | ||
36 | @@ -XXX,XX +XXX,XX @@ uint32_t HELPER(sve_while)(void *vd, uint32_t count, uint32_t pred_desc) | ||
37 | return predtest_ones(d, oprsz, esz_mask); | ||
38 | } | ||
39 | |||
40 | +uint64_t HELPER(sve_fadda_h)(uint64_t nn, void *vm, void *vg, | ||
41 | + void *status, uint32_t desc) | ||
42 | +{ | ||
43 | + intptr_t i = 0, opr_sz = simd_oprsz(desc); | ||
44 | + float16 result = nn; | ||
45 | + | ||
46 | + do { | ||
47 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); | ||
48 | + do { | ||
49 | + if (pg & 1) { | ||
50 | + float16 mm = *(float16 *)(vm + H1_2(i)); | ||
51 | + result = float16_add(result, mm, status); | ||
52 | + } | ||
53 | + i += sizeof(float16), pg >>= sizeof(float16); | ||
54 | + } while (i & 15); | ||
55 | + } while (i < opr_sz); | ||
56 | + | ||
57 | + return result; | ||
58 | +} | ||
59 | + | ||
60 | +uint64_t HELPER(sve_fadda_s)(uint64_t nn, void *vm, void *vg, | ||
61 | + void *status, uint32_t desc) | ||
62 | +{ | ||
63 | + intptr_t i = 0, opr_sz = simd_oprsz(desc); | ||
64 | + float32 result = nn; | ||
65 | + | ||
66 | + do { | ||
67 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); | ||
68 | + do { | ||
69 | + if (pg & 1) { | ||
70 | + float32 mm = *(float32 *)(vm + H1_2(i)); | ||
71 | + result = float32_add(result, mm, status); | ||
72 | + } | ||
73 | + i += sizeof(float32), pg >>= sizeof(float32); | ||
74 | + } while (i & 15); | ||
75 | + } while (i < opr_sz); | ||
76 | + | ||
77 | + return result; | ||
78 | +} | ||
79 | + | ||
80 | +uint64_t HELPER(sve_fadda_d)(uint64_t nn, void *vm, void *vg, | ||
81 | + void *status, uint32_t desc) | ||
82 | +{ | ||
83 | + intptr_t i = 0, opr_sz = simd_oprsz(desc) / 8; | ||
84 | + uint64_t *m = vm; | ||
85 | + uint8_t *pg = vg; | ||
86 | + | ||
87 | + for (i = 0; i < opr_sz; i++) { | ||
88 | + if (pg[H1(i)] & 1) { | ||
89 | + nn = float64_add(nn, m[i], status); | ||
90 | + } | ||
91 | + } | ||
92 | + | ||
93 | + return nn; | ||
94 | +} | ||
95 | + | ||
96 | /* Fully general three-operand expander, controlled by a predicate, | ||
97 | * With the extra float_status parameter. | ||
98 | */ | ||
99 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
100 | index XXXXXXX..XXXXXXX 100644 | ||
101 | --- a/target/arm/translate-sve.c | ||
102 | +++ b/target/arm/translate-sve.c | ||
103 | @@ -XXX,XX +XXX,XX @@ DO_ZZI(UMIN, umin) | ||
104 | |||
105 | #undef DO_ZZI | ||
106 | |||
107 | +/* | ||
108 | + *** SVE Floating Point Accumulating Reduction Group | ||
109 | + */ | ||
110 | + | ||
111 | +static bool trans_FADDA(DisasContext *s, arg_rprr_esz *a, uint32_t insn) | ||
112 | +{ | ||
113 | + typedef void fadda_fn(TCGv_i64, TCGv_i64, TCGv_ptr, | ||
114 | + TCGv_ptr, TCGv_ptr, TCGv_i32); | ||
115 | + static fadda_fn * const fns[3] = { | ||
116 | + gen_helper_sve_fadda_h, | ||
117 | + gen_helper_sve_fadda_s, | ||
118 | + gen_helper_sve_fadda_d, | ||
119 | + }; | ||
120 | + unsigned vsz = vec_full_reg_size(s); | ||
121 | + TCGv_ptr t_rm, t_pg, t_fpst; | ||
122 | + TCGv_i64 t_val; | ||
123 | + TCGv_i32 t_desc; | ||
124 | + | ||
125 | + if (a->esz == 0) { | ||
126 | + return false; | ||
127 | + } | ||
128 | + if (!sve_access_check(s)) { | ||
129 | + return true; | ||
130 | + } | ||
131 | + | ||
132 | + t_val = load_esz(cpu_env, vec_reg_offset(s, a->rn, 0, a->esz), a->esz); | ||
133 | + t_rm = tcg_temp_new_ptr(); | ||
134 | + t_pg = tcg_temp_new_ptr(); | ||
135 | + tcg_gen_addi_ptr(t_rm, cpu_env, vec_full_reg_offset(s, a->rm)); | ||
136 | + tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, a->pg)); | ||
137 | + t_fpst = get_fpstatus_ptr(a->esz == MO_16); | ||
138 | + t_desc = tcg_const_i32(simd_desc(vsz, vsz, 0)); | ||
139 | + | ||
140 | + fns[a->esz - 1](t_val, t_val, t_rm, t_pg, t_fpst, t_desc); | ||
141 | + | ||
142 | + tcg_temp_free_i32(t_desc); | ||
143 | + tcg_temp_free_ptr(t_fpst); | ||
144 | + tcg_temp_free_ptr(t_pg); | ||
145 | + tcg_temp_free_ptr(t_rm); | ||
146 | + | ||
147 | + write_fp_dreg(s, a->rd, t_val); | ||
148 | + tcg_temp_free_i64(t_val); | ||
149 | + return true; | ||
150 | +} | ||
151 | + | ||
152 | /* | ||
153 | *** SVE Floating Point Arithmetic - Unpredicated Group | ||
154 | */ | ||
155 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
156 | index XXXXXXX..XXXXXXX 100644 | ||
157 | --- a/target/arm/sve.decode | ||
158 | +++ b/target/arm/sve.decode | ||
159 | @@ -XXX,XX +XXX,XX @@ UMIN_zzi 00100101 .. 101 011 110 ........ ..... @rdn_i8u | ||
160 | # SVE integer multiply immediate (unpredicated) | ||
161 | MUL_zzi 00100101 .. 110 000 110 ........ ..... @rdn_i8s | ||
162 | |||
163 | +### SVE FP Accumulating Reduction Group | ||
164 | + | ||
165 | +# SVE floating-point serial reduction (predicated) | ||
166 | +FADDA 01100101 .. 011 000 001 ... ..... ..... @rdn_pg_rm | ||
167 | + | ||
168 | ### SVE Floating Point Arithmetic - Unpredicated Group | ||
169 | |||
170 | # SVE floating-point arithmetic (unpredicated) | ||
171 | -- | ||
172 | 2.17.1 | ||
173 | |||
174 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-10-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 5 +++ | ||
9 | target/arm/sve_helper.c | 41 +++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 62 ++++++++++++++++++++++++++++++++++++++ | ||
11 | target/arm/sve.decode | 5 +++ | ||
12 | 4 files changed, 113 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_3(sve_clr_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) | ||
19 | DEF_HELPER_FLAGS_3(sve_clr_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32) | ||
20 | DEF_HELPER_FLAGS_3(sve_clr_d, TCG_CALL_NO_RWG, void, ptr, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_4(sve_movz_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | ||
23 | +DEF_HELPER_FLAGS_4(sve_movz_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_4(sve_movz_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | ||
25 | +DEF_HELPER_FLAGS_4(sve_movz_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | ||
26 | + | ||
27 | DEF_HELPER_FLAGS_4(sve_asr_zpzi_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | ||
28 | DEF_HELPER_FLAGS_4(sve_asr_zpzi_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | ||
29 | DEF_HELPER_FLAGS_4(sve_asr_zpzi_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | ||
30 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
31 | index XXXXXXX..XXXXXXX 100644 | ||
32 | --- a/target/arm/sve_helper.c | ||
33 | +++ b/target/arm/sve_helper.c | ||
34 | @@ -XXX,XX +XXX,XX @@ void HELPER(sve_clr_d)(void *vd, void *vg, uint32_t desc) | ||
35 | } | ||
36 | } | ||
37 | |||
38 | +/* Copy Zn into Zd, and store zero into inactive elements. */ | ||
39 | +void HELPER(sve_movz_b)(void *vd, void *vn, void *vg, uint32_t desc) | ||
40 | +{ | ||
41 | + intptr_t i, opr_sz = simd_oprsz(desc) / 8; | ||
42 | + uint64_t *d = vd, *n = vn; | ||
43 | + uint8_t *pg = vg; | ||
44 | + for (i = 0; i < opr_sz; i += 1) { | ||
45 | + d[i] = n[i] & expand_pred_b(pg[H1(i)]); | ||
46 | + } | ||
47 | +} | ||
48 | + | ||
49 | +void HELPER(sve_movz_h)(void *vd, void *vn, void *vg, uint32_t desc) | ||
50 | +{ | ||
51 | + intptr_t i, opr_sz = simd_oprsz(desc) / 8; | ||
52 | + uint64_t *d = vd, *n = vn; | ||
53 | + uint8_t *pg = vg; | ||
54 | + for (i = 0; i < opr_sz; i += 1) { | ||
55 | + d[i] = n[i] & expand_pred_h(pg[H1(i)]); | ||
56 | + } | ||
57 | +} | ||
58 | + | ||
59 | +void HELPER(sve_movz_s)(void *vd, void *vn, void *vg, uint32_t desc) | ||
60 | +{ | ||
61 | + intptr_t i, opr_sz = simd_oprsz(desc) / 8; | ||
62 | + uint64_t *d = vd, *n = vn; | ||
63 | + uint8_t *pg = vg; | ||
64 | + for (i = 0; i < opr_sz; i += 1) { | ||
65 | + d[i] = n[i] & expand_pred_s(pg[H1(i)]); | ||
66 | + } | ||
67 | +} | ||
68 | + | ||
69 | +void HELPER(sve_movz_d)(void *vd, void *vn, void *vg, uint32_t desc) | ||
70 | +{ | ||
71 | + intptr_t i, opr_sz = simd_oprsz(desc) / 8; | ||
72 | + uint64_t *d = vd, *n = vn; | ||
73 | + uint8_t *pg = vg; | ||
74 | + for (i = 0; i < opr_sz; i += 1) { | ||
75 | + d[i] = n[1] & -(uint64_t)(pg[H1(i)] & 1); | ||
76 | + } | ||
77 | +} | ||
78 | + | ||
79 | /* Three-operand expander, immediate operand, controlled by a predicate. | ||
80 | */ | ||
81 | #define DO_ZPZI(NAME, TYPE, H, OP) \ | ||
82 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
83 | index XXXXXXX..XXXXXXX 100644 | ||
84 | --- a/target/arm/translate-sve.c | ||
85 | +++ b/target/arm/translate-sve.c | ||
86 | @@ -XXX,XX +XXX,XX @@ static bool do_clr_zp(DisasContext *s, int rd, int pg, int esz) | ||
87 | return true; | ||
88 | } | ||
89 | |||
90 | +/* Copy Zn into Zd, storing zeros into inactive elements. */ | ||
91 | +static void do_movz_zpz(DisasContext *s, int rd, int rn, int pg, int esz) | ||
92 | +{ | ||
93 | + static gen_helper_gvec_3 * const fns[4] = { | ||
94 | + gen_helper_sve_movz_b, gen_helper_sve_movz_h, | ||
95 | + gen_helper_sve_movz_s, gen_helper_sve_movz_d, | ||
96 | + }; | ||
97 | + unsigned vsz = vec_full_reg_size(s); | ||
98 | + tcg_gen_gvec_3_ool(vec_full_reg_offset(s, rd), | ||
99 | + vec_full_reg_offset(s, rn), | ||
100 | + pred_full_reg_offset(s, pg), | ||
101 | + vsz, vsz, 0, fns[esz]); | ||
102 | +} | ||
103 | + | ||
104 | static bool do_zpzi_ool(DisasContext *s, arg_rpri_esz *a, | ||
105 | gen_helper_gvec_3 *fn) | ||
106 | { | ||
107 | @@ -XXX,XX +XXX,XX @@ static bool trans_LD1RQ_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn) | ||
108 | return true; | ||
109 | } | ||
110 | |||
111 | +/* Load and broadcast element. */ | ||
112 | +static bool trans_LD1R_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn) | ||
113 | +{ | ||
114 | + if (!sve_access_check(s)) { | ||
115 | + return true; | ||
116 | + } | ||
117 | + | ||
118 | + unsigned vsz = vec_full_reg_size(s); | ||
119 | + unsigned psz = pred_full_reg_size(s); | ||
120 | + unsigned esz = dtype_esz[a->dtype]; | ||
121 | + TCGLabel *over = gen_new_label(); | ||
122 | + TCGv_i64 temp; | ||
123 | + | ||
124 | + /* If the guarding predicate has no bits set, no load occurs. */ | ||
125 | + if (psz <= 8) { | ||
126 | + /* Reduce the pred_esz_masks value simply to reduce the | ||
127 | + * size of the code generated here. | ||
128 | + */ | ||
129 | + uint64_t psz_mask = MAKE_64BIT_MASK(0, psz * 8); | ||
130 | + temp = tcg_temp_new_i64(); | ||
131 | + tcg_gen_ld_i64(temp, cpu_env, pred_full_reg_offset(s, a->pg)); | ||
132 | + tcg_gen_andi_i64(temp, temp, pred_esz_masks[esz] & psz_mask); | ||
133 | + tcg_gen_brcondi_i64(TCG_COND_EQ, temp, 0, over); | ||
134 | + tcg_temp_free_i64(temp); | ||
135 | + } else { | ||
136 | + TCGv_i32 t32 = tcg_temp_new_i32(); | ||
137 | + find_last_active(s, t32, esz, a->pg); | ||
138 | + tcg_gen_brcondi_i32(TCG_COND_LT, t32, 0, over); | ||
139 | + tcg_temp_free_i32(t32); | ||
140 | + } | ||
141 | + | ||
142 | + /* Load the data. */ | ||
143 | + temp = tcg_temp_new_i64(); | ||
144 | + tcg_gen_addi_i64(temp, cpu_reg_sp(s, a->rn), a->imm << esz); | ||
145 | + tcg_gen_qemu_ld_i64(temp, temp, get_mem_index(s), | ||
146 | + s->be_data | dtype_mop[a->dtype]); | ||
147 | + | ||
148 | + /* Broadcast to *all* elements. */ | ||
149 | + tcg_gen_gvec_dup_i64(esz, vec_full_reg_offset(s, a->rd), | ||
150 | + vsz, vsz, temp); | ||
151 | + tcg_temp_free_i64(temp); | ||
152 | + | ||
153 | + /* Zero the inactive elements. */ | ||
154 | + gen_set_label(over); | ||
155 | + do_movz_zpz(s, a->rd, a->rd, a->pg, esz); | ||
156 | + return true; | ||
157 | +} | ||
158 | + | ||
159 | static void do_st_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, | ||
160 | int msz, int esz, int nreg) | ||
161 | { | ||
162 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
163 | index XXXXXXX..XXXXXXX 100644 | ||
164 | --- a/target/arm/sve.decode | ||
165 | +++ b/target/arm/sve.decode | ||
166 | @@ -XXX,XX +XXX,XX @@ | ||
167 | %imm8_16_10 16:5 10:3 | ||
168 | %imm9_16_10 16:s6 10:3 | ||
169 | %size_23 23:2 | ||
170 | +%dtype_23_13 23:2 13:2 | ||
171 | |||
172 | # A combination of tsz:imm3 -- extract esize. | ||
173 | %tszimm_esz 22:2 5:5 !function=tszimm_esz | ||
174 | @@ -XXX,XX +XXX,XX @@ LDR_pri 10000101 10 ...... 000 ... ..... 0 .... @pd_rn_i9 | ||
175 | # SVE load vector register | ||
176 | LDR_zri 10000101 10 ...... 010 ... ..... ..... @rd_rn_i9 | ||
177 | |||
178 | +# SVE load and broadcast element | ||
179 | +LD1R_zpri 1000010 .. 1 imm:6 1.. pg:3 rn:5 rd:5 \ | ||
180 | + &rpri_load dtype=%dtype_23_13 nreg=0 | ||
181 | + | ||
182 | ### SVE Memory Contiguous Load Group | ||
183 | |||
184 | # SVE contiguous load (scalar plus scalar) | ||
185 | -- | ||
186 | 2.17.1 | ||
187 | |||
188 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-11-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 103 +++++++++++++++++++++++++++++++++++++ | ||
9 | target/arm/sve.decode | 6 +++ | ||
10 | 2 files changed, 109 insertions(+) | ||
11 | |||
12 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
13 | index XXXXXXX..XXXXXXX 100644 | ||
14 | --- a/target/arm/translate-sve.c | ||
15 | +++ b/target/arm/translate-sve.c | ||
16 | @@ -XXX,XX +XXX,XX @@ static void do_ldr(DisasContext *s, uint32_t vofs, uint32_t len, | ||
17 | tcg_temp_free_i64(t0); | ||
18 | } | ||
19 | |||
20 | +/* Similarly for stores. */ | ||
21 | +static void do_str(DisasContext *s, uint32_t vofs, uint32_t len, | ||
22 | + int rn, int imm) | ||
23 | +{ | ||
24 | + uint32_t len_align = QEMU_ALIGN_DOWN(len, 8); | ||
25 | + uint32_t len_remain = len % 8; | ||
26 | + uint32_t nparts = len / 8 + ctpop8(len_remain); | ||
27 | + int midx = get_mem_index(s); | ||
28 | + TCGv_i64 addr, t0; | ||
29 | + | ||
30 | + addr = tcg_temp_new_i64(); | ||
31 | + t0 = tcg_temp_new_i64(); | ||
32 | + | ||
33 | + /* Note that unpredicated load/store of vector/predicate registers | ||
34 | + * are defined as a stream of bytes, which equates to little-endian | ||
35 | + * operations on larger quantities. There is no nice way to force | ||
36 | + * a little-endian store for aarch64_be-linux-user out of line. | ||
37 | + * | ||
38 | + * Attempt to keep code expansion to a minimum by limiting the | ||
39 | + * amount of unrolling done. | ||
40 | + */ | ||
41 | + if (nparts <= 4) { | ||
42 | + int i; | ||
43 | + | ||
44 | + for (i = 0; i < len_align; i += 8) { | ||
45 | + tcg_gen_ld_i64(t0, cpu_env, vofs + i); | ||
46 | + tcg_gen_addi_i64(addr, cpu_reg_sp(s, rn), imm + i); | ||
47 | + tcg_gen_qemu_st_i64(t0, addr, midx, MO_LEQ); | ||
48 | + } | ||
49 | + } else { | ||
50 | + TCGLabel *loop = gen_new_label(); | ||
51 | + TCGv_ptr t2, i = tcg_const_local_ptr(0); | ||
52 | + | ||
53 | + gen_set_label(loop); | ||
54 | + | ||
55 | + t2 = tcg_temp_new_ptr(); | ||
56 | + tcg_gen_add_ptr(t2, cpu_env, i); | ||
57 | + tcg_gen_ld_i64(t0, t2, vofs); | ||
58 | + | ||
59 | + /* Minimize the number of local temps that must be re-read from | ||
60 | + * the stack each iteration. Instead, re-compute values other | ||
61 | + * than the loop counter. | ||
62 | + */ | ||
63 | + tcg_gen_addi_ptr(t2, i, imm); | ||
64 | + tcg_gen_extu_ptr_i64(addr, t2); | ||
65 | + tcg_gen_add_i64(addr, addr, cpu_reg_sp(s, rn)); | ||
66 | + tcg_temp_free_ptr(t2); | ||
67 | + | ||
68 | + tcg_gen_qemu_st_i64(t0, addr, midx, MO_LEQ); | ||
69 | + | ||
70 | + tcg_gen_addi_ptr(i, i, 8); | ||
71 | + | ||
72 | + tcg_gen_brcondi_ptr(TCG_COND_LTU, i, len_align, loop); | ||
73 | + tcg_temp_free_ptr(i); | ||
74 | + } | ||
75 | + | ||
76 | + /* Predicate register stores can be any multiple of 2. */ | ||
77 | + if (len_remain) { | ||
78 | + tcg_gen_ld_i64(t0, cpu_env, vofs + len_align); | ||
79 | + tcg_gen_addi_i64(addr, cpu_reg_sp(s, rn), imm + len_align); | ||
80 | + | ||
81 | + switch (len_remain) { | ||
82 | + case 2: | ||
83 | + case 4: | ||
84 | + case 8: | ||
85 | + tcg_gen_qemu_st_i64(t0, addr, midx, MO_LE | ctz32(len_remain)); | ||
86 | + break; | ||
87 | + | ||
88 | + case 6: | ||
89 | + tcg_gen_qemu_st_i64(t0, addr, midx, MO_LEUL); | ||
90 | + tcg_gen_addi_i64(addr, addr, 4); | ||
91 | + tcg_gen_shri_i64(t0, t0, 32); | ||
92 | + tcg_gen_qemu_st_i64(t0, addr, midx, MO_LEUW); | ||
93 | + break; | ||
94 | + | ||
95 | + default: | ||
96 | + g_assert_not_reached(); | ||
97 | + } | ||
98 | + } | ||
99 | + tcg_temp_free_i64(addr); | ||
100 | + tcg_temp_free_i64(t0); | ||
101 | +} | ||
102 | + | ||
103 | static bool trans_LDR_zri(DisasContext *s, arg_rri *a, uint32_t insn) | ||
104 | { | ||
105 | if (sve_access_check(s)) { | ||
106 | @@ -XXX,XX +XXX,XX @@ static bool trans_LDR_pri(DisasContext *s, arg_rri *a, uint32_t insn) | ||
107 | return true; | ||
108 | } | ||
109 | |||
110 | +static bool trans_STR_zri(DisasContext *s, arg_rri *a, uint32_t insn) | ||
111 | +{ | ||
112 | + if (sve_access_check(s)) { | ||
113 | + int size = vec_full_reg_size(s); | ||
114 | + int off = vec_full_reg_offset(s, a->rd); | ||
115 | + do_str(s, off, size, a->rn, a->imm * size); | ||
116 | + } | ||
117 | + return true; | ||
118 | +} | ||
119 | + | ||
120 | +static bool trans_STR_pri(DisasContext *s, arg_rri *a, uint32_t insn) | ||
121 | +{ | ||
122 | + if (sve_access_check(s)) { | ||
123 | + int size = pred_full_reg_size(s); | ||
124 | + int off = pred_full_reg_offset(s, a->rd); | ||
125 | + do_str(s, off, size, a->rn, a->imm * size); | ||
126 | + } | ||
127 | + return true; | ||
128 | +} | ||
129 | + | ||
130 | /* | ||
131 | *** SVE Memory - Contiguous Load Group | ||
132 | */ | ||
133 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
134 | index XXXXXXX..XXXXXXX 100644 | ||
135 | --- a/target/arm/sve.decode | ||
136 | +++ b/target/arm/sve.decode | ||
137 | @@ -XXX,XX +XXX,XX @@ LD1RQ_zpri 1010010 .. 00 0.... 001 ... ..... ..... \ | ||
138 | |||
139 | ### SVE Memory Store Group | ||
140 | |||
141 | +# SVE store predicate register | ||
142 | +STR_pri 1110010 11 0. ..... 000 ... ..... 0 .... @pd_rn_i9 | ||
143 | + | ||
144 | +# SVE store vector register | ||
145 | +STR_zri 1110010 11 0. ..... 010 ... ..... ..... @rd_rn_i9 | ||
146 | + | ||
147 | # SVE contiguous store (scalar plus immediate) | ||
148 | # ST1B, ST1H, ST1W, ST1D; require msz <= esz | ||
149 | ST_zpri 1110010 .. esz:2 0.... 111 ... ..... ..... \ | ||
150 | -- | ||
151 | 2.17.1 | ||
152 | |||
153 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-12-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 41 +++++++++++++++++++++ | ||
9 | target/arm/sve_helper.c | 61 +++++++++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 75 ++++++++++++++++++++++++++++++++++++++ | ||
11 | target/arm/sve.decode | 39 ++++++++++++++++++++ | ||
12 | 4 files changed, 216 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_4(sve_st1hs_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
19 | DEF_HELPER_FLAGS_4(sve_st1hd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
20 | |||
21 | DEF_HELPER_FLAGS_4(sve_st1sd_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
22 | + | ||
23 | +DEF_HELPER_FLAGS_6(sve_stbs_zsu, TCG_CALL_NO_WG, | ||
24 | + void, env, ptr, ptr, ptr, tl, i32) | ||
25 | +DEF_HELPER_FLAGS_6(sve_sths_zsu, TCG_CALL_NO_WG, | ||
26 | + void, env, ptr, ptr, ptr, tl, i32) | ||
27 | +DEF_HELPER_FLAGS_6(sve_stss_zsu, TCG_CALL_NO_WG, | ||
28 | + void, env, ptr, ptr, ptr, tl, i32) | ||
29 | + | ||
30 | +DEF_HELPER_FLAGS_6(sve_stbs_zss, TCG_CALL_NO_WG, | ||
31 | + void, env, ptr, ptr, ptr, tl, i32) | ||
32 | +DEF_HELPER_FLAGS_6(sve_sths_zss, TCG_CALL_NO_WG, | ||
33 | + void, env, ptr, ptr, ptr, tl, i32) | ||
34 | +DEF_HELPER_FLAGS_6(sve_stss_zss, TCG_CALL_NO_WG, | ||
35 | + void, env, ptr, ptr, ptr, tl, i32) | ||
36 | + | ||
37 | +DEF_HELPER_FLAGS_6(sve_stbd_zsu, TCG_CALL_NO_WG, | ||
38 | + void, env, ptr, ptr, ptr, tl, i32) | ||
39 | +DEF_HELPER_FLAGS_6(sve_sthd_zsu, TCG_CALL_NO_WG, | ||
40 | + void, env, ptr, ptr, ptr, tl, i32) | ||
41 | +DEF_HELPER_FLAGS_6(sve_stsd_zsu, TCG_CALL_NO_WG, | ||
42 | + void, env, ptr, ptr, ptr, tl, i32) | ||
43 | +DEF_HELPER_FLAGS_6(sve_stdd_zsu, TCG_CALL_NO_WG, | ||
44 | + void, env, ptr, ptr, ptr, tl, i32) | ||
45 | + | ||
46 | +DEF_HELPER_FLAGS_6(sve_stbd_zss, TCG_CALL_NO_WG, | ||
47 | + void, env, ptr, ptr, ptr, tl, i32) | ||
48 | +DEF_HELPER_FLAGS_6(sve_sthd_zss, TCG_CALL_NO_WG, | ||
49 | + void, env, ptr, ptr, ptr, tl, i32) | ||
50 | +DEF_HELPER_FLAGS_6(sve_stsd_zss, TCG_CALL_NO_WG, | ||
51 | + void, env, ptr, ptr, ptr, tl, i32) | ||
52 | +DEF_HELPER_FLAGS_6(sve_stdd_zss, TCG_CALL_NO_WG, | ||
53 | + void, env, ptr, ptr, ptr, tl, i32) | ||
54 | + | ||
55 | +DEF_HELPER_FLAGS_6(sve_stbd_zd, TCG_CALL_NO_WG, | ||
56 | + void, env, ptr, ptr, ptr, tl, i32) | ||
57 | +DEF_HELPER_FLAGS_6(sve_sthd_zd, TCG_CALL_NO_WG, | ||
58 | + void, env, ptr, ptr, ptr, tl, i32) | ||
59 | +DEF_HELPER_FLAGS_6(sve_stsd_zd, TCG_CALL_NO_WG, | ||
60 | + void, env, ptr, ptr, ptr, tl, i32) | ||
61 | +DEF_HELPER_FLAGS_6(sve_stdd_zd, TCG_CALL_NO_WG, | ||
62 | + void, env, ptr, ptr, ptr, tl, i32) | ||
63 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
64 | index XXXXXXX..XXXXXXX 100644 | ||
65 | --- a/target/arm/sve_helper.c | ||
66 | +++ b/target/arm/sve_helper.c | ||
67 | @@ -XXX,XX +XXX,XX @@ void HELPER(sve_st4dd_r)(CPUARMState *env, void *vg, | ||
68 | addr += 4 * 8; | ||
69 | } | ||
70 | } | ||
71 | + | ||
72 | +/* Stores with a vector index. */ | ||
73 | + | ||
74 | +#define DO_ST1_ZPZ_S(NAME, TYPEI, FN) \ | ||
75 | +void HELPER(NAME)(CPUARMState *env, void *vd, void *vg, void *vm, \ | ||
76 | + target_ulong base, uint32_t desc) \ | ||
77 | +{ \ | ||
78 | + intptr_t i, oprsz = simd_oprsz(desc); \ | ||
79 | + unsigned scale = simd_data(desc); \ | ||
80 | + uintptr_t ra = GETPC(); \ | ||
81 | + for (i = 0; i < oprsz; ) { \ | ||
82 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ | ||
83 | + do { \ | ||
84 | + if (likely(pg & 1)) { \ | ||
85 | + target_ulong off = *(TYPEI *)(vm + H1_4(i)); \ | ||
86 | + uint32_t d = *(uint32_t *)(vd + H1_4(i)); \ | ||
87 | + FN(env, base + (off << scale), d, ra); \ | ||
88 | + } \ | ||
89 | + i += sizeof(uint32_t), pg >>= sizeof(uint32_t); \ | ||
90 | + } while (i & 15); \ | ||
91 | + } \ | ||
92 | +} | ||
93 | + | ||
94 | +#define DO_ST1_ZPZ_D(NAME, TYPEI, FN) \ | ||
95 | +void HELPER(NAME)(CPUARMState *env, void *vd, void *vg, void *vm, \ | ||
96 | + target_ulong base, uint32_t desc) \ | ||
97 | +{ \ | ||
98 | + intptr_t i, oprsz = simd_oprsz(desc) / 8; \ | ||
99 | + unsigned scale = simd_data(desc); \ | ||
100 | + uintptr_t ra = GETPC(); \ | ||
101 | + uint64_t *d = vd, *m = vm; uint8_t *pg = vg; \ | ||
102 | + for (i = 0; i < oprsz; i++) { \ | ||
103 | + if (likely(pg[H1(i)] & 1)) { \ | ||
104 | + target_ulong off = (target_ulong)(TYPEI)m[i] << scale; \ | ||
105 | + FN(env, base + off, d[i], ra); \ | ||
106 | + } \ | ||
107 | + } \ | ||
108 | +} | ||
109 | + | ||
110 | +DO_ST1_ZPZ_S(sve_stbs_zsu, uint32_t, cpu_stb_data_ra) | ||
111 | +DO_ST1_ZPZ_S(sve_sths_zsu, uint32_t, cpu_stw_data_ra) | ||
112 | +DO_ST1_ZPZ_S(sve_stss_zsu, uint32_t, cpu_stl_data_ra) | ||
113 | + | ||
114 | +DO_ST1_ZPZ_S(sve_stbs_zss, int32_t, cpu_stb_data_ra) | ||
115 | +DO_ST1_ZPZ_S(sve_sths_zss, int32_t, cpu_stw_data_ra) | ||
116 | +DO_ST1_ZPZ_S(sve_stss_zss, int32_t, cpu_stl_data_ra) | ||
117 | + | ||
118 | +DO_ST1_ZPZ_D(sve_stbd_zsu, uint32_t, cpu_stb_data_ra) | ||
119 | +DO_ST1_ZPZ_D(sve_sthd_zsu, uint32_t, cpu_stw_data_ra) | ||
120 | +DO_ST1_ZPZ_D(sve_stsd_zsu, uint32_t, cpu_stl_data_ra) | ||
121 | +DO_ST1_ZPZ_D(sve_stdd_zsu, uint32_t, cpu_stq_data_ra) | ||
122 | + | ||
123 | +DO_ST1_ZPZ_D(sve_stbd_zss, int32_t, cpu_stb_data_ra) | ||
124 | +DO_ST1_ZPZ_D(sve_sthd_zss, int32_t, cpu_stw_data_ra) | ||
125 | +DO_ST1_ZPZ_D(sve_stsd_zss, int32_t, cpu_stl_data_ra) | ||
126 | +DO_ST1_ZPZ_D(sve_stdd_zss, int32_t, cpu_stq_data_ra) | ||
127 | + | ||
128 | +DO_ST1_ZPZ_D(sve_stbd_zd, uint64_t, cpu_stb_data_ra) | ||
129 | +DO_ST1_ZPZ_D(sve_sthd_zd, uint64_t, cpu_stw_data_ra) | ||
130 | +DO_ST1_ZPZ_D(sve_stsd_zd, uint64_t, cpu_stl_data_ra) | ||
131 | +DO_ST1_ZPZ_D(sve_stdd_zd, uint64_t, cpu_stq_data_ra) | ||
132 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
133 | index XXXXXXX..XXXXXXX 100644 | ||
134 | --- a/target/arm/translate-sve.c | ||
135 | +++ b/target/arm/translate-sve.c | ||
136 | @@ -XXX,XX +XXX,XX @@ typedef void gen_helper_gvec_flags_4(TCGv_i32, TCGv_ptr, TCGv_ptr, | ||
137 | TCGv_ptr, TCGv_ptr, TCGv_i32); | ||
138 | |||
139 | typedef void gen_helper_gvec_mem(TCGv_env, TCGv_ptr, TCGv_i64, TCGv_i32); | ||
140 | +typedef void gen_helper_gvec_mem_scatter(TCGv_env, TCGv_ptr, TCGv_ptr, | ||
141 | + TCGv_ptr, TCGv_i64, TCGv_i32); | ||
142 | |||
143 | /* | ||
144 | * Helpers for extracting complex instruction fields. | ||
145 | @@ -XXX,XX +XXX,XX @@ static bool trans_ST_zpri(DisasContext *s, arg_rpri_store *a, uint32_t insn) | ||
146 | } | ||
147 | return true; | ||
148 | } | ||
149 | + | ||
150 | +/* | ||
151 | + *** SVE gather loads / scatter stores | ||
152 | + */ | ||
153 | + | ||
154 | +static void do_mem_zpz(DisasContext *s, int zt, int pg, int zm, int scale, | ||
155 | + TCGv_i64 scalar, gen_helper_gvec_mem_scatter *fn) | ||
156 | +{ | ||
157 | + unsigned vsz = vec_full_reg_size(s); | ||
158 | + TCGv_i32 desc = tcg_const_i32(simd_desc(vsz, vsz, scale)); | ||
159 | + TCGv_ptr t_zm = tcg_temp_new_ptr(); | ||
160 | + TCGv_ptr t_pg = tcg_temp_new_ptr(); | ||
161 | + TCGv_ptr t_zt = tcg_temp_new_ptr(); | ||
162 | + | ||
163 | + tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg)); | ||
164 | + tcg_gen_addi_ptr(t_zm, cpu_env, vec_full_reg_offset(s, zm)); | ||
165 | + tcg_gen_addi_ptr(t_zt, cpu_env, vec_full_reg_offset(s, zt)); | ||
166 | + fn(cpu_env, t_zt, t_pg, t_zm, scalar, desc); | ||
167 | + | ||
168 | + tcg_temp_free_ptr(t_zt); | ||
169 | + tcg_temp_free_ptr(t_zm); | ||
170 | + tcg_temp_free_ptr(t_pg); | ||
171 | + tcg_temp_free_i32(desc); | ||
172 | +} | ||
173 | + | ||
174 | +static bool trans_ST1_zprz(DisasContext *s, arg_ST1_zprz *a, uint32_t insn) | ||
175 | +{ | ||
176 | + /* Indexed by [xs][msz]. */ | ||
177 | + static gen_helper_gvec_mem_scatter * const fn32[2][3] = { | ||
178 | + { gen_helper_sve_stbs_zsu, | ||
179 | + gen_helper_sve_sths_zsu, | ||
180 | + gen_helper_sve_stss_zsu, }, | ||
181 | + { gen_helper_sve_stbs_zss, | ||
182 | + gen_helper_sve_sths_zss, | ||
183 | + gen_helper_sve_stss_zss, }, | ||
184 | + }; | ||
185 | + /* Note that we overload xs=2 to indicate 64-bit offset. */ | ||
186 | + static gen_helper_gvec_mem_scatter * const fn64[3][4] = { | ||
187 | + { gen_helper_sve_stbd_zsu, | ||
188 | + gen_helper_sve_sthd_zsu, | ||
189 | + gen_helper_sve_stsd_zsu, | ||
190 | + gen_helper_sve_stdd_zsu, }, | ||
191 | + { gen_helper_sve_stbd_zss, | ||
192 | + gen_helper_sve_sthd_zss, | ||
193 | + gen_helper_sve_stsd_zss, | ||
194 | + gen_helper_sve_stdd_zss, }, | ||
195 | + { gen_helper_sve_stbd_zd, | ||
196 | + gen_helper_sve_sthd_zd, | ||
197 | + gen_helper_sve_stsd_zd, | ||
198 | + gen_helper_sve_stdd_zd, }, | ||
199 | + }; | ||
200 | + gen_helper_gvec_mem_scatter *fn; | ||
201 | + | ||
202 | + if (a->esz < a->msz || (a->msz == 0 && a->scale)) { | ||
203 | + return false; | ||
204 | + } | ||
205 | + if (!sve_access_check(s)) { | ||
206 | + return true; | ||
207 | + } | ||
208 | + switch (a->esz) { | ||
209 | + case MO_32: | ||
210 | + fn = fn32[a->xs][a->msz]; | ||
211 | + break; | ||
212 | + case MO_64: | ||
213 | + fn = fn64[a->xs][a->msz]; | ||
214 | + break; | ||
215 | + default: | ||
216 | + g_assert_not_reached(); | ||
217 | + } | ||
218 | + do_mem_zpz(s, a->rd, a->pg, a->rm, a->scale * a->msz, | ||
219 | + cpu_reg_sp(s, a->rn), fn); | ||
220 | + return true; | ||
221 | +} | ||
222 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
223 | index XXXXXXX..XXXXXXX 100644 | ||
224 | --- a/target/arm/sve.decode | ||
225 | +++ b/target/arm/sve.decode | ||
226 | @@ -XXX,XX +XXX,XX @@ | ||
227 | &rpri_load rd pg rn imm dtype nreg | ||
228 | &rprr_store rd pg rn rm msz esz nreg | ||
229 | &rpri_store rd pg rn imm msz esz nreg | ||
230 | +&rprr_scatter_store rd pg rn rm esz msz xs scale | ||
231 | |||
232 | ########################################################################### | ||
233 | # Named instruction formats. These are generally used to | ||
234 | @@ -XXX,XX +XXX,XX @@ | ||
235 | @rpri_store_msz ....... msz:2 .. . imm:s4 ... pg:3 rn:5 rd:5 &rpri_store | ||
236 | @rprr_store_esz_n0 ....... .. esz:2 rm:5 ... pg:3 rn:5 rd:5 \ | ||
237 | &rprr_store nreg=0 | ||
238 | +@rprr_scatter_store ....... msz:2 .. rm:5 ... pg:3 rn:5 rd:5 \ | ||
239 | + &rprr_scatter_store | ||
240 | |||
241 | ########################################################################### | ||
242 | # Instruction patterns. Grouped according to the SVE encodingindex.xhtml. | ||
243 | @@ -XXX,XX +XXX,XX @@ ST_zpri 1110010 .. nreg:2 1.... 111 ... ..... ..... \ | ||
244 | # SVE store multiple structures (scalar plus scalar) (nreg != 0) | ||
245 | ST_zprr 1110010 msz:2 nreg:2 ..... 011 ... ..... ..... \ | ||
246 | @rprr_store esz=%size_23 | ||
247 | + | ||
248 | +# SVE 32-bit scatter store (scalar plus 32-bit scaled offsets) | ||
249 | +# Require msz > 0 && msz <= esz. | ||
250 | +ST1_zprz 1110010 .. 11 ..... 100 ... ..... ..... \ | ||
251 | + @rprr_scatter_store xs=0 esz=2 scale=1 | ||
252 | +ST1_zprz 1110010 .. 11 ..... 110 ... ..... ..... \ | ||
253 | + @rprr_scatter_store xs=1 esz=2 scale=1 | ||
254 | + | ||
255 | +# SVE 32-bit scatter store (scalar plus 32-bit unscaled offsets) | ||
256 | +# Require msz <= esz. | ||
257 | +ST1_zprz 1110010 .. 10 ..... 100 ... ..... ..... \ | ||
258 | + @rprr_scatter_store xs=0 esz=2 scale=0 | ||
259 | +ST1_zprz 1110010 .. 10 ..... 110 ... ..... ..... \ | ||
260 | + @rprr_scatter_store xs=1 esz=2 scale=0 | ||
261 | + | ||
262 | +# SVE 64-bit scatter store (scalar plus 64-bit scaled offset) | ||
263 | +# Require msz > 0 | ||
264 | +ST1_zprz 1110010 .. 01 ..... 101 ... ..... ..... \ | ||
265 | + @rprr_scatter_store xs=2 esz=3 scale=1 | ||
266 | + | ||
267 | +# SVE 64-bit scatter store (scalar plus 64-bit unscaled offset) | ||
268 | +ST1_zprz 1110010 .. 00 ..... 101 ... ..... ..... \ | ||
269 | + @rprr_scatter_store xs=2 esz=3 scale=0 | ||
270 | + | ||
271 | +# SVE 64-bit scatter store (scalar plus unpacked 32-bit scaled offset) | ||
272 | +# Require msz > 0 | ||
273 | +ST1_zprz 1110010 .. 01 ..... 100 ... ..... ..... \ | ||
274 | + @rprr_scatter_store xs=0 esz=3 scale=1 | ||
275 | +ST1_zprz 1110010 .. 01 ..... 110 ... ..... ..... \ | ||
276 | + @rprr_scatter_store xs=1 esz=3 scale=1 | ||
277 | + | ||
278 | +# SVE 64-bit scatter store (scalar plus unpacked 32-bit unscaled offset) | ||
279 | +ST1_zprz 1110010 .. 00 ..... 100 ... ..... ..... \ | ||
280 | + @rprr_scatter_store xs=0 esz=3 scale=0 | ||
281 | +ST1_zprz 1110010 .. 00 ..... 110 ... ..... ..... \ | ||
282 | + @rprr_scatter_store xs=1 esz=3 scale=0 | ||
283 | -- | ||
284 | 2.17.1 | ||
285 | |||
286 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-13-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 21 +++++++++++++++++++++ | ||
9 | target/arm/sve.decode | 23 +++++++++++++++++++++++ | ||
10 | 2 files changed, 44 insertions(+) | ||
11 | |||
12 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
13 | index XXXXXXX..XXXXXXX 100644 | ||
14 | --- a/target/arm/translate-sve.c | ||
15 | +++ b/target/arm/translate-sve.c | ||
16 | @@ -XXX,XX +XXX,XX @@ static bool trans_ST1_zprz(DisasContext *s, arg_ST1_zprz *a, uint32_t insn) | ||
17 | cpu_reg_sp(s, a->rn), fn); | ||
18 | return true; | ||
19 | } | ||
20 | + | ||
21 | +/* | ||
22 | + * Prefetches | ||
23 | + */ | ||
24 | + | ||
25 | +static bool trans_PRF(DisasContext *s, arg_PRF *a, uint32_t insn) | ||
26 | +{ | ||
27 | + /* Prefetch is a nop within QEMU. */ | ||
28 | + sve_access_check(s); | ||
29 | + return true; | ||
30 | +} | ||
31 | + | ||
32 | +static bool trans_PRF_rr(DisasContext *s, arg_PRF_rr *a, uint32_t insn) | ||
33 | +{ | ||
34 | + if (a->rm == 31) { | ||
35 | + return false; | ||
36 | + } | ||
37 | + /* Prefetch is a nop within QEMU. */ | ||
38 | + sve_access_check(s); | ||
39 | + return true; | ||
40 | +} | ||
41 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
42 | index XXXXXXX..XXXXXXX 100644 | ||
43 | --- a/target/arm/sve.decode | ||
44 | +++ b/target/arm/sve.decode | ||
45 | @@ -XXX,XX +XXX,XX @@ LD1RQ_zprr 1010010 .. 00 ..... 000 ... ..... ..... \ | ||
46 | LD1RQ_zpri 1010010 .. 00 0.... 001 ... ..... ..... \ | ||
47 | @rpri_load_msz nreg=0 | ||
48 | |||
49 | +# SVE 32-bit gather prefetch (scalar plus 32-bit scaled offsets) | ||
50 | +PRF 1000010 00 -1 ----- 0-- --- ----- 0 ---- | ||
51 | + | ||
52 | +# SVE 32-bit gather prefetch (vector plus immediate) | ||
53 | +PRF 1000010 -- 00 ----- 111 --- ----- 0 ---- | ||
54 | + | ||
55 | +# SVE contiguous prefetch (scalar plus immediate) | ||
56 | +PRF 1000010 11 1- ----- 0-- --- ----- 0 ---- | ||
57 | + | ||
58 | +# SVE contiguous prefetch (scalar plus scalar) | ||
59 | +PRF_rr 1000010 -- 00 rm:5 110 --- ----- 0 ---- | ||
60 | + | ||
61 | +### SVE Memory 64-bit Gather Group | ||
62 | + | ||
63 | +# SVE 64-bit gather prefetch (scalar plus 64-bit scaled offsets) | ||
64 | +PRF 1100010 00 11 ----- 1-- --- ----- 0 ---- | ||
65 | + | ||
66 | +# SVE 64-bit gather prefetch (scalar plus unpacked 32-bit scaled offsets) | ||
67 | +PRF 1100010 00 -1 ----- 0-- --- ----- 0 ---- | ||
68 | + | ||
69 | +# SVE 64-bit gather prefetch (vector plus immediate) | ||
70 | +PRF 1100010 -- 00 ----- 111 --- ----- 0 ---- | ||
71 | + | ||
72 | ### SVE Memory Store Group | ||
73 | |||
74 | # SVE store predicate register | ||
75 | -- | ||
76 | 2.17.1 | ||
77 | |||
78 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-15-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 67 +++++++++++++++++++++++++++++ | ||
9 | target/arm/sve_helper.c | 88 ++++++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 40 ++++++++++++++++- | ||
11 | 3 files changed, 193 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/target/arm/helper-sve.h | ||
16 | +++ b/target/arm/helper-sve.h | ||
17 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_6(sve_ldhds_zd, TCG_CALL_NO_WG, | ||
18 | DEF_HELPER_FLAGS_6(sve_ldsds_zd, TCG_CALL_NO_WG, | ||
19 | void, env, ptr, ptr, ptr, tl, i32) | ||
20 | |||
21 | +DEF_HELPER_FLAGS_6(sve_ldffbsu_zsu, TCG_CALL_NO_WG, | ||
22 | + void, env, ptr, ptr, ptr, tl, i32) | ||
23 | +DEF_HELPER_FLAGS_6(sve_ldffhsu_zsu, TCG_CALL_NO_WG, | ||
24 | + void, env, ptr, ptr, ptr, tl, i32) | ||
25 | +DEF_HELPER_FLAGS_6(sve_ldffssu_zsu, TCG_CALL_NO_WG, | ||
26 | + void, env, ptr, ptr, ptr, tl, i32) | ||
27 | +DEF_HELPER_FLAGS_6(sve_ldffbss_zsu, TCG_CALL_NO_WG, | ||
28 | + void, env, ptr, ptr, ptr, tl, i32) | ||
29 | +DEF_HELPER_FLAGS_6(sve_ldffhss_zsu, TCG_CALL_NO_WG, | ||
30 | + void, env, ptr, ptr, ptr, tl, i32) | ||
31 | + | ||
32 | +DEF_HELPER_FLAGS_6(sve_ldffbsu_zss, TCG_CALL_NO_WG, | ||
33 | + void, env, ptr, ptr, ptr, tl, i32) | ||
34 | +DEF_HELPER_FLAGS_6(sve_ldffhsu_zss, TCG_CALL_NO_WG, | ||
35 | + void, env, ptr, ptr, ptr, tl, i32) | ||
36 | +DEF_HELPER_FLAGS_6(sve_ldffssu_zss, TCG_CALL_NO_WG, | ||
37 | + void, env, ptr, ptr, ptr, tl, i32) | ||
38 | +DEF_HELPER_FLAGS_6(sve_ldffbss_zss, TCG_CALL_NO_WG, | ||
39 | + void, env, ptr, ptr, ptr, tl, i32) | ||
40 | +DEF_HELPER_FLAGS_6(sve_ldffhss_zss, TCG_CALL_NO_WG, | ||
41 | + void, env, ptr, ptr, ptr, tl, i32) | ||
42 | + | ||
43 | +DEF_HELPER_FLAGS_6(sve_ldffbdu_zsu, TCG_CALL_NO_WG, | ||
44 | + void, env, ptr, ptr, ptr, tl, i32) | ||
45 | +DEF_HELPER_FLAGS_6(sve_ldffhdu_zsu, TCG_CALL_NO_WG, | ||
46 | + void, env, ptr, ptr, ptr, tl, i32) | ||
47 | +DEF_HELPER_FLAGS_6(sve_ldffsdu_zsu, TCG_CALL_NO_WG, | ||
48 | + void, env, ptr, ptr, ptr, tl, i32) | ||
49 | +DEF_HELPER_FLAGS_6(sve_ldffddu_zsu, TCG_CALL_NO_WG, | ||
50 | + void, env, ptr, ptr, ptr, tl, i32) | ||
51 | +DEF_HELPER_FLAGS_6(sve_ldffbds_zsu, TCG_CALL_NO_WG, | ||
52 | + void, env, ptr, ptr, ptr, tl, i32) | ||
53 | +DEF_HELPER_FLAGS_6(sve_ldffhds_zsu, TCG_CALL_NO_WG, | ||
54 | + void, env, ptr, ptr, ptr, tl, i32) | ||
55 | +DEF_HELPER_FLAGS_6(sve_ldffsds_zsu, TCG_CALL_NO_WG, | ||
56 | + void, env, ptr, ptr, ptr, tl, i32) | ||
57 | + | ||
58 | +DEF_HELPER_FLAGS_6(sve_ldffbdu_zss, TCG_CALL_NO_WG, | ||
59 | + void, env, ptr, ptr, ptr, tl, i32) | ||
60 | +DEF_HELPER_FLAGS_6(sve_ldffhdu_zss, TCG_CALL_NO_WG, | ||
61 | + void, env, ptr, ptr, ptr, tl, i32) | ||
62 | +DEF_HELPER_FLAGS_6(sve_ldffsdu_zss, TCG_CALL_NO_WG, | ||
63 | + void, env, ptr, ptr, ptr, tl, i32) | ||
64 | +DEF_HELPER_FLAGS_6(sve_ldffddu_zss, TCG_CALL_NO_WG, | ||
65 | + void, env, ptr, ptr, ptr, tl, i32) | ||
66 | +DEF_HELPER_FLAGS_6(sve_ldffbds_zss, TCG_CALL_NO_WG, | ||
67 | + void, env, ptr, ptr, ptr, tl, i32) | ||
68 | +DEF_HELPER_FLAGS_6(sve_ldffhds_zss, TCG_CALL_NO_WG, | ||
69 | + void, env, ptr, ptr, ptr, tl, i32) | ||
70 | +DEF_HELPER_FLAGS_6(sve_ldffsds_zss, TCG_CALL_NO_WG, | ||
71 | + void, env, ptr, ptr, ptr, tl, i32) | ||
72 | + | ||
73 | +DEF_HELPER_FLAGS_6(sve_ldffbdu_zd, TCG_CALL_NO_WG, | ||
74 | + void, env, ptr, ptr, ptr, tl, i32) | ||
75 | +DEF_HELPER_FLAGS_6(sve_ldffhdu_zd, TCG_CALL_NO_WG, | ||
76 | + void, env, ptr, ptr, ptr, tl, i32) | ||
77 | +DEF_HELPER_FLAGS_6(sve_ldffsdu_zd, TCG_CALL_NO_WG, | ||
78 | + void, env, ptr, ptr, ptr, tl, i32) | ||
79 | +DEF_HELPER_FLAGS_6(sve_ldffddu_zd, TCG_CALL_NO_WG, | ||
80 | + void, env, ptr, ptr, ptr, tl, i32) | ||
81 | +DEF_HELPER_FLAGS_6(sve_ldffbds_zd, TCG_CALL_NO_WG, | ||
82 | + void, env, ptr, ptr, ptr, tl, i32) | ||
83 | +DEF_HELPER_FLAGS_6(sve_ldffhds_zd, TCG_CALL_NO_WG, | ||
84 | + void, env, ptr, ptr, ptr, tl, i32) | ||
85 | +DEF_HELPER_FLAGS_6(sve_ldffsds_zd, TCG_CALL_NO_WG, | ||
86 | + void, env, ptr, ptr, ptr, tl, i32) | ||
87 | + | ||
88 | DEF_HELPER_FLAGS_6(sve_stbs_zsu, TCG_CALL_NO_WG, | ||
89 | void, env, ptr, ptr, ptr, tl, i32) | ||
90 | DEF_HELPER_FLAGS_6(sve_sths_zsu, TCG_CALL_NO_WG, | ||
91 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
92 | index XXXXXXX..XXXXXXX 100644 | ||
93 | --- a/target/arm/sve_helper.c | ||
94 | +++ b/target/arm/sve_helper.c | ||
95 | @@ -XXX,XX +XXX,XX @@ DO_LD1_ZPZ_D(sve_ldbds_zd, uint64_t, int8_t, cpu_ldub_data_ra) | ||
96 | DO_LD1_ZPZ_D(sve_ldhds_zd, uint64_t, int16_t, cpu_lduw_data_ra) | ||
97 | DO_LD1_ZPZ_D(sve_ldsds_zd, uint64_t, int32_t, cpu_ldl_data_ra) | ||
98 | |||
99 | +/* First fault loads with a vector index. */ | ||
100 | + | ||
101 | +#ifdef CONFIG_USER_ONLY | ||
102 | + | ||
103 | +#define DO_LDFF1_ZPZ(NAME, TYPEE, TYPEI, TYPEM, FN, H) \ | ||
104 | +void HELPER(NAME)(CPUARMState *env, void *vd, void *vg, void *vm, \ | ||
105 | + target_ulong base, uint32_t desc) \ | ||
106 | +{ \ | ||
107 | + intptr_t i, oprsz = simd_oprsz(desc); \ | ||
108 | + unsigned scale = simd_data(desc); \ | ||
109 | + uintptr_t ra = GETPC(); \ | ||
110 | + bool first = true; \ | ||
111 | + mmap_lock(); \ | ||
112 | + for (i = 0; i < oprsz; i++) { \ | ||
113 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ | ||
114 | + do { \ | ||
115 | + TYPEM m = 0; \ | ||
116 | + if (pg & 1) { \ | ||
117 | + target_ulong off = *(TYPEI *)(vm + H(i)); \ | ||
118 | + target_ulong addr = base + (off << scale); \ | ||
119 | + if (!first && \ | ||
120 | + page_check_range(addr, sizeof(TYPEM), PAGE_READ)) { \ | ||
121 | + record_fault(env, i, oprsz); \ | ||
122 | + goto exit; \ | ||
123 | + } \ | ||
124 | + m = FN(env, addr, ra); \ | ||
125 | + first = false; \ | ||
126 | + } \ | ||
127 | + *(TYPEE *)(vd + H(i)) = m; \ | ||
128 | + i += sizeof(TYPEE), pg >>= sizeof(TYPEE); \ | ||
129 | + } while (i & 15); \ | ||
130 | + } \ | ||
131 | + exit: \ | ||
132 | + mmap_unlock(); \ | ||
133 | +} | ||
134 | + | ||
135 | +#else | ||
136 | + | ||
137 | +#define DO_LDFF1_ZPZ(NAME, TYPEE, TYPEI, TYPEM, FN, H) \ | ||
138 | +void HELPER(NAME)(CPUARMState *env, void *vd, void *vg, void *vm, \ | ||
139 | + target_ulong base, uint32_t desc) \ | ||
140 | +{ \ | ||
141 | + g_assert_not_reached(); \ | ||
142 | +} | ||
143 | + | ||
144 | +#endif | ||
145 | + | ||
146 | +#define DO_LDFF1_ZPZ_S(NAME, TYPEI, TYPEM, FN) \ | ||
147 | + DO_LDFF1_ZPZ(NAME, uint32_t, TYPEI, TYPEM, FN, H1_4) | ||
148 | +#define DO_LDFF1_ZPZ_D(NAME, TYPEI, TYPEM, FN) \ | ||
149 | + DO_LDFF1_ZPZ(NAME, uint64_t, TYPEI, TYPEM, FN, ) | ||
150 | + | ||
151 | +DO_LDFF1_ZPZ_S(sve_ldffbsu_zsu, uint32_t, uint8_t, cpu_ldub_data_ra) | ||
152 | +DO_LDFF1_ZPZ_S(sve_ldffhsu_zsu, uint32_t, uint16_t, cpu_lduw_data_ra) | ||
153 | +DO_LDFF1_ZPZ_S(sve_ldffssu_zsu, uint32_t, uint32_t, cpu_ldl_data_ra) | ||
154 | +DO_LDFF1_ZPZ_S(sve_ldffbss_zsu, uint32_t, int8_t, cpu_ldub_data_ra) | ||
155 | +DO_LDFF1_ZPZ_S(sve_ldffhss_zsu, uint32_t, int16_t, cpu_lduw_data_ra) | ||
156 | + | ||
157 | +DO_LDFF1_ZPZ_S(sve_ldffbsu_zss, int32_t, uint8_t, cpu_ldub_data_ra) | ||
158 | +DO_LDFF1_ZPZ_S(sve_ldffhsu_zss, int32_t, uint16_t, cpu_lduw_data_ra) | ||
159 | +DO_LDFF1_ZPZ_S(sve_ldffssu_zss, int32_t, uint32_t, cpu_ldl_data_ra) | ||
160 | +DO_LDFF1_ZPZ_S(sve_ldffbss_zss, int32_t, int8_t, cpu_ldub_data_ra) | ||
161 | +DO_LDFF1_ZPZ_S(sve_ldffhss_zss, int32_t, int16_t, cpu_lduw_data_ra) | ||
162 | + | ||
163 | +DO_LDFF1_ZPZ_D(sve_ldffbdu_zsu, uint32_t, uint8_t, cpu_ldub_data_ra) | ||
164 | +DO_LDFF1_ZPZ_D(sve_ldffhdu_zsu, uint32_t, uint16_t, cpu_lduw_data_ra) | ||
165 | +DO_LDFF1_ZPZ_D(sve_ldffsdu_zsu, uint32_t, uint32_t, cpu_ldl_data_ra) | ||
166 | +DO_LDFF1_ZPZ_D(sve_ldffddu_zsu, uint32_t, uint64_t, cpu_ldq_data_ra) | ||
167 | +DO_LDFF1_ZPZ_D(sve_ldffbds_zsu, uint32_t, int8_t, cpu_ldub_data_ra) | ||
168 | +DO_LDFF1_ZPZ_D(sve_ldffhds_zsu, uint32_t, int16_t, cpu_lduw_data_ra) | ||
169 | +DO_LDFF1_ZPZ_D(sve_ldffsds_zsu, uint32_t, int32_t, cpu_ldl_data_ra) | ||
170 | + | ||
171 | +DO_LDFF1_ZPZ_D(sve_ldffbdu_zss, int32_t, uint8_t, cpu_ldub_data_ra) | ||
172 | +DO_LDFF1_ZPZ_D(sve_ldffhdu_zss, int32_t, uint16_t, cpu_lduw_data_ra) | ||
173 | +DO_LDFF1_ZPZ_D(sve_ldffsdu_zss, int32_t, uint32_t, cpu_ldl_data_ra) | ||
174 | +DO_LDFF1_ZPZ_D(sve_ldffddu_zss, int32_t, uint64_t, cpu_ldq_data_ra) | ||
175 | +DO_LDFF1_ZPZ_D(sve_ldffbds_zss, int32_t, int8_t, cpu_ldub_data_ra) | ||
176 | +DO_LDFF1_ZPZ_D(sve_ldffhds_zss, int32_t, int16_t, cpu_lduw_data_ra) | ||
177 | +DO_LDFF1_ZPZ_D(sve_ldffsds_zss, int32_t, int32_t, cpu_ldl_data_ra) | ||
178 | + | ||
179 | +DO_LDFF1_ZPZ_D(sve_ldffbdu_zd, uint64_t, uint8_t, cpu_ldub_data_ra) | ||
180 | +DO_LDFF1_ZPZ_D(sve_ldffhdu_zd, uint64_t, uint16_t, cpu_lduw_data_ra) | ||
181 | +DO_LDFF1_ZPZ_D(sve_ldffsdu_zd, uint64_t, uint32_t, cpu_ldl_data_ra) | ||
182 | +DO_LDFF1_ZPZ_D(sve_ldffddu_zd, uint64_t, uint64_t, cpu_ldq_data_ra) | ||
183 | +DO_LDFF1_ZPZ_D(sve_ldffbds_zd, uint64_t, int8_t, cpu_ldub_data_ra) | ||
184 | +DO_LDFF1_ZPZ_D(sve_ldffhds_zd, uint64_t, int16_t, cpu_lduw_data_ra) | ||
185 | +DO_LDFF1_ZPZ_D(sve_ldffsds_zd, uint64_t, int32_t, cpu_ldl_data_ra) | ||
186 | + | ||
187 | /* Stores with a vector index. */ | ||
188 | |||
189 | #define DO_ST1_ZPZ_S(NAME, TYPEI, FN) \ | ||
190 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
191 | index XXXXXXX..XXXXXXX 100644 | ||
192 | --- a/target/arm/translate-sve.c | ||
193 | +++ b/target/arm/translate-sve.c | ||
194 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_mem_scatter * const gather_load_fn32[2][2][2][3] = { | ||
195 | { gen_helper_sve_ldbsu_zss, | ||
196 | gen_helper_sve_ldhsu_zss, | ||
197 | gen_helper_sve_ldssu_zss, } } }, | ||
198 | - /* TODO fill in first-fault handlers */ | ||
199 | + | ||
200 | + { { { gen_helper_sve_ldffbss_zsu, | ||
201 | + gen_helper_sve_ldffhss_zsu, | ||
202 | + NULL, }, | ||
203 | + { gen_helper_sve_ldffbsu_zsu, | ||
204 | + gen_helper_sve_ldffhsu_zsu, | ||
205 | + gen_helper_sve_ldffssu_zsu, } }, | ||
206 | + { { gen_helper_sve_ldffbss_zss, | ||
207 | + gen_helper_sve_ldffhss_zss, | ||
208 | + NULL, }, | ||
209 | + { gen_helper_sve_ldffbsu_zss, | ||
210 | + gen_helper_sve_ldffhsu_zss, | ||
211 | + gen_helper_sve_ldffssu_zss, } } } | ||
212 | }; | ||
213 | |||
214 | /* Note that we overload xs=2 to indicate 64-bit offset. */ | ||
215 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_mem_scatter * const gather_load_fn64[2][3][2][4] = { | ||
216 | gen_helper_sve_ldhdu_zd, | ||
217 | gen_helper_sve_ldsdu_zd, | ||
218 | gen_helper_sve_ldddu_zd, } } }, | ||
219 | - /* TODO fill in first-fault handlers */ | ||
220 | + | ||
221 | + { { { gen_helper_sve_ldffbds_zsu, | ||
222 | + gen_helper_sve_ldffhds_zsu, | ||
223 | + gen_helper_sve_ldffsds_zsu, | ||
224 | + NULL, }, | ||
225 | + { gen_helper_sve_ldffbdu_zsu, | ||
226 | + gen_helper_sve_ldffhdu_zsu, | ||
227 | + gen_helper_sve_ldffsdu_zsu, | ||
228 | + gen_helper_sve_ldffddu_zsu, } }, | ||
229 | + { { gen_helper_sve_ldffbds_zss, | ||
230 | + gen_helper_sve_ldffhds_zss, | ||
231 | + gen_helper_sve_ldffsds_zss, | ||
232 | + NULL, }, | ||
233 | + { gen_helper_sve_ldffbdu_zss, | ||
234 | + gen_helper_sve_ldffhdu_zss, | ||
235 | + gen_helper_sve_ldffsdu_zss, | ||
236 | + gen_helper_sve_ldffddu_zss, } }, | ||
237 | + { { gen_helper_sve_ldffbds_zd, | ||
238 | + gen_helper_sve_ldffhds_zd, | ||
239 | + gen_helper_sve_ldffsds_zd, | ||
240 | + NULL, }, | ||
241 | + { gen_helper_sve_ldffbdu_zd, | ||
242 | + gen_helper_sve_ldffhdu_zd, | ||
243 | + gen_helper_sve_ldffsdu_zd, | ||
244 | + gen_helper_sve_ldffddu_zd, } } } | ||
245 | }; | ||
246 | |||
247 | static bool trans_LD1_zprz(DisasContext *s, arg_LD1_zprz *a, uint32_t insn) | ||
248 | -- | ||
249 | 2.17.1 | ||
250 | |||
251 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-16-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 85 ++++++++++++++++++++++++++------------ | ||
9 | target/arm/sve.decode | 11 +++++ | ||
10 | 2 files changed, 70 insertions(+), 26 deletions(-) | ||
11 | |||
12 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
13 | index XXXXXXX..XXXXXXX 100644 | ||
14 | --- a/target/arm/translate-sve.c | ||
15 | +++ b/target/arm/translate-sve.c | ||
16 | @@ -XXX,XX +XXX,XX @@ static bool trans_LD1_zpiz(DisasContext *s, arg_LD1_zpiz *a, uint32_t insn) | ||
17 | return true; | ||
18 | } | ||
19 | |||
20 | +/* Indexed by [xs][msz]. */ | ||
21 | +static gen_helper_gvec_mem_scatter * const scatter_store_fn32[2][3] = { | ||
22 | + { gen_helper_sve_stbs_zsu, | ||
23 | + gen_helper_sve_sths_zsu, | ||
24 | + gen_helper_sve_stss_zsu, }, | ||
25 | + { gen_helper_sve_stbs_zss, | ||
26 | + gen_helper_sve_sths_zss, | ||
27 | + gen_helper_sve_stss_zss, }, | ||
28 | +}; | ||
29 | + | ||
30 | +/* Note that we overload xs=2 to indicate 64-bit offset. */ | ||
31 | +static gen_helper_gvec_mem_scatter * const scatter_store_fn64[3][4] = { | ||
32 | + { gen_helper_sve_stbd_zsu, | ||
33 | + gen_helper_sve_sthd_zsu, | ||
34 | + gen_helper_sve_stsd_zsu, | ||
35 | + gen_helper_sve_stdd_zsu, }, | ||
36 | + { gen_helper_sve_stbd_zss, | ||
37 | + gen_helper_sve_sthd_zss, | ||
38 | + gen_helper_sve_stsd_zss, | ||
39 | + gen_helper_sve_stdd_zss, }, | ||
40 | + { gen_helper_sve_stbd_zd, | ||
41 | + gen_helper_sve_sthd_zd, | ||
42 | + gen_helper_sve_stsd_zd, | ||
43 | + gen_helper_sve_stdd_zd, }, | ||
44 | +}; | ||
45 | + | ||
46 | static bool trans_ST1_zprz(DisasContext *s, arg_ST1_zprz *a, uint32_t insn) | ||
47 | { | ||
48 | - /* Indexed by [xs][msz]. */ | ||
49 | - static gen_helper_gvec_mem_scatter * const fn32[2][3] = { | ||
50 | - { gen_helper_sve_stbs_zsu, | ||
51 | - gen_helper_sve_sths_zsu, | ||
52 | - gen_helper_sve_stss_zsu, }, | ||
53 | - { gen_helper_sve_stbs_zss, | ||
54 | - gen_helper_sve_sths_zss, | ||
55 | - gen_helper_sve_stss_zss, }, | ||
56 | - }; | ||
57 | - /* Note that we overload xs=2 to indicate 64-bit offset. */ | ||
58 | - static gen_helper_gvec_mem_scatter * const fn64[3][4] = { | ||
59 | - { gen_helper_sve_stbd_zsu, | ||
60 | - gen_helper_sve_sthd_zsu, | ||
61 | - gen_helper_sve_stsd_zsu, | ||
62 | - gen_helper_sve_stdd_zsu, }, | ||
63 | - { gen_helper_sve_stbd_zss, | ||
64 | - gen_helper_sve_sthd_zss, | ||
65 | - gen_helper_sve_stsd_zss, | ||
66 | - gen_helper_sve_stdd_zss, }, | ||
67 | - { gen_helper_sve_stbd_zd, | ||
68 | - gen_helper_sve_sthd_zd, | ||
69 | - gen_helper_sve_stsd_zd, | ||
70 | - gen_helper_sve_stdd_zd, }, | ||
71 | - }; | ||
72 | gen_helper_gvec_mem_scatter *fn; | ||
73 | |||
74 | if (a->esz < a->msz || (a->msz == 0 && a->scale)) { | ||
75 | @@ -XXX,XX +XXX,XX @@ static bool trans_ST1_zprz(DisasContext *s, arg_ST1_zprz *a, uint32_t insn) | ||
76 | } | ||
77 | switch (a->esz) { | ||
78 | case MO_32: | ||
79 | - fn = fn32[a->xs][a->msz]; | ||
80 | + fn = scatter_store_fn32[a->xs][a->msz]; | ||
81 | break; | ||
82 | case MO_64: | ||
83 | - fn = fn64[a->xs][a->msz]; | ||
84 | + fn = scatter_store_fn64[a->xs][a->msz]; | ||
85 | break; | ||
86 | default: | ||
87 | g_assert_not_reached(); | ||
88 | @@ -XXX,XX +XXX,XX @@ static bool trans_ST1_zprz(DisasContext *s, arg_ST1_zprz *a, uint32_t insn) | ||
89 | return true; | ||
90 | } | ||
91 | |||
92 | +static bool trans_ST1_zpiz(DisasContext *s, arg_ST1_zpiz *a, uint32_t insn) | ||
93 | +{ | ||
94 | + gen_helper_gvec_mem_scatter *fn = NULL; | ||
95 | + TCGv_i64 imm; | ||
96 | + | ||
97 | + if (a->esz < a->msz) { | ||
98 | + return false; | ||
99 | + } | ||
100 | + if (!sve_access_check(s)) { | ||
101 | + return true; | ||
102 | + } | ||
103 | + | ||
104 | + switch (a->esz) { | ||
105 | + case MO_32: | ||
106 | + fn = scatter_store_fn32[0][a->msz]; | ||
107 | + break; | ||
108 | + case MO_64: | ||
109 | + fn = scatter_store_fn64[2][a->msz]; | ||
110 | + break; | ||
111 | + } | ||
112 | + assert(fn != NULL); | ||
113 | + | ||
114 | + /* Treat ST1_zpiz (zn[x] + imm) the same way as ST1_zprz (rn + zm[x]) | ||
115 | + * by loading the immediate into the scalar parameter. | ||
116 | + */ | ||
117 | + imm = tcg_const_i64(a->imm << a->msz); | ||
118 | + do_mem_zpz(s, a->rd, a->pg, a->rn, 0, imm, fn); | ||
119 | + tcg_temp_free_i64(imm); | ||
120 | + return true; | ||
121 | +} | ||
122 | + | ||
123 | /* | ||
124 | * Prefetches | ||
125 | */ | ||
126 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
127 | index XXXXXXX..XXXXXXX 100644 | ||
128 | --- a/target/arm/sve.decode | ||
129 | +++ b/target/arm/sve.decode | ||
130 | @@ -XXX,XX +XXX,XX @@ | ||
131 | &rprr_gather_load rd pg rn rm esz msz u ff xs scale | ||
132 | &rpri_gather_load rd pg rn imm esz msz u ff | ||
133 | &rprr_scatter_store rd pg rn rm esz msz xs scale | ||
134 | +&rpri_scatter_store rd pg rn imm esz msz | ||
135 | |||
136 | ########################################################################### | ||
137 | # Named instruction formats. These are generally used to | ||
138 | @@ -XXX,XX +XXX,XX @@ | ||
139 | &rprr_store nreg=0 | ||
140 | @rprr_scatter_store ....... msz:2 .. rm:5 ... pg:3 rn:5 rd:5 \ | ||
141 | &rprr_scatter_store | ||
142 | +@rpri_scatter_store ....... msz:2 .. imm:5 ... pg:3 rn:5 rd:5 \ | ||
143 | + &rpri_scatter_store | ||
144 | |||
145 | ########################################################################### | ||
146 | # Instruction patterns. Grouped according to the SVE encodingindex.xhtml. | ||
147 | @@ -XXX,XX +XXX,XX @@ ST1_zprz 1110010 .. 01 ..... 101 ... ..... ..... \ | ||
148 | ST1_zprz 1110010 .. 00 ..... 101 ... ..... ..... \ | ||
149 | @rprr_scatter_store xs=2 esz=3 scale=0 | ||
150 | |||
151 | +# SVE 64-bit scatter store (vector plus immediate) | ||
152 | +ST1_zpiz 1110010 .. 10 ..... 101 ... ..... ..... \ | ||
153 | + @rpri_scatter_store esz=3 | ||
154 | + | ||
155 | +# SVE 32-bit scatter store (vector plus immediate) | ||
156 | +ST1_zpiz 1110010 .. 11 ..... 101 ... ..... ..... \ | ||
157 | + @rpri_scatter_store esz=2 | ||
158 | + | ||
159 | # SVE 64-bit scatter store (scalar plus unpacked 32-bit scaled offset) | ||
160 | # Require msz > 0 | ||
161 | ST1_zprz 1110010 .. 01 ..... 100 ... ..... ..... \ | ||
162 | -- | ||
163 | 2.17.1 | ||
164 | |||
165 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-17-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 49 ++++++++++++++++++++++++++++++ | ||
9 | target/arm/sve_helper.c | 62 ++++++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 40 ++++++++++++++++++++++++ | ||
11 | target/arm/sve.decode | 11 +++++++ | ||
12 | 4 files changed, 162 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(sve_ucvt_ds, TCG_CALL_NO_RWG, | ||
19 | DEF_HELPER_FLAGS_5(sve_ucvt_dd, TCG_CALL_NO_RWG, | ||
20 | void, ptr, ptr, ptr, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_6(sve_fcmge_h, TCG_CALL_NO_RWG, | ||
23 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_6(sve_fcmge_s, TCG_CALL_NO_RWG, | ||
25 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
26 | +DEF_HELPER_FLAGS_6(sve_fcmge_d, TCG_CALL_NO_RWG, | ||
27 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
28 | + | ||
29 | +DEF_HELPER_FLAGS_6(sve_fcmgt_h, TCG_CALL_NO_RWG, | ||
30 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
31 | +DEF_HELPER_FLAGS_6(sve_fcmgt_s, TCG_CALL_NO_RWG, | ||
32 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
33 | +DEF_HELPER_FLAGS_6(sve_fcmgt_d, TCG_CALL_NO_RWG, | ||
34 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
35 | + | ||
36 | +DEF_HELPER_FLAGS_6(sve_fcmeq_h, TCG_CALL_NO_RWG, | ||
37 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
38 | +DEF_HELPER_FLAGS_6(sve_fcmeq_s, TCG_CALL_NO_RWG, | ||
39 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
40 | +DEF_HELPER_FLAGS_6(sve_fcmeq_d, TCG_CALL_NO_RWG, | ||
41 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
42 | + | ||
43 | +DEF_HELPER_FLAGS_6(sve_fcmne_h, TCG_CALL_NO_RWG, | ||
44 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
45 | +DEF_HELPER_FLAGS_6(sve_fcmne_s, TCG_CALL_NO_RWG, | ||
46 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
47 | +DEF_HELPER_FLAGS_6(sve_fcmne_d, TCG_CALL_NO_RWG, | ||
48 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
49 | + | ||
50 | +DEF_HELPER_FLAGS_6(sve_fcmuo_h, TCG_CALL_NO_RWG, | ||
51 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
52 | +DEF_HELPER_FLAGS_6(sve_fcmuo_s, TCG_CALL_NO_RWG, | ||
53 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
54 | +DEF_HELPER_FLAGS_6(sve_fcmuo_d, TCG_CALL_NO_RWG, | ||
55 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
56 | + | ||
57 | +DEF_HELPER_FLAGS_6(sve_facge_h, TCG_CALL_NO_RWG, | ||
58 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
59 | +DEF_HELPER_FLAGS_6(sve_facge_s, TCG_CALL_NO_RWG, | ||
60 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
61 | +DEF_HELPER_FLAGS_6(sve_facge_d, TCG_CALL_NO_RWG, | ||
62 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
63 | + | ||
64 | +DEF_HELPER_FLAGS_6(sve_facgt_h, TCG_CALL_NO_RWG, | ||
65 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
66 | +DEF_HELPER_FLAGS_6(sve_facgt_s, TCG_CALL_NO_RWG, | ||
67 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
68 | +DEF_HELPER_FLAGS_6(sve_facgt_d, TCG_CALL_NO_RWG, | ||
69 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
70 | + | ||
71 | DEF_HELPER_FLAGS_3(sve_fmla_zpzzz_h, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
72 | DEF_HELPER_FLAGS_3(sve_fmla_zpzzz_s, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
73 | DEF_HELPER_FLAGS_3(sve_fmla_zpzzz_d, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
74 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
75 | index XXXXXXX..XXXXXXX 100644 | ||
76 | --- a/target/arm/sve_helper.c | ||
77 | +++ b/target/arm/sve_helper.c | ||
78 | @@ -XXX,XX +XXX,XX @@ void HELPER(sve_fnmls_zpzzz_d)(CPUARMState *env, void *vg, uint32_t desc) | ||
79 | do_fmla_zpzzz_d(env, vg, desc, 0, INT64_MIN); | ||
80 | } | ||
81 | |||
82 | +/* Two operand floating-point comparison controlled by a predicate. | ||
83 | + * Unlike the integer version, we are not allowed to optimistically | ||
84 | + * compare operands, since the comparison may have side effects wrt | ||
85 | + * the FPSR. | ||
86 | + */ | ||
87 | +#define DO_FPCMP_PPZZ(NAME, TYPE, H, OP) \ | ||
88 | +void HELPER(NAME)(void *vd, void *vn, void *vm, void *vg, \ | ||
89 | + void *status, uint32_t desc) \ | ||
90 | +{ \ | ||
91 | + intptr_t i = simd_oprsz(desc), j = (i - 1) >> 6; \ | ||
92 | + uint64_t *d = vd, *g = vg; \ | ||
93 | + do { \ | ||
94 | + uint64_t out = 0, pg = g[j]; \ | ||
95 | + do { \ | ||
96 | + i -= sizeof(TYPE), out <<= sizeof(TYPE); \ | ||
97 | + if (likely((pg >> (i & 63)) & 1)) { \ | ||
98 | + TYPE nn = *(TYPE *)(vn + H(i)); \ | ||
99 | + TYPE mm = *(TYPE *)(vm + H(i)); \ | ||
100 | + out |= OP(TYPE, nn, mm, status); \ | ||
101 | + } \ | ||
102 | + } while (i & 63); \ | ||
103 | + d[j--] = out; \ | ||
104 | + } while (i > 0); \ | ||
105 | +} | ||
106 | + | ||
107 | +#define DO_FPCMP_PPZZ_H(NAME, OP) \ | ||
108 | + DO_FPCMP_PPZZ(NAME##_h, float16, H1_2, OP) | ||
109 | +#define DO_FPCMP_PPZZ_S(NAME, OP) \ | ||
110 | + DO_FPCMP_PPZZ(NAME##_s, float32, H1_4, OP) | ||
111 | +#define DO_FPCMP_PPZZ_D(NAME, OP) \ | ||
112 | + DO_FPCMP_PPZZ(NAME##_d, float64, , OP) | ||
113 | + | ||
114 | +#define DO_FPCMP_PPZZ_ALL(NAME, OP) \ | ||
115 | + DO_FPCMP_PPZZ_H(NAME, OP) \ | ||
116 | + DO_FPCMP_PPZZ_S(NAME, OP) \ | ||
117 | + DO_FPCMP_PPZZ_D(NAME, OP) | ||
118 | + | ||
119 | +#define DO_FCMGE(TYPE, X, Y, ST) TYPE##_compare(Y, X, ST) <= 0 | ||
120 | +#define DO_FCMGT(TYPE, X, Y, ST) TYPE##_compare(Y, X, ST) < 0 | ||
121 | +#define DO_FCMEQ(TYPE, X, Y, ST) TYPE##_compare_quiet(X, Y, ST) == 0 | ||
122 | +#define DO_FCMNE(TYPE, X, Y, ST) TYPE##_compare_quiet(X, Y, ST) != 0 | ||
123 | +#define DO_FCMUO(TYPE, X, Y, ST) \ | ||
124 | + TYPE##_compare_quiet(X, Y, ST) == float_relation_unordered | ||
125 | +#define DO_FACGE(TYPE, X, Y, ST) \ | ||
126 | + TYPE##_compare(TYPE##_abs(Y), TYPE##_abs(X), ST) <= 0 | ||
127 | +#define DO_FACGT(TYPE, X, Y, ST) \ | ||
128 | + TYPE##_compare(TYPE##_abs(Y), TYPE##_abs(X), ST) < 0 | ||
129 | + | ||
130 | +DO_FPCMP_PPZZ_ALL(sve_fcmge, DO_FCMGE) | ||
131 | +DO_FPCMP_PPZZ_ALL(sve_fcmgt, DO_FCMGT) | ||
132 | +DO_FPCMP_PPZZ_ALL(sve_fcmeq, DO_FCMEQ) | ||
133 | +DO_FPCMP_PPZZ_ALL(sve_fcmne, DO_FCMNE) | ||
134 | +DO_FPCMP_PPZZ_ALL(sve_fcmuo, DO_FCMUO) | ||
135 | +DO_FPCMP_PPZZ_ALL(sve_facge, DO_FACGE) | ||
136 | +DO_FPCMP_PPZZ_ALL(sve_facgt, DO_FACGT) | ||
137 | + | ||
138 | +#undef DO_FPCMP_PPZZ_ALL | ||
139 | +#undef DO_FPCMP_PPZZ_D | ||
140 | +#undef DO_FPCMP_PPZZ_S | ||
141 | +#undef DO_FPCMP_PPZZ_H | ||
142 | +#undef DO_FPCMP_PPZZ | ||
143 | + | ||
144 | /* | ||
145 | * Load contiguous data, protected by a governing predicate. | ||
146 | */ | ||
147 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
148 | index XXXXXXX..XXXXXXX 100644 | ||
149 | --- a/target/arm/translate-sve.c | ||
150 | +++ b/target/arm/translate-sve.c | ||
151 | @@ -XXX,XX +XXX,XX @@ DO_FP3(FMULX, fmulx) | ||
152 | |||
153 | #undef DO_FP3 | ||
154 | |||
155 | +static bool do_fp_cmp(DisasContext *s, arg_rprr_esz *a, | ||
156 | + gen_helper_gvec_4_ptr *fn) | ||
157 | +{ | ||
158 | + if (fn == NULL) { | ||
159 | + return false; | ||
160 | + } | ||
161 | + if (sve_access_check(s)) { | ||
162 | + unsigned vsz = vec_full_reg_size(s); | ||
163 | + TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); | ||
164 | + tcg_gen_gvec_4_ptr(pred_full_reg_offset(s, a->rd), | ||
165 | + vec_full_reg_offset(s, a->rn), | ||
166 | + vec_full_reg_offset(s, a->rm), | ||
167 | + pred_full_reg_offset(s, a->pg), | ||
168 | + status, vsz, vsz, 0, fn); | ||
169 | + tcg_temp_free_ptr(status); | ||
170 | + } | ||
171 | + return true; | ||
172 | +} | ||
173 | + | ||
174 | +#define DO_FPCMP(NAME, name) \ | ||
175 | +static bool trans_##NAME##_ppzz(DisasContext *s, arg_rprr_esz *a, \ | ||
176 | + uint32_t insn) \ | ||
177 | +{ \ | ||
178 | + static gen_helper_gvec_4_ptr * const fns[4] = { \ | ||
179 | + NULL, gen_helper_sve_##name##_h, \ | ||
180 | + gen_helper_sve_##name##_s, gen_helper_sve_##name##_d \ | ||
181 | + }; \ | ||
182 | + return do_fp_cmp(s, a, fns[a->esz]); \ | ||
183 | +} | ||
184 | + | ||
185 | +DO_FPCMP(FCMGE, fcmge) | ||
186 | +DO_FPCMP(FCMGT, fcmgt) | ||
187 | +DO_FPCMP(FCMEQ, fcmeq) | ||
188 | +DO_FPCMP(FCMNE, fcmne) | ||
189 | +DO_FPCMP(FCMUO, fcmuo) | ||
190 | +DO_FPCMP(FACGE, facge) | ||
191 | +DO_FPCMP(FACGT, facgt) | ||
192 | + | ||
193 | +#undef DO_FPCMP | ||
194 | + | ||
195 | typedef void gen_helper_sve_fmla(TCGv_env, TCGv_ptr, TCGv_i32); | ||
196 | |||
197 | static bool do_fmla(DisasContext *s, arg_rprrr_esz *a, gen_helper_sve_fmla *fn) | ||
198 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
199 | index XXXXXXX..XXXXXXX 100644 | ||
200 | --- a/target/arm/sve.decode | ||
201 | +++ b/target/arm/sve.decode | ||
202 | @@ -XXX,XX +XXX,XX @@ UXTH 00000100 .. 010 011 101 ... ..... ..... @rd_pg_rn | ||
203 | SXTW 00000100 .. 010 100 101 ... ..... ..... @rd_pg_rn | ||
204 | UXTW 00000100 .. 010 101 101 ... ..... ..... @rd_pg_rn | ||
205 | |||
206 | +### SVE Floating Point Compare - Vectors Group | ||
207 | + | ||
208 | +# SVE floating-point compare vectors | ||
209 | +FCMGE_ppzz 01100101 .. 0 ..... 010 ... ..... 0 .... @pd_pg_rn_rm | ||
210 | +FCMGT_ppzz 01100101 .. 0 ..... 010 ... ..... 1 .... @pd_pg_rn_rm | ||
211 | +FCMEQ_ppzz 01100101 .. 0 ..... 011 ... ..... 0 .... @pd_pg_rn_rm | ||
212 | +FCMNE_ppzz 01100101 .. 0 ..... 011 ... ..... 1 .... @pd_pg_rn_rm | ||
213 | +FCMUO_ppzz 01100101 .. 0 ..... 110 ... ..... 0 .... @pd_pg_rn_rm | ||
214 | +FACGE_ppzz 01100101 .. 0 ..... 110 ... ..... 1 .... @pd_pg_rn_rm | ||
215 | +FACGT_ppzz 01100101 .. 0 ..... 111 ... ..... 1 .... @pd_pg_rn_rm | ||
216 | + | ||
217 | ### SVE Integer Multiply-Add Group | ||
218 | |||
219 | # SVE integer multiply-add writing addend (predicated) | ||
220 | -- | ||
221 | 2.17.1 | ||
222 | |||
223 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-18-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 56 ++++++++++++++++++++++++++++ | ||
9 | target/arm/sve_helper.c | 69 +++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 75 ++++++++++++++++++++++++++++++++++++++ | ||
11 | target/arm/sve.decode | 14 +++++++ | ||
12 | 4 files changed, 214 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_6(sve_fmulx_s, TCG_CALL_NO_RWG, | ||
19 | DEF_HELPER_FLAGS_6(sve_fmulx_d, TCG_CALL_NO_RWG, | ||
20 | void, ptr, ptr, ptr, ptr, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_6(sve_fadds_h, TCG_CALL_NO_RWG, | ||
23 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_6(sve_fadds_s, TCG_CALL_NO_RWG, | ||
25 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
26 | +DEF_HELPER_FLAGS_6(sve_fadds_d, TCG_CALL_NO_RWG, | ||
27 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
28 | + | ||
29 | +DEF_HELPER_FLAGS_6(sve_fsubs_h, TCG_CALL_NO_RWG, | ||
30 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
31 | +DEF_HELPER_FLAGS_6(sve_fsubs_s, TCG_CALL_NO_RWG, | ||
32 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
33 | +DEF_HELPER_FLAGS_6(sve_fsubs_d, TCG_CALL_NO_RWG, | ||
34 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
35 | + | ||
36 | +DEF_HELPER_FLAGS_6(sve_fmuls_h, TCG_CALL_NO_RWG, | ||
37 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
38 | +DEF_HELPER_FLAGS_6(sve_fmuls_s, TCG_CALL_NO_RWG, | ||
39 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
40 | +DEF_HELPER_FLAGS_6(sve_fmuls_d, TCG_CALL_NO_RWG, | ||
41 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
42 | + | ||
43 | +DEF_HELPER_FLAGS_6(sve_fsubrs_h, TCG_CALL_NO_RWG, | ||
44 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
45 | +DEF_HELPER_FLAGS_6(sve_fsubrs_s, TCG_CALL_NO_RWG, | ||
46 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
47 | +DEF_HELPER_FLAGS_6(sve_fsubrs_d, TCG_CALL_NO_RWG, | ||
48 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
49 | + | ||
50 | +DEF_HELPER_FLAGS_6(sve_fmaxnms_h, TCG_CALL_NO_RWG, | ||
51 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
52 | +DEF_HELPER_FLAGS_6(sve_fmaxnms_s, TCG_CALL_NO_RWG, | ||
53 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
54 | +DEF_HELPER_FLAGS_6(sve_fmaxnms_d, TCG_CALL_NO_RWG, | ||
55 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
56 | + | ||
57 | +DEF_HELPER_FLAGS_6(sve_fminnms_h, TCG_CALL_NO_RWG, | ||
58 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
59 | +DEF_HELPER_FLAGS_6(sve_fminnms_s, TCG_CALL_NO_RWG, | ||
60 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
61 | +DEF_HELPER_FLAGS_6(sve_fminnms_d, TCG_CALL_NO_RWG, | ||
62 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
63 | + | ||
64 | +DEF_HELPER_FLAGS_6(sve_fmaxs_h, TCG_CALL_NO_RWG, | ||
65 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
66 | +DEF_HELPER_FLAGS_6(sve_fmaxs_s, TCG_CALL_NO_RWG, | ||
67 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
68 | +DEF_HELPER_FLAGS_6(sve_fmaxs_d, TCG_CALL_NO_RWG, | ||
69 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
70 | + | ||
71 | +DEF_HELPER_FLAGS_6(sve_fmins_h, TCG_CALL_NO_RWG, | ||
72 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
73 | +DEF_HELPER_FLAGS_6(sve_fmins_s, TCG_CALL_NO_RWG, | ||
74 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
75 | +DEF_HELPER_FLAGS_6(sve_fmins_d, TCG_CALL_NO_RWG, | ||
76 | + void, ptr, ptr, ptr, i64, ptr, i32) | ||
77 | + | ||
78 | DEF_HELPER_FLAGS_5(sve_scvt_hh, TCG_CALL_NO_RWG, | ||
79 | void, ptr, ptr, ptr, ptr, i32) | ||
80 | DEF_HELPER_FLAGS_5(sve_scvt_sh, TCG_CALL_NO_RWG, | ||
81 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
82 | index XXXXXXX..XXXXXXX 100644 | ||
83 | --- a/target/arm/sve_helper.c | ||
84 | +++ b/target/arm/sve_helper.c | ||
85 | @@ -XXX,XX +XXX,XX @@ DO_ZPZZ_FP(sve_fmulx_d, uint64_t, , helper_vfp_mulxd) | ||
86 | |||
87 | #undef DO_ZPZZ_FP | ||
88 | |||
89 | +/* Three-operand expander, with one scalar operand, controlled by | ||
90 | + * a predicate, with the extra float_status parameter. | ||
91 | + */ | ||
92 | +#define DO_ZPZS_FP(NAME, TYPE, H, OP) \ | ||
93 | +void HELPER(NAME)(void *vd, void *vn, void *vg, uint64_t scalar, \ | ||
94 | + void *status, uint32_t desc) \ | ||
95 | +{ \ | ||
96 | + intptr_t i = simd_oprsz(desc); \ | ||
97 | + uint64_t *g = vg; \ | ||
98 | + TYPE mm = scalar; \ | ||
99 | + do { \ | ||
100 | + uint64_t pg = g[(i - 1) >> 6]; \ | ||
101 | + do { \ | ||
102 | + i -= sizeof(TYPE); \ | ||
103 | + if (likely((pg >> (i & 63)) & 1)) { \ | ||
104 | + TYPE nn = *(TYPE *)(vn + H(i)); \ | ||
105 | + *(TYPE *)(vd + H(i)) = OP(nn, mm, status); \ | ||
106 | + } \ | ||
107 | + } while (i & 63); \ | ||
108 | + } while (i != 0); \ | ||
109 | +} | ||
110 | + | ||
111 | +DO_ZPZS_FP(sve_fadds_h, float16, H1_2, float16_add) | ||
112 | +DO_ZPZS_FP(sve_fadds_s, float32, H1_4, float32_add) | ||
113 | +DO_ZPZS_FP(sve_fadds_d, float64, , float64_add) | ||
114 | + | ||
115 | +DO_ZPZS_FP(sve_fsubs_h, float16, H1_2, float16_sub) | ||
116 | +DO_ZPZS_FP(sve_fsubs_s, float32, H1_4, float32_sub) | ||
117 | +DO_ZPZS_FP(sve_fsubs_d, float64, , float64_sub) | ||
118 | + | ||
119 | +DO_ZPZS_FP(sve_fmuls_h, float16, H1_2, float16_mul) | ||
120 | +DO_ZPZS_FP(sve_fmuls_s, float32, H1_4, float32_mul) | ||
121 | +DO_ZPZS_FP(sve_fmuls_d, float64, , float64_mul) | ||
122 | + | ||
123 | +static inline float16 subr_h(float16 a, float16 b, float_status *s) | ||
124 | +{ | ||
125 | + return float16_sub(b, a, s); | ||
126 | +} | ||
127 | + | ||
128 | +static inline float32 subr_s(float32 a, float32 b, float_status *s) | ||
129 | +{ | ||
130 | + return float32_sub(b, a, s); | ||
131 | +} | ||
132 | + | ||
133 | +static inline float64 subr_d(float64 a, float64 b, float_status *s) | ||
134 | +{ | ||
135 | + return float64_sub(b, a, s); | ||
136 | +} | ||
137 | + | ||
138 | +DO_ZPZS_FP(sve_fsubrs_h, float16, H1_2, subr_h) | ||
139 | +DO_ZPZS_FP(sve_fsubrs_s, float32, H1_4, subr_s) | ||
140 | +DO_ZPZS_FP(sve_fsubrs_d, float64, , subr_d) | ||
141 | + | ||
142 | +DO_ZPZS_FP(sve_fmaxnms_h, float16, H1_2, float16_maxnum) | ||
143 | +DO_ZPZS_FP(sve_fmaxnms_s, float32, H1_4, float32_maxnum) | ||
144 | +DO_ZPZS_FP(sve_fmaxnms_d, float64, , float64_maxnum) | ||
145 | + | ||
146 | +DO_ZPZS_FP(sve_fminnms_h, float16, H1_2, float16_minnum) | ||
147 | +DO_ZPZS_FP(sve_fminnms_s, float32, H1_4, float32_minnum) | ||
148 | +DO_ZPZS_FP(sve_fminnms_d, float64, , float64_minnum) | ||
149 | + | ||
150 | +DO_ZPZS_FP(sve_fmaxs_h, float16, H1_2, float16_max) | ||
151 | +DO_ZPZS_FP(sve_fmaxs_s, float32, H1_4, float32_max) | ||
152 | +DO_ZPZS_FP(sve_fmaxs_d, float64, , float64_max) | ||
153 | + | ||
154 | +DO_ZPZS_FP(sve_fmins_h, float16, H1_2, float16_min) | ||
155 | +DO_ZPZS_FP(sve_fmins_s, float32, H1_4, float32_min) | ||
156 | +DO_ZPZS_FP(sve_fmins_d, float64, , float64_min) | ||
157 | + | ||
158 | /* Fully general two-operand expander, controlled by a predicate, | ||
159 | * With the extra float_status parameter. | ||
160 | */ | ||
161 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
162 | index XXXXXXX..XXXXXXX 100644 | ||
163 | --- a/target/arm/translate-sve.c | ||
164 | +++ b/target/arm/translate-sve.c | ||
165 | @@ -XXX,XX +XXX,XX @@ | ||
166 | #include "exec/log.h" | ||
167 | #include "trace-tcg.h" | ||
168 | #include "translate-a64.h" | ||
169 | +#include "fpu/softfloat.h" | ||
170 | |||
171 | |||
172 | typedef void GVecGen2sFn(unsigned, uint32_t, uint32_t, | ||
173 | @@ -XXX,XX +XXX,XX @@ DO_FP3(FMULX, fmulx) | ||
174 | |||
175 | #undef DO_FP3 | ||
176 | |||
177 | +typedef void gen_helper_sve_fp2scalar(TCGv_ptr, TCGv_ptr, TCGv_ptr, | ||
178 | + TCGv_i64, TCGv_ptr, TCGv_i32); | ||
179 | + | ||
180 | +static void do_fp_scalar(DisasContext *s, int zd, int zn, int pg, bool is_fp16, | ||
181 | + TCGv_i64 scalar, gen_helper_sve_fp2scalar *fn) | ||
182 | +{ | ||
183 | + unsigned vsz = vec_full_reg_size(s); | ||
184 | + TCGv_ptr t_zd, t_zn, t_pg, status; | ||
185 | + TCGv_i32 desc; | ||
186 | + | ||
187 | + t_zd = tcg_temp_new_ptr(); | ||
188 | + t_zn = tcg_temp_new_ptr(); | ||
189 | + t_pg = tcg_temp_new_ptr(); | ||
190 | + tcg_gen_addi_ptr(t_zd, cpu_env, vec_full_reg_offset(s, zd)); | ||
191 | + tcg_gen_addi_ptr(t_zn, cpu_env, vec_full_reg_offset(s, zn)); | ||
192 | + tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg)); | ||
193 | + | ||
194 | + status = get_fpstatus_ptr(is_fp16); | ||
195 | + desc = tcg_const_i32(simd_desc(vsz, vsz, 0)); | ||
196 | + fn(t_zd, t_zn, t_pg, scalar, status, desc); | ||
197 | + | ||
198 | + tcg_temp_free_i32(desc); | ||
199 | + tcg_temp_free_ptr(status); | ||
200 | + tcg_temp_free_ptr(t_pg); | ||
201 | + tcg_temp_free_ptr(t_zn); | ||
202 | + tcg_temp_free_ptr(t_zd); | ||
203 | +} | ||
204 | + | ||
205 | +static void do_fp_imm(DisasContext *s, arg_rpri_esz *a, uint64_t imm, | ||
206 | + gen_helper_sve_fp2scalar *fn) | ||
207 | +{ | ||
208 | + TCGv_i64 temp = tcg_const_i64(imm); | ||
209 | + do_fp_scalar(s, a->rd, a->rn, a->pg, a->esz == MO_16, temp, fn); | ||
210 | + tcg_temp_free_i64(temp); | ||
211 | +} | ||
212 | + | ||
213 | +#define DO_FP_IMM(NAME, name, const0, const1) \ | ||
214 | +static bool trans_##NAME##_zpzi(DisasContext *s, arg_rpri_esz *a, \ | ||
215 | + uint32_t insn) \ | ||
216 | +{ \ | ||
217 | + static gen_helper_sve_fp2scalar * const fns[3] = { \ | ||
218 | + gen_helper_sve_##name##_h, \ | ||
219 | + gen_helper_sve_##name##_s, \ | ||
220 | + gen_helper_sve_##name##_d \ | ||
221 | + }; \ | ||
222 | + static uint64_t const val[3][2] = { \ | ||
223 | + { float16_##const0, float16_##const1 }, \ | ||
224 | + { float32_##const0, float32_##const1 }, \ | ||
225 | + { float64_##const0, float64_##const1 }, \ | ||
226 | + }; \ | ||
227 | + if (a->esz == 0) { \ | ||
228 | + return false; \ | ||
229 | + } \ | ||
230 | + if (sve_access_check(s)) { \ | ||
231 | + do_fp_imm(s, a, val[a->esz - 1][a->imm], fns[a->esz - 1]); \ | ||
232 | + } \ | ||
233 | + return true; \ | ||
234 | +} | ||
235 | + | ||
236 | +#define float16_two make_float16(0x4000) | ||
237 | +#define float32_two make_float32(0x40000000) | ||
238 | +#define float64_two make_float64(0x4000000000000000ULL) | ||
239 | + | ||
240 | +DO_FP_IMM(FADD, fadds, half, one) | ||
241 | +DO_FP_IMM(FSUB, fsubs, half, one) | ||
242 | +DO_FP_IMM(FMUL, fmuls, half, two) | ||
243 | +DO_FP_IMM(FSUBR, fsubrs, half, one) | ||
244 | +DO_FP_IMM(FMAXNM, fmaxnms, zero, one) | ||
245 | +DO_FP_IMM(FMINNM, fminnms, zero, one) | ||
246 | +DO_FP_IMM(FMAX, fmaxs, zero, one) | ||
247 | +DO_FP_IMM(FMIN, fmins, zero, one) | ||
248 | + | ||
249 | +#undef DO_FP_IMM | ||
250 | + | ||
251 | static bool do_fp_cmp(DisasContext *s, arg_rprr_esz *a, | ||
252 | gen_helper_gvec_4_ptr *fn) | ||
253 | { | ||
254 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
255 | index XXXXXXX..XXXXXXX 100644 | ||
256 | --- a/target/arm/sve.decode | ||
257 | +++ b/target/arm/sve.decode | ||
258 | @@ -XXX,XX +XXX,XX @@ | ||
259 | @rdn_pg4 ........ esz:2 .. pg:4 ... ........ rd:5 \ | ||
260 | &rpri_esz rn=%reg_movprfx | ||
261 | |||
262 | +# Two register operand, one one-bit floating-point operand. | ||
263 | +@rdn_i1 ........ esz:2 ......... pg:3 .... imm:1 rd:5 \ | ||
264 | + &rpri_esz rn=%reg_movprfx | ||
265 | + | ||
266 | # Two register operand, one encoded bitmask. | ||
267 | @rdn_dbm ........ .. .... dbm:13 rd:5 \ | ||
268 | &rr_dbm rn=%reg_movprfx | ||
269 | @@ -XXX,XX +XXX,XX @@ FMULX 01100101 .. 00 1010 100 ... ..... ..... @rdn_pg_rm | ||
270 | FDIV 01100101 .. 00 1100 100 ... ..... ..... @rdm_pg_rn # FDIVR | ||
271 | FDIV 01100101 .. 00 1101 100 ... ..... ..... @rdn_pg_rm | ||
272 | |||
273 | +# SVE floating-point arithmetic with immediate (predicated) | ||
274 | +FADD_zpzi 01100101 .. 011 000 100 ... 0000 . ..... @rdn_i1 | ||
275 | +FSUB_zpzi 01100101 .. 011 001 100 ... 0000 . ..... @rdn_i1 | ||
276 | +FMUL_zpzi 01100101 .. 011 010 100 ... 0000 . ..... @rdn_i1 | ||
277 | +FSUBR_zpzi 01100101 .. 011 011 100 ... 0000 . ..... @rdn_i1 | ||
278 | +FMAXNM_zpzi 01100101 .. 011 100 100 ... 0000 . ..... @rdn_i1 | ||
279 | +FMINNM_zpzi 01100101 .. 011 101 100 ... 0000 . ..... @rdn_i1 | ||
280 | +FMAX_zpzi 01100101 .. 011 110 100 ... 0000 . ..... @rdn_i1 | ||
281 | +FMIN_zpzi 01100101 .. 011 111 100 ... 0000 . ..... @rdn_i1 | ||
282 | + | ||
283 | ### SVE FP Multiply-Add Group | ||
284 | |||
285 | # SVE floating-point multiply-accumulate writing addend | ||
286 | -- | ||
287 | 2.17.1 | ||
288 | |||
289 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-19-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper.h | 14 +++++++++++ | ||
9 | target/arm/translate-sve.c | 50 ++++++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/vec_helper.c | 48 ++++++++++++++++++++++++++++++++++++ | ||
11 | target/arm/sve.decode | 19 +++++++++++++++ | ||
12 | 4 files changed, 131 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper.h b/target/arm/helper.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper.h | ||
17 | +++ b/target/arm/helper.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(gvec_ftsmul_s, TCG_CALL_NO_RWG, | ||
19 | DEF_HELPER_FLAGS_5(gvec_ftsmul_d, TCG_CALL_NO_RWG, | ||
20 | void, ptr, ptr, ptr, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_5(gvec_fmul_idx_h, TCG_CALL_NO_RWG, | ||
23 | + void, ptr, ptr, ptr, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_5(gvec_fmul_idx_s, TCG_CALL_NO_RWG, | ||
25 | + void, ptr, ptr, ptr, ptr, i32) | ||
26 | +DEF_HELPER_FLAGS_5(gvec_fmul_idx_d, TCG_CALL_NO_RWG, | ||
27 | + void, ptr, ptr, ptr, ptr, i32) | ||
28 | + | ||
29 | +DEF_HELPER_FLAGS_6(gvec_fmla_idx_h, TCG_CALL_NO_RWG, | ||
30 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
31 | +DEF_HELPER_FLAGS_6(gvec_fmla_idx_s, TCG_CALL_NO_RWG, | ||
32 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
33 | +DEF_HELPER_FLAGS_6(gvec_fmla_idx_d, TCG_CALL_NO_RWG, | ||
34 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
35 | + | ||
36 | #ifdef TARGET_AARCH64 | ||
37 | #include "helper-a64.h" | ||
38 | #include "helper-sve.h" | ||
39 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
40 | index XXXXXXX..XXXXXXX 100644 | ||
41 | --- a/target/arm/translate-sve.c | ||
42 | +++ b/target/arm/translate-sve.c | ||
43 | @@ -XXX,XX +XXX,XX @@ DO_ZZI(UMIN, umin) | ||
44 | |||
45 | #undef DO_ZZI | ||
46 | |||
47 | +/* | ||
48 | + *** SVE Floating Point Multiply-Add Indexed Group | ||
49 | + */ | ||
50 | + | ||
51 | +static bool trans_FMLA_zzxz(DisasContext *s, arg_FMLA_zzxz *a, uint32_t insn) | ||
52 | +{ | ||
53 | + static gen_helper_gvec_4_ptr * const fns[3] = { | ||
54 | + gen_helper_gvec_fmla_idx_h, | ||
55 | + gen_helper_gvec_fmla_idx_s, | ||
56 | + gen_helper_gvec_fmla_idx_d, | ||
57 | + }; | ||
58 | + | ||
59 | + if (sve_access_check(s)) { | ||
60 | + unsigned vsz = vec_full_reg_size(s); | ||
61 | + TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); | ||
62 | + tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), | ||
63 | + vec_full_reg_offset(s, a->rn), | ||
64 | + vec_full_reg_offset(s, a->rm), | ||
65 | + vec_full_reg_offset(s, a->ra), | ||
66 | + status, vsz, vsz, (a->index << 1) | a->sub, | ||
67 | + fns[a->esz - 1]); | ||
68 | + tcg_temp_free_ptr(status); | ||
69 | + } | ||
70 | + return true; | ||
71 | +} | ||
72 | + | ||
73 | +/* | ||
74 | + *** SVE Floating Point Multiply Indexed Group | ||
75 | + */ | ||
76 | + | ||
77 | +static bool trans_FMUL_zzx(DisasContext *s, arg_FMUL_zzx *a, uint32_t insn) | ||
78 | +{ | ||
79 | + static gen_helper_gvec_3_ptr * const fns[3] = { | ||
80 | + gen_helper_gvec_fmul_idx_h, | ||
81 | + gen_helper_gvec_fmul_idx_s, | ||
82 | + gen_helper_gvec_fmul_idx_d, | ||
83 | + }; | ||
84 | + | ||
85 | + if (sve_access_check(s)) { | ||
86 | + unsigned vsz = vec_full_reg_size(s); | ||
87 | + TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); | ||
88 | + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | ||
89 | + vec_full_reg_offset(s, a->rn), | ||
90 | + vec_full_reg_offset(s, a->rm), | ||
91 | + status, vsz, vsz, a->index, fns[a->esz - 1]); | ||
92 | + tcg_temp_free_ptr(status); | ||
93 | + } | ||
94 | + return true; | ||
95 | +} | ||
96 | + | ||
97 | /* | ||
98 | *** SVE Floating Point Accumulating Reduction Group | ||
99 | */ | ||
100 | diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c | ||
101 | index XXXXXXX..XXXXXXX 100644 | ||
102 | --- a/target/arm/vec_helper.c | ||
103 | +++ b/target/arm/vec_helper.c | ||
104 | @@ -XXX,XX +XXX,XX @@ DO_3OP(gvec_rsqrts_d, helper_rsqrtsf_f64, float64) | ||
105 | |||
106 | #endif | ||
107 | #undef DO_3OP | ||
108 | + | ||
109 | +/* For the indexed ops, SVE applies the index per 128-bit vector segment. | ||
110 | + * For AdvSIMD, there is of course only one such vector segment. | ||
111 | + */ | ||
112 | + | ||
113 | +#define DO_MUL_IDX(NAME, TYPE, H) \ | ||
114 | +void HELPER(NAME)(void *vd, void *vn, void *vm, void *stat, uint32_t desc) \ | ||
115 | +{ \ | ||
116 | + intptr_t i, j, oprsz = simd_oprsz(desc), segment = 16 / sizeof(TYPE); \ | ||
117 | + intptr_t idx = simd_data(desc); \ | ||
118 | + TYPE *d = vd, *n = vn, *m = vm; \ | ||
119 | + for (i = 0; i < oprsz / sizeof(TYPE); i += segment) { \ | ||
120 | + TYPE mm = m[H(i + idx)]; \ | ||
121 | + for (j = 0; j < segment; j++) { \ | ||
122 | + d[i + j] = TYPE##_mul(n[i + j], mm, stat); \ | ||
123 | + } \ | ||
124 | + } \ | ||
125 | +} | ||
126 | + | ||
127 | +DO_MUL_IDX(gvec_fmul_idx_h, float16, H2) | ||
128 | +DO_MUL_IDX(gvec_fmul_idx_s, float32, H4) | ||
129 | +DO_MUL_IDX(gvec_fmul_idx_d, float64, ) | ||
130 | + | ||
131 | +#undef DO_MUL_IDX | ||
132 | + | ||
133 | +#define DO_FMLA_IDX(NAME, TYPE, H) \ | ||
134 | +void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, \ | ||
135 | + void *stat, uint32_t desc) \ | ||
136 | +{ \ | ||
137 | + intptr_t i, j, oprsz = simd_oprsz(desc), segment = 16 / sizeof(TYPE); \ | ||
138 | + TYPE op1_neg = extract32(desc, SIMD_DATA_SHIFT, 1); \ | ||
139 | + intptr_t idx = desc >> (SIMD_DATA_SHIFT + 1); \ | ||
140 | + TYPE *d = vd, *n = vn, *m = vm, *a = va; \ | ||
141 | + op1_neg <<= (8 * sizeof(TYPE) - 1); \ | ||
142 | + for (i = 0; i < oprsz / sizeof(TYPE); i += segment) { \ | ||
143 | + TYPE mm = m[H(i + idx)]; \ | ||
144 | + for (j = 0; j < segment; j++) { \ | ||
145 | + d[i + j] = TYPE##_muladd(n[i + j] ^ op1_neg, \ | ||
146 | + mm, a[i + j], 0, stat); \ | ||
147 | + } \ | ||
148 | + } \ | ||
149 | +} | ||
150 | + | ||
151 | +DO_FMLA_IDX(gvec_fmla_idx_h, float16, H2) | ||
152 | +DO_FMLA_IDX(gvec_fmla_idx_s, float32, H4) | ||
153 | +DO_FMLA_IDX(gvec_fmla_idx_d, float64, ) | ||
154 | + | ||
155 | +#undef DO_FMLA_IDX | ||
156 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
157 | index XXXXXXX..XXXXXXX 100644 | ||
158 | --- a/target/arm/sve.decode | ||
159 | +++ b/target/arm/sve.decode | ||
160 | @@ -XXX,XX +XXX,XX @@ | ||
161 | %imm9_16_10 16:s6 10:3 | ||
162 | %size_23 23:2 | ||
163 | %dtype_23_13 23:2 13:2 | ||
164 | +%index3_22_19 22:1 19:2 | ||
165 | |||
166 | # A combination of tsz:imm3 -- extract esize. | ||
167 | %tszimm_esz 22:2 5:5 !function=tszimm_esz | ||
168 | @@ -XXX,XX +XXX,XX @@ UMIN_zzi 00100101 .. 101 011 110 ........ ..... @rdn_i8u | ||
169 | # SVE integer multiply immediate (unpredicated) | ||
170 | MUL_zzi 00100101 .. 110 000 110 ........ ..... @rdn_i8s | ||
171 | |||
172 | +### SVE FP Multiply-Add Indexed Group | ||
173 | + | ||
174 | +# SVE floating-point multiply-add (indexed) | ||
175 | +FMLA_zzxz 01100100 0.1 .. rm:3 00000 sub:1 rn:5 rd:5 \ | ||
176 | + ra=%reg_movprfx index=%index3_22_19 esz=1 | ||
177 | +FMLA_zzxz 01100100 101 index:2 rm:3 00000 sub:1 rn:5 rd:5 \ | ||
178 | + ra=%reg_movprfx esz=2 | ||
179 | +FMLA_zzxz 01100100 111 index:1 rm:4 00000 sub:1 rn:5 rd:5 \ | ||
180 | + ra=%reg_movprfx esz=3 | ||
181 | + | ||
182 | +### SVE FP Multiply Indexed Group | ||
183 | + | ||
184 | +# SVE floating-point multiply (indexed) | ||
185 | +FMUL_zzx 01100100 0.1 .. rm:3 001000 rn:5 rd:5 \ | ||
186 | + index=%index3_22_19 esz=1 | ||
187 | +FMUL_zzx 01100100 101 index:2 rm:3 001000 rn:5 rd:5 esz=2 | ||
188 | +FMUL_zzx 01100100 111 index:1 rm:4 001000 rn:5 rd:5 esz=3 | ||
189 | + | ||
190 | ### SVE FP Accumulating Reduction Group | ||
191 | |||
192 | # SVE floating-point serial reduction (predicated) | ||
193 | -- | ||
194 | 2.17.1 | ||
195 | |||
196 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-20-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 35 ++++++++++++++++++++++ | ||
9 | target/arm/sve_helper.c | 61 ++++++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 57 +++++++++++++++++++++++++++++++++++ | ||
11 | target/arm/sve.decode | 8 +++++ | ||
12 | 4 files changed, 161 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(gvec_rsqrts_s, TCG_CALL_NO_RWG, | ||
19 | DEF_HELPER_FLAGS_5(gvec_rsqrts_d, TCG_CALL_NO_RWG, | ||
20 | void, ptr, ptr, ptr, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_4(sve_faddv_h, TCG_CALL_NO_RWG, | ||
23 | + i64, ptr, ptr, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_4(sve_faddv_s, TCG_CALL_NO_RWG, | ||
25 | + i64, ptr, ptr, ptr, i32) | ||
26 | +DEF_HELPER_FLAGS_4(sve_faddv_d, TCG_CALL_NO_RWG, | ||
27 | + i64, ptr, ptr, ptr, i32) | ||
28 | + | ||
29 | +DEF_HELPER_FLAGS_4(sve_fmaxnmv_h, TCG_CALL_NO_RWG, | ||
30 | + i64, ptr, ptr, ptr, i32) | ||
31 | +DEF_HELPER_FLAGS_4(sve_fmaxnmv_s, TCG_CALL_NO_RWG, | ||
32 | + i64, ptr, ptr, ptr, i32) | ||
33 | +DEF_HELPER_FLAGS_4(sve_fmaxnmv_d, TCG_CALL_NO_RWG, | ||
34 | + i64, ptr, ptr, ptr, i32) | ||
35 | + | ||
36 | +DEF_HELPER_FLAGS_4(sve_fminnmv_h, TCG_CALL_NO_RWG, | ||
37 | + i64, ptr, ptr, ptr, i32) | ||
38 | +DEF_HELPER_FLAGS_4(sve_fminnmv_s, TCG_CALL_NO_RWG, | ||
39 | + i64, ptr, ptr, ptr, i32) | ||
40 | +DEF_HELPER_FLAGS_4(sve_fminnmv_d, TCG_CALL_NO_RWG, | ||
41 | + i64, ptr, ptr, ptr, i32) | ||
42 | + | ||
43 | +DEF_HELPER_FLAGS_4(sve_fmaxv_h, TCG_CALL_NO_RWG, | ||
44 | + i64, ptr, ptr, ptr, i32) | ||
45 | +DEF_HELPER_FLAGS_4(sve_fmaxv_s, TCG_CALL_NO_RWG, | ||
46 | + i64, ptr, ptr, ptr, i32) | ||
47 | +DEF_HELPER_FLAGS_4(sve_fmaxv_d, TCG_CALL_NO_RWG, | ||
48 | + i64, ptr, ptr, ptr, i32) | ||
49 | + | ||
50 | +DEF_HELPER_FLAGS_4(sve_fminv_h, TCG_CALL_NO_RWG, | ||
51 | + i64, ptr, ptr, ptr, i32) | ||
52 | +DEF_HELPER_FLAGS_4(sve_fminv_s, TCG_CALL_NO_RWG, | ||
53 | + i64, ptr, ptr, ptr, i32) | ||
54 | +DEF_HELPER_FLAGS_4(sve_fminv_d, TCG_CALL_NO_RWG, | ||
55 | + i64, ptr, ptr, ptr, i32) | ||
56 | + | ||
57 | DEF_HELPER_FLAGS_5(sve_fadda_h, TCG_CALL_NO_RWG, | ||
58 | i64, i64, ptr, ptr, ptr, i32) | ||
59 | DEF_HELPER_FLAGS_5(sve_fadda_s, TCG_CALL_NO_RWG, | ||
60 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
61 | index XXXXXXX..XXXXXXX 100644 | ||
62 | --- a/target/arm/sve_helper.c | ||
63 | +++ b/target/arm/sve_helper.c | ||
64 | @@ -XXX,XX +XXX,XX @@ uint32_t HELPER(sve_while)(void *vd, uint32_t count, uint32_t pred_desc) | ||
65 | return predtest_ones(d, oprsz, esz_mask); | ||
66 | } | ||
67 | |||
68 | +/* Recursive reduction on a function; | ||
69 | + * C.f. the ARM ARM function ReducePredicated. | ||
70 | + * | ||
71 | + * While it would be possible to write this without the DATA temporary, | ||
72 | + * it is much simpler to process the predicate register this way. | ||
73 | + * The recursion is bounded to depth 7 (128 fp16 elements), so there's | ||
74 | + * little to gain with a more complex non-recursive form. | ||
75 | + */ | ||
76 | +#define DO_REDUCE(NAME, TYPE, H, FUNC, IDENT) \ | ||
77 | +static TYPE NAME##_reduce(TYPE *data, float_status *status, uintptr_t n) \ | ||
78 | +{ \ | ||
79 | + if (n == 1) { \ | ||
80 | + return *data; \ | ||
81 | + } else { \ | ||
82 | + uintptr_t half = n / 2; \ | ||
83 | + TYPE lo = NAME##_reduce(data, status, half); \ | ||
84 | + TYPE hi = NAME##_reduce(data + half, status, half); \ | ||
85 | + return TYPE##_##FUNC(lo, hi, status); \ | ||
86 | + } \ | ||
87 | +} \ | ||
88 | +uint64_t HELPER(NAME)(void *vn, void *vg, void *vs, uint32_t desc) \ | ||
89 | +{ \ | ||
90 | + uintptr_t i, oprsz = simd_oprsz(desc), maxsz = simd_maxsz(desc); \ | ||
91 | + TYPE data[sizeof(ARMVectorReg) / sizeof(TYPE)]; \ | ||
92 | + for (i = 0; i < oprsz; ) { \ | ||
93 | + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ | ||
94 | + do { \ | ||
95 | + TYPE nn = *(TYPE *)(vn + H(i)); \ | ||
96 | + *(TYPE *)((void *)data + i) = (pg & 1 ? nn : IDENT); \ | ||
97 | + i += sizeof(TYPE), pg >>= sizeof(TYPE); \ | ||
98 | + } while (i & 15); \ | ||
99 | + } \ | ||
100 | + for (; i < maxsz; i += sizeof(TYPE)) { \ | ||
101 | + *(TYPE *)((void *)data + i) = IDENT; \ | ||
102 | + } \ | ||
103 | + return NAME##_reduce(data, vs, maxsz / sizeof(TYPE)); \ | ||
104 | +} | ||
105 | + | ||
106 | +DO_REDUCE(sve_faddv_h, float16, H1_2, add, float16_zero) | ||
107 | +DO_REDUCE(sve_faddv_s, float32, H1_4, add, float32_zero) | ||
108 | +DO_REDUCE(sve_faddv_d, float64, , add, float64_zero) | ||
109 | + | ||
110 | +/* Identity is floatN_default_nan, without the function call. */ | ||
111 | +DO_REDUCE(sve_fminnmv_h, float16, H1_2, minnum, 0x7E00) | ||
112 | +DO_REDUCE(sve_fminnmv_s, float32, H1_4, minnum, 0x7FC00000) | ||
113 | +DO_REDUCE(sve_fminnmv_d, float64, , minnum, 0x7FF8000000000000ULL) | ||
114 | + | ||
115 | +DO_REDUCE(sve_fmaxnmv_h, float16, H1_2, maxnum, 0x7E00) | ||
116 | +DO_REDUCE(sve_fmaxnmv_s, float32, H1_4, maxnum, 0x7FC00000) | ||
117 | +DO_REDUCE(sve_fmaxnmv_d, float64, , maxnum, 0x7FF8000000000000ULL) | ||
118 | + | ||
119 | +DO_REDUCE(sve_fminv_h, float16, H1_2, min, float16_infinity) | ||
120 | +DO_REDUCE(sve_fminv_s, float32, H1_4, min, float32_infinity) | ||
121 | +DO_REDUCE(sve_fminv_d, float64, , min, float64_infinity) | ||
122 | + | ||
123 | +DO_REDUCE(sve_fmaxv_h, float16, H1_2, max, float16_chs(float16_infinity)) | ||
124 | +DO_REDUCE(sve_fmaxv_s, float32, H1_4, max, float32_chs(float32_infinity)) | ||
125 | +DO_REDUCE(sve_fmaxv_d, float64, , max, float64_chs(float64_infinity)) | ||
126 | + | ||
127 | +#undef DO_REDUCE | ||
128 | + | ||
129 | uint64_t HELPER(sve_fadda_h)(uint64_t nn, void *vm, void *vg, | ||
130 | void *status, uint32_t desc) | ||
131 | { | ||
132 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
133 | index XXXXXXX..XXXXXXX 100644 | ||
134 | --- a/target/arm/translate-sve.c | ||
135 | +++ b/target/arm/translate-sve.c | ||
136 | @@ -XXX,XX +XXX,XX @@ static bool trans_FMUL_zzx(DisasContext *s, arg_FMUL_zzx *a, uint32_t insn) | ||
137 | return true; | ||
138 | } | ||
139 | |||
140 | +/* | ||
141 | + *** SVE Floating Point Fast Reduction Group | ||
142 | + */ | ||
143 | + | ||
144 | +typedef void gen_helper_fp_reduce(TCGv_i64, TCGv_ptr, TCGv_ptr, | ||
145 | + TCGv_ptr, TCGv_i32); | ||
146 | + | ||
147 | +static void do_reduce(DisasContext *s, arg_rpr_esz *a, | ||
148 | + gen_helper_fp_reduce *fn) | ||
149 | +{ | ||
150 | + unsigned vsz = vec_full_reg_size(s); | ||
151 | + unsigned p2vsz = pow2ceil(vsz); | ||
152 | + TCGv_i32 t_desc = tcg_const_i32(simd_desc(vsz, p2vsz, 0)); | ||
153 | + TCGv_ptr t_zn, t_pg, status; | ||
154 | + TCGv_i64 temp; | ||
155 | + | ||
156 | + temp = tcg_temp_new_i64(); | ||
157 | + t_zn = tcg_temp_new_ptr(); | ||
158 | + t_pg = tcg_temp_new_ptr(); | ||
159 | + | ||
160 | + tcg_gen_addi_ptr(t_zn, cpu_env, vec_full_reg_offset(s, a->rn)); | ||
161 | + tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, a->pg)); | ||
162 | + status = get_fpstatus_ptr(a->esz == MO_16); | ||
163 | + | ||
164 | + fn(temp, t_zn, t_pg, status, t_desc); | ||
165 | + tcg_temp_free_ptr(t_zn); | ||
166 | + tcg_temp_free_ptr(t_pg); | ||
167 | + tcg_temp_free_ptr(status); | ||
168 | + tcg_temp_free_i32(t_desc); | ||
169 | + | ||
170 | + write_fp_dreg(s, a->rd, temp); | ||
171 | + tcg_temp_free_i64(temp); | ||
172 | +} | ||
173 | + | ||
174 | +#define DO_VPZ(NAME, name) \ | ||
175 | +static bool trans_##NAME(DisasContext *s, arg_rpr_esz *a, uint32_t insn) \ | ||
176 | +{ \ | ||
177 | + static gen_helper_fp_reduce * const fns[3] = { \ | ||
178 | + gen_helper_sve_##name##_h, \ | ||
179 | + gen_helper_sve_##name##_s, \ | ||
180 | + gen_helper_sve_##name##_d, \ | ||
181 | + }; \ | ||
182 | + if (a->esz == 0) { \ | ||
183 | + return false; \ | ||
184 | + } \ | ||
185 | + if (sve_access_check(s)) { \ | ||
186 | + do_reduce(s, a, fns[a->esz - 1]); \ | ||
187 | + } \ | ||
188 | + return true; \ | ||
189 | +} | ||
190 | + | ||
191 | +DO_VPZ(FADDV, faddv) | ||
192 | +DO_VPZ(FMINNMV, fminnmv) | ||
193 | +DO_VPZ(FMAXNMV, fmaxnmv) | ||
194 | +DO_VPZ(FMINV, fminv) | ||
195 | +DO_VPZ(FMAXV, fmaxv) | ||
196 | + | ||
197 | /* | ||
198 | *** SVE Floating Point Accumulating Reduction Group | ||
199 | */ | ||
200 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
201 | index XXXXXXX..XXXXXXX 100644 | ||
202 | --- a/target/arm/sve.decode | ||
203 | +++ b/target/arm/sve.decode | ||
204 | @@ -XXX,XX +XXX,XX @@ FMUL_zzx 01100100 0.1 .. rm:3 001000 rn:5 rd:5 \ | ||
205 | FMUL_zzx 01100100 101 index:2 rm:3 001000 rn:5 rd:5 esz=2 | ||
206 | FMUL_zzx 01100100 111 index:1 rm:4 001000 rn:5 rd:5 esz=3 | ||
207 | |||
208 | +### SVE FP Fast Reduction Group | ||
209 | + | ||
210 | +FADDV 01100101 .. 000 000 001 ... ..... ..... @rd_pg_rn | ||
211 | +FMAXNMV 01100101 .. 000 100 001 ... ..... ..... @rd_pg_rn | ||
212 | +FMINNMV 01100101 .. 000 101 001 ... ..... ..... @rd_pg_rn | ||
213 | +FMAXV 01100101 .. 000 110 001 ... ..... ..... @rd_pg_rn | ||
214 | +FMINV 01100101 .. 000 111 001 ... ..... ..... @rd_pg_rn | ||
215 | + | ||
216 | ### SVE FP Accumulating Reduction Group | ||
217 | |||
218 | # SVE floating-point serial reduction (predicated) | ||
219 | -- | ||
220 | 2.17.1 | ||
221 | |||
222 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-21-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper.h | 8 +++++++ | ||
9 | target/arm/translate-sve.c | 47 ++++++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/vec_helper.c | 20 ++++++++++++++++ | ||
11 | target/arm/sve.decode | 5 ++++ | ||
12 | 4 files changed, 80 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper.h b/target/arm/helper.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper.h | ||
17 | +++ b/target/arm/helper.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(gvec_fcmlas_idx, TCG_CALL_NO_RWG, | ||
19 | DEF_HELPER_FLAGS_5(gvec_fcmlad, TCG_CALL_NO_RWG, | ||
20 | void, ptr, ptr, ptr, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_4(gvec_frecpe_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | ||
23 | +DEF_HELPER_FLAGS_4(gvec_frecpe_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_4(gvec_frecpe_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | ||
25 | + | ||
26 | +DEF_HELPER_FLAGS_4(gvec_frsqrte_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | ||
27 | +DEF_HELPER_FLAGS_4(gvec_frsqrte_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | ||
28 | +DEF_HELPER_FLAGS_4(gvec_frsqrte_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | ||
29 | + | ||
30 | DEF_HELPER_FLAGS_5(gvec_fadd_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) | ||
31 | DEF_HELPER_FLAGS_5(gvec_fadd_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) | ||
32 | DEF_HELPER_FLAGS_5(gvec_fadd_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) | ||
33 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
34 | index XXXXXXX..XXXXXXX 100644 | ||
35 | --- a/target/arm/translate-sve.c | ||
36 | +++ b/target/arm/translate-sve.c | ||
37 | @@ -XXX,XX +XXX,XX @@ DO_VPZ(FMAXNMV, fmaxnmv) | ||
38 | DO_VPZ(FMINV, fminv) | ||
39 | DO_VPZ(FMAXV, fmaxv) | ||
40 | |||
41 | +/* | ||
42 | + *** SVE Floating Point Unary Operations - Unpredicated Group | ||
43 | + */ | ||
44 | + | ||
45 | +static void do_zz_fp(DisasContext *s, arg_rr_esz *a, gen_helper_gvec_2_ptr *fn) | ||
46 | +{ | ||
47 | + unsigned vsz = vec_full_reg_size(s); | ||
48 | + TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); | ||
49 | + | ||
50 | + tcg_gen_gvec_2_ptr(vec_full_reg_offset(s, a->rd), | ||
51 | + vec_full_reg_offset(s, a->rn), | ||
52 | + status, vsz, vsz, 0, fn); | ||
53 | + tcg_temp_free_ptr(status); | ||
54 | +} | ||
55 | + | ||
56 | +static bool trans_FRECPE(DisasContext *s, arg_rr_esz *a, uint32_t insn) | ||
57 | +{ | ||
58 | + static gen_helper_gvec_2_ptr * const fns[3] = { | ||
59 | + gen_helper_gvec_frecpe_h, | ||
60 | + gen_helper_gvec_frecpe_s, | ||
61 | + gen_helper_gvec_frecpe_d, | ||
62 | + }; | ||
63 | + if (a->esz == 0) { | ||
64 | + return false; | ||
65 | + } | ||
66 | + if (sve_access_check(s)) { | ||
67 | + do_zz_fp(s, a, fns[a->esz - 1]); | ||
68 | + } | ||
69 | + return true; | ||
70 | +} | ||
71 | + | ||
72 | +static bool trans_FRSQRTE(DisasContext *s, arg_rr_esz *a, uint32_t insn) | ||
73 | +{ | ||
74 | + static gen_helper_gvec_2_ptr * const fns[3] = { | ||
75 | + gen_helper_gvec_frsqrte_h, | ||
76 | + gen_helper_gvec_frsqrte_s, | ||
77 | + gen_helper_gvec_frsqrte_d, | ||
78 | + }; | ||
79 | + if (a->esz == 0) { | ||
80 | + return false; | ||
81 | + } | ||
82 | + if (sve_access_check(s)) { | ||
83 | + do_zz_fp(s, a, fns[a->esz - 1]); | ||
84 | + } | ||
85 | + return true; | ||
86 | +} | ||
87 | + | ||
88 | /* | ||
89 | *** SVE Floating Point Accumulating Reduction Group | ||
90 | */ | ||
91 | diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c | ||
92 | index XXXXXXX..XXXXXXX 100644 | ||
93 | --- a/target/arm/vec_helper.c | ||
94 | +++ b/target/arm/vec_helper.c | ||
95 | @@ -XXX,XX +XXX,XX @@ void HELPER(gvec_fcmlad)(void *vd, void *vn, void *vm, | ||
96 | clear_tail(d, opr_sz, simd_maxsz(desc)); | ||
97 | } | ||
98 | |||
99 | +#define DO_2OP(NAME, FUNC, TYPE) \ | ||
100 | +void HELPER(NAME)(void *vd, void *vn, void *stat, uint32_t desc) \ | ||
101 | +{ \ | ||
102 | + intptr_t i, oprsz = simd_oprsz(desc); \ | ||
103 | + TYPE *d = vd, *n = vn; \ | ||
104 | + for (i = 0; i < oprsz / sizeof(TYPE); i++) { \ | ||
105 | + d[i] = FUNC(n[i], stat); \ | ||
106 | + } \ | ||
107 | +} | ||
108 | + | ||
109 | +DO_2OP(gvec_frecpe_h, helper_recpe_f16, float16) | ||
110 | +DO_2OP(gvec_frecpe_s, helper_recpe_f32, float32) | ||
111 | +DO_2OP(gvec_frecpe_d, helper_recpe_f64, float64) | ||
112 | + | ||
113 | +DO_2OP(gvec_frsqrte_h, helper_rsqrte_f16, float16) | ||
114 | +DO_2OP(gvec_frsqrte_s, helper_rsqrte_f32, float32) | ||
115 | +DO_2OP(gvec_frsqrte_d, helper_rsqrte_f64, float64) | ||
116 | + | ||
117 | +#undef DO_2OP | ||
118 | + | ||
119 | /* Floating-point trigonometric starting value. | ||
120 | * See the ARM ARM pseudocode function FPTrigSMul. | ||
121 | */ | ||
122 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
123 | index XXXXXXX..XXXXXXX 100644 | ||
124 | --- a/target/arm/sve.decode | ||
125 | +++ b/target/arm/sve.decode | ||
126 | @@ -XXX,XX +XXX,XX @@ FMINNMV 01100101 .. 000 101 001 ... ..... ..... @rd_pg_rn | ||
127 | FMAXV 01100101 .. 000 110 001 ... ..... ..... @rd_pg_rn | ||
128 | FMINV 01100101 .. 000 111 001 ... ..... ..... @rd_pg_rn | ||
129 | |||
130 | +## SVE Floating Point Unary Operations - Unpredicated Group | ||
131 | + | ||
132 | +FRECPE 01100101 .. 001 110 001100 ..... ..... @rd_rn | ||
133 | +FRSQRTE 01100101 .. 001 111 001100 ..... ..... @rd_rn | ||
134 | + | ||
135 | ### SVE FP Accumulating Reduction Group | ||
136 | |||
137 | # SVE floating-point serial reduction (predicated) | ||
138 | -- | ||
139 | 2.17.1 | ||
140 | |||
141 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-22-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 42 +++++++++++++++++++++++++++++++++++++ | ||
9 | target/arm/sve_helper.c | 43 ++++++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 43 ++++++++++++++++++++++++++++++++++++++ | ||
11 | target/arm/sve.decode | 10 +++++++++ | ||
12 | 4 files changed, 138 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(sve_fadda_s, TCG_CALL_NO_RWG, | ||
19 | DEF_HELPER_FLAGS_5(sve_fadda_d, TCG_CALL_NO_RWG, | ||
20 | i64, i64, ptr, ptr, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_5(sve_fcmge0_h, TCG_CALL_NO_RWG, | ||
23 | + void, ptr, ptr, ptr, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_5(sve_fcmge0_s, TCG_CALL_NO_RWG, | ||
25 | + void, ptr, ptr, ptr, ptr, i32) | ||
26 | +DEF_HELPER_FLAGS_5(sve_fcmge0_d, TCG_CALL_NO_RWG, | ||
27 | + void, ptr, ptr, ptr, ptr, i32) | ||
28 | + | ||
29 | +DEF_HELPER_FLAGS_5(sve_fcmgt0_h, TCG_CALL_NO_RWG, | ||
30 | + void, ptr, ptr, ptr, ptr, i32) | ||
31 | +DEF_HELPER_FLAGS_5(sve_fcmgt0_s, TCG_CALL_NO_RWG, | ||
32 | + void, ptr, ptr, ptr, ptr, i32) | ||
33 | +DEF_HELPER_FLAGS_5(sve_fcmgt0_d, TCG_CALL_NO_RWG, | ||
34 | + void, ptr, ptr, ptr, ptr, i32) | ||
35 | + | ||
36 | +DEF_HELPER_FLAGS_5(sve_fcmlt0_h, TCG_CALL_NO_RWG, | ||
37 | + void, ptr, ptr, ptr, ptr, i32) | ||
38 | +DEF_HELPER_FLAGS_5(sve_fcmlt0_s, TCG_CALL_NO_RWG, | ||
39 | + void, ptr, ptr, ptr, ptr, i32) | ||
40 | +DEF_HELPER_FLAGS_5(sve_fcmlt0_d, TCG_CALL_NO_RWG, | ||
41 | + void, ptr, ptr, ptr, ptr, i32) | ||
42 | + | ||
43 | +DEF_HELPER_FLAGS_5(sve_fcmle0_h, TCG_CALL_NO_RWG, | ||
44 | + void, ptr, ptr, ptr, ptr, i32) | ||
45 | +DEF_HELPER_FLAGS_5(sve_fcmle0_s, TCG_CALL_NO_RWG, | ||
46 | + void, ptr, ptr, ptr, ptr, i32) | ||
47 | +DEF_HELPER_FLAGS_5(sve_fcmle0_d, TCG_CALL_NO_RWG, | ||
48 | + void, ptr, ptr, ptr, ptr, i32) | ||
49 | + | ||
50 | +DEF_HELPER_FLAGS_5(sve_fcmeq0_h, TCG_CALL_NO_RWG, | ||
51 | + void, ptr, ptr, ptr, ptr, i32) | ||
52 | +DEF_HELPER_FLAGS_5(sve_fcmeq0_s, TCG_CALL_NO_RWG, | ||
53 | + void, ptr, ptr, ptr, ptr, i32) | ||
54 | +DEF_HELPER_FLAGS_5(sve_fcmeq0_d, TCG_CALL_NO_RWG, | ||
55 | + void, ptr, ptr, ptr, ptr, i32) | ||
56 | + | ||
57 | +DEF_HELPER_FLAGS_5(sve_fcmne0_h, TCG_CALL_NO_RWG, | ||
58 | + void, ptr, ptr, ptr, ptr, i32) | ||
59 | +DEF_HELPER_FLAGS_5(sve_fcmne0_s, TCG_CALL_NO_RWG, | ||
60 | + void, ptr, ptr, ptr, ptr, i32) | ||
61 | +DEF_HELPER_FLAGS_5(sve_fcmne0_d, TCG_CALL_NO_RWG, | ||
62 | + void, ptr, ptr, ptr, ptr, i32) | ||
63 | + | ||
64 | DEF_HELPER_FLAGS_6(sve_fadd_h, TCG_CALL_NO_RWG, | ||
65 | void, ptr, ptr, ptr, ptr, ptr, i32) | ||
66 | DEF_HELPER_FLAGS_6(sve_fadd_s, TCG_CALL_NO_RWG, | ||
67 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
68 | index XXXXXXX..XXXXXXX 100644 | ||
69 | --- a/target/arm/sve_helper.c | ||
70 | +++ b/target/arm/sve_helper.c | ||
71 | @@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *vg, \ | ||
72 | |||
73 | #define DO_FCMGE(TYPE, X, Y, ST) TYPE##_compare(Y, X, ST) <= 0 | ||
74 | #define DO_FCMGT(TYPE, X, Y, ST) TYPE##_compare(Y, X, ST) < 0 | ||
75 | +#define DO_FCMLE(TYPE, X, Y, ST) TYPE##_compare(X, Y, ST) <= 0 | ||
76 | +#define DO_FCMLT(TYPE, X, Y, ST) TYPE##_compare(X, Y, ST) < 0 | ||
77 | #define DO_FCMEQ(TYPE, X, Y, ST) TYPE##_compare_quiet(X, Y, ST) == 0 | ||
78 | #define DO_FCMNE(TYPE, X, Y, ST) TYPE##_compare_quiet(X, Y, ST) != 0 | ||
79 | #define DO_FCMUO(TYPE, X, Y, ST) \ | ||
80 | @@ -XXX,XX +XXX,XX @@ DO_FPCMP_PPZZ_ALL(sve_facgt, DO_FACGT) | ||
81 | #undef DO_FPCMP_PPZZ_H | ||
82 | #undef DO_FPCMP_PPZZ | ||
83 | |||
84 | +/* One operand floating-point comparison against zero, controlled | ||
85 | + * by a predicate. | ||
86 | + */ | ||
87 | +#define DO_FPCMP_PPZ0(NAME, TYPE, H, OP) \ | ||
88 | +void HELPER(NAME)(void *vd, void *vn, void *vg, \ | ||
89 | + void *status, uint32_t desc) \ | ||
90 | +{ \ | ||
91 | + intptr_t i = simd_oprsz(desc), j = (i - 1) >> 6; \ | ||
92 | + uint64_t *d = vd, *g = vg; \ | ||
93 | + do { \ | ||
94 | + uint64_t out = 0, pg = g[j]; \ | ||
95 | + do { \ | ||
96 | + i -= sizeof(TYPE), out <<= sizeof(TYPE); \ | ||
97 | + if ((pg >> (i & 63)) & 1) { \ | ||
98 | + TYPE nn = *(TYPE *)(vn + H(i)); \ | ||
99 | + out |= OP(TYPE, nn, 0, status); \ | ||
100 | + } \ | ||
101 | + } while (i & 63); \ | ||
102 | + d[j--] = out; \ | ||
103 | + } while (i > 0); \ | ||
104 | +} | ||
105 | + | ||
106 | +#define DO_FPCMP_PPZ0_H(NAME, OP) \ | ||
107 | + DO_FPCMP_PPZ0(NAME##_h, float16, H1_2, OP) | ||
108 | +#define DO_FPCMP_PPZ0_S(NAME, OP) \ | ||
109 | + DO_FPCMP_PPZ0(NAME##_s, float32, H1_4, OP) | ||
110 | +#define DO_FPCMP_PPZ0_D(NAME, OP) \ | ||
111 | + DO_FPCMP_PPZ0(NAME##_d, float64, , OP) | ||
112 | + | ||
113 | +#define DO_FPCMP_PPZ0_ALL(NAME, OP) \ | ||
114 | + DO_FPCMP_PPZ0_H(NAME, OP) \ | ||
115 | + DO_FPCMP_PPZ0_S(NAME, OP) \ | ||
116 | + DO_FPCMP_PPZ0_D(NAME, OP) | ||
117 | + | ||
118 | +DO_FPCMP_PPZ0_ALL(sve_fcmge0, DO_FCMGE) | ||
119 | +DO_FPCMP_PPZ0_ALL(sve_fcmgt0, DO_FCMGT) | ||
120 | +DO_FPCMP_PPZ0_ALL(sve_fcmle0, DO_FCMLE) | ||
121 | +DO_FPCMP_PPZ0_ALL(sve_fcmlt0, DO_FCMLT) | ||
122 | +DO_FPCMP_PPZ0_ALL(sve_fcmeq0, DO_FCMEQ) | ||
123 | +DO_FPCMP_PPZ0_ALL(sve_fcmne0, DO_FCMNE) | ||
124 | + | ||
125 | /* | ||
126 | * Load contiguous data, protected by a governing predicate. | ||
127 | */ | ||
128 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
129 | index XXXXXXX..XXXXXXX 100644 | ||
130 | --- a/target/arm/translate-sve.c | ||
131 | +++ b/target/arm/translate-sve.c | ||
132 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRSQRTE(DisasContext *s, arg_rr_esz *a, uint32_t insn) | ||
133 | return true; | ||
134 | } | ||
135 | |||
136 | +/* | ||
137 | + *** SVE Floating Point Compare with Zero Group | ||
138 | + */ | ||
139 | + | ||
140 | +static void do_ppz_fp(DisasContext *s, arg_rpr_esz *a, | ||
141 | + gen_helper_gvec_3_ptr *fn) | ||
142 | +{ | ||
143 | + unsigned vsz = vec_full_reg_size(s); | ||
144 | + TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); | ||
145 | + | ||
146 | + tcg_gen_gvec_3_ptr(pred_full_reg_offset(s, a->rd), | ||
147 | + vec_full_reg_offset(s, a->rn), | ||
148 | + pred_full_reg_offset(s, a->pg), | ||
149 | + status, vsz, vsz, 0, fn); | ||
150 | + tcg_temp_free_ptr(status); | ||
151 | +} | ||
152 | + | ||
153 | +#define DO_PPZ(NAME, name) \ | ||
154 | +static bool trans_##NAME(DisasContext *s, arg_rpr_esz *a, uint32_t insn) \ | ||
155 | +{ \ | ||
156 | + static gen_helper_gvec_3_ptr * const fns[3] = { \ | ||
157 | + gen_helper_sve_##name##_h, \ | ||
158 | + gen_helper_sve_##name##_s, \ | ||
159 | + gen_helper_sve_##name##_d, \ | ||
160 | + }; \ | ||
161 | + if (a->esz == 0) { \ | ||
162 | + return false; \ | ||
163 | + } \ | ||
164 | + if (sve_access_check(s)) { \ | ||
165 | + do_ppz_fp(s, a, fns[a->esz - 1]); \ | ||
166 | + } \ | ||
167 | + return true; \ | ||
168 | +} | ||
169 | + | ||
170 | +DO_PPZ(FCMGE_ppz0, fcmge0) | ||
171 | +DO_PPZ(FCMGT_ppz0, fcmgt0) | ||
172 | +DO_PPZ(FCMLE_ppz0, fcmle0) | ||
173 | +DO_PPZ(FCMLT_ppz0, fcmlt0) | ||
174 | +DO_PPZ(FCMEQ_ppz0, fcmeq0) | ||
175 | +DO_PPZ(FCMNE_ppz0, fcmne0) | ||
176 | + | ||
177 | +#undef DO_PPZ | ||
178 | + | ||
179 | /* | ||
180 | *** SVE Floating Point Accumulating Reduction Group | ||
181 | */ | ||
182 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
183 | index XXXXXXX..XXXXXXX 100644 | ||
184 | --- a/target/arm/sve.decode | ||
185 | +++ b/target/arm/sve.decode | ||
186 | @@ -XXX,XX +XXX,XX @@ | ||
187 | # One register operand, with governing predicate, vector element size | ||
188 | @rd_pg_rn ........ esz:2 ... ... ... pg:3 rn:5 rd:5 &rpr_esz | ||
189 | @rd_pg4_pn ........ esz:2 ... ... .. pg:4 . rn:4 rd:5 &rpr_esz | ||
190 | +@pd_pg_rn ........ esz:2 ... ... ... pg:3 rn:5 . rd:4 &rpr_esz | ||
191 | |||
192 | # One register operand, with governing predicate, no vector element size | ||
193 | @rd_pg_rn_e0 ........ .. ... ... ... pg:3 rn:5 rd:5 &rpr_esz esz=0 | ||
194 | @@ -XXX,XX +XXX,XX @@ FMINV 01100101 .. 000 111 001 ... ..... ..... @rd_pg_rn | ||
195 | FRECPE 01100101 .. 001 110 001100 ..... ..... @rd_rn | ||
196 | FRSQRTE 01100101 .. 001 111 001100 ..... ..... @rd_rn | ||
197 | |||
198 | +### SVE FP Compare with Zero Group | ||
199 | + | ||
200 | +FCMGE_ppz0 01100101 .. 0100 00 001 ... ..... 0 .... @pd_pg_rn | ||
201 | +FCMGT_ppz0 01100101 .. 0100 00 001 ... ..... 1 .... @pd_pg_rn | ||
202 | +FCMLT_ppz0 01100101 .. 0100 01 001 ... ..... 0 .... @pd_pg_rn | ||
203 | +FCMLE_ppz0 01100101 .. 0100 01 001 ... ..... 1 .... @pd_pg_rn | ||
204 | +FCMEQ_ppz0 01100101 .. 0100 10 001 ... ..... 0 .... @pd_pg_rn | ||
205 | +FCMNE_ppz0 01100101 .. 0100 11 001 ... ..... 0 .... @pd_pg_rn | ||
206 | + | ||
207 | ### SVE FP Accumulating Reduction Group | ||
208 | |||
209 | # SVE floating-point serial reduction (predicated) | ||
210 | -- | ||
211 | 2.17.1 | ||
212 | |||
213 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-23-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 4 +++ | ||
9 | target/arm/sve_helper.c | 70 ++++++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 27 +++++++++++++++ | ||
11 | target/arm/sve.decode | 3 ++ | ||
12 | 4 files changed, 104 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_3(sve_fnmls_zpzzz_h, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
19 | DEF_HELPER_FLAGS_3(sve_fnmls_zpzzz_s, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
20 | DEF_HELPER_FLAGS_3(sve_fnmls_zpzzz_d, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_5(sve_ftmad_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) | ||
23 | +DEF_HELPER_FLAGS_5(sve_ftmad_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_5(sve_ftmad_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) | ||
25 | + | ||
26 | DEF_HELPER_FLAGS_4(sve_ld1bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
27 | DEF_HELPER_FLAGS_4(sve_ld2bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
28 | DEF_HELPER_FLAGS_4(sve_ld3bb_r, TCG_CALL_NO_WG, void, env, ptr, tl, i32) | ||
29 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
30 | index XXXXXXX..XXXXXXX 100644 | ||
31 | --- a/target/arm/sve_helper.c | ||
32 | +++ b/target/arm/sve_helper.c | ||
33 | @@ -XXX,XX +XXX,XX @@ DO_FPCMP_PPZ0_ALL(sve_fcmlt0, DO_FCMLT) | ||
34 | DO_FPCMP_PPZ0_ALL(sve_fcmeq0, DO_FCMEQ) | ||
35 | DO_FPCMP_PPZ0_ALL(sve_fcmne0, DO_FCMNE) | ||
36 | |||
37 | +/* FP Trig Multiply-Add. */ | ||
38 | + | ||
39 | +void HELPER(sve_ftmad_h)(void *vd, void *vn, void *vm, void *vs, uint32_t desc) | ||
40 | +{ | ||
41 | + static const float16 coeff[16] = { | ||
42 | + 0x3c00, 0xb155, 0x2030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | ||
43 | + 0x3c00, 0xb800, 0x293a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | ||
44 | + }; | ||
45 | + intptr_t i, opr_sz = simd_oprsz(desc) / sizeof(float16); | ||
46 | + intptr_t x = simd_data(desc); | ||
47 | + float16 *d = vd, *n = vn, *m = vm; | ||
48 | + for (i = 0; i < opr_sz; i++) { | ||
49 | + float16 mm = m[i]; | ||
50 | + intptr_t xx = x; | ||
51 | + if (float16_is_neg(mm)) { | ||
52 | + mm = float16_abs(mm); | ||
53 | + xx += 8; | ||
54 | + } | ||
55 | + d[i] = float16_muladd(n[i], mm, coeff[xx], 0, vs); | ||
56 | + } | ||
57 | +} | ||
58 | + | ||
59 | +void HELPER(sve_ftmad_s)(void *vd, void *vn, void *vm, void *vs, uint32_t desc) | ||
60 | +{ | ||
61 | + static const float32 coeff[16] = { | ||
62 | + 0x3f800000, 0xbe2aaaab, 0x3c088886, 0xb95008b9, | ||
63 | + 0x36369d6d, 0x00000000, 0x00000000, 0x00000000, | ||
64 | + 0x3f800000, 0xbf000000, 0x3d2aaaa6, 0xbab60705, | ||
65 | + 0x37cd37cc, 0x00000000, 0x00000000, 0x00000000, | ||
66 | + }; | ||
67 | + intptr_t i, opr_sz = simd_oprsz(desc) / sizeof(float32); | ||
68 | + intptr_t x = simd_data(desc); | ||
69 | + float32 *d = vd, *n = vn, *m = vm; | ||
70 | + for (i = 0; i < opr_sz; i++) { | ||
71 | + float32 mm = m[i]; | ||
72 | + intptr_t xx = x; | ||
73 | + if (float32_is_neg(mm)) { | ||
74 | + mm = float32_abs(mm); | ||
75 | + xx += 8; | ||
76 | + } | ||
77 | + d[i] = float32_muladd(n[i], mm, coeff[xx], 0, vs); | ||
78 | + } | ||
79 | +} | ||
80 | + | ||
81 | +void HELPER(sve_ftmad_d)(void *vd, void *vn, void *vm, void *vs, uint32_t desc) | ||
82 | +{ | ||
83 | + static const float64 coeff[16] = { | ||
84 | + 0x3ff0000000000000ull, 0xbfc5555555555543ull, | ||
85 | + 0x3f8111111110f30cull, 0xbf2a01a019b92fc6ull, | ||
86 | + 0x3ec71de351f3d22bull, 0xbe5ae5e2b60f7b91ull, | ||
87 | + 0x3de5d8408868552full, 0x0000000000000000ull, | ||
88 | + 0x3ff0000000000000ull, 0xbfe0000000000000ull, | ||
89 | + 0x3fa5555555555536ull, 0xbf56c16c16c13a0bull, | ||
90 | + 0x3efa01a019b1e8d8ull, 0xbe927e4f7282f468ull, | ||
91 | + 0x3e21ee96d2641b13ull, 0xbda8f76380fbb401ull, | ||
92 | + }; | ||
93 | + intptr_t i, opr_sz = simd_oprsz(desc) / sizeof(float64); | ||
94 | + intptr_t x = simd_data(desc); | ||
95 | + float64 *d = vd, *n = vn, *m = vm; | ||
96 | + for (i = 0; i < opr_sz; i++) { | ||
97 | + float64 mm = m[i]; | ||
98 | + intptr_t xx = x; | ||
99 | + if (float64_is_neg(mm)) { | ||
100 | + mm = float64_abs(mm); | ||
101 | + xx += 8; | ||
102 | + } | ||
103 | + d[i] = float64_muladd(n[i], mm, coeff[xx], 0, vs); | ||
104 | + } | ||
105 | +} | ||
106 | + | ||
107 | /* | ||
108 | * Load contiguous data, protected by a governing predicate. | ||
109 | */ | ||
110 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
111 | index XXXXXXX..XXXXXXX 100644 | ||
112 | --- a/target/arm/translate-sve.c | ||
113 | +++ b/target/arm/translate-sve.c | ||
114 | @@ -XXX,XX +XXX,XX @@ DO_PPZ(FCMNE_ppz0, fcmne0) | ||
115 | |||
116 | #undef DO_PPZ | ||
117 | |||
118 | +/* | ||
119 | + *** SVE floating-point trig multiply-add coefficient | ||
120 | + */ | ||
121 | + | ||
122 | +static bool trans_FTMAD(DisasContext *s, arg_FTMAD *a, uint32_t insn) | ||
123 | +{ | ||
124 | + static gen_helper_gvec_3_ptr * const fns[3] = { | ||
125 | + gen_helper_sve_ftmad_h, | ||
126 | + gen_helper_sve_ftmad_s, | ||
127 | + gen_helper_sve_ftmad_d, | ||
128 | + }; | ||
129 | + | ||
130 | + if (a->esz == 0) { | ||
131 | + return false; | ||
132 | + } | ||
133 | + if (sve_access_check(s)) { | ||
134 | + unsigned vsz = vec_full_reg_size(s); | ||
135 | + TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); | ||
136 | + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | ||
137 | + vec_full_reg_offset(s, a->rn), | ||
138 | + vec_full_reg_offset(s, a->rm), | ||
139 | + status, vsz, vsz, a->imm, fns[a->esz - 1]); | ||
140 | + tcg_temp_free_ptr(status); | ||
141 | + } | ||
142 | + return true; | ||
143 | +} | ||
144 | + | ||
145 | /* | ||
146 | *** SVE Floating Point Accumulating Reduction Group | ||
147 | */ | ||
148 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
149 | index XXXXXXX..XXXXXXX 100644 | ||
150 | --- a/target/arm/sve.decode | ||
151 | +++ b/target/arm/sve.decode | ||
152 | @@ -XXX,XX +XXX,XX @@ FMINNM_zpzi 01100101 .. 011 101 100 ... 0000 . ..... @rdn_i1 | ||
153 | FMAX_zpzi 01100101 .. 011 110 100 ... 0000 . ..... @rdn_i1 | ||
154 | FMIN_zpzi 01100101 .. 011 111 100 ... 0000 . ..... @rdn_i1 | ||
155 | |||
156 | +# SVE floating-point trig multiply-add coefficient | ||
157 | +FTMAD 01100101 esz:2 010 imm:3 100000 rm:5 rd:5 rn=%reg_movprfx | ||
158 | + | ||
159 | ### SVE FP Multiply-Add Group | ||
160 | |||
161 | # SVE floating-point multiply-accumulate writing addend | ||
162 | -- | ||
163 | 2.17.1 | ||
164 | |||
165 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-24-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 13 +++++++++ | ||
9 | target/arm/sve_helper.c | 55 ++++++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 30 +++++++++++++++++++++ | ||
11 | target/arm/sve.decode | 8 ++++++ | ||
12 | 4 files changed, 106 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_6(sve_fmins_s, TCG_CALL_NO_RWG, | ||
19 | DEF_HELPER_FLAGS_6(sve_fmins_d, TCG_CALL_NO_RWG, | ||
20 | void, ptr, ptr, ptr, i64, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_5(sve_fcvt_sh, TCG_CALL_NO_RWG, | ||
23 | + void, ptr, ptr, ptr, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_5(sve_fcvt_dh, TCG_CALL_NO_RWG, | ||
25 | + void, ptr, ptr, ptr, ptr, i32) | ||
26 | +DEF_HELPER_FLAGS_5(sve_fcvt_hs, TCG_CALL_NO_RWG, | ||
27 | + void, ptr, ptr, ptr, ptr, i32) | ||
28 | +DEF_HELPER_FLAGS_5(sve_fcvt_ds, TCG_CALL_NO_RWG, | ||
29 | + void, ptr, ptr, ptr, ptr, i32) | ||
30 | +DEF_HELPER_FLAGS_5(sve_fcvt_hd, TCG_CALL_NO_RWG, | ||
31 | + void, ptr, ptr, ptr, ptr, i32) | ||
32 | +DEF_HELPER_FLAGS_5(sve_fcvt_sd, TCG_CALL_NO_RWG, | ||
33 | + void, ptr, ptr, ptr, ptr, i32) | ||
34 | + | ||
35 | DEF_HELPER_FLAGS_5(sve_scvt_hh, TCG_CALL_NO_RWG, | ||
36 | void, ptr, ptr, ptr, ptr, i32) | ||
37 | DEF_HELPER_FLAGS_5(sve_scvt_sh, TCG_CALL_NO_RWG, | ||
38 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
39 | index XXXXXXX..XXXXXXX 100644 | ||
40 | --- a/target/arm/sve_helper.c | ||
41 | +++ b/target/arm/sve_helper.c | ||
42 | @@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vg, void *status, uint32_t desc) \ | ||
43 | } while (i != 0); \ | ||
44 | } | ||
45 | |||
46 | +/* SVE fp16 conversions always use IEEE mode. Like AdvSIMD, they ignore | ||
47 | + * FZ16. When converting from fp16, this affects flushing input denormals; | ||
48 | + * when converting to fp16, this affects flushing output denormals. | ||
49 | + */ | ||
50 | +static inline float32 sve_f16_to_f32(float16 f, float_status *fpst) | ||
51 | +{ | ||
52 | + flag save = get_flush_inputs_to_zero(fpst); | ||
53 | + float32 ret; | ||
54 | + | ||
55 | + set_flush_inputs_to_zero(false, fpst); | ||
56 | + ret = float16_to_float32(f, true, fpst); | ||
57 | + set_flush_inputs_to_zero(save, fpst); | ||
58 | + return ret; | ||
59 | +} | ||
60 | + | ||
61 | +static inline float64 sve_f16_to_f64(float16 f, float_status *fpst) | ||
62 | +{ | ||
63 | + flag save = get_flush_inputs_to_zero(fpst); | ||
64 | + float64 ret; | ||
65 | + | ||
66 | + set_flush_inputs_to_zero(false, fpst); | ||
67 | + ret = float16_to_float64(f, true, fpst); | ||
68 | + set_flush_inputs_to_zero(save, fpst); | ||
69 | + return ret; | ||
70 | +} | ||
71 | + | ||
72 | +static inline float16 sve_f32_to_f16(float32 f, float_status *fpst) | ||
73 | +{ | ||
74 | + flag save = get_flush_to_zero(fpst); | ||
75 | + float16 ret; | ||
76 | + | ||
77 | + set_flush_to_zero(false, fpst); | ||
78 | + ret = float32_to_float16(f, true, fpst); | ||
79 | + set_flush_to_zero(save, fpst); | ||
80 | + return ret; | ||
81 | +} | ||
82 | + | ||
83 | +static inline float16 sve_f64_to_f16(float64 f, float_status *fpst) | ||
84 | +{ | ||
85 | + flag save = get_flush_to_zero(fpst); | ||
86 | + float16 ret; | ||
87 | + | ||
88 | + set_flush_to_zero(false, fpst); | ||
89 | + ret = float64_to_float16(f, true, fpst); | ||
90 | + set_flush_to_zero(save, fpst); | ||
91 | + return ret; | ||
92 | +} | ||
93 | + | ||
94 | +DO_ZPZ_FP(sve_fcvt_sh, uint32_t, H1_4, sve_f32_to_f16) | ||
95 | +DO_ZPZ_FP(sve_fcvt_hs, uint32_t, H1_4, sve_f16_to_f32) | ||
96 | +DO_ZPZ_FP(sve_fcvt_dh, uint64_t, , sve_f64_to_f16) | ||
97 | +DO_ZPZ_FP(sve_fcvt_hd, uint64_t, , sve_f16_to_f64) | ||
98 | +DO_ZPZ_FP(sve_fcvt_ds, uint64_t, , float64_to_float32) | ||
99 | +DO_ZPZ_FP(sve_fcvt_sd, uint64_t, , float32_to_float64) | ||
100 | + | ||
101 | DO_ZPZ_FP(sve_scvt_hh, uint16_t, H1_2, int16_to_float16) | ||
102 | DO_ZPZ_FP(sve_scvt_sh, uint32_t, H1_4, int32_to_float16) | ||
103 | DO_ZPZ_FP(sve_scvt_ss, uint32_t, H1_4, int32_to_float32) | ||
104 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
105 | index XXXXXXX..XXXXXXX 100644 | ||
106 | --- a/target/arm/translate-sve.c | ||
107 | +++ b/target/arm/translate-sve.c | ||
108 | @@ -XXX,XX +XXX,XX @@ static bool do_zpz_ptr(DisasContext *s, int rd, int rn, int pg, | ||
109 | return true; | ||
110 | } | ||
111 | |||
112 | +static bool trans_FCVT_sh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
113 | +{ | ||
114 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvt_sh); | ||
115 | +} | ||
116 | + | ||
117 | +static bool trans_FCVT_hs(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
118 | +{ | ||
119 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_hs); | ||
120 | +} | ||
121 | + | ||
122 | +static bool trans_FCVT_dh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
123 | +{ | ||
124 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvt_dh); | ||
125 | +} | ||
126 | + | ||
127 | +static bool trans_FCVT_hd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
128 | +{ | ||
129 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_hd); | ||
130 | +} | ||
131 | + | ||
132 | +static bool trans_FCVT_ds(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
133 | +{ | ||
134 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_ds); | ||
135 | +} | ||
136 | + | ||
137 | +static bool trans_FCVT_sd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
138 | +{ | ||
139 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_sd); | ||
140 | +} | ||
141 | + | ||
142 | static bool trans_SCVTF_hh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
143 | { | ||
144 | return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_scvt_hh); | ||
145 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
146 | index XXXXXXX..XXXXXXX 100644 | ||
147 | --- a/target/arm/sve.decode | ||
148 | +++ b/target/arm/sve.decode | ||
149 | @@ -XXX,XX +XXX,XX @@ FNMLS_zpzzz 01100101 .. 1 ..... 111 ... ..... ..... @rdn_pg_rm_ra | ||
150 | |||
151 | ### SVE FP Unary Operations Predicated Group | ||
152 | |||
153 | +# SVE floating-point convert precision | ||
154 | +FCVT_sh 01100101 10 0010 00 101 ... ..... ..... @rd_pg_rn_e0 | ||
155 | +FCVT_hs 01100101 10 0010 01 101 ... ..... ..... @rd_pg_rn_e0 | ||
156 | +FCVT_dh 01100101 11 0010 00 101 ... ..... ..... @rd_pg_rn_e0 | ||
157 | +FCVT_hd 01100101 11 0010 01 101 ... ..... ..... @rd_pg_rn_e0 | ||
158 | +FCVT_ds 01100101 11 0010 10 101 ... ..... ..... @rd_pg_rn_e0 | ||
159 | +FCVT_sd 01100101 11 0010 11 101 ... ..... ..... @rd_pg_rn_e0 | ||
160 | + | ||
161 | # SVE integer convert to floating-point | ||
162 | SCVTF_hh 01100101 01 010 01 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
163 | SCVTF_sh 01100101 01 010 10 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
164 | -- | ||
165 | 2.17.1 | ||
166 | |||
167 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-25-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 30 +++++++++++++ | ||
9 | target/arm/helper.h | 12 +++--- | ||
10 | target/arm/helper.c | 2 +- | ||
11 | target/arm/sve_helper.c | 88 ++++++++++++++++++++++++++++++++++++++ | ||
12 | target/arm/translate-sve.c | 70 ++++++++++++++++++++++++++++++ | ||
13 | target/arm/sve.decode | 16 +++++++ | ||
14 | 6 files changed, 211 insertions(+), 7 deletions(-) | ||
15 | |||
16 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/target/arm/helper-sve.h | ||
19 | +++ b/target/arm/helper-sve.h | ||
20 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(sve_fcvt_hd, TCG_CALL_NO_RWG, | ||
21 | DEF_HELPER_FLAGS_5(sve_fcvt_sd, TCG_CALL_NO_RWG, | ||
22 | void, ptr, ptr, ptr, ptr, i32) | ||
23 | |||
24 | +DEF_HELPER_FLAGS_5(sve_fcvtzs_hh, TCG_CALL_NO_RWG, | ||
25 | + void, ptr, ptr, ptr, ptr, i32) | ||
26 | +DEF_HELPER_FLAGS_5(sve_fcvtzs_hs, TCG_CALL_NO_RWG, | ||
27 | + void, ptr, ptr, ptr, ptr, i32) | ||
28 | +DEF_HELPER_FLAGS_5(sve_fcvtzs_ss, TCG_CALL_NO_RWG, | ||
29 | + void, ptr, ptr, ptr, ptr, i32) | ||
30 | +DEF_HELPER_FLAGS_5(sve_fcvtzs_ds, TCG_CALL_NO_RWG, | ||
31 | + void, ptr, ptr, ptr, ptr, i32) | ||
32 | +DEF_HELPER_FLAGS_5(sve_fcvtzs_hd, TCG_CALL_NO_RWG, | ||
33 | + void, ptr, ptr, ptr, ptr, i32) | ||
34 | +DEF_HELPER_FLAGS_5(sve_fcvtzs_sd, TCG_CALL_NO_RWG, | ||
35 | + void, ptr, ptr, ptr, ptr, i32) | ||
36 | +DEF_HELPER_FLAGS_5(sve_fcvtzs_dd, TCG_CALL_NO_RWG, | ||
37 | + void, ptr, ptr, ptr, ptr, i32) | ||
38 | + | ||
39 | +DEF_HELPER_FLAGS_5(sve_fcvtzu_hh, TCG_CALL_NO_RWG, | ||
40 | + void, ptr, ptr, ptr, ptr, i32) | ||
41 | +DEF_HELPER_FLAGS_5(sve_fcvtzu_hs, TCG_CALL_NO_RWG, | ||
42 | + void, ptr, ptr, ptr, ptr, i32) | ||
43 | +DEF_HELPER_FLAGS_5(sve_fcvtzu_ss, TCG_CALL_NO_RWG, | ||
44 | + void, ptr, ptr, ptr, ptr, i32) | ||
45 | +DEF_HELPER_FLAGS_5(sve_fcvtzu_ds, TCG_CALL_NO_RWG, | ||
46 | + void, ptr, ptr, ptr, ptr, i32) | ||
47 | +DEF_HELPER_FLAGS_5(sve_fcvtzu_hd, TCG_CALL_NO_RWG, | ||
48 | + void, ptr, ptr, ptr, ptr, i32) | ||
49 | +DEF_HELPER_FLAGS_5(sve_fcvtzu_sd, TCG_CALL_NO_RWG, | ||
50 | + void, ptr, ptr, ptr, ptr, i32) | ||
51 | +DEF_HELPER_FLAGS_5(sve_fcvtzu_dd, TCG_CALL_NO_RWG, | ||
52 | + void, ptr, ptr, ptr, ptr, i32) | ||
53 | + | ||
54 | DEF_HELPER_FLAGS_5(sve_scvt_hh, TCG_CALL_NO_RWG, | ||
55 | void, ptr, ptr, ptr, ptr, i32) | ||
56 | DEF_HELPER_FLAGS_5(sve_scvt_sh, TCG_CALL_NO_RWG, | ||
57 | diff --git a/target/arm/helper.h b/target/arm/helper.h | ||
58 | index XXXXXXX..XXXXXXX 100644 | ||
59 | --- a/target/arm/helper.h | ||
60 | +++ b/target/arm/helper.h | ||
61 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_2(vfp_touid, i32, f64, ptr) | ||
62 | DEF_HELPER_2(vfp_touizh, i32, f16, ptr) | ||
63 | DEF_HELPER_2(vfp_touizs, i32, f32, ptr) | ||
64 | DEF_HELPER_2(vfp_touizd, i32, f64, ptr) | ||
65 | -DEF_HELPER_2(vfp_tosih, i32, f16, ptr) | ||
66 | -DEF_HELPER_2(vfp_tosis, i32, f32, ptr) | ||
67 | -DEF_HELPER_2(vfp_tosid, i32, f64, ptr) | ||
68 | -DEF_HELPER_2(vfp_tosizh, i32, f16, ptr) | ||
69 | -DEF_HELPER_2(vfp_tosizs, i32, f32, ptr) | ||
70 | -DEF_HELPER_2(vfp_tosizd, i32, f64, ptr) | ||
71 | +DEF_HELPER_2(vfp_tosih, s32, f16, ptr) | ||
72 | +DEF_HELPER_2(vfp_tosis, s32, f32, ptr) | ||
73 | +DEF_HELPER_2(vfp_tosid, s32, f64, ptr) | ||
74 | +DEF_HELPER_2(vfp_tosizh, s32, f16, ptr) | ||
75 | +DEF_HELPER_2(vfp_tosizs, s32, f32, ptr) | ||
76 | +DEF_HELPER_2(vfp_tosizd, s32, f64, ptr) | ||
77 | |||
78 | DEF_HELPER_3(vfp_toshs_round_to_zero, i32, f32, i32, ptr) | ||
79 | DEF_HELPER_3(vfp_tosls_round_to_zero, i32, f32, i32, ptr) | ||
80 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
81 | index XXXXXXX..XXXXXXX 100644 | ||
82 | --- a/target/arm/helper.c | ||
83 | +++ b/target/arm/helper.c | ||
84 | @@ -XXX,XX +XXX,XX @@ ftype HELPER(name)(uint32_t x, void *fpstp) \ | ||
85 | } | ||
86 | |||
87 | #define CONV_FTOI(name, ftype, fsz, sign, round) \ | ||
88 | -uint32_t HELPER(name)(ftype x, void *fpstp) \ | ||
89 | +sign##int32_t HELPER(name)(ftype x, void *fpstp) \ | ||
90 | { \ | ||
91 | float_status *fpst = fpstp; \ | ||
92 | if (float##fsz##_is_any_nan(x)) { \ | ||
93 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
94 | index XXXXXXX..XXXXXXX 100644 | ||
95 | --- a/target/arm/sve_helper.c | ||
96 | +++ b/target/arm/sve_helper.c | ||
97 | @@ -XXX,XX +XXX,XX @@ static inline float16 sve_f64_to_f16(float64 f, float_status *fpst) | ||
98 | return ret; | ||
99 | } | ||
100 | |||
101 | +static inline int16_t vfp_float16_to_int16_rtz(float16 f, float_status *s) | ||
102 | +{ | ||
103 | + if (float16_is_any_nan(f)) { | ||
104 | + float_raise(float_flag_invalid, s); | ||
105 | + return 0; | ||
106 | + } | ||
107 | + return float16_to_int16_round_to_zero(f, s); | ||
108 | +} | ||
109 | + | ||
110 | +static inline int64_t vfp_float16_to_int64_rtz(float16 f, float_status *s) | ||
111 | +{ | ||
112 | + if (float16_is_any_nan(f)) { | ||
113 | + float_raise(float_flag_invalid, s); | ||
114 | + return 0; | ||
115 | + } | ||
116 | + return float16_to_int64_round_to_zero(f, s); | ||
117 | +} | ||
118 | + | ||
119 | +static inline int64_t vfp_float32_to_int64_rtz(float32 f, float_status *s) | ||
120 | +{ | ||
121 | + if (float32_is_any_nan(f)) { | ||
122 | + float_raise(float_flag_invalid, s); | ||
123 | + return 0; | ||
124 | + } | ||
125 | + return float32_to_int64_round_to_zero(f, s); | ||
126 | +} | ||
127 | + | ||
128 | +static inline int64_t vfp_float64_to_int64_rtz(float64 f, float_status *s) | ||
129 | +{ | ||
130 | + if (float64_is_any_nan(f)) { | ||
131 | + float_raise(float_flag_invalid, s); | ||
132 | + return 0; | ||
133 | + } | ||
134 | + return float64_to_int64_round_to_zero(f, s); | ||
135 | +} | ||
136 | + | ||
137 | +static inline uint16_t vfp_float16_to_uint16_rtz(float16 f, float_status *s) | ||
138 | +{ | ||
139 | + if (float16_is_any_nan(f)) { | ||
140 | + float_raise(float_flag_invalid, s); | ||
141 | + return 0; | ||
142 | + } | ||
143 | + return float16_to_uint16_round_to_zero(f, s); | ||
144 | +} | ||
145 | + | ||
146 | +static inline uint64_t vfp_float16_to_uint64_rtz(float16 f, float_status *s) | ||
147 | +{ | ||
148 | + if (float16_is_any_nan(f)) { | ||
149 | + float_raise(float_flag_invalid, s); | ||
150 | + return 0; | ||
151 | + } | ||
152 | + return float16_to_uint64_round_to_zero(f, s); | ||
153 | +} | ||
154 | + | ||
155 | +static inline uint64_t vfp_float32_to_uint64_rtz(float32 f, float_status *s) | ||
156 | +{ | ||
157 | + if (float32_is_any_nan(f)) { | ||
158 | + float_raise(float_flag_invalid, s); | ||
159 | + return 0; | ||
160 | + } | ||
161 | + return float32_to_uint64_round_to_zero(f, s); | ||
162 | +} | ||
163 | + | ||
164 | +static inline uint64_t vfp_float64_to_uint64_rtz(float64 f, float_status *s) | ||
165 | +{ | ||
166 | + if (float64_is_any_nan(f)) { | ||
167 | + float_raise(float_flag_invalid, s); | ||
168 | + return 0; | ||
169 | + } | ||
170 | + return float64_to_uint64_round_to_zero(f, s); | ||
171 | +} | ||
172 | + | ||
173 | DO_ZPZ_FP(sve_fcvt_sh, uint32_t, H1_4, sve_f32_to_f16) | ||
174 | DO_ZPZ_FP(sve_fcvt_hs, uint32_t, H1_4, sve_f16_to_f32) | ||
175 | DO_ZPZ_FP(sve_fcvt_dh, uint64_t, , sve_f64_to_f16) | ||
176 | @@ -XXX,XX +XXX,XX @@ DO_ZPZ_FP(sve_fcvt_hd, uint64_t, , sve_f16_to_f64) | ||
177 | DO_ZPZ_FP(sve_fcvt_ds, uint64_t, , float64_to_float32) | ||
178 | DO_ZPZ_FP(sve_fcvt_sd, uint64_t, , float32_to_float64) | ||
179 | |||
180 | +DO_ZPZ_FP(sve_fcvtzs_hh, uint16_t, H1_2, vfp_float16_to_int16_rtz) | ||
181 | +DO_ZPZ_FP(sve_fcvtzs_hs, uint32_t, H1_4, helper_vfp_tosizh) | ||
182 | +DO_ZPZ_FP(sve_fcvtzs_ss, uint32_t, H1_4, helper_vfp_tosizs) | ||
183 | +DO_ZPZ_FP(sve_fcvtzs_hd, uint64_t, , vfp_float16_to_int64_rtz) | ||
184 | +DO_ZPZ_FP(sve_fcvtzs_sd, uint64_t, , vfp_float32_to_int64_rtz) | ||
185 | +DO_ZPZ_FP(sve_fcvtzs_ds, uint64_t, , helper_vfp_tosizd) | ||
186 | +DO_ZPZ_FP(sve_fcvtzs_dd, uint64_t, , vfp_float64_to_int64_rtz) | ||
187 | + | ||
188 | +DO_ZPZ_FP(sve_fcvtzu_hh, uint16_t, H1_2, vfp_float16_to_uint16_rtz) | ||
189 | +DO_ZPZ_FP(sve_fcvtzu_hs, uint32_t, H1_4, helper_vfp_touizh) | ||
190 | +DO_ZPZ_FP(sve_fcvtzu_ss, uint32_t, H1_4, helper_vfp_touizs) | ||
191 | +DO_ZPZ_FP(sve_fcvtzu_hd, uint64_t, , vfp_float16_to_uint64_rtz) | ||
192 | +DO_ZPZ_FP(sve_fcvtzu_sd, uint64_t, , vfp_float32_to_uint64_rtz) | ||
193 | +DO_ZPZ_FP(sve_fcvtzu_ds, uint64_t, , helper_vfp_touizd) | ||
194 | +DO_ZPZ_FP(sve_fcvtzu_dd, uint64_t, , vfp_float64_to_uint64_rtz) | ||
195 | + | ||
196 | DO_ZPZ_FP(sve_scvt_hh, uint16_t, H1_2, int16_to_float16) | ||
197 | DO_ZPZ_FP(sve_scvt_sh, uint32_t, H1_4, int32_to_float16) | ||
198 | DO_ZPZ_FP(sve_scvt_ss, uint32_t, H1_4, int32_to_float32) | ||
199 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
200 | index XXXXXXX..XXXXXXX 100644 | ||
201 | --- a/target/arm/translate-sve.c | ||
202 | +++ b/target/arm/translate-sve.c | ||
203 | @@ -XXX,XX +XXX,XX @@ static bool trans_FCVT_sd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
204 | return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_sd); | ||
205 | } | ||
206 | |||
207 | +static bool trans_FCVTZS_hh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
208 | +{ | ||
209 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvtzs_hh); | ||
210 | +} | ||
211 | + | ||
212 | +static bool trans_FCVTZU_hh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
213 | +{ | ||
214 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvtzu_hh); | ||
215 | +} | ||
216 | + | ||
217 | +static bool trans_FCVTZS_hs(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
218 | +{ | ||
219 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvtzs_hs); | ||
220 | +} | ||
221 | + | ||
222 | +static bool trans_FCVTZU_hs(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
223 | +{ | ||
224 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvtzu_hs); | ||
225 | +} | ||
226 | + | ||
227 | +static bool trans_FCVTZS_hd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
228 | +{ | ||
229 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvtzs_hd); | ||
230 | +} | ||
231 | + | ||
232 | +static bool trans_FCVTZU_hd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
233 | +{ | ||
234 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvtzu_hd); | ||
235 | +} | ||
236 | + | ||
237 | +static bool trans_FCVTZS_ss(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
238 | +{ | ||
239 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzs_ss); | ||
240 | +} | ||
241 | + | ||
242 | +static bool trans_FCVTZU_ss(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
243 | +{ | ||
244 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzu_ss); | ||
245 | +} | ||
246 | + | ||
247 | +static bool trans_FCVTZS_sd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
248 | +{ | ||
249 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzs_sd); | ||
250 | +} | ||
251 | + | ||
252 | +static bool trans_FCVTZU_sd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
253 | +{ | ||
254 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzu_sd); | ||
255 | +} | ||
256 | + | ||
257 | +static bool trans_FCVTZS_ds(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
258 | +{ | ||
259 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzs_ds); | ||
260 | +} | ||
261 | + | ||
262 | +static bool trans_FCVTZU_ds(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
263 | +{ | ||
264 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzu_ds); | ||
265 | +} | ||
266 | + | ||
267 | +static bool trans_FCVTZS_dd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
268 | +{ | ||
269 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzs_dd); | ||
270 | +} | ||
271 | + | ||
272 | +static bool trans_FCVTZU_dd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
273 | +{ | ||
274 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzu_dd); | ||
275 | +} | ||
276 | + | ||
277 | static bool trans_SCVTF_hh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
278 | { | ||
279 | return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_scvt_hh); | ||
280 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
281 | index XXXXXXX..XXXXXXX 100644 | ||
282 | --- a/target/arm/sve.decode | ||
283 | +++ b/target/arm/sve.decode | ||
284 | @@ -XXX,XX +XXX,XX @@ FCVT_hd 01100101 11 0010 01 101 ... ..... ..... @rd_pg_rn_e0 | ||
285 | FCVT_ds 01100101 11 0010 10 101 ... ..... ..... @rd_pg_rn_e0 | ||
286 | FCVT_sd 01100101 11 0010 11 101 ... ..... ..... @rd_pg_rn_e0 | ||
287 | |||
288 | +# SVE floating-point convert to integer | ||
289 | +FCVTZS_hh 01100101 01 011 01 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
290 | +FCVTZU_hh 01100101 01 011 01 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
291 | +FCVTZS_hs 01100101 01 011 10 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
292 | +FCVTZU_hs 01100101 01 011 10 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
293 | +FCVTZS_hd 01100101 01 011 11 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
294 | +FCVTZU_hd 01100101 01 011 11 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
295 | +FCVTZS_ss 01100101 10 011 10 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
296 | +FCVTZU_ss 01100101 10 011 10 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
297 | +FCVTZS_ds 01100101 11 011 00 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
298 | +FCVTZU_ds 01100101 11 011 00 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
299 | +FCVTZS_sd 01100101 11 011 10 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
300 | +FCVTZU_sd 01100101 11 011 10 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
301 | +FCVTZS_dd 01100101 11 011 11 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
302 | +FCVTZU_dd 01100101 11 011 11 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
303 | + | ||
304 | # SVE integer convert to floating-point | ||
305 | SCVTF_hh 01100101 01 010 01 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
306 | SCVTF_sh 01100101 01 010 10 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
307 | -- | ||
308 | 2.17.1 | ||
309 | |||
310 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-26-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 14 +++++++ | ||
9 | target/arm/sve_helper.c | 8 ++++ | ||
10 | target/arm/translate-sve.c | 77 ++++++++++++++++++++++++++++++++++++++ | ||
11 | target/arm/sve.decode | 9 +++++ | ||
12 | 4 files changed, 108 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(sve_fcvtzu_sd, TCG_CALL_NO_RWG, | ||
19 | DEF_HELPER_FLAGS_5(sve_fcvtzu_dd, TCG_CALL_NO_RWG, | ||
20 | void, ptr, ptr, ptr, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_5(sve_frint_h, TCG_CALL_NO_RWG, | ||
23 | + void, ptr, ptr, ptr, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_5(sve_frint_s, TCG_CALL_NO_RWG, | ||
25 | + void, ptr, ptr, ptr, ptr, i32) | ||
26 | +DEF_HELPER_FLAGS_5(sve_frint_d, TCG_CALL_NO_RWG, | ||
27 | + void, ptr, ptr, ptr, ptr, i32) | ||
28 | + | ||
29 | +DEF_HELPER_FLAGS_5(sve_frintx_h, TCG_CALL_NO_RWG, | ||
30 | + void, ptr, ptr, ptr, ptr, i32) | ||
31 | +DEF_HELPER_FLAGS_5(sve_frintx_s, TCG_CALL_NO_RWG, | ||
32 | + void, ptr, ptr, ptr, ptr, i32) | ||
33 | +DEF_HELPER_FLAGS_5(sve_frintx_d, TCG_CALL_NO_RWG, | ||
34 | + void, ptr, ptr, ptr, ptr, i32) | ||
35 | + | ||
36 | DEF_HELPER_FLAGS_5(sve_scvt_hh, TCG_CALL_NO_RWG, | ||
37 | void, ptr, ptr, ptr, ptr, i32) | ||
38 | DEF_HELPER_FLAGS_5(sve_scvt_sh, TCG_CALL_NO_RWG, | ||
39 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
40 | index XXXXXXX..XXXXXXX 100644 | ||
41 | --- a/target/arm/sve_helper.c | ||
42 | +++ b/target/arm/sve_helper.c | ||
43 | @@ -XXX,XX +XXX,XX @@ DO_ZPZ_FP(sve_fcvtzu_sd, uint64_t, , vfp_float32_to_uint64_rtz) | ||
44 | DO_ZPZ_FP(sve_fcvtzu_ds, uint64_t, , helper_vfp_touizd) | ||
45 | DO_ZPZ_FP(sve_fcvtzu_dd, uint64_t, , vfp_float64_to_uint64_rtz) | ||
46 | |||
47 | +DO_ZPZ_FP(sve_frint_h, uint16_t, H1_2, helper_advsimd_rinth) | ||
48 | +DO_ZPZ_FP(sve_frint_s, uint32_t, H1_4, helper_rints) | ||
49 | +DO_ZPZ_FP(sve_frint_d, uint64_t, , helper_rintd) | ||
50 | + | ||
51 | +DO_ZPZ_FP(sve_frintx_h, uint16_t, H1_2, float16_round_to_int) | ||
52 | +DO_ZPZ_FP(sve_frintx_s, uint32_t, H1_4, float32_round_to_int) | ||
53 | +DO_ZPZ_FP(sve_frintx_d, uint64_t, , float64_round_to_int) | ||
54 | + | ||
55 | DO_ZPZ_FP(sve_scvt_hh, uint16_t, H1_2, int16_to_float16) | ||
56 | DO_ZPZ_FP(sve_scvt_sh, uint32_t, H1_4, int32_to_float16) | ||
57 | DO_ZPZ_FP(sve_scvt_ss, uint32_t, H1_4, int32_to_float32) | ||
58 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
59 | index XXXXXXX..XXXXXXX 100644 | ||
60 | --- a/target/arm/translate-sve.c | ||
61 | +++ b/target/arm/translate-sve.c | ||
62 | @@ -XXX,XX +XXX,XX @@ static bool trans_FCVTZU_dd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
63 | return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzu_dd); | ||
64 | } | ||
65 | |||
66 | +static gen_helper_gvec_3_ptr * const frint_fns[3] = { | ||
67 | + gen_helper_sve_frint_h, | ||
68 | + gen_helper_sve_frint_s, | ||
69 | + gen_helper_sve_frint_d | ||
70 | +}; | ||
71 | + | ||
72 | +static bool trans_FRINTI(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
73 | +{ | ||
74 | + if (a->esz == 0) { | ||
75 | + return false; | ||
76 | + } | ||
77 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16, | ||
78 | + frint_fns[a->esz - 1]); | ||
79 | +} | ||
80 | + | ||
81 | +static bool trans_FRINTX(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
82 | +{ | ||
83 | + static gen_helper_gvec_3_ptr * const fns[3] = { | ||
84 | + gen_helper_sve_frintx_h, | ||
85 | + gen_helper_sve_frintx_s, | ||
86 | + gen_helper_sve_frintx_d | ||
87 | + }; | ||
88 | + if (a->esz == 0) { | ||
89 | + return false; | ||
90 | + } | ||
91 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16, fns[a->esz - 1]); | ||
92 | +} | ||
93 | + | ||
94 | +static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, int mode) | ||
95 | +{ | ||
96 | + if (a->esz == 0) { | ||
97 | + return false; | ||
98 | + } | ||
99 | + if (sve_access_check(s)) { | ||
100 | + unsigned vsz = vec_full_reg_size(s); | ||
101 | + TCGv_i32 tmode = tcg_const_i32(mode); | ||
102 | + TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); | ||
103 | + | ||
104 | + gen_helper_set_rmode(tmode, tmode, status); | ||
105 | + | ||
106 | + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | ||
107 | + vec_full_reg_offset(s, a->rn), | ||
108 | + pred_full_reg_offset(s, a->pg), | ||
109 | + status, vsz, vsz, 0, frint_fns[a->esz - 1]); | ||
110 | + | ||
111 | + gen_helper_set_rmode(tmode, tmode, status); | ||
112 | + tcg_temp_free_i32(tmode); | ||
113 | + tcg_temp_free_ptr(status); | ||
114 | + } | ||
115 | + return true; | ||
116 | +} | ||
117 | + | ||
118 | +static bool trans_FRINTN(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
119 | +{ | ||
120 | + return do_frint_mode(s, a, float_round_nearest_even); | ||
121 | +} | ||
122 | + | ||
123 | +static bool trans_FRINTP(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
124 | +{ | ||
125 | + return do_frint_mode(s, a, float_round_up); | ||
126 | +} | ||
127 | + | ||
128 | +static bool trans_FRINTM(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
129 | +{ | ||
130 | + return do_frint_mode(s, a, float_round_down); | ||
131 | +} | ||
132 | + | ||
133 | +static bool trans_FRINTZ(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
134 | +{ | ||
135 | + return do_frint_mode(s, a, float_round_to_zero); | ||
136 | +} | ||
137 | + | ||
138 | +static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
139 | +{ | ||
140 | + return do_frint_mode(s, a, float_round_ties_away); | ||
141 | +} | ||
142 | + | ||
143 | static bool trans_SCVTF_hh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
144 | { | ||
145 | return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_scvt_hh); | ||
146 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
147 | index XXXXXXX..XXXXXXX 100644 | ||
148 | --- a/target/arm/sve.decode | ||
149 | +++ b/target/arm/sve.decode | ||
150 | @@ -XXX,XX +XXX,XX @@ FCVTZU_sd 01100101 11 011 10 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
151 | FCVTZS_dd 01100101 11 011 11 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
152 | FCVTZU_dd 01100101 11 011 11 1 101 ... ..... ..... @rd_pg_rn_e0 | ||
153 | |||
154 | +# SVE floating-point round to integral value | ||
155 | +FRINTN 01100101 .. 000 000 101 ... ..... ..... @rd_pg_rn | ||
156 | +FRINTP 01100101 .. 000 001 101 ... ..... ..... @rd_pg_rn | ||
157 | +FRINTM 01100101 .. 000 010 101 ... ..... ..... @rd_pg_rn | ||
158 | +FRINTZ 01100101 .. 000 011 101 ... ..... ..... @rd_pg_rn | ||
159 | +FRINTA 01100101 .. 000 100 101 ... ..... ..... @rd_pg_rn | ||
160 | +FRINTX 01100101 .. 000 110 101 ... ..... ..... @rd_pg_rn | ||
161 | +FRINTI 01100101 .. 000 111 101 ... ..... ..... @rd_pg_rn | ||
162 | + | ||
163 | # SVE integer convert to floating-point | ||
164 | SCVTF_hh 01100101 01 010 01 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
165 | SCVTF_sh 01100101 01 010 10 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
166 | -- | ||
167 | 2.17.1 | ||
168 | |||
169 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-27-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 14 ++++++++++++++ | ||
9 | target/arm/sve_helper.c | 8 ++++++++ | ||
10 | target/arm/translate-sve.c | 26 ++++++++++++++++++++++++++ | ||
11 | target/arm/sve.decode | 4 ++++ | ||
12 | 4 files changed, 52 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(sve_frintx_s, TCG_CALL_NO_RWG, | ||
19 | DEF_HELPER_FLAGS_5(sve_frintx_d, TCG_CALL_NO_RWG, | ||
20 | void, ptr, ptr, ptr, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_5(sve_frecpx_h, TCG_CALL_NO_RWG, | ||
23 | + void, ptr, ptr, ptr, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_5(sve_frecpx_s, TCG_CALL_NO_RWG, | ||
25 | + void, ptr, ptr, ptr, ptr, i32) | ||
26 | +DEF_HELPER_FLAGS_5(sve_frecpx_d, TCG_CALL_NO_RWG, | ||
27 | + void, ptr, ptr, ptr, ptr, i32) | ||
28 | + | ||
29 | +DEF_HELPER_FLAGS_5(sve_fsqrt_h, TCG_CALL_NO_RWG, | ||
30 | + void, ptr, ptr, ptr, ptr, i32) | ||
31 | +DEF_HELPER_FLAGS_5(sve_fsqrt_s, TCG_CALL_NO_RWG, | ||
32 | + void, ptr, ptr, ptr, ptr, i32) | ||
33 | +DEF_HELPER_FLAGS_5(sve_fsqrt_d, TCG_CALL_NO_RWG, | ||
34 | + void, ptr, ptr, ptr, ptr, i32) | ||
35 | + | ||
36 | DEF_HELPER_FLAGS_5(sve_scvt_hh, TCG_CALL_NO_RWG, | ||
37 | void, ptr, ptr, ptr, ptr, i32) | ||
38 | DEF_HELPER_FLAGS_5(sve_scvt_sh, TCG_CALL_NO_RWG, | ||
39 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
40 | index XXXXXXX..XXXXXXX 100644 | ||
41 | --- a/target/arm/sve_helper.c | ||
42 | +++ b/target/arm/sve_helper.c | ||
43 | @@ -XXX,XX +XXX,XX @@ DO_ZPZ_FP(sve_frintx_h, uint16_t, H1_2, float16_round_to_int) | ||
44 | DO_ZPZ_FP(sve_frintx_s, uint32_t, H1_4, float32_round_to_int) | ||
45 | DO_ZPZ_FP(sve_frintx_d, uint64_t, , float64_round_to_int) | ||
46 | |||
47 | +DO_ZPZ_FP(sve_frecpx_h, uint16_t, H1_2, helper_frecpx_f16) | ||
48 | +DO_ZPZ_FP(sve_frecpx_s, uint32_t, H1_4, helper_frecpx_f32) | ||
49 | +DO_ZPZ_FP(sve_frecpx_d, uint64_t, , helper_frecpx_f64) | ||
50 | + | ||
51 | +DO_ZPZ_FP(sve_fsqrt_h, uint16_t, H1_2, float16_sqrt) | ||
52 | +DO_ZPZ_FP(sve_fsqrt_s, uint32_t, H1_4, float32_sqrt) | ||
53 | +DO_ZPZ_FP(sve_fsqrt_d, uint64_t, , float64_sqrt) | ||
54 | + | ||
55 | DO_ZPZ_FP(sve_scvt_hh, uint16_t, H1_2, int16_to_float16) | ||
56 | DO_ZPZ_FP(sve_scvt_sh, uint32_t, H1_4, int32_to_float16) | ||
57 | DO_ZPZ_FP(sve_scvt_ss, uint32_t, H1_4, int32_to_float32) | ||
58 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
59 | index XXXXXXX..XXXXXXX 100644 | ||
60 | --- a/target/arm/translate-sve.c | ||
61 | +++ b/target/arm/translate-sve.c | ||
62 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
63 | return do_frint_mode(s, a, float_round_ties_away); | ||
64 | } | ||
65 | |||
66 | +static bool trans_FRECPX(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
67 | +{ | ||
68 | + static gen_helper_gvec_3_ptr * const fns[3] = { | ||
69 | + gen_helper_sve_frecpx_h, | ||
70 | + gen_helper_sve_frecpx_s, | ||
71 | + gen_helper_sve_frecpx_d | ||
72 | + }; | ||
73 | + if (a->esz == 0) { | ||
74 | + return false; | ||
75 | + } | ||
76 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16, fns[a->esz - 1]); | ||
77 | +} | ||
78 | + | ||
79 | +static bool trans_FSQRT(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
80 | +{ | ||
81 | + static gen_helper_gvec_3_ptr * const fns[3] = { | ||
82 | + gen_helper_sve_fsqrt_h, | ||
83 | + gen_helper_sve_fsqrt_s, | ||
84 | + gen_helper_sve_fsqrt_d | ||
85 | + }; | ||
86 | + if (a->esz == 0) { | ||
87 | + return false; | ||
88 | + } | ||
89 | + return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16, fns[a->esz - 1]); | ||
90 | +} | ||
91 | + | ||
92 | static bool trans_SCVTF_hh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
93 | { | ||
94 | return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_scvt_hh); | ||
95 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
96 | index XXXXXXX..XXXXXXX 100644 | ||
97 | --- a/target/arm/sve.decode | ||
98 | +++ b/target/arm/sve.decode | ||
99 | @@ -XXX,XX +XXX,XX @@ FRINTA 01100101 .. 000 100 101 ... ..... ..... @rd_pg_rn | ||
100 | FRINTX 01100101 .. 000 110 101 ... ..... ..... @rd_pg_rn | ||
101 | FRINTI 01100101 .. 000 111 101 ... ..... ..... @rd_pg_rn | ||
102 | |||
103 | +# SVE floating-point unary operations | ||
104 | +FRECPX 01100101 .. 001 100 101 ... ..... ..... @rd_pg_rn | ||
105 | +FSQRT 01100101 .. 001 101 101 ... ..... ..... @rd_pg_rn | ||
106 | + | ||
107 | # SVE integer convert to floating-point | ||
108 | SCVTF_hh 01100101 01 010 01 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
109 | SCVTF_sh 01100101 01 010 10 0 101 ... ..... ..... @rd_pg_rn_e0 | ||
110 | -- | ||
111 | 2.17.1 | ||
112 | |||
113 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-28-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 60 +++++++++++++++++++++++++++++++++++++- | ||
9 | target/arm/sve.decode | 7 +++++ | ||
10 | 2 files changed, 66 insertions(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
13 | index XXXXXXX..XXXXXXX 100644 | ||
14 | --- a/target/arm/translate-sve.c | ||
15 | +++ b/target/arm/translate-sve.c | ||
16 | @@ -XXX,XX +XXX,XX @@ static bool do_zpzz_ool(DisasContext *s, arg_rprr_esz *a, gen_helper_gvec_4 *fn) | ||
17 | return true; | ||
18 | } | ||
19 | |||
20 | +/* Select active elememnts from Zn and inactive elements from Zm, | ||
21 | + * storing the result in Zd. | ||
22 | + */ | ||
23 | +static void do_sel_z(DisasContext *s, int rd, int rn, int rm, int pg, int esz) | ||
24 | +{ | ||
25 | + static gen_helper_gvec_4 * const fns[4] = { | ||
26 | + gen_helper_sve_sel_zpzz_b, gen_helper_sve_sel_zpzz_h, | ||
27 | + gen_helper_sve_sel_zpzz_s, gen_helper_sve_sel_zpzz_d | ||
28 | + }; | ||
29 | + unsigned vsz = vec_full_reg_size(s); | ||
30 | + tcg_gen_gvec_4_ool(vec_full_reg_offset(s, rd), | ||
31 | + vec_full_reg_offset(s, rn), | ||
32 | + vec_full_reg_offset(s, rm), | ||
33 | + pred_full_reg_offset(s, pg), | ||
34 | + vsz, vsz, 0, fns[esz]); | ||
35 | +} | ||
36 | + | ||
37 | #define DO_ZPZZ(NAME, name) \ | ||
38 | static bool trans_##NAME##_zpzz(DisasContext *s, arg_rprr_esz *a, \ | ||
39 | uint32_t insn) \ | ||
40 | @@ -XXX,XX +XXX,XX @@ static bool trans_UDIV_zpzz(DisasContext *s, arg_rprr_esz *a, uint32_t insn) | ||
41 | return do_zpzz_ool(s, a, fns[a->esz]); | ||
42 | } | ||
43 | |||
44 | -DO_ZPZZ(SEL, sel) | ||
45 | +static bool trans_SEL_zpzz(DisasContext *s, arg_rprr_esz *a, uint32_t insn) | ||
46 | +{ | ||
47 | + if (sve_access_check(s)) { | ||
48 | + do_sel_z(s, a->rd, a->rn, a->rm, a->pg, a->esz); | ||
49 | + } | ||
50 | + return true; | ||
51 | +} | ||
52 | |||
53 | #undef DO_ZPZZ | ||
54 | |||
55 | @@ -XXX,XX +XXX,XX @@ static bool trans_PRF_rr(DisasContext *s, arg_PRF_rr *a, uint32_t insn) | ||
56 | sve_access_check(s); | ||
57 | return true; | ||
58 | } | ||
59 | + | ||
60 | +/* | ||
61 | + * Move Prefix | ||
62 | + * | ||
63 | + * TODO: The implementation so far could handle predicated merging movprfx. | ||
64 | + * The helper functions as written take an extra source register to | ||
65 | + * use in the operation, but the result is only written when predication | ||
66 | + * succeeds. For unpredicated movprfx, we need to rearrange the helpers | ||
67 | + * to allow the final write back to the destination to be unconditional. | ||
68 | + * For predicated zeroing movprfx, we need to rearrange the helpers to | ||
69 | + * allow the final write back to zero inactives. | ||
70 | + * | ||
71 | + * In the meantime, just emit the moves. | ||
72 | + */ | ||
73 | + | ||
74 | +static bool trans_MOVPRFX(DisasContext *s, arg_MOVPRFX *a, uint32_t insn) | ||
75 | +{ | ||
76 | + return do_mov_z(s, a->rd, a->rn); | ||
77 | +} | ||
78 | + | ||
79 | +static bool trans_MOVPRFX_m(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
80 | +{ | ||
81 | + if (sve_access_check(s)) { | ||
82 | + do_sel_z(s, a->rd, a->rn, a->rd, a->pg, a->esz); | ||
83 | + } | ||
84 | + return true; | ||
85 | +} | ||
86 | + | ||
87 | +static bool trans_MOVPRFX_z(DisasContext *s, arg_rpr_esz *a, uint32_t insn) | ||
88 | +{ | ||
89 | + if (sve_access_check(s)) { | ||
90 | + do_movz_zpz(s, a->rd, a->rn, a->pg, a->esz); | ||
91 | + } | ||
92 | + return true; | ||
93 | +} | ||
94 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
95 | index XXXXXXX..XXXXXXX 100644 | ||
96 | --- a/target/arm/sve.decode | ||
97 | +++ b/target/arm/sve.decode | ||
98 | @@ -XXX,XX +XXX,XX @@ ORV 00000100 .. 011 000 001 ... ..... ..... @rd_pg_rn | ||
99 | EORV 00000100 .. 011 001 001 ... ..... ..... @rd_pg_rn | ||
100 | ANDV 00000100 .. 011 010 001 ... ..... ..... @rd_pg_rn | ||
101 | |||
102 | +# SVE constructive prefix (predicated) | ||
103 | +MOVPRFX_z 00000100 .. 010 000 001 ... ..... ..... @rd_pg_rn | ||
104 | +MOVPRFX_m 00000100 .. 010 001 001 ... ..... ..... @rd_pg_rn | ||
105 | + | ||
106 | # SVE integer add reduction (predicated) | ||
107 | # Note that saddv requires size != 3. | ||
108 | UADDV 00000100 .. 000 001 001 ... ..... ..... @rd_pg_rn | ||
109 | @@ -XXX,XX +XXX,XX @@ ADR_p64 00000100 11 1 ..... 1010 .. ..... ..... @rd_rn_msz_rm | ||
110 | |||
111 | ### SVE Integer Misc - Unpredicated Group | ||
112 | |||
113 | +# SVE constructive prefix (unpredicated) | ||
114 | +MOVPRFX 00000100 00 1 00000 101111 rn:5 rd:5 | ||
115 | + | ||
116 | # SVE floating-point exponential accelerator | ||
117 | # Note esz != 0 | ||
118 | FEXPA 00000100 .. 1 00000 101110 ..... ..... @rd_rn | ||
119 | -- | ||
120 | 2.17.1 | ||
121 | |||
122 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-29-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 7 +++ | ||
9 | target/arm/sve_helper.c | 100 +++++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 24 +++++++++ | ||
11 | target/arm/sve.decode | 4 ++ | ||
12 | 4 files changed, 135 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_6(sve_facgt_s, TCG_CALL_NO_RWG, | ||
19 | DEF_HELPER_FLAGS_6(sve_facgt_d, TCG_CALL_NO_RWG, | ||
20 | void, ptr, ptr, ptr, ptr, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_6(sve_fcadd_h, TCG_CALL_NO_RWG, | ||
23 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_6(sve_fcadd_s, TCG_CALL_NO_RWG, | ||
25 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
26 | +DEF_HELPER_FLAGS_6(sve_fcadd_d, TCG_CALL_NO_RWG, | ||
27 | + void, ptr, ptr, ptr, ptr, ptr, i32) | ||
28 | + | ||
29 | DEF_HELPER_FLAGS_3(sve_fmla_zpzzz_h, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
30 | DEF_HELPER_FLAGS_3(sve_fmla_zpzzz_s, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
31 | DEF_HELPER_FLAGS_3(sve_fmla_zpzzz_d, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
32 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
33 | index XXXXXXX..XXXXXXX 100644 | ||
34 | --- a/target/arm/sve_helper.c | ||
35 | +++ b/target/arm/sve_helper.c | ||
36 | @@ -XXX,XX +XXX,XX @@ void HELPER(sve_ftmad_d)(void *vd, void *vn, void *vm, void *vs, uint32_t desc) | ||
37 | } | ||
38 | } | ||
39 | |||
40 | +/* | ||
41 | + * FP Complex Add | ||
42 | + */ | ||
43 | + | ||
44 | +void HELPER(sve_fcadd_h)(void *vd, void *vn, void *vm, void *vg, | ||
45 | + void *vs, uint32_t desc) | ||
46 | +{ | ||
47 | + intptr_t j, i = simd_oprsz(desc); | ||
48 | + uint64_t *g = vg; | ||
49 | + float16 neg_imag = float16_set_sign(0, simd_data(desc)); | ||
50 | + float16 neg_real = float16_chs(neg_imag); | ||
51 | + | ||
52 | + do { | ||
53 | + uint64_t pg = g[(i - 1) >> 6]; | ||
54 | + do { | ||
55 | + float16 e0, e1, e2, e3; | ||
56 | + | ||
57 | + /* I holds the real index; J holds the imag index. */ | ||
58 | + j = i - sizeof(float16); | ||
59 | + i -= 2 * sizeof(float16); | ||
60 | + | ||
61 | + e0 = *(float16 *)(vn + H1_2(i)); | ||
62 | + e1 = *(float16 *)(vm + H1_2(j)) ^ neg_real; | ||
63 | + e2 = *(float16 *)(vn + H1_2(j)); | ||
64 | + e3 = *(float16 *)(vm + H1_2(i)) ^ neg_imag; | ||
65 | + | ||
66 | + if (likely((pg >> (i & 63)) & 1)) { | ||
67 | + *(float16 *)(vd + H1_2(i)) = float16_add(e0, e1, vs); | ||
68 | + } | ||
69 | + if (likely((pg >> (j & 63)) & 1)) { | ||
70 | + *(float16 *)(vd + H1_2(j)) = float16_add(e2, e3, vs); | ||
71 | + } | ||
72 | + } while (i & 63); | ||
73 | + } while (i != 0); | ||
74 | +} | ||
75 | + | ||
76 | +void HELPER(sve_fcadd_s)(void *vd, void *vn, void *vm, void *vg, | ||
77 | + void *vs, uint32_t desc) | ||
78 | +{ | ||
79 | + intptr_t j, i = simd_oprsz(desc); | ||
80 | + uint64_t *g = vg; | ||
81 | + float32 neg_imag = float32_set_sign(0, simd_data(desc)); | ||
82 | + float32 neg_real = float32_chs(neg_imag); | ||
83 | + | ||
84 | + do { | ||
85 | + uint64_t pg = g[(i - 1) >> 6]; | ||
86 | + do { | ||
87 | + float32 e0, e1, e2, e3; | ||
88 | + | ||
89 | + /* I holds the real index; J holds the imag index. */ | ||
90 | + j = i - sizeof(float32); | ||
91 | + i -= 2 * sizeof(float32); | ||
92 | + | ||
93 | + e0 = *(float32 *)(vn + H1_2(i)); | ||
94 | + e1 = *(float32 *)(vm + H1_2(j)) ^ neg_real; | ||
95 | + e2 = *(float32 *)(vn + H1_2(j)); | ||
96 | + e3 = *(float32 *)(vm + H1_2(i)) ^ neg_imag; | ||
97 | + | ||
98 | + if (likely((pg >> (i & 63)) & 1)) { | ||
99 | + *(float32 *)(vd + H1_2(i)) = float32_add(e0, e1, vs); | ||
100 | + } | ||
101 | + if (likely((pg >> (j & 63)) & 1)) { | ||
102 | + *(float32 *)(vd + H1_2(j)) = float32_add(e2, e3, vs); | ||
103 | + } | ||
104 | + } while (i & 63); | ||
105 | + } while (i != 0); | ||
106 | +} | ||
107 | + | ||
108 | +void HELPER(sve_fcadd_d)(void *vd, void *vn, void *vm, void *vg, | ||
109 | + void *vs, uint32_t desc) | ||
110 | +{ | ||
111 | + intptr_t j, i = simd_oprsz(desc); | ||
112 | + uint64_t *g = vg; | ||
113 | + float64 neg_imag = float64_set_sign(0, simd_data(desc)); | ||
114 | + float64 neg_real = float64_chs(neg_imag); | ||
115 | + | ||
116 | + do { | ||
117 | + uint64_t pg = g[(i - 1) >> 6]; | ||
118 | + do { | ||
119 | + float64 e0, e1, e2, e3; | ||
120 | + | ||
121 | + /* I holds the real index; J holds the imag index. */ | ||
122 | + j = i - sizeof(float64); | ||
123 | + i -= 2 * sizeof(float64); | ||
124 | + | ||
125 | + e0 = *(float64 *)(vn + H1_2(i)); | ||
126 | + e1 = *(float64 *)(vm + H1_2(j)) ^ neg_real; | ||
127 | + e2 = *(float64 *)(vn + H1_2(j)); | ||
128 | + e3 = *(float64 *)(vm + H1_2(i)) ^ neg_imag; | ||
129 | + | ||
130 | + if (likely((pg >> (i & 63)) & 1)) { | ||
131 | + *(float64 *)(vd + H1_2(i)) = float64_add(e0, e1, vs); | ||
132 | + } | ||
133 | + if (likely((pg >> (j & 63)) & 1)) { | ||
134 | + *(float64 *)(vd + H1_2(j)) = float64_add(e2, e3, vs); | ||
135 | + } | ||
136 | + } while (i & 63); | ||
137 | + } while (i != 0); | ||
138 | +} | ||
139 | + | ||
140 | /* | ||
141 | * Load contiguous data, protected by a governing predicate. | ||
142 | */ | ||
143 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
144 | index XXXXXXX..XXXXXXX 100644 | ||
145 | --- a/target/arm/translate-sve.c | ||
146 | +++ b/target/arm/translate-sve.c | ||
147 | @@ -XXX,XX +XXX,XX @@ DO_FPCMP(FACGT, facgt) | ||
148 | |||
149 | #undef DO_FPCMP | ||
150 | |||
151 | +static bool trans_FCADD(DisasContext *s, arg_FCADD *a, uint32_t insn) | ||
152 | +{ | ||
153 | + static gen_helper_gvec_4_ptr * const fns[3] = { | ||
154 | + gen_helper_sve_fcadd_h, | ||
155 | + gen_helper_sve_fcadd_s, | ||
156 | + gen_helper_sve_fcadd_d | ||
157 | + }; | ||
158 | + | ||
159 | + if (a->esz == 0) { | ||
160 | + return false; | ||
161 | + } | ||
162 | + if (sve_access_check(s)) { | ||
163 | + unsigned vsz = vec_full_reg_size(s); | ||
164 | + TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); | ||
165 | + tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), | ||
166 | + vec_full_reg_offset(s, a->rn), | ||
167 | + vec_full_reg_offset(s, a->rm), | ||
168 | + pred_full_reg_offset(s, a->pg), | ||
169 | + status, vsz, vsz, a->rot, fns[a->esz - 1]); | ||
170 | + tcg_temp_free_ptr(status); | ||
171 | + } | ||
172 | + return true; | ||
173 | +} | ||
174 | + | ||
175 | typedef void gen_helper_sve_fmla(TCGv_env, TCGv_ptr, TCGv_i32); | ||
176 | |||
177 | static bool do_fmla(DisasContext *s, arg_rprrr_esz *a, gen_helper_sve_fmla *fn) | ||
178 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
179 | index XXXXXXX..XXXXXXX 100644 | ||
180 | --- a/target/arm/sve.decode | ||
181 | +++ b/target/arm/sve.decode | ||
182 | @@ -XXX,XX +XXX,XX @@ UMIN_zzi 00100101 .. 101 011 110 ........ ..... @rdn_i8u | ||
183 | # SVE integer multiply immediate (unpredicated) | ||
184 | MUL_zzi 00100101 .. 110 000 110 ........ ..... @rdn_i8s | ||
185 | |||
186 | +# SVE floating-point complex add (predicated) | ||
187 | +FCADD 01100100 esz:2 00000 rot:1 100 pg:3 rm:5 rd:5 \ | ||
188 | + rn=%reg_movprfx | ||
189 | + | ||
190 | ### SVE FP Multiply-Add Indexed Group | ||
191 | |||
192 | # SVE floating-point multiply-add (indexed) | ||
193 | -- | ||
194 | 2.17.1 | ||
195 | |||
196 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-30-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper-sve.h | 4 + | ||
9 | target/arm/sve_helper.c | 162 +++++++++++++++++++++++++++++++++++++ | ||
10 | target/arm/translate-sve.c | 37 +++++++++ | ||
11 | target/arm/sve.decode | 4 + | ||
12 | 4 files changed, 207 insertions(+) | ||
13 | |||
14 | diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper-sve.h | ||
17 | +++ b/target/arm/helper-sve.h | ||
18 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_3(sve_fnmls_zpzzz_h, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
19 | DEF_HELPER_FLAGS_3(sve_fnmls_zpzzz_s, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
20 | DEF_HELPER_FLAGS_3(sve_fnmls_zpzzz_d, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
21 | |||
22 | +DEF_HELPER_FLAGS_3(sve_fcmla_zpzzz_h, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
23 | +DEF_HELPER_FLAGS_3(sve_fcmla_zpzzz_s, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
24 | +DEF_HELPER_FLAGS_3(sve_fcmla_zpzzz_d, TCG_CALL_NO_RWG, void, env, ptr, i32) | ||
25 | + | ||
26 | DEF_HELPER_FLAGS_5(sve_ftmad_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) | ||
27 | DEF_HELPER_FLAGS_5(sve_ftmad_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) | ||
28 | DEF_HELPER_FLAGS_5(sve_ftmad_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) | ||
29 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | ||
30 | index XXXXXXX..XXXXXXX 100644 | ||
31 | --- a/target/arm/sve_helper.c | ||
32 | +++ b/target/arm/sve_helper.c | ||
33 | @@ -XXX,XX +XXX,XX @@ void HELPER(sve_fcadd_d)(void *vd, void *vn, void *vm, void *vg, | ||
34 | } while (i != 0); | ||
35 | } | ||
36 | |||
37 | +/* | ||
38 | + * FP Complex Multiply | ||
39 | + */ | ||
40 | + | ||
41 | +QEMU_BUILD_BUG_ON(SIMD_DATA_SHIFT + 22 > 32); | ||
42 | + | ||
43 | +void HELPER(sve_fcmla_zpzzz_h)(CPUARMState *env, void *vg, uint32_t desc) | ||
44 | +{ | ||
45 | + intptr_t j, i = simd_oprsz(desc); | ||
46 | + unsigned rd = extract32(desc, SIMD_DATA_SHIFT, 5); | ||
47 | + unsigned rn = extract32(desc, SIMD_DATA_SHIFT + 5, 5); | ||
48 | + unsigned rm = extract32(desc, SIMD_DATA_SHIFT + 10, 5); | ||
49 | + unsigned ra = extract32(desc, SIMD_DATA_SHIFT + 15, 5); | ||
50 | + unsigned rot = extract32(desc, SIMD_DATA_SHIFT + 20, 2); | ||
51 | + bool flip = rot & 1; | ||
52 | + float16 neg_imag, neg_real; | ||
53 | + void *vd = &env->vfp.zregs[rd]; | ||
54 | + void *vn = &env->vfp.zregs[rn]; | ||
55 | + void *vm = &env->vfp.zregs[rm]; | ||
56 | + void *va = &env->vfp.zregs[ra]; | ||
57 | + uint64_t *g = vg; | ||
58 | + | ||
59 | + neg_imag = float16_set_sign(0, (rot & 2) != 0); | ||
60 | + neg_real = float16_set_sign(0, rot == 1 || rot == 2); | ||
61 | + | ||
62 | + do { | ||
63 | + uint64_t pg = g[(i - 1) >> 6]; | ||
64 | + do { | ||
65 | + float16 e1, e2, e3, e4, nr, ni, mr, mi, d; | ||
66 | + | ||
67 | + /* I holds the real index; J holds the imag index. */ | ||
68 | + j = i - sizeof(float16); | ||
69 | + i -= 2 * sizeof(float16); | ||
70 | + | ||
71 | + nr = *(float16 *)(vn + H1_2(i)); | ||
72 | + ni = *(float16 *)(vn + H1_2(j)); | ||
73 | + mr = *(float16 *)(vm + H1_2(i)); | ||
74 | + mi = *(float16 *)(vm + H1_2(j)); | ||
75 | + | ||
76 | + e2 = (flip ? ni : nr); | ||
77 | + e1 = (flip ? mi : mr) ^ neg_real; | ||
78 | + e4 = e2; | ||
79 | + e3 = (flip ? mr : mi) ^ neg_imag; | ||
80 | + | ||
81 | + if (likely((pg >> (i & 63)) & 1)) { | ||
82 | + d = *(float16 *)(va + H1_2(i)); | ||
83 | + d = float16_muladd(e2, e1, d, 0, &env->vfp.fp_status_f16); | ||
84 | + *(float16 *)(vd + H1_2(i)) = d; | ||
85 | + } | ||
86 | + if (likely((pg >> (j & 63)) & 1)) { | ||
87 | + d = *(float16 *)(va + H1_2(j)); | ||
88 | + d = float16_muladd(e4, e3, d, 0, &env->vfp.fp_status_f16); | ||
89 | + *(float16 *)(vd + H1_2(j)) = d; | ||
90 | + } | ||
91 | + } while (i & 63); | ||
92 | + } while (i != 0); | ||
93 | +} | ||
94 | + | ||
95 | +void HELPER(sve_fcmla_zpzzz_s)(CPUARMState *env, void *vg, uint32_t desc) | ||
96 | +{ | ||
97 | + intptr_t j, i = simd_oprsz(desc); | ||
98 | + unsigned rd = extract32(desc, SIMD_DATA_SHIFT, 5); | ||
99 | + unsigned rn = extract32(desc, SIMD_DATA_SHIFT + 5, 5); | ||
100 | + unsigned rm = extract32(desc, SIMD_DATA_SHIFT + 10, 5); | ||
101 | + unsigned ra = extract32(desc, SIMD_DATA_SHIFT + 15, 5); | ||
102 | + unsigned rot = extract32(desc, SIMD_DATA_SHIFT + 20, 2); | ||
103 | + bool flip = rot & 1; | ||
104 | + float32 neg_imag, neg_real; | ||
105 | + void *vd = &env->vfp.zregs[rd]; | ||
106 | + void *vn = &env->vfp.zregs[rn]; | ||
107 | + void *vm = &env->vfp.zregs[rm]; | ||
108 | + void *va = &env->vfp.zregs[ra]; | ||
109 | + uint64_t *g = vg; | ||
110 | + | ||
111 | + neg_imag = float32_set_sign(0, (rot & 2) != 0); | ||
112 | + neg_real = float32_set_sign(0, rot == 1 || rot == 2); | ||
113 | + | ||
114 | + do { | ||
115 | + uint64_t pg = g[(i - 1) >> 6]; | ||
116 | + do { | ||
117 | + float32 e1, e2, e3, e4, nr, ni, mr, mi, d; | ||
118 | + | ||
119 | + /* I holds the real index; J holds the imag index. */ | ||
120 | + j = i - sizeof(float32); | ||
121 | + i -= 2 * sizeof(float32); | ||
122 | + | ||
123 | + nr = *(float32 *)(vn + H1_2(i)); | ||
124 | + ni = *(float32 *)(vn + H1_2(j)); | ||
125 | + mr = *(float32 *)(vm + H1_2(i)); | ||
126 | + mi = *(float32 *)(vm + H1_2(j)); | ||
127 | + | ||
128 | + e2 = (flip ? ni : nr); | ||
129 | + e1 = (flip ? mi : mr) ^ neg_real; | ||
130 | + e4 = e2; | ||
131 | + e3 = (flip ? mr : mi) ^ neg_imag; | ||
132 | + | ||
133 | + if (likely((pg >> (i & 63)) & 1)) { | ||
134 | + d = *(float32 *)(va + H1_2(i)); | ||
135 | + d = float32_muladd(e2, e1, d, 0, &env->vfp.fp_status); | ||
136 | + *(float32 *)(vd + H1_2(i)) = d; | ||
137 | + } | ||
138 | + if (likely((pg >> (j & 63)) & 1)) { | ||
139 | + d = *(float32 *)(va + H1_2(j)); | ||
140 | + d = float32_muladd(e4, e3, d, 0, &env->vfp.fp_status); | ||
141 | + *(float32 *)(vd + H1_2(j)) = d; | ||
142 | + } | ||
143 | + } while (i & 63); | ||
144 | + } while (i != 0); | ||
145 | +} | ||
146 | + | ||
147 | +void HELPER(sve_fcmla_zpzzz_d)(CPUARMState *env, void *vg, uint32_t desc) | ||
148 | +{ | ||
149 | + intptr_t j, i = simd_oprsz(desc); | ||
150 | + unsigned rd = extract32(desc, SIMD_DATA_SHIFT, 5); | ||
151 | + unsigned rn = extract32(desc, SIMD_DATA_SHIFT + 5, 5); | ||
152 | + unsigned rm = extract32(desc, SIMD_DATA_SHIFT + 10, 5); | ||
153 | + unsigned ra = extract32(desc, SIMD_DATA_SHIFT + 15, 5); | ||
154 | + unsigned rot = extract32(desc, SIMD_DATA_SHIFT + 20, 2); | ||
155 | + bool flip = rot & 1; | ||
156 | + float64 neg_imag, neg_real; | ||
157 | + void *vd = &env->vfp.zregs[rd]; | ||
158 | + void *vn = &env->vfp.zregs[rn]; | ||
159 | + void *vm = &env->vfp.zregs[rm]; | ||
160 | + void *va = &env->vfp.zregs[ra]; | ||
161 | + uint64_t *g = vg; | ||
162 | + | ||
163 | + neg_imag = float64_set_sign(0, (rot & 2) != 0); | ||
164 | + neg_real = float64_set_sign(0, rot == 1 || rot == 2); | ||
165 | + | ||
166 | + do { | ||
167 | + uint64_t pg = g[(i - 1) >> 6]; | ||
168 | + do { | ||
169 | + float64 e1, e2, e3, e4, nr, ni, mr, mi, d; | ||
170 | + | ||
171 | + /* I holds the real index; J holds the imag index. */ | ||
172 | + j = i - sizeof(float64); | ||
173 | + i -= 2 * sizeof(float64); | ||
174 | + | ||
175 | + nr = *(float64 *)(vn + H1_2(i)); | ||
176 | + ni = *(float64 *)(vn + H1_2(j)); | ||
177 | + mr = *(float64 *)(vm + H1_2(i)); | ||
178 | + mi = *(float64 *)(vm + H1_2(j)); | ||
179 | + | ||
180 | + e2 = (flip ? ni : nr); | ||
181 | + e1 = (flip ? mi : mr) ^ neg_real; | ||
182 | + e4 = e2; | ||
183 | + e3 = (flip ? mr : mi) ^ neg_imag; | ||
184 | + | ||
185 | + if (likely((pg >> (i & 63)) & 1)) { | ||
186 | + d = *(float64 *)(va + H1_2(i)); | ||
187 | + d = float64_muladd(e2, e1, d, 0, &env->vfp.fp_status); | ||
188 | + *(float64 *)(vd + H1_2(i)) = d; | ||
189 | + } | ||
190 | + if (likely((pg >> (j & 63)) & 1)) { | ||
191 | + d = *(float64 *)(va + H1_2(j)); | ||
192 | + d = float64_muladd(e4, e3, d, 0, &env->vfp.fp_status); | ||
193 | + *(float64 *)(vd + H1_2(j)) = d; | ||
194 | + } | ||
195 | + } while (i & 63); | ||
196 | + } while (i != 0); | ||
197 | +} | ||
198 | + | ||
199 | /* | ||
200 | * Load contiguous data, protected by a governing predicate. | ||
201 | */ | ||
202 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
203 | index XXXXXXX..XXXXXXX 100644 | ||
204 | --- a/target/arm/translate-sve.c | ||
205 | +++ b/target/arm/translate-sve.c | ||
206 | @@ -XXX,XX +XXX,XX @@ DO_FMLA(FNMLS_zpzzz, fnmls_zpzzz) | ||
207 | |||
208 | #undef DO_FMLA | ||
209 | |||
210 | +static bool trans_FCMLA_zpzzz(DisasContext *s, | ||
211 | + arg_FCMLA_zpzzz *a, uint32_t insn) | ||
212 | +{ | ||
213 | + static gen_helper_sve_fmla * const fns[3] = { | ||
214 | + gen_helper_sve_fcmla_zpzzz_h, | ||
215 | + gen_helper_sve_fcmla_zpzzz_s, | ||
216 | + gen_helper_sve_fcmla_zpzzz_d, | ||
217 | + }; | ||
218 | + | ||
219 | + if (a->esz == 0) { | ||
220 | + return false; | ||
221 | + } | ||
222 | + if (sve_access_check(s)) { | ||
223 | + unsigned vsz = vec_full_reg_size(s); | ||
224 | + unsigned desc; | ||
225 | + TCGv_i32 t_desc; | ||
226 | + TCGv_ptr pg = tcg_temp_new_ptr(); | ||
227 | + | ||
228 | + /* We would need 7 operands to pass these arguments "properly". | ||
229 | + * So we encode all the register numbers into the descriptor. | ||
230 | + */ | ||
231 | + desc = deposit32(a->rd, 5, 5, a->rn); | ||
232 | + desc = deposit32(desc, 10, 5, a->rm); | ||
233 | + desc = deposit32(desc, 15, 5, a->ra); | ||
234 | + desc = deposit32(desc, 20, 2, a->rot); | ||
235 | + desc = sextract32(desc, 0, 22); | ||
236 | + desc = simd_desc(vsz, vsz, desc); | ||
237 | + | ||
238 | + t_desc = tcg_const_i32(desc); | ||
239 | + tcg_gen_addi_ptr(pg, cpu_env, pred_full_reg_offset(s, a->pg)); | ||
240 | + fns[a->esz - 1](cpu_env, pg, t_desc); | ||
241 | + tcg_temp_free_i32(t_desc); | ||
242 | + tcg_temp_free_ptr(pg); | ||
243 | + } | ||
244 | + return true; | ||
245 | +} | ||
246 | + | ||
247 | /* | ||
248 | *** SVE Floating Point Unary Operations Predicated Group | ||
249 | */ | ||
250 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
251 | index XXXXXXX..XXXXXXX 100644 | ||
252 | --- a/target/arm/sve.decode | ||
253 | +++ b/target/arm/sve.decode | ||
254 | @@ -XXX,XX +XXX,XX @@ MUL_zzi 00100101 .. 110 000 110 ........ ..... @rdn_i8s | ||
255 | FCADD 01100100 esz:2 00000 rot:1 100 pg:3 rm:5 rd:5 \ | ||
256 | rn=%reg_movprfx | ||
257 | |||
258 | +# SVE floating-point complex multiply-add (predicated) | ||
259 | +FCMLA_zpzzz 01100100 esz:2 0 rm:5 0 rot:2 pg:3 rn:5 rd:5 \ | ||
260 | + ra=%reg_movprfx | ||
261 | + | ||
262 | ### SVE FP Multiply-Add Indexed Group | ||
263 | |||
264 | # SVE floating-point multiply-add (indexed) | ||
265 | -- | ||
266 | 2.17.1 | ||
267 | |||
268 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | For aa64 advsimd, we had been passing the pre-indexed vector. | ||
4 | However, sve applies the index to each 128-bit segment, so we | ||
5 | need to pass in the index separately. | ||
6 | |||
7 | For aa32 advsimd, the fp32 operation always has index 0, but | ||
8 | we failed to interpret the fp16 index correctly. | ||
9 | |||
10 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
11 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
13 | Message-id: 20180627043328.11531-31-richard.henderson@linaro.org | ||
14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
15 | --- | ||
16 | target/arm/translate-a64.c | 21 ++++++++++++--------- | ||
17 | target/arm/translate.c | 32 +++++++++++++++++++++++--------- | ||
18 | target/arm/vec_helper.c | 10 ++++++---- | ||
19 | 3 files changed, 41 insertions(+), 22 deletions(-) | ||
20 | |||
21 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | ||
22 | index XXXXXXX..XXXXXXX 100644 | ||
23 | --- a/target/arm/translate-a64.c | ||
24 | +++ b/target/arm/translate-a64.c | ||
25 | @@ -XXX,XX +XXX,XX @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) | ||
26 | case 0x13: /* FCMLA #90 */ | ||
27 | case 0x15: /* FCMLA #180 */ | ||
28 | case 0x17: /* FCMLA #270 */ | ||
29 | - tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, rd), | ||
30 | - vec_full_reg_offset(s, rn), | ||
31 | - vec_reg_offset(s, rm, index, size), fpst, | ||
32 | - is_q ? 16 : 8, vec_full_reg_size(s), | ||
33 | - extract32(insn, 13, 2), /* rot */ | ||
34 | - size == MO_64 | ||
35 | - ? gen_helper_gvec_fcmlas_idx | ||
36 | - : gen_helper_gvec_fcmlah_idx); | ||
37 | - tcg_temp_free_ptr(fpst); | ||
38 | + { | ||
39 | + int rot = extract32(insn, 13, 2); | ||
40 | + int data = (index << 2) | rot; | ||
41 | + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, rd), | ||
42 | + vec_full_reg_offset(s, rn), | ||
43 | + vec_full_reg_offset(s, rm), fpst, | ||
44 | + is_q ? 16 : 8, vec_full_reg_size(s), data, | ||
45 | + size == MO_64 | ||
46 | + ? gen_helper_gvec_fcmlas_idx | ||
47 | + : gen_helper_gvec_fcmlah_idx); | ||
48 | + tcg_temp_free_ptr(fpst); | ||
49 | + } | ||
50 | return; | ||
51 | } | ||
52 | |||
53 | diff --git a/target/arm/translate.c b/target/arm/translate.c | ||
54 | index XXXXXXX..XXXXXXX 100644 | ||
55 | --- a/target/arm/translate.c | ||
56 | +++ b/target/arm/translate.c | ||
57 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_insn_3same_ext(DisasContext *s, uint32_t insn) | ||
58 | |||
59 | static int disas_neon_insn_2reg_scalar_ext(DisasContext *s, uint32_t insn) | ||
60 | { | ||
61 | - int rd, rn, rm, rot, size, opr_sz; | ||
62 | + gen_helper_gvec_3_ptr *fn_gvec_ptr; | ||
63 | + int rd, rn, rm, opr_sz, data; | ||
64 | TCGv_ptr fpst; | ||
65 | bool q; | ||
66 | |||
67 | q = extract32(insn, 6, 1); | ||
68 | VFP_DREG_D(rd, insn); | ||
69 | VFP_DREG_N(rn, insn); | ||
70 | - VFP_DREG_M(rm, insn); | ||
71 | if ((rd | rn) & q) { | ||
72 | return 1; | ||
73 | } | ||
74 | |||
75 | if ((insn & 0xff000f10) == 0xfe000800) { | ||
76 | /* VCMLA (indexed) -- 1111 1110 S.RR .... .... 1000 ...0 .... */ | ||
77 | - rot = extract32(insn, 20, 2); | ||
78 | - size = extract32(insn, 23, 1); | ||
79 | - if (!arm_dc_feature(s, ARM_FEATURE_V8_FCMA) | ||
80 | - || (!size && !arm_dc_feature(s, ARM_FEATURE_V8_FP16))) { | ||
81 | + int rot = extract32(insn, 20, 2); | ||
82 | + int size = extract32(insn, 23, 1); | ||
83 | + int index; | ||
84 | + | ||
85 | + if (!arm_dc_feature(s, ARM_FEATURE_V8_FCMA)) { | ||
86 | return 1; | ||
87 | } | ||
88 | + if (size == 0) { | ||
89 | + if (!arm_dc_feature(s, ARM_FEATURE_V8_FP16)) { | ||
90 | + return 1; | ||
91 | + } | ||
92 | + /* For fp16, rm is just Vm, and index is M. */ | ||
93 | + rm = extract32(insn, 0, 4); | ||
94 | + index = extract32(insn, 5, 1); | ||
95 | + } else { | ||
96 | + /* For fp32, rm is the usual M:Vm, and index is 0. */ | ||
97 | + VFP_DREG_M(rm, insn); | ||
98 | + index = 0; | ||
99 | + } | ||
100 | + data = (index << 2) | rot; | ||
101 | + fn_gvec_ptr = (size ? gen_helper_gvec_fcmlas_idx | ||
102 | + : gen_helper_gvec_fcmlah_idx); | ||
103 | } else { | ||
104 | return 1; | ||
105 | } | ||
106 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_insn_2reg_scalar_ext(DisasContext *s, uint32_t insn) | ||
107 | tcg_gen_gvec_3_ptr(vfp_reg_offset(1, rd), | ||
108 | vfp_reg_offset(1, rn), | ||
109 | vfp_reg_offset(1, rm), fpst, | ||
110 | - opr_sz, opr_sz, rot, | ||
111 | - size ? gen_helper_gvec_fcmlas_idx | ||
112 | - : gen_helper_gvec_fcmlah_idx); | ||
113 | + opr_sz, opr_sz, data, fn_gvec_ptr); | ||
114 | tcg_temp_free_ptr(fpst); | ||
115 | return 0; | ||
116 | } | ||
117 | diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c | ||
118 | index XXXXXXX..XXXXXXX 100644 | ||
119 | --- a/target/arm/vec_helper.c | ||
120 | +++ b/target/arm/vec_helper.c | ||
121 | @@ -XXX,XX +XXX,XX @@ void HELPER(gvec_fcmlah_idx)(void *vd, void *vn, void *vm, | ||
122 | float_status *fpst = vfpst; | ||
123 | intptr_t flip = extract32(desc, SIMD_DATA_SHIFT, 1); | ||
124 | uint32_t neg_imag = extract32(desc, SIMD_DATA_SHIFT + 1, 1); | ||
125 | + intptr_t index = extract32(desc, SIMD_DATA_SHIFT + 2, 2); | ||
126 | uint32_t neg_real = flip ^ neg_imag; | ||
127 | uintptr_t i; | ||
128 | - float16 e1 = m[H2(flip)]; | ||
129 | - float16 e3 = m[H2(1 - flip)]; | ||
130 | + float16 e1 = m[H2(2 * index + flip)]; | ||
131 | + float16 e3 = m[H2(2 * index + 1 - flip)]; | ||
132 | |||
133 | /* Shift boolean to the sign bit so we can xor to negate. */ | ||
134 | neg_real <<= 15; | ||
135 | @@ -XXX,XX +XXX,XX @@ void HELPER(gvec_fcmlas_idx)(void *vd, void *vn, void *vm, | ||
136 | float_status *fpst = vfpst; | ||
137 | intptr_t flip = extract32(desc, SIMD_DATA_SHIFT, 1); | ||
138 | uint32_t neg_imag = extract32(desc, SIMD_DATA_SHIFT + 1, 1); | ||
139 | + intptr_t index = extract32(desc, SIMD_DATA_SHIFT + 2, 2); | ||
140 | uint32_t neg_real = flip ^ neg_imag; | ||
141 | uintptr_t i; | ||
142 | - float32 e1 = m[H4(flip)]; | ||
143 | - float32 e3 = m[H4(1 - flip)]; | ||
144 | + float32 e1 = m[H4(2 * index + flip)]; | ||
145 | + float32 e3 = m[H4(2 * index + 1 - flip)]; | ||
146 | |||
147 | /* Shift boolean to the sign bit so we can xor to negate. */ | ||
148 | neg_real <<= 31; | ||
149 | -- | ||
150 | 2.17.1 | ||
151 | |||
152 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Enhance the existing helpers to support SVE, which takes the | ||
4 | index from each 128-bit segment. The change has no effect | ||
5 | for AdvSIMD, since there is only one such segment. | ||
6 | |||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
10 | Message-id: 20180627043328.11531-32-richard.henderson@linaro.org | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | --- | ||
13 | target/arm/translate-sve.c | 23 ++++++++++++++++++ | ||
14 | target/arm/vec_helper.c | 50 +++++++++++++++++++++++--------------- | ||
15 | target/arm/sve.decode | 6 +++++ | ||
16 | 3 files changed, 59 insertions(+), 20 deletions(-) | ||
17 | |||
18 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
19 | index XXXXXXX..XXXXXXX 100644 | ||
20 | --- a/target/arm/translate-sve.c | ||
21 | +++ b/target/arm/translate-sve.c | ||
22 | @@ -XXX,XX +XXX,XX @@ static bool trans_FCMLA_zpzzz(DisasContext *s, | ||
23 | return true; | ||
24 | } | ||
25 | |||
26 | +static bool trans_FCMLA_zzxz(DisasContext *s, arg_FCMLA_zzxz *a, uint32_t insn) | ||
27 | +{ | ||
28 | + static gen_helper_gvec_3_ptr * const fns[2] = { | ||
29 | + gen_helper_gvec_fcmlah_idx, | ||
30 | + gen_helper_gvec_fcmlas_idx, | ||
31 | + }; | ||
32 | + | ||
33 | + tcg_debug_assert(a->esz == 1 || a->esz == 2); | ||
34 | + tcg_debug_assert(a->rd == a->ra); | ||
35 | + if (sve_access_check(s)) { | ||
36 | + unsigned vsz = vec_full_reg_size(s); | ||
37 | + TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); | ||
38 | + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | ||
39 | + vec_full_reg_offset(s, a->rn), | ||
40 | + vec_full_reg_offset(s, a->rm), | ||
41 | + status, vsz, vsz, | ||
42 | + a->index * 4 + a->rot, | ||
43 | + fns[a->esz - 1]); | ||
44 | + tcg_temp_free_ptr(status); | ||
45 | + } | ||
46 | + return true; | ||
47 | +} | ||
48 | + | ||
49 | /* | ||
50 | *** SVE Floating Point Unary Operations Predicated Group | ||
51 | */ | ||
52 | diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c | ||
53 | index XXXXXXX..XXXXXXX 100644 | ||
54 | --- a/target/arm/vec_helper.c | ||
55 | +++ b/target/arm/vec_helper.c | ||
56 | @@ -XXX,XX +XXX,XX @@ void HELPER(gvec_fcmlah_idx)(void *vd, void *vn, void *vm, | ||
57 | uint32_t neg_imag = extract32(desc, SIMD_DATA_SHIFT + 1, 1); | ||
58 | intptr_t index = extract32(desc, SIMD_DATA_SHIFT + 2, 2); | ||
59 | uint32_t neg_real = flip ^ neg_imag; | ||
60 | - uintptr_t i; | ||
61 | - float16 e1 = m[H2(2 * index + flip)]; | ||
62 | - float16 e3 = m[H2(2 * index + 1 - flip)]; | ||
63 | + intptr_t elements = opr_sz / sizeof(float16); | ||
64 | + intptr_t eltspersegment = 16 / sizeof(float16); | ||
65 | + intptr_t i, j; | ||
66 | |||
67 | /* Shift boolean to the sign bit so we can xor to negate. */ | ||
68 | neg_real <<= 15; | ||
69 | neg_imag <<= 15; | ||
70 | - e1 ^= neg_real; | ||
71 | - e3 ^= neg_imag; | ||
72 | |||
73 | - for (i = 0; i < opr_sz / 2; i += 2) { | ||
74 | - float16 e2 = n[H2(i + flip)]; | ||
75 | - float16 e4 = e2; | ||
76 | + for (i = 0; i < elements; i += eltspersegment) { | ||
77 | + float16 mr = m[H2(i + 2 * index + 0)]; | ||
78 | + float16 mi = m[H2(i + 2 * index + 1)]; | ||
79 | + float16 e1 = neg_real ^ (flip ? mi : mr); | ||
80 | + float16 e3 = neg_imag ^ (flip ? mr : mi); | ||
81 | |||
82 | - d[H2(i)] = float16_muladd(e2, e1, d[H2(i)], 0, fpst); | ||
83 | - d[H2(i + 1)] = float16_muladd(e4, e3, d[H2(i + 1)], 0, fpst); | ||
84 | + for (j = i; j < i + eltspersegment; j += 2) { | ||
85 | + float16 e2 = n[H2(j + flip)]; | ||
86 | + float16 e4 = e2; | ||
87 | + | ||
88 | + d[H2(j)] = float16_muladd(e2, e1, d[H2(j)], 0, fpst); | ||
89 | + d[H2(j + 1)] = float16_muladd(e4, e3, d[H2(j + 1)], 0, fpst); | ||
90 | + } | ||
91 | } | ||
92 | clear_tail(d, opr_sz, simd_maxsz(desc)); | ||
93 | } | ||
94 | @@ -XXX,XX +XXX,XX @@ void HELPER(gvec_fcmlas_idx)(void *vd, void *vn, void *vm, | ||
95 | uint32_t neg_imag = extract32(desc, SIMD_DATA_SHIFT + 1, 1); | ||
96 | intptr_t index = extract32(desc, SIMD_DATA_SHIFT + 2, 2); | ||
97 | uint32_t neg_real = flip ^ neg_imag; | ||
98 | - uintptr_t i; | ||
99 | - float32 e1 = m[H4(2 * index + flip)]; | ||
100 | - float32 e3 = m[H4(2 * index + 1 - flip)]; | ||
101 | + intptr_t elements = opr_sz / sizeof(float32); | ||
102 | + intptr_t eltspersegment = 16 / sizeof(float32); | ||
103 | + intptr_t i, j; | ||
104 | |||
105 | /* Shift boolean to the sign bit so we can xor to negate. */ | ||
106 | neg_real <<= 31; | ||
107 | neg_imag <<= 31; | ||
108 | - e1 ^= neg_real; | ||
109 | - e3 ^= neg_imag; | ||
110 | |||
111 | - for (i = 0; i < opr_sz / 4; i += 2) { | ||
112 | - float32 e2 = n[H4(i + flip)]; | ||
113 | - float32 e4 = e2; | ||
114 | + for (i = 0; i < elements; i += eltspersegment) { | ||
115 | + float32 mr = m[H4(i + 2 * index + 0)]; | ||
116 | + float32 mi = m[H4(i + 2 * index + 1)]; | ||
117 | + float32 e1 = neg_real ^ (flip ? mi : mr); | ||
118 | + float32 e3 = neg_imag ^ (flip ? mr : mi); | ||
119 | |||
120 | - d[H4(i)] = float32_muladd(e2, e1, d[H4(i)], 0, fpst); | ||
121 | - d[H4(i + 1)] = float32_muladd(e4, e3, d[H4(i + 1)], 0, fpst); | ||
122 | + for (j = i; j < i + eltspersegment; j += 2) { | ||
123 | + float32 e2 = n[H4(j + flip)]; | ||
124 | + float32 e4 = e2; | ||
125 | + | ||
126 | + d[H4(j)] = float32_muladd(e2, e1, d[H4(j)], 0, fpst); | ||
127 | + d[H4(j + 1)] = float32_muladd(e4, e3, d[H4(j + 1)], 0, fpst); | ||
128 | + } | ||
129 | } | ||
130 | clear_tail(d, opr_sz, simd_maxsz(desc)); | ||
131 | } | ||
132 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
133 | index XXXXXXX..XXXXXXX 100644 | ||
134 | --- a/target/arm/sve.decode | ||
135 | +++ b/target/arm/sve.decode | ||
136 | @@ -XXX,XX +XXX,XX @@ FCADD 01100100 esz:2 00000 rot:1 100 pg:3 rm:5 rd:5 \ | ||
137 | FCMLA_zpzzz 01100100 esz:2 0 rm:5 0 rot:2 pg:3 rn:5 rd:5 \ | ||
138 | ra=%reg_movprfx | ||
139 | |||
140 | +# SVE floating-point complex multiply-add (indexed) | ||
141 | +FCMLA_zzxz 01100100 10 1 index:2 rm:3 0001 rot:2 rn:5 rd:5 \ | ||
142 | + ra=%reg_movprfx esz=1 | ||
143 | +FCMLA_zzxz 01100100 11 1 index:1 rm:4 0001 rot:2 rn:5 rd:5 \ | ||
144 | + ra=%reg_movprfx esz=2 | ||
145 | + | ||
146 | ### SVE FP Multiply-Add Indexed Group | ||
147 | |||
148 | # SVE floating-point multiply-add (indexed) | ||
149 | -- | ||
150 | 2.17.1 | ||
151 | |||
152 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | Move bootindex.txt into the system section of the manual and turn it |
---|---|---|---|
2 | into rST format. To make the document make more sense in the context | ||
3 | of the system manual, expand the title and introductory paragraphs to | ||
4 | give more context. | ||
2 | 5 | ||
3 | Enable ARM_FEATURE_SVE for the generic "max" cpu. | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Markus Armbruster <armbru@redhat.com> | ||
8 | Message-id: 20210727194955.7764-1-peter.maydell@linaro.org | ||
9 | --- | ||
10 | docs/bootindex.txt | 52 --------------------------- | ||
11 | docs/system/bootindex.rst | 76 +++++++++++++++++++++++++++++++++++++++ | ||
12 | docs/system/index.rst | 1 + | ||
13 | 3 files changed, 77 insertions(+), 52 deletions(-) | ||
14 | delete mode 100644 docs/bootindex.txt | ||
15 | create mode 100644 docs/system/bootindex.rst | ||
4 | 16 | ||
5 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | 17 | diff --git a/docs/bootindex.txt b/docs/bootindex.txt |
6 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 18 | deleted file mode 100644 |
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 19 | index XXXXXXX..XXXXXXX |
8 | Message-id: 20180627043328.11531-35-richard.henderson@linaro.org | 20 | --- a/docs/bootindex.txt |
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 21 | +++ /dev/null |
10 | --- | 22 | @@ -XXX,XX +XXX,XX @@ |
11 | linux-user/elfload.c | 1 + | 23 | -= Bootindex property = |
12 | target/arm/cpu.c | 7 +++++++ | 24 | - |
13 | target/arm/cpu64.c | 1 + | 25 | -Block and net devices have bootindex property. This property is used to |
14 | 3 files changed, 9 insertions(+) | 26 | -determine the order in which firmware will consider devices for booting |
15 | 27 | -the guest OS. If the bootindex property is not set for a device, it gets | |
16 | diff --git a/linux-user/elfload.c b/linux-user/elfload.c | 28 | -lowest boot priority. There is no particular order in which devices with |
29 | -unset bootindex property will be considered for booting, but they will | ||
30 | -still be bootable. | ||
31 | - | ||
32 | -== Example == | ||
33 | - | ||
34 | -Let's assume we have a QEMU machine with two NICs (virtio, e1000) and two | ||
35 | -disks (IDE, virtio): | ||
36 | - | ||
37 | -qemu -drive file=disk1.img,if=none,id=disk1 | ||
38 | - -device ide-hd,drive=disk1,bootindex=4 | ||
39 | - -drive file=disk2.img,if=none,id=disk2 | ||
40 | - -device virtio-blk-pci,drive=disk2,bootindex=3 | ||
41 | - -netdev type=user,id=net0 -device virtio-net-pci,netdev=net0,bootindex=2 | ||
42 | - -netdev type=user,id=net1 -device e1000,netdev=net1,bootindex=1 | ||
43 | - | ||
44 | -Given the command above, firmware should try to boot from the e1000 NIC | ||
45 | -first. If this fails, it should try the virtio NIC next; if this fails | ||
46 | -too, it should try the virtio disk, and then the IDE disk. | ||
47 | - | ||
48 | -== Limitations == | ||
49 | - | ||
50 | -1. Some firmware has limitations on which devices can be considered for | ||
51 | -booting. For instance, the PC BIOS boot specification allows only one | ||
52 | -disk to be bootable. If boot from disk fails for some reason, the BIOS | ||
53 | -won't retry booting from other disk. It can still try to boot from | ||
54 | -floppy or net, though. | ||
55 | - | ||
56 | -2. Sometimes, firmware cannot map the device path QEMU wants firmware to | ||
57 | -boot from to a boot method. It doesn't happen for devices the firmware | ||
58 | -can natively boot from, but if firmware relies on an option ROM for | ||
59 | -booting, and the same option ROM is used for booting from more then one | ||
60 | -device, the firmware may not be able to ask the option ROM to boot from | ||
61 | -a particular device reliably. For instance with the PC BIOS, if a SCSI HBA | ||
62 | -has three bootable devices target1, target3, target5 connected to it, | ||
63 | -the option ROM will have a boot method for each of them, but it is not | ||
64 | -possible to map from boot method back to a specific target. This is a | ||
65 | -shortcoming of the PC BIOS boot specification. | ||
66 | - | ||
67 | -== Mixing bootindex and boot order parameters == | ||
68 | - | ||
69 | -Note that it does not make sense to use the bootindex property together | ||
70 | -with the "-boot order=..." (or "-boot once=...") parameter. The guest | ||
71 | -firmware implementations normally either support the one or the other, | ||
72 | -but not both parameters at the same time. Mixing them will result in | ||
73 | -undefined behavior, and thus the guest firmware will likely not boot | ||
74 | -from the expected devices. | ||
75 | diff --git a/docs/system/bootindex.rst b/docs/system/bootindex.rst | ||
76 | new file mode 100644 | ||
77 | index XXXXXXX..XXXXXXX | ||
78 | --- /dev/null | ||
79 | +++ b/docs/system/bootindex.rst | ||
80 | @@ -XXX,XX +XXX,XX @@ | ||
81 | +Managing device boot order with bootindex properties | ||
82 | +==================================================== | ||
83 | + | ||
84 | +QEMU can tell QEMU-aware guest firmware (like the x86 PC BIOS) | ||
85 | +which order it should look for a bootable OS on which devices. | ||
86 | +A simple way to set this order is to use the ``-boot order=`` option, | ||
87 | +but you can also do this more flexibly, by setting a ``bootindex`` | ||
88 | +property on the individual block or net devices you specify | ||
89 | +on the QEMU command line. | ||
90 | + | ||
91 | +The ``bootindex`` properties are used to determine the order in which | ||
92 | +firmware will consider devices for booting the guest OS. If the | ||
93 | +``bootindex`` property is not set for a device, it gets the lowest | ||
94 | +boot priority. There is no particular order in which devices with no | ||
95 | +``bootindex`` property set will be considered for booting, but they | ||
96 | +will still be bootable. | ||
97 | + | ||
98 | +Some guest machine types (for instance the s390x machines) do | ||
99 | +not support ``-boot order=``; on those machines you must always | ||
100 | +use ``bootindex`` properties. | ||
101 | + | ||
102 | +There is no way to set a ``bootindex`` property if you are using | ||
103 | +a short-form option like ``-hda`` or ``-cdrom``, so to use | ||
104 | +``bootindex`` properties you will need to expand out those options | ||
105 | +into long-form ``-drive`` and ``-device`` option pairs. | ||
106 | + | ||
107 | +Example | ||
108 | +------- | ||
109 | + | ||
110 | +Let's assume we have a QEMU machine with two NICs (virtio, e1000) and two | ||
111 | +disks (IDE, virtio): | ||
112 | + | ||
113 | +.. parsed-literal:: | ||
114 | + | ||
115 | + |qemu_system| -drive file=disk1.img,if=none,id=disk1 \\ | ||
116 | + -device ide-hd,drive=disk1,bootindex=4 \\ | ||
117 | + -drive file=disk2.img,if=none,id=disk2 \\ | ||
118 | + -device virtio-blk-pci,drive=disk2,bootindex=3 \\ | ||
119 | + -netdev type=user,id=net0 \\ | ||
120 | + -device virtio-net-pci,netdev=net0,bootindex=2 \\ | ||
121 | + -netdev type=user,id=net1 \\ | ||
122 | + -device e1000,netdev=net1,bootindex=1 | ||
123 | + | ||
124 | +Given the command above, firmware should try to boot from the e1000 NIC | ||
125 | +first. If this fails, it should try the virtio NIC next; if this fails | ||
126 | +too, it should try the virtio disk, and then the IDE disk. | ||
127 | + | ||
128 | +Limitations | ||
129 | +----------- | ||
130 | + | ||
131 | +Some firmware has limitations on which devices can be considered for | ||
132 | +booting. For instance, the PC BIOS boot specification allows only one | ||
133 | +disk to be bootable. If boot from disk fails for some reason, the BIOS | ||
134 | +won't retry booting from other disk. It can still try to boot from | ||
135 | +floppy or net, though. | ||
136 | + | ||
137 | +Sometimes, firmware cannot map the device path QEMU wants firmware to | ||
138 | +boot from to a boot method. It doesn't happen for devices the firmware | ||
139 | +can natively boot from, but if firmware relies on an option ROM for | ||
140 | +booting, and the same option ROM is used for booting from more then one | ||
141 | +device, the firmware may not be able to ask the option ROM to boot from | ||
142 | +a particular device reliably. For instance with the PC BIOS, if a SCSI HBA | ||
143 | +has three bootable devices target1, target3, target5 connected to it, | ||
144 | +the option ROM will have a boot method for each of them, but it is not | ||
145 | +possible to map from boot method back to a specific target. This is a | ||
146 | +shortcoming of the PC BIOS boot specification. | ||
147 | + | ||
148 | +Mixing bootindex and boot order parameters | ||
149 | +------------------------------------------ | ||
150 | + | ||
151 | +Note that it does not make sense to use the bootindex property together | ||
152 | +with the ``-boot order=...`` (or ``-boot once=...``) parameter. The guest | ||
153 | +firmware implementations normally either support the one or the other, | ||
154 | +but not both parameters at the same time. Mixing them will result in | ||
155 | +undefined behavior, and thus the guest firmware will likely not boot | ||
156 | +from the expected devices. | ||
157 | diff --git a/docs/system/index.rst b/docs/system/index.rst | ||
17 | index XXXXXXX..XXXXXXX 100644 | 158 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/linux-user/elfload.c | 159 | --- a/docs/system/index.rst |
19 | +++ b/linux-user/elfload.c | 160 | +++ b/docs/system/index.rst |
20 | @@ -XXX,XX +XXX,XX @@ static uint32_t get_elf_hwcap(void) | 161 | @@ -XXX,XX +XXX,XX @@ or Hypervisor.Framework. |
21 | GET_FEATURE(ARM_FEATURE_V8_ATOMICS, ARM_HWCAP_A64_ATOMICS); | 162 | authz |
22 | GET_FEATURE(ARM_FEATURE_V8_RDM, ARM_HWCAP_A64_ASIMDRDM); | 163 | gdb |
23 | GET_FEATURE(ARM_FEATURE_V8_FCMA, ARM_HWCAP_A64_FCMA); | 164 | managed-startup |
24 | + GET_FEATURE(ARM_FEATURE_SVE, ARM_HWCAP_A64_SVE); | 165 | + bootindex |
25 | #undef GET_FEATURE | 166 | cpu-hotplug |
26 | 167 | pr-manager | |
27 | return hwcaps; | 168 | targets |
28 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/target/arm/cpu.c | ||
31 | +++ b/target/arm/cpu.c | ||
32 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_reset(CPUState *s) | ||
33 | env->cp15.sctlr_el[1] |= SCTLR_UCT | SCTLR_UCI | SCTLR_DZE; | ||
34 | /* and to the FP/Neon instructions */ | ||
35 | env->cp15.cpacr_el1 = deposit64(env->cp15.cpacr_el1, 20, 2, 3); | ||
36 | + /* and to the SVE instructions */ | ||
37 | + env->cp15.cpacr_el1 = deposit64(env->cp15.cpacr_el1, 16, 2, 3); | ||
38 | + env->cp15.cptr_el[3] |= CPTR_EZ; | ||
39 | + /* with maximum vector length */ | ||
40 | + env->vfp.zcr_el[1] = ARM_MAX_VQ - 1; | ||
41 | + env->vfp.zcr_el[2] = ARM_MAX_VQ - 1; | ||
42 | + env->vfp.zcr_el[3] = ARM_MAX_VQ - 1; | ||
43 | #else | ||
44 | /* Reset into the highest available EL */ | ||
45 | if (arm_feature(env, ARM_FEATURE_EL3)) { | ||
46 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | ||
47 | index XXXXXXX..XXXXXXX 100644 | ||
48 | --- a/target/arm/cpu64.c | ||
49 | +++ b/target/arm/cpu64.c | ||
50 | @@ -XXX,XX +XXX,XX @@ static void aarch64_max_initfn(Object *obj) | ||
51 | set_feature(&cpu->env, ARM_FEATURE_V8_RDM); | ||
52 | set_feature(&cpu->env, ARM_FEATURE_V8_FP16); | ||
53 | set_feature(&cpu->env, ARM_FEATURE_V8_FCMA); | ||
54 | + set_feature(&cpu->env, ARM_FEATURE_SVE); | ||
55 | /* For usermode -cpu max we can use a larger and more efficient DCZ | ||
56 | * blocksize since we don't have to follow what the hardware does. | ||
57 | */ | ||
58 | -- | 169 | -- |
59 | 2.17.1 | 170 | 2.20.1 |
60 | 171 | ||
61 | 172 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | Most of docs/barrier.txt is describing the protocol implemented |
---|---|---|---|
2 | by the input-barrier device. Move this into the interop | ||
3 | section of the manual, and rstify it. | ||
2 | 4 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
5 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
6 | Message-id: 20180627043328.11531-34-richard.henderson@linaro.org | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> | ||
7 | Reviewed-by: Laurent Vivier <laurent@vivier.eu> | ||
8 | Message-id: 20210727204112.12579-2-peter.maydell@linaro.org | ||
8 | --- | 9 | --- |
9 | target/arm/helper.h | 5 ++ | 10 | docs/barrier.txt | 318 ----------------------------- |
10 | target/arm/translate-sve.c | 18 ++++++ | 11 | docs/interop/barrier.rst | 426 +++++++++++++++++++++++++++++++++++++++ |
11 | target/arm/vec_helper.c | 124 +++++++++++++++++++++++++++++++++++++ | 12 | docs/interop/index.rst | 1 + |
12 | target/arm/sve.decode | 6 ++ | 13 | 3 files changed, 427 insertions(+), 318 deletions(-) |
13 | 4 files changed, 153 insertions(+) | 14 | create mode 100644 docs/interop/barrier.rst |
14 | 15 | ||
15 | diff --git a/target/arm/helper.h b/target/arm/helper.h | 16 | diff --git a/docs/barrier.txt b/docs/barrier.txt |
16 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/helper.h | 18 | --- a/docs/barrier.txt |
18 | +++ b/target/arm/helper.h | 19 | +++ b/docs/barrier.txt |
19 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_4(gvec_udot_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | 20 | @@ -XXX,XX +XXX,XX @@ |
20 | DEF_HELPER_FLAGS_4(gvec_sdot_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | 21 | |
21 | DEF_HELPER_FLAGS_4(gvec_udot_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | 22 | (qemu) object_del barrier0 |
22 | 23 | (qemu) object_add input-barrier,id=barrier0,name=VM-1 | |
23 | +DEF_HELPER_FLAGS_4(gvec_sdot_idx_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | 24 | - |
24 | +DEF_HELPER_FLAGS_4(gvec_udot_idx_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | 25 | -* Message format |
25 | +DEF_HELPER_FLAGS_4(gvec_sdot_idx_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | 26 | - |
26 | +DEF_HELPER_FLAGS_4(gvec_udot_idx_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | 27 | - Message format between the server and client is in two parts: |
27 | + | 28 | - |
28 | DEF_HELPER_FLAGS_5(gvec_fcaddh, TCG_CALL_NO_RWG, | 29 | - 1- the payload length is a 32bit integer in network endianness, |
29 | void, ptr, ptr, ptr, ptr, i32) | 30 | - 2- the payload |
30 | DEF_HELPER_FLAGS_5(gvec_fcadds, TCG_CALL_NO_RWG, | 31 | - |
31 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 32 | - The payload starts with a 4byte string (without NUL) which is the |
33 | - command. The first command between the server and the client | ||
34 | - is the only command not encoded on 4 bytes ("Barrier"). | ||
35 | - The remaining part of the payload is decoded according to the command. | ||
36 | - | ||
37 | -* Protocol Description (from barrier/src/lib/barrier/protocol_types.h) | ||
38 | - | ||
39 | - - barrierCmdHello "Barrier" | ||
40 | - | ||
41 | - Direction: server -> client | ||
42 | - Parameters: { int16_t minor, int16_t major } | ||
43 | - Description: | ||
44 | - | ||
45 | - Say hello to client | ||
46 | - minor = protocol major version number supported by server | ||
47 | - major = protocol minor version number supported by server | ||
48 | - | ||
49 | - - barrierCmdHelloBack "Barrier" | ||
50 | - | ||
51 | - Direction: client ->server | ||
52 | - Parameters: { int16_t minor, int16_t major, char *name} | ||
53 | - Description: | ||
54 | - | ||
55 | - Respond to hello from server | ||
56 | - minor = protocol major version number supported by client | ||
57 | - major = protocol minor version number supported by client | ||
58 | - name = client name | ||
59 | - | ||
60 | - - barrierCmdDInfo "DINF" | ||
61 | - | ||
62 | - Direction: client ->server | ||
63 | - Parameters: { int16_t x_origin, int16_t y_origin, int16_t width, int16_t height, int16_t x, int16_t y} | ||
64 | - Description: | ||
65 | - | ||
66 | - The client screen must send this message in response to the | ||
67 | - barrierCmdQInfo message. It must also send this message when the | ||
68 | - screen's resolution changes. In this case, the client screen should | ||
69 | - ignore any barrierCmdDMouseMove messages until it receives a | ||
70 | - barrierCmdCInfoAck in order to prevent attempts to move the mouse off | ||
71 | - the new screen area. | ||
72 | - | ||
73 | - - barrierCmdCNoop "CNOP" | ||
74 | - | ||
75 | - Direction: client -> server | ||
76 | - Parameters: None | ||
77 | - Description: | ||
78 | - | ||
79 | - No operation | ||
80 | - | ||
81 | - - barrierCmdCClose "CBYE" | ||
82 | - | ||
83 | - Direction: server -> client | ||
84 | - Parameters: None | ||
85 | - Description: | ||
86 | - | ||
87 | - Close connection | ||
88 | - | ||
89 | - - barrierCmdCEnter "CINN" | ||
90 | - | ||
91 | - Direction: server -> client | ||
92 | - Parameters: { int16_t x, int16_t y, int32_t seq, int16_t modifier } | ||
93 | - Description: | ||
94 | - | ||
95 | - Enter screen. | ||
96 | - x,y = entering screen absolute coordinates | ||
97 | - seq = sequence number, which is used to order messages between | ||
98 | - screens. the secondary screen must return this number | ||
99 | - with some messages | ||
100 | - modifier = modifier key mask. this will have bits set for each | ||
101 | - toggle modifier key that is activated on entry to the | ||
102 | - screen. the secondary screen should adjust its toggle | ||
103 | - modifiers to reflect that state. | ||
104 | - | ||
105 | - - barrierCmdCLeave "COUT" | ||
106 | - | ||
107 | - Direction: server -> client | ||
108 | - Parameters: None | ||
109 | - Description: | ||
110 | - | ||
111 | - Leaving screen. the secondary screen should send clipboard data in | ||
112 | - response to this message for those clipboards that it has grabbed | ||
113 | - (i.e. has sent a barrierCmdCClipboard for and has not received a | ||
114 | - barrierCmdCClipboard for with a greater sequence number) and that | ||
115 | - were grabbed or have changed since the last leave. | ||
116 | - | ||
117 | - - barrierCmdCClipboard "CCLP" | ||
118 | - | ||
119 | - Direction: server -> client | ||
120 | - Parameters: { int8_t id, int32_t seq } | ||
121 | - Description: | ||
122 | - | ||
123 | - Grab clipboard. Sent by screen when some other app on that screen | ||
124 | - grabs a clipboard. | ||
125 | - id = the clipboard identifier | ||
126 | - seq = sequence number. Client must use the sequence number passed in | ||
127 | - the most recent barrierCmdCEnter. the server always sends 0. | ||
128 | - | ||
129 | - - barrierCmdCScreenSaver "CSEC" | ||
130 | - | ||
131 | - Direction: server -> client | ||
132 | - Parameters: { int8_t started } | ||
133 | - Description: | ||
134 | - | ||
135 | - Screensaver change. | ||
136 | - started = Screensaver on primary has started (1) or closed (0) | ||
137 | - | ||
138 | - - barrierCmdCResetOptions "CROP" | ||
139 | - | ||
140 | - Direction: server -> client | ||
141 | - Parameters: None | ||
142 | - Description: | ||
143 | - | ||
144 | - Reset options. Client should reset all of its options to their | ||
145 | - defaults. | ||
146 | - | ||
147 | - - barrierCmdCInfoAck "CIAK" | ||
148 | - | ||
149 | - Direction: server -> client | ||
150 | - Parameters: None | ||
151 | - Description: | ||
152 | - | ||
153 | - Resolution change acknowledgment. Sent by server in response to a | ||
154 | - client screen's barrierCmdDInfo. This is sent for every | ||
155 | - barrierCmdDInfo, whether or not the server had sent a barrierCmdQInfo. | ||
156 | - | ||
157 | - - barrierCmdCKeepAlive "CALV" | ||
158 | - | ||
159 | - Direction: server -> client | ||
160 | - Parameters: None | ||
161 | - Description: | ||
162 | - | ||
163 | - Keep connection alive. Sent by the server periodically to verify | ||
164 | - that connections are still up and running. clients must reply in | ||
165 | - kind on receipt. if the server gets an error sending the message or | ||
166 | - does not receive a reply within a reasonable time then the server | ||
167 | - disconnects the client. if the client doesn't receive these (or any | ||
168 | - message) periodically then it should disconnect from the server. the | ||
169 | - appropriate interval is defined by an option. | ||
170 | - | ||
171 | - - barrierCmdDKeyDown "DKDN" | ||
172 | - | ||
173 | - Direction: server -> client | ||
174 | - Parameters: { int16_t keyid, int16_t modifier [,int16_t button] } | ||
175 | - Description: | ||
176 | - | ||
177 | - Key pressed. | ||
178 | - keyid = X11 key id | ||
179 | - modified = modified mask | ||
180 | - button = X11 Xkb keycode (optional) | ||
181 | - | ||
182 | - - barrierCmdDKeyRepeat "DKRP" | ||
183 | - | ||
184 | - Direction: server -> client | ||
185 | - Parameters: { int16_t keyid, int16_t modifier, int16_t repeat [,int16_t button] } | ||
186 | - Description: | ||
187 | - | ||
188 | - Key auto-repeat. | ||
189 | - keyid = X11 key id | ||
190 | - modified = modified mask | ||
191 | - repeat = number of repeats | ||
192 | - button = X11 Xkb keycode (optional) | ||
193 | - | ||
194 | - - barrierCmdDKeyUp "DKUP" | ||
195 | - | ||
196 | - Direction: server -> client | ||
197 | - Parameters: { int16_t keyid, int16_t modifier [,int16_t button] } | ||
198 | - Description: | ||
199 | - | ||
200 | - Key released. | ||
201 | - keyid = X11 key id | ||
202 | - modified = modified mask | ||
203 | - button = X11 Xkb keycode (optional) | ||
204 | - | ||
205 | - - barrierCmdDMouseDown "DMDN" | ||
206 | - | ||
207 | - Direction: server -> client | ||
208 | - Parameters: { int8_t button } | ||
209 | - Description: | ||
210 | - | ||
211 | - Mouse button pressed. | ||
212 | - button = button id | ||
213 | - | ||
214 | - - barrierCmdDMouseUp "DMUP" | ||
215 | - | ||
216 | - Direction: server -> client | ||
217 | - Parameters: { int8_t button } | ||
218 | - Description: | ||
219 | - | ||
220 | - Mouse button release. | ||
221 | - button = button id | ||
222 | - | ||
223 | - - barrierCmdDMouseMove "DMMV" | ||
224 | - | ||
225 | - Direction: server -> client | ||
226 | - Parameters: { int16_t x, int16_t y } | ||
227 | - Description: | ||
228 | - | ||
229 | - Absolute mouse moved. | ||
230 | - x,y = absolute screen coordinates | ||
231 | - | ||
232 | - - barrierCmdDMouseRelMove "DMRM" | ||
233 | - | ||
234 | - Direction: server -> client | ||
235 | - Parameters: { int16_t x, int16_t y } | ||
236 | - Description: | ||
237 | - | ||
238 | - Relative mouse moved. | ||
239 | - x,y = r relative screen coordinates | ||
240 | - | ||
241 | - - barrierCmdDMouseWheel "DMWM" | ||
242 | - | ||
243 | - Direction: server -> client | ||
244 | - Parameters: { int16_t x , int16_t y } or { int16_t y } | ||
245 | - Description: | ||
246 | - | ||
247 | - Mouse scroll. The delta should be +120 for one tick forward (away | ||
248 | - from the user) or right and -120 for one tick backward (toward the | ||
249 | - user) or left. | ||
250 | - x = x delta | ||
251 | - y = y delta | ||
252 | - | ||
253 | - - barrierCmdDClipboard "DCLP" | ||
254 | - | ||
255 | - Direction: server -> client | ||
256 | - Parameters: { int8_t id, int32_t seq, int8_t mark, char *data } | ||
257 | - Description: | ||
258 | - | ||
259 | - Clipboard data. | ||
260 | - id = clipboard id | ||
261 | - seq = sequence number. The sequence number is 0 when sent by the | ||
262 | - server. Client screens should use the/ sequence number from | ||
263 | - the most recent barrierCmdCEnter. | ||
264 | - | ||
265 | - - barrierCmdDSetOptions "DSOP" | ||
266 | - | ||
267 | - Direction: server -> client | ||
268 | - Parameters: { int32 t nb, { int32_t id, int32_t val }[] } | ||
269 | - Description: | ||
270 | - | ||
271 | - Set options. Client should set the given option/value pairs. | ||
272 | - nb = numbers of { id, val } entries | ||
273 | - id = option id | ||
274 | - val = option new value | ||
275 | - | ||
276 | - - barrierCmdDFileTransfer "DFTR" | ||
277 | - | ||
278 | - Direction: server -> client | ||
279 | - Parameters: { int8_t mark, char *content } | ||
280 | - Description: | ||
281 | - | ||
282 | - Transfer file data. | ||
283 | - mark = 0 means the content followed is the file size | ||
284 | - 1 means the content followed is the chunk data | ||
285 | - 2 means the file transfer is finished | ||
286 | - | ||
287 | - - barrierCmdDDragInfo "DDRG" int16_t char * | ||
288 | - | ||
289 | - Direction: server -> client | ||
290 | - Parameters: { int16_t nb, char *content } | ||
291 | - Description: | ||
292 | - | ||
293 | - Drag information. | ||
294 | - nb = number of dragging objects | ||
295 | - content = object's directory | ||
296 | - | ||
297 | - - barrierCmdQInfo "QINF" | ||
298 | - | ||
299 | - Direction: server -> client | ||
300 | - Parameters: None | ||
301 | - Description: | ||
302 | - | ||
303 | - Query screen info | ||
304 | - Client should reply with a barrierCmdDInfo | ||
305 | - | ||
306 | - - barrierCmdEIncompatible "EICV" | ||
307 | - | ||
308 | - Direction: server -> client | ||
309 | - Parameters: { int16_t nb, major *minor } | ||
310 | - Description: | ||
311 | - | ||
312 | - Incompatible version. | ||
313 | - major = major version | ||
314 | - minor = minor version | ||
315 | - | ||
316 | - - barrierCmdEBusy "EBSY" | ||
317 | - | ||
318 | - Direction: server -> client | ||
319 | - Parameters: None | ||
320 | - Description: | ||
321 | - | ||
322 | - Name provided when connecting is already in use. | ||
323 | - | ||
324 | - - barrierCmdEUnknown "EUNK" | ||
325 | - | ||
326 | - Direction: server -> client | ||
327 | - Parameters: None | ||
328 | - Description: | ||
329 | - | ||
330 | - Unknown client. Name provided when connecting is not in primary's | ||
331 | - screen configuration map. | ||
332 | - | ||
333 | - - barrierCmdEBad "EBAD" | ||
334 | - | ||
335 | - Direction: server -> client | ||
336 | - Parameters: None | ||
337 | - Description: | ||
338 | - | ||
339 | - Protocol violation. Server should disconnect after sending this | ||
340 | - message. | ||
341 | - | ||
342 | * TO DO | ||
343 | |||
344 | - Enable SSL | ||
345 | diff --git a/docs/interop/barrier.rst b/docs/interop/barrier.rst | ||
346 | new file mode 100644 | ||
347 | index XXXXXXX..XXXXXXX | ||
348 | --- /dev/null | ||
349 | +++ b/docs/interop/barrier.rst | ||
350 | @@ -XXX,XX +XXX,XX @@ | ||
351 | +Barrier client protocol | ||
352 | +======================= | ||
353 | + | ||
354 | +QEMU's ``input-barrier`` device implements the client end of | ||
355 | +the KVM (Keyboard-Video-Mouse) software | ||
356 | +`Barrier <https://github.com/debauchee/barrier>`__. | ||
357 | + | ||
358 | +This document briefly describes the protocol as we implement it. | ||
359 | + | ||
360 | +Message format | ||
361 | +-------------- | ||
362 | + | ||
363 | +Message format between the server and client is in two parts: | ||
364 | + | ||
365 | +#. the payload length, a 32bit integer in network endianness | ||
366 | +#. the payload | ||
367 | + | ||
368 | +The payload starts with a 4byte string (without NUL) which is the | ||
369 | +command. The first command between the server and the client | ||
370 | +is the only command not encoded on 4 bytes ("Barrier"). | ||
371 | +The remaining part of the payload is decoded according to the command. | ||
372 | + | ||
373 | +Protocol Description | ||
374 | +-------------------- | ||
375 | + | ||
376 | +This comes from ``barrier/src/lib/barrier/protocol_types.h``. | ||
377 | + | ||
378 | +barrierCmdHello "Barrier" | ||
379 | +^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
380 | + | ||
381 | +Direction: | ||
382 | + server -> client | ||
383 | +Parameters: | ||
384 | + ``{ int16_t minor, int16_t major }`` | ||
385 | +Description: | ||
386 | + Say hello to client | ||
387 | + | ||
388 | + ``minor`` = protocol major version number supported by server | ||
389 | + | ||
390 | + ``major`` = protocol minor version number supported by server | ||
391 | + | ||
392 | +barrierCmdHelloBack "Barrier" | ||
393 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
394 | + | ||
395 | +Direction: | ||
396 | + client ->server | ||
397 | +Parameters: | ||
398 | + ``{ int16_t minor, int16_t major, char *name}`` | ||
399 | +Description: | ||
400 | + Respond to hello from server | ||
401 | + | ||
402 | + ``minor`` = protocol major version number supported by client | ||
403 | + | ||
404 | + ``major`` = protocol minor version number supported by client | ||
405 | + | ||
406 | + ``name`` = client name | ||
407 | + | ||
408 | +barrierCmdDInfo "DINF" | ||
409 | +^^^^^^^^^^^^^^^^^^^^^^^ | ||
410 | + | ||
411 | +Direction: | ||
412 | + client ->server | ||
413 | +Parameters: | ||
414 | + ``{ int16_t x_origin, int16_t y_origin, int16_t width, int16_t height, int16_t x, int16_t y}`` | ||
415 | +Description: | ||
416 | + The client screen must send this message in response to the | ||
417 | + barrierCmdQInfo message. It must also send this message when the | ||
418 | + screen's resolution changes. In this case, the client screen should | ||
419 | + ignore any barrierCmdDMouseMove messages until it receives a | ||
420 | + barrierCmdCInfoAck in order to prevent attempts to move the mouse off | ||
421 | + the new screen area. | ||
422 | + | ||
423 | +barrierCmdCNoop "CNOP" | ||
424 | +^^^^^^^^^^^^^^^^^^^^^^^ | ||
425 | + | ||
426 | +Direction: | ||
427 | + client -> server | ||
428 | +Parameters: | ||
429 | + None | ||
430 | +Description: | ||
431 | + No operation | ||
432 | + | ||
433 | +barrierCmdCClose "CBYE" | ||
434 | +^^^^^^^^^^^^^^^^^^^^^^^ | ||
435 | + | ||
436 | +Direction: | ||
437 | + server -> client | ||
438 | +Parameters: | ||
439 | + None | ||
440 | +Description: | ||
441 | + Close connection | ||
442 | + | ||
443 | +barrierCmdCEnter "CINN" | ||
444 | +^^^^^^^^^^^^^^^^^^^^^^^ | ||
445 | + | ||
446 | +Direction: | ||
447 | + server -> client | ||
448 | +Parameters: | ||
449 | + ``{ int16_t x, int16_t y, int32_t seq, int16_t modifier }`` | ||
450 | +Description: | ||
451 | + Enter screen. | ||
452 | + | ||
453 | + ``x``, ``y`` = entering screen absolute coordinates | ||
454 | + | ||
455 | + ``seq`` = sequence number, which is used to order messages between | ||
456 | + screens. the secondary screen must return this number | ||
457 | + with some messages | ||
458 | + | ||
459 | + ``modifier`` = modifier key mask. this will have bits set for each | ||
460 | + toggle modifier key that is activated on entry to the | ||
461 | + screen. the secondary screen should adjust its toggle | ||
462 | + modifiers to reflect that state. | ||
463 | + | ||
464 | +barrierCmdCLeave "COUT" | ||
465 | +^^^^^^^^^^^^^^^^^^^^^^^ | ||
466 | + | ||
467 | +Direction: | ||
468 | + server -> client | ||
469 | +Parameters: | ||
470 | + None | ||
471 | +Description: | ||
472 | + Leaving screen. the secondary screen should send clipboard data in | ||
473 | + response to this message for those clipboards that it has grabbed | ||
474 | + (i.e. has sent a barrierCmdCClipboard for and has not received a | ||
475 | + barrierCmdCClipboard for with a greater sequence number) and that | ||
476 | + were grabbed or have changed since the last leave. | ||
477 | + | ||
478 | +barrierCmdCClipboard "CCLP" | ||
479 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
480 | + | ||
481 | +Direction: | ||
482 | + server -> client | ||
483 | +Parameters: | ||
484 | + ``{ int8_t id, int32_t seq }`` | ||
485 | +Description: | ||
486 | + Grab clipboard. Sent by screen when some other app on that screen | ||
487 | + grabs a clipboard. | ||
488 | + | ||
489 | + ``id`` = the clipboard identifier | ||
490 | + | ||
491 | + ``seq`` = sequence number. Client must use the sequence number passed in | ||
492 | + the most recent barrierCmdCEnter. the server always sends 0. | ||
493 | + | ||
494 | +barrierCmdCScreenSaver "CSEC" | ||
495 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
496 | + | ||
497 | +Direction: | ||
498 | + server -> client | ||
499 | +Parameters: | ||
500 | + ``{ int8_t started }`` | ||
501 | +Description: | ||
502 | + Screensaver change. | ||
503 | + | ||
504 | + ``started`` = Screensaver on primary has started (1) or closed (0) | ||
505 | + | ||
506 | +barrierCmdCResetOptions "CROP" | ||
507 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
508 | + | ||
509 | +Direction: | ||
510 | + server -> client | ||
511 | +Parameters: | ||
512 | + None | ||
513 | +Description: | ||
514 | + Reset options. Client should reset all of its options to their | ||
515 | + defaults. | ||
516 | + | ||
517 | +barrierCmdCInfoAck "CIAK" | ||
518 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
519 | + | ||
520 | +Direction: | ||
521 | + server -> client | ||
522 | +Parameters: | ||
523 | + None | ||
524 | +Description: | ||
525 | + Resolution change acknowledgment. Sent by server in response to a | ||
526 | + client screen's barrierCmdDInfo. This is sent for every | ||
527 | + barrierCmdDInfo, whether or not the server had sent a barrierCmdQInfo. | ||
528 | + | ||
529 | +barrierCmdCKeepAlive "CALV" | ||
530 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
531 | + | ||
532 | +Direction: | ||
533 | + server -> client | ||
534 | +Parameters: | ||
535 | + None | ||
536 | +Description: | ||
537 | + Keep connection alive. Sent by the server periodically to verify | ||
538 | + that connections are still up and running. clients must reply in | ||
539 | + kind on receipt. if the server gets an error sending the message or | ||
540 | + does not receive a reply within a reasonable time then the server | ||
541 | + disconnects the client. if the client doesn't receive these (or any | ||
542 | + message) periodically then it should disconnect from the server. the | ||
543 | + appropriate interval is defined by an option. | ||
544 | + | ||
545 | +barrierCmdDKeyDown "DKDN" | ||
546 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
547 | + | ||
548 | +Direction: | ||
549 | + server -> client | ||
550 | +Parameters: | ||
551 | + ``{ int16_t keyid, int16_t modifier [,int16_t button] }`` | ||
552 | +Description: | ||
553 | + Key pressed. | ||
554 | + | ||
555 | + ``keyid`` = X11 key id | ||
556 | + | ||
557 | + ``modified`` = modified mask | ||
558 | + | ||
559 | + ``button`` = X11 Xkb keycode (optional) | ||
560 | + | ||
561 | +barrierCmdDKeyRepeat "DKRP" | ||
562 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
563 | + | ||
564 | +Direction: | ||
565 | + server -> client | ||
566 | +Parameters: | ||
567 | + ``{ int16_t keyid, int16_t modifier, int16_t repeat [,int16_t button] }`` | ||
568 | +Description: | ||
569 | + Key auto-repeat. | ||
570 | + | ||
571 | + ``keyid`` = X11 key id | ||
572 | + | ||
573 | + ``modified`` = modified mask | ||
574 | + | ||
575 | + ``repeat`` = number of repeats | ||
576 | + | ||
577 | + ``button`` = X11 Xkb keycode (optional) | ||
578 | + | ||
579 | +barrierCmdDKeyUp "DKUP" | ||
580 | +^^^^^^^^^^^^^^^^^^^^^^^ | ||
581 | + | ||
582 | +Direction: | ||
583 | + server -> client | ||
584 | +Parameters: | ||
585 | + ``{ int16_t keyid, int16_t modifier [,int16_t button] }`` | ||
586 | +Description: | ||
587 | + Key released. | ||
588 | + | ||
589 | + ``keyid`` = X11 key id | ||
590 | + | ||
591 | + ``modified`` = modified mask | ||
592 | + | ||
593 | + ``button`` = X11 Xkb keycode (optional) | ||
594 | + | ||
595 | +barrierCmdDMouseDown "DMDN" | ||
596 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
597 | + | ||
598 | +Direction: | ||
599 | + server -> client | ||
600 | +Parameters: | ||
601 | + ``{ int8_t button }`` | ||
602 | +Description: | ||
603 | + Mouse button pressed. | ||
604 | + | ||
605 | + ``button`` = button id | ||
606 | + | ||
607 | +barrierCmdDMouseUp "DMUP" | ||
608 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
609 | + | ||
610 | +Direction: | ||
611 | + server -> client | ||
612 | +Parameters: | ||
613 | + ``{ int8_t button }`` | ||
614 | +Description: | ||
615 | + Mouse button release. | ||
616 | + | ||
617 | + ``button`` = button id | ||
618 | + | ||
619 | +barrierCmdDMouseMove "DMMV" | ||
620 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
621 | + | ||
622 | +Direction: | ||
623 | + server -> client | ||
624 | +Parameters: | ||
625 | + ``{ int16_t x, int16_t y }`` | ||
626 | +Description: | ||
627 | + Absolute mouse moved. | ||
628 | + | ||
629 | + ``x``, ``y`` = absolute screen coordinates | ||
630 | + | ||
631 | +barrierCmdDMouseRelMove "DMRM" | ||
632 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
633 | + | ||
634 | +Direction: | ||
635 | + server -> client | ||
636 | +Parameters: | ||
637 | + ``{ int16_t x, int16_t y }`` | ||
638 | +Description: | ||
639 | + Relative mouse moved. | ||
640 | + | ||
641 | + ``x``, ``y`` = r relative screen coordinates | ||
642 | + | ||
643 | +barrierCmdDMouseWheel "DMWM" | ||
644 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
645 | + | ||
646 | +Direction: | ||
647 | + server -> client | ||
648 | +Parameters: | ||
649 | + ``{ int16_t x , int16_t y }`` or ``{ int16_t y }`` | ||
650 | +Description: | ||
651 | + Mouse scroll. The delta should be +120 for one tick forward (away | ||
652 | + from the user) or right and -120 for one tick backward (toward the | ||
653 | + user) or left. | ||
654 | + | ||
655 | + ``x`` = x delta | ||
656 | + | ||
657 | + ``y`` = y delta | ||
658 | + | ||
659 | +barrierCmdDClipboard "DCLP" | ||
660 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
661 | + | ||
662 | +Direction: | ||
663 | + server -> client | ||
664 | +Parameters: | ||
665 | + ``{ int8_t id, int32_t seq, int8_t mark, char *data }`` | ||
666 | +Description: | ||
667 | + Clipboard data. | ||
668 | + | ||
669 | + ``id`` = clipboard id | ||
670 | + | ||
671 | + ``seq`` = sequence number. The sequence number is 0 when sent by the | ||
672 | + server. Client screens should use the/ sequence number from | ||
673 | + the most recent barrierCmdCEnter. | ||
674 | + | ||
675 | +barrierCmdDSetOptions "DSOP" | ||
676 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
677 | + | ||
678 | +Direction: | ||
679 | + server -> client | ||
680 | +Parameters: | ||
681 | + ``{ int32 t nb, { int32_t id, int32_t val }[] }`` | ||
682 | +Description: | ||
683 | + Set options. Client should set the given option/value pairs. | ||
684 | + | ||
685 | + ``nb`` = numbers of ``{ id, val }`` entries | ||
686 | + | ||
687 | + ``id`` = option id | ||
688 | + | ||
689 | + ``val`` = option new value | ||
690 | + | ||
691 | +barrierCmdDFileTransfer "DFTR" | ||
692 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
693 | + | ||
694 | +Direction: | ||
695 | + server -> client | ||
696 | +Parameters: | ||
697 | + ``{ int8_t mark, char *content }`` | ||
698 | +Description: | ||
699 | + Transfer file data. | ||
700 | + | ||
701 | + * ``mark`` = 0 means the content followed is the file size | ||
702 | + * 1 means the content followed is the chunk data | ||
703 | + * 2 means the file transfer is finished | ||
704 | + | ||
705 | +barrierCmdDDragInfo "DDRG" | ||
706 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
707 | + | ||
708 | +Direction: | ||
709 | + server -> client | ||
710 | +Parameters: | ||
711 | + ``{ int16_t nb, char *content }`` | ||
712 | +Description: | ||
713 | + Drag information. | ||
714 | + | ||
715 | + ``nb`` = number of dragging objects | ||
716 | + | ||
717 | + ``content`` = object's directory | ||
718 | + | ||
719 | +barrierCmdQInfo "QINF" | ||
720 | +^^^^^^^^^^^^^^^^^^^^^^^ | ||
721 | + | ||
722 | +Direction: | ||
723 | + server -> client | ||
724 | +Parameters: | ||
725 | + None | ||
726 | +Description: | ||
727 | + Query screen info | ||
728 | + | ||
729 | + Client should reply with a barrierCmdDInfo | ||
730 | + | ||
731 | +barrierCmdEIncompatible "EICV" | ||
732 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
733 | + | ||
734 | +Direction: | ||
735 | + server -> client | ||
736 | +Parameters: | ||
737 | + ``{ int16_t nb, major *minor }`` | ||
738 | +Description: | ||
739 | + Incompatible version. | ||
740 | + | ||
741 | + ``major`` = major version | ||
742 | + | ||
743 | + ``minor`` = minor version | ||
744 | + | ||
745 | +barrierCmdEBusy "EBSY" | ||
746 | +^^^^^^^^^^^^^^^^^^^^^^^ | ||
747 | + | ||
748 | +Direction: | ||
749 | + server -> client | ||
750 | +Parameters: | ||
751 | + None | ||
752 | +Description: | ||
753 | + Name provided when connecting is already in use. | ||
754 | + | ||
755 | +barrierCmdEUnknown "EUNK" | ||
756 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
757 | + | ||
758 | +Direction: | ||
759 | + server -> client | ||
760 | +Parameters: | ||
761 | + None | ||
762 | +Description: | ||
763 | + Unknown client. Name provided when connecting is not in primary's | ||
764 | + screen configuration map. | ||
765 | + | ||
766 | +barrierCmdEBad "EBAD" | ||
767 | +^^^^^^^^^^^^^^^^^^^^^^^ | ||
768 | + | ||
769 | +Direction: | ||
770 | + server -> client | ||
771 | +Parameters: | ||
772 | + None | ||
773 | +Description: | ||
774 | + Protocol violation. Server should disconnect after sending this | ||
775 | + message. | ||
776 | + | ||
777 | diff --git a/docs/interop/index.rst b/docs/interop/index.rst | ||
32 | index XXXXXXX..XXXXXXX 100644 | 778 | index XXXXXXX..XXXXXXX 100644 |
33 | --- a/target/arm/translate-sve.c | 779 | --- a/docs/interop/index.rst |
34 | +++ b/target/arm/translate-sve.c | 780 | +++ b/docs/interop/index.rst |
35 | @@ -XXX,XX +XXX,XX @@ static bool trans_DOT_zzz(DisasContext *s, arg_DOT_zzz *a, uint32_t insn) | 781 | @@ -XXX,XX +XXX,XX @@ are useful for making QEMU interoperate with other software. |
36 | return true; | 782 | .. toctree:: |
37 | } | 783 | :maxdepth: 2 |
38 | 784 | ||
39 | +static bool trans_DOT_zzx(DisasContext *s, arg_DOT_zzx *a, uint32_t insn) | 785 | + barrier |
40 | +{ | 786 | bitmaps |
41 | + static gen_helper_gvec_3 * const fns[2][2] = { | 787 | dbus |
42 | + { gen_helper_gvec_sdot_idx_b, gen_helper_gvec_sdot_idx_h }, | 788 | dbus-vmstate |
43 | + { gen_helper_gvec_udot_idx_b, gen_helper_gvec_udot_idx_h } | ||
44 | + }; | ||
45 | + | ||
46 | + if (sve_access_check(s)) { | ||
47 | + unsigned vsz = vec_full_reg_size(s); | ||
48 | + tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), | ||
49 | + vec_full_reg_offset(s, a->rn), | ||
50 | + vec_full_reg_offset(s, a->rm), | ||
51 | + vsz, vsz, a->index, fns[a->u][a->sz]); | ||
52 | + } | ||
53 | + return true; | ||
54 | +} | ||
55 | + | ||
56 | + | ||
57 | /* | ||
58 | *** SVE Floating Point Multiply-Add Indexed Group | ||
59 | */ | ||
60 | diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c | ||
61 | index XXXXXXX..XXXXXXX 100644 | ||
62 | --- a/target/arm/vec_helper.c | ||
63 | +++ b/target/arm/vec_helper.c | ||
64 | @@ -XXX,XX +XXX,XX @@ void HELPER(gvec_udot_h)(void *vd, void *vn, void *vm, uint32_t desc) | ||
65 | clear_tail(d, opr_sz, simd_maxsz(desc)); | ||
66 | } | ||
67 | |||
68 | +void HELPER(gvec_sdot_idx_b)(void *vd, void *vn, void *vm, uint32_t desc) | ||
69 | +{ | ||
70 | + intptr_t i, segend, opr_sz = simd_oprsz(desc), opr_sz_4 = opr_sz / 4; | ||
71 | + intptr_t index = simd_data(desc); | ||
72 | + uint32_t *d = vd; | ||
73 | + int8_t *n = vn; | ||
74 | + int8_t *m_indexed = (int8_t *)vm + index * 4; | ||
75 | + | ||
76 | + /* Notice the special case of opr_sz == 8, from aa64/aa32 advsimd. | ||
77 | + * Otherwise opr_sz is a multiple of 16. | ||
78 | + */ | ||
79 | + segend = MIN(4, opr_sz_4); | ||
80 | + i = 0; | ||
81 | + do { | ||
82 | + int8_t m0 = m_indexed[i * 4 + 0]; | ||
83 | + int8_t m1 = m_indexed[i * 4 + 1]; | ||
84 | + int8_t m2 = m_indexed[i * 4 + 2]; | ||
85 | + int8_t m3 = m_indexed[i * 4 + 3]; | ||
86 | + | ||
87 | + do { | ||
88 | + d[i] += n[i * 4 + 0] * m0 | ||
89 | + + n[i * 4 + 1] * m1 | ||
90 | + + n[i * 4 + 2] * m2 | ||
91 | + + n[i * 4 + 3] * m3; | ||
92 | + } while (++i < segend); | ||
93 | + segend = i + 4; | ||
94 | + } while (i < opr_sz_4); | ||
95 | + | ||
96 | + clear_tail(d, opr_sz, simd_maxsz(desc)); | ||
97 | +} | ||
98 | + | ||
99 | +void HELPER(gvec_udot_idx_b)(void *vd, void *vn, void *vm, uint32_t desc) | ||
100 | +{ | ||
101 | + intptr_t i, segend, opr_sz = simd_oprsz(desc), opr_sz_4 = opr_sz / 4; | ||
102 | + intptr_t index = simd_data(desc); | ||
103 | + uint32_t *d = vd; | ||
104 | + uint8_t *n = vn; | ||
105 | + uint8_t *m_indexed = (uint8_t *)vm + index * 4; | ||
106 | + | ||
107 | + /* Notice the special case of opr_sz == 8, from aa64/aa32 advsimd. | ||
108 | + * Otherwise opr_sz is a multiple of 16. | ||
109 | + */ | ||
110 | + segend = MIN(4, opr_sz_4); | ||
111 | + i = 0; | ||
112 | + do { | ||
113 | + uint8_t m0 = m_indexed[i * 4 + 0]; | ||
114 | + uint8_t m1 = m_indexed[i * 4 + 1]; | ||
115 | + uint8_t m2 = m_indexed[i * 4 + 2]; | ||
116 | + uint8_t m3 = m_indexed[i * 4 + 3]; | ||
117 | + | ||
118 | + do { | ||
119 | + d[i] += n[i * 4 + 0] * m0 | ||
120 | + + n[i * 4 + 1] * m1 | ||
121 | + + n[i * 4 + 2] * m2 | ||
122 | + + n[i * 4 + 3] * m3; | ||
123 | + } while (++i < segend); | ||
124 | + segend = i + 4; | ||
125 | + } while (i < opr_sz_4); | ||
126 | + | ||
127 | + clear_tail(d, opr_sz, simd_maxsz(desc)); | ||
128 | +} | ||
129 | + | ||
130 | +void HELPER(gvec_sdot_idx_h)(void *vd, void *vn, void *vm, uint32_t desc) | ||
131 | +{ | ||
132 | + intptr_t i, opr_sz = simd_oprsz(desc), opr_sz_8 = opr_sz / 8; | ||
133 | + intptr_t index = simd_data(desc); | ||
134 | + uint64_t *d = vd; | ||
135 | + int16_t *n = vn; | ||
136 | + int16_t *m_indexed = (int16_t *)vm + index * 4; | ||
137 | + | ||
138 | + /* This is supported by SVE only, so opr_sz is always a multiple of 16. | ||
139 | + * Process the entire segment all at once, writing back the results | ||
140 | + * only after we've consumed all of the inputs. | ||
141 | + */ | ||
142 | + for (i = 0; i < opr_sz_8 ; i += 2) { | ||
143 | + uint64_t d0, d1; | ||
144 | + | ||
145 | + d0 = n[i * 4 + 0] * (int64_t)m_indexed[i * 4 + 0]; | ||
146 | + d0 += n[i * 4 + 1] * (int64_t)m_indexed[i * 4 + 1]; | ||
147 | + d0 += n[i * 4 + 2] * (int64_t)m_indexed[i * 4 + 2]; | ||
148 | + d0 += n[i * 4 + 3] * (int64_t)m_indexed[i * 4 + 3]; | ||
149 | + d1 = n[i * 4 + 4] * (int64_t)m_indexed[i * 4 + 0]; | ||
150 | + d1 += n[i * 4 + 5] * (int64_t)m_indexed[i * 4 + 1]; | ||
151 | + d1 += n[i * 4 + 6] * (int64_t)m_indexed[i * 4 + 2]; | ||
152 | + d1 += n[i * 4 + 7] * (int64_t)m_indexed[i * 4 + 3]; | ||
153 | + | ||
154 | + d[i + 0] += d0; | ||
155 | + d[i + 1] += d1; | ||
156 | + } | ||
157 | + | ||
158 | + clear_tail(d, opr_sz, simd_maxsz(desc)); | ||
159 | +} | ||
160 | + | ||
161 | +void HELPER(gvec_udot_idx_h)(void *vd, void *vn, void *vm, uint32_t desc) | ||
162 | +{ | ||
163 | + intptr_t i, opr_sz = simd_oprsz(desc), opr_sz_8 = opr_sz / 8; | ||
164 | + intptr_t index = simd_data(desc); | ||
165 | + uint64_t *d = vd; | ||
166 | + uint16_t *n = vn; | ||
167 | + uint16_t *m_indexed = (uint16_t *)vm + index * 4; | ||
168 | + | ||
169 | + /* This is supported by SVE only, so opr_sz is always a multiple of 16. | ||
170 | + * Process the entire segment all at once, writing back the results | ||
171 | + * only after we've consumed all of the inputs. | ||
172 | + */ | ||
173 | + for (i = 0; i < opr_sz_8 ; i += 2) { | ||
174 | + uint64_t d0, d1; | ||
175 | + | ||
176 | + d0 = n[i * 4 + 0] * (uint64_t)m_indexed[i * 4 + 0]; | ||
177 | + d0 += n[i * 4 + 1] * (uint64_t)m_indexed[i * 4 + 1]; | ||
178 | + d0 += n[i * 4 + 2] * (uint64_t)m_indexed[i * 4 + 2]; | ||
179 | + d0 += n[i * 4 + 3] * (uint64_t)m_indexed[i * 4 + 3]; | ||
180 | + d1 = n[i * 4 + 4] * (uint64_t)m_indexed[i * 4 + 0]; | ||
181 | + d1 += n[i * 4 + 5] * (uint64_t)m_indexed[i * 4 + 1]; | ||
182 | + d1 += n[i * 4 + 6] * (uint64_t)m_indexed[i * 4 + 2]; | ||
183 | + d1 += n[i * 4 + 7] * (uint64_t)m_indexed[i * 4 + 3]; | ||
184 | + | ||
185 | + d[i + 0] += d0; | ||
186 | + d[i + 1] += d1; | ||
187 | + } | ||
188 | + | ||
189 | + clear_tail(d, opr_sz, simd_maxsz(desc)); | ||
190 | +} | ||
191 | + | ||
192 | void HELPER(gvec_fcaddh)(void *vd, void *vn, void *vm, | ||
193 | void *vfpst, uint32_t desc) | ||
194 | { | ||
195 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
196 | index XXXXXXX..XXXXXXX 100644 | ||
197 | --- a/target/arm/sve.decode | ||
198 | +++ b/target/arm/sve.decode | ||
199 | @@ -XXX,XX +XXX,XX @@ MUL_zzi 00100101 .. 110 000 110 ........ ..... @rdn_i8s | ||
200 | # SVE integer dot product (unpredicated) | ||
201 | DOT_zzz 01000100 1 sz:1 0 rm:5 00000 u:1 rn:5 rd:5 ra=%reg_movprfx | ||
202 | |||
203 | +# SVE integer dot product (indexed) | ||
204 | +DOT_zzx 01000100 101 index:2 rm:3 00000 u:1 rn:5 rd:5 \ | ||
205 | + sz=0 ra=%reg_movprfx | ||
206 | +DOT_zzx 01000100 111 index:1 rm:4 00000 u:1 rn:5 rd:5 \ | ||
207 | + sz=1 ra=%reg_movprfx | ||
208 | + | ||
209 | # SVE floating-point complex add (predicated) | ||
210 | FCADD 01100100 esz:2 00000 rot:1 100 pg:3 rm:5 rd:5 \ | ||
211 | rn=%reg_movprfx | ||
212 | -- | 789 | -- |
213 | 2.17.1 | 790 | 2.20.1 |
214 | 791 | ||
215 | 792 | diff view generated by jsdifflib |
1 | We don't actually implement SD command CRC checking, because | 1 | docs/barrier.txt has a couple of TODO notes about things to be |
---|---|---|---|
2 | for almost all of our SD controllers the CRC generation is | 2 | implemented in this device; move them into a comment in the |
3 | done in hardware, and so modelling CRC generation and checking | 3 | source code. |
4 | would be a bit pointless. (The exception is that milkymist-memcard | ||
5 | makes the guest software compute the CRC.) | ||
6 | |||
7 | As a result almost all of our SD controller models don't bother | ||
8 | to set the SDRequest crc field, and the SD card model doesn't | ||
9 | check it. So the tracing of it in sdbus_do_command() provokes | ||
10 | Coverity warnings about use of uninitialized data. | ||
11 | |||
12 | Drop the CRC field from the trace; we can always add it back | ||
13 | if and when we do anything useful with the CRC. | ||
14 | |||
15 | Fixes Coverity issues 1386072, 1386074, 1386076, 1390571. | ||
16 | 4 | ||
17 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
18 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 6 | Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> |
19 | Message-id: 20180626180324.5537-1-peter.maydell@linaro.org | 7 | Reviewed-by: Laurent Vivier <laurent@vivier.eu> |
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20210727204112.12579-3-peter.maydell@linaro.org | ||
20 | --- | 10 | --- |
21 | hw/sd/core.c | 2 +- | 11 | docs/barrier.txt | 4 ---- |
22 | hw/sd/trace-events | 2 +- | 12 | ui/input-barrier.c | 5 +++++ |
23 | 2 files changed, 2 insertions(+), 2 deletions(-) | 13 | 2 files changed, 5 insertions(+), 4 deletions(-) |
24 | 14 | ||
25 | diff --git a/hw/sd/core.c b/hw/sd/core.c | 15 | diff --git a/docs/barrier.txt b/docs/barrier.txt |
26 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
27 | --- a/hw/sd/core.c | 17 | --- a/docs/barrier.txt |
28 | +++ b/hw/sd/core.c | 18 | +++ b/docs/barrier.txt |
29 | @@ -XXX,XX +XXX,XX @@ int sdbus_do_command(SDBus *sdbus, SDRequest *req, uint8_t *response) | 19 | @@ -XXX,XX +XXX,XX @@ |
30 | { | 20 | |
31 | SDState *card = get_card(sdbus); | 21 | (qemu) object_del barrier0 |
32 | 22 | (qemu) object_add input-barrier,id=barrier0,name=VM-1 | |
33 | - trace_sdbus_command(sdbus_name(sdbus), req->cmd, req->arg, req->crc); | 23 | -* TO DO |
34 | + trace_sdbus_command(sdbus_name(sdbus), req->cmd, req->arg); | 24 | - |
35 | if (card) { | 25 | - - Enable SSL |
36 | SDCardClass *sc = SD_CARD_GET_CLASS(card); | 26 | - - Manage SetOptions/ResetOptions commands |
37 | 27 | ||
38 | diff --git a/hw/sd/trace-events b/hw/sd/trace-events | 28 | diff --git a/ui/input-barrier.c b/ui/input-barrier.c |
39 | index XXXXXXX..XXXXXXX 100644 | 29 | index XXXXXXX..XXXXXXX 100644 |
40 | --- a/hw/sd/trace-events | 30 | --- a/ui/input-barrier.c |
41 | +++ b/hw/sd/trace-events | 31 | +++ b/ui/input-barrier.c |
42 | @@ -XXX,XX +XXX,XX @@ bcm2835_sdhost_edm_change(const char *why, uint32_t edm) "(%s) EDM now 0x%x" | 32 | @@ -XXX,XX +XXX,XX @@ |
43 | bcm2835_sdhost_update_irq(uint32_t irq) "IRQ bits 0x%x\n" | 33 | * |
44 | 34 | * This work is licensed under the terms of the GNU GPL, version 2 or later. | |
45 | # hw/sd/core.c | 35 | * See the COPYING file in the top-level directory. |
46 | -sdbus_command(const char *bus_name, uint8_t cmd, uint32_t arg, uint8_t crc) "@%s CMD%02d arg 0x%08x crc 0x%02x" | 36 | + * |
47 | +sdbus_command(const char *bus_name, uint8_t cmd, uint32_t arg) "@%s CMD%02d arg 0x%08x" | 37 | + * TODO: |
48 | sdbus_read(const char *bus_name, uint8_t value) "@%s value 0x%02x" | 38 | + * |
49 | sdbus_write(const char *bus_name, uint8_t value) "@%s value 0x%02x" | 39 | + * - Enable SSL |
50 | sdbus_set_voltage(const char *bus_name, uint16_t millivolts) "@%s %u (mV)" | 40 | + * - Manage SetOptions/ResetOptions commands |
41 | */ | ||
42 | |||
43 | #include "qemu/osdep.h" | ||
51 | -- | 44 | -- |
52 | 2.17.1 | 45 | 2.20.1 |
53 | 46 | ||
54 | 47 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | The remaining text in docs/barrier.txt is user-facing description |
---|---|---|---|
2 | of what the device is and how to use it. Move this into the | ||
3 | system manual and rstify it. | ||
2 | 4 | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Message-id: 20180627043328.11531-33-richard.henderson@linaro.org | ||
6 | [PMM: moved 'ra=%reg_movprfx' here from following patch] | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> | ||
7 | Reviewed-by: Laurent Vivier <laurent@vivier.eu> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20210727204112.12579-4-peter.maydell@linaro.org | ||
8 | --- | 10 | --- |
9 | target/arm/helper.h | 5 +++ | 11 | docs/barrier.txt | 48 ----------------------------------------- |
10 | target/arm/translate-sve.c | 17 ++++++++++ | 12 | docs/system/barrier.rst | 44 +++++++++++++++++++++++++++++++++++++ |
11 | target/arm/vec_helper.c | 67 ++++++++++++++++++++++++++++++++++++++ | 13 | docs/system/index.rst | 1 + |
12 | target/arm/sve.decode | 3 ++ | 14 | 3 files changed, 45 insertions(+), 48 deletions(-) |
13 | 4 files changed, 92 insertions(+) | 15 | delete mode 100644 docs/barrier.txt |
16 | create mode 100644 docs/system/barrier.rst | ||
14 | 17 | ||
15 | diff --git a/target/arm/helper.h b/target/arm/helper.h | 18 | diff --git a/docs/barrier.txt b/docs/barrier.txt |
19 | deleted file mode 100644 | ||
20 | index XXXXXXX..XXXXXXX | ||
21 | --- a/docs/barrier.txt | ||
22 | +++ /dev/null | ||
23 | @@ -XXX,XX +XXX,XX @@ | ||
24 | - QEMU Barrier Client | ||
25 | - | ||
26 | - | ||
27 | -* About | ||
28 | - | ||
29 | - Barrier is a KVM (Keyboard-Video-Mouse) software forked from Symless's | ||
30 | - synergy 1.9 codebase. | ||
31 | - | ||
32 | - See https://github.com/debauchee/barrier | ||
33 | - | ||
34 | -* QEMU usage | ||
35 | - | ||
36 | - Generally, mouse and keyboard are grabbed through the QEMU video | ||
37 | - interface emulation. | ||
38 | - | ||
39 | - But when we want to use a video graphic adapter via a PCI passthrough | ||
40 | - there is no way to provide the keyboard and mouse inputs to the VM | ||
41 | - except by plugging a second set of mouse and keyboard to the host | ||
42 | - or by installing a KVM software in the guest OS. | ||
43 | - | ||
44 | - The QEMU Barrier client avoids this by implementing directly the Barrier | ||
45 | - protocol into QEMU. | ||
46 | - | ||
47 | - This protocol is enabled by adding an input-barrier object to QEMU. | ||
48 | - | ||
49 | - Syntax: input-barrier,id=<object-id>,name=<guest display name> | ||
50 | - [,server=<barrier server address>][,port=<barrier server port>] | ||
51 | - [,x-origin=<x-origin>][,y-origin=<y-origin>] | ||
52 | - [,width=<width>][,height=<height>] | ||
53 | - | ||
54 | - The object can be added on the QEMU command line, for instance with: | ||
55 | - | ||
56 | - ... -object input-barrier,id=barrier0,name=VM-1 ... | ||
57 | - | ||
58 | - where VM-1 is the name the display configured int the Barrier server | ||
59 | - on the host providing the mouse and the keyboard events. | ||
60 | - | ||
61 | - by default <barrier server address> is "localhost", port is 24800, | ||
62 | - <x-origin> and <y-origin> are set to 0, <width> and <height> to | ||
63 | - 1920 and 1080. | ||
64 | - | ||
65 | - If Barrier server is stopped QEMU needs to be reconnected manually, | ||
66 | - by removing and re-adding the input-barrier object, for instance | ||
67 | - with the help of the HMP monitor: | ||
68 | - | ||
69 | - (qemu) object_del barrier0 | ||
70 | - (qemu) object_add input-barrier,id=barrier0,name=VM-1 | ||
71 | - | ||
72 | diff --git a/docs/system/barrier.rst b/docs/system/barrier.rst | ||
73 | new file mode 100644 | ||
74 | index XXXXXXX..XXXXXXX | ||
75 | --- /dev/null | ||
76 | +++ b/docs/system/barrier.rst | ||
77 | @@ -XXX,XX +XXX,XX @@ | ||
78 | +QEMU Barrier Client | ||
79 | +=================== | ||
80 | + | ||
81 | +Generally, mouse and keyboard are grabbed through the QEMU video | ||
82 | +interface emulation. | ||
83 | + | ||
84 | +But when we want to use a video graphic adapter via a PCI passthrough | ||
85 | +there is no way to provide the keyboard and mouse inputs to the VM | ||
86 | +except by plugging a second set of mouse and keyboard to the host | ||
87 | +or by installing a KVM software in the guest OS. | ||
88 | + | ||
89 | +The QEMU Barrier client avoids this by implementing directly the Barrier | ||
90 | +protocol into QEMU. | ||
91 | + | ||
92 | +`Barrier <https://github.com/debauchee/barrier>`__ | ||
93 | +is a KVM (Keyboard-Video-Mouse) software forked from Symless's | ||
94 | +synergy 1.9 codebase. | ||
95 | + | ||
96 | +This protocol is enabled by adding an input-barrier object to QEMU. | ||
97 | + | ||
98 | +Syntax:: | ||
99 | + | ||
100 | + input-barrier,id=<object-id>,name=<guest display name> | ||
101 | + [,server=<barrier server address>][,port=<barrier server port>] | ||
102 | + [,x-origin=<x-origin>][,y-origin=<y-origin>] | ||
103 | + [,width=<width>][,height=<height>] | ||
104 | + | ||
105 | +The object can be added on the QEMU command line, for instance with:: | ||
106 | + | ||
107 | + -object input-barrier,id=barrier0,name=VM-1 | ||
108 | + | ||
109 | +where VM-1 is the name the display configured in the Barrier server | ||
110 | +on the host providing the mouse and the keyboard events. | ||
111 | + | ||
112 | +by default ``<barrier server address>`` is ``localhost``, | ||
113 | +``<port>`` is ``24800``, ``<x-origin>`` and ``<y-origin>`` are set to ``0``, | ||
114 | +``<width>`` and ``<height>`` to ``1920`` and ``1080``. | ||
115 | + | ||
116 | +If the Barrier server is stopped QEMU needs to be reconnected manually, | ||
117 | +by removing and re-adding the input-barrier object, for instance | ||
118 | +with the help of the HMP monitor:: | ||
119 | + | ||
120 | + (qemu) object_del barrier0 | ||
121 | + (qemu) object_add input-barrier,id=barrier0,name=VM-1 | ||
122 | diff --git a/docs/system/index.rst b/docs/system/index.rst | ||
16 | index XXXXXXX..XXXXXXX 100644 | 123 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/helper.h | 124 | --- a/docs/system/index.rst |
18 | +++ b/target/arm/helper.h | 125 | +++ b/docs/system/index.rst |
19 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_5(gvec_qrdmlah_s32, TCG_CALL_NO_RWG, | 126 | @@ -XXX,XX +XXX,XX @@ or Hypervisor.Framework. |
20 | DEF_HELPER_FLAGS_5(gvec_qrdmlsh_s32, TCG_CALL_NO_RWG, | 127 | linuxboot |
21 | void, ptr, ptr, ptr, ptr, i32) | 128 | generic-loader |
22 | 129 | guest-loader | |
23 | +DEF_HELPER_FLAGS_4(gvec_sdot_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | 130 | + barrier |
24 | +DEF_HELPER_FLAGS_4(gvec_udot_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | 131 | vnc-security |
25 | +DEF_HELPER_FLAGS_4(gvec_sdot_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | 132 | tls |
26 | +DEF_HELPER_FLAGS_4(gvec_udot_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) | 133 | secrets |
27 | + | ||
28 | DEF_HELPER_FLAGS_5(gvec_fcaddh, TCG_CALL_NO_RWG, | ||
29 | void, ptr, ptr, ptr, ptr, i32) | ||
30 | DEF_HELPER_FLAGS_5(gvec_fcadds, TCG_CALL_NO_RWG, | ||
31 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
32 | index XXXXXXX..XXXXXXX 100644 | ||
33 | --- a/target/arm/translate-sve.c | ||
34 | +++ b/target/arm/translate-sve.c | ||
35 | @@ -XXX,XX +XXX,XX @@ DO_ZZI(UMIN, umin) | ||
36 | |||
37 | #undef DO_ZZI | ||
38 | |||
39 | +static bool trans_DOT_zzz(DisasContext *s, arg_DOT_zzz *a, uint32_t insn) | ||
40 | +{ | ||
41 | + static gen_helper_gvec_3 * const fns[2][2] = { | ||
42 | + { gen_helper_gvec_sdot_b, gen_helper_gvec_sdot_h }, | ||
43 | + { gen_helper_gvec_udot_b, gen_helper_gvec_udot_h } | ||
44 | + }; | ||
45 | + | ||
46 | + if (sve_access_check(s)) { | ||
47 | + unsigned vsz = vec_full_reg_size(s); | ||
48 | + tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), | ||
49 | + vec_full_reg_offset(s, a->rn), | ||
50 | + vec_full_reg_offset(s, a->rm), | ||
51 | + vsz, vsz, 0, fns[a->u][a->sz]); | ||
52 | + } | ||
53 | + return true; | ||
54 | +} | ||
55 | + | ||
56 | /* | ||
57 | *** SVE Floating Point Multiply-Add Indexed Group | ||
58 | */ | ||
59 | diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c | ||
60 | index XXXXXXX..XXXXXXX 100644 | ||
61 | --- a/target/arm/vec_helper.c | ||
62 | +++ b/target/arm/vec_helper.c | ||
63 | @@ -XXX,XX +XXX,XX @@ void HELPER(gvec_qrdmlsh_s32)(void *vd, void *vn, void *vm, | ||
64 | clear_tail(d, opr_sz, simd_maxsz(desc)); | ||
65 | } | ||
66 | |||
67 | +/* Integer 8 and 16-bit dot-product. | ||
68 | + * | ||
69 | + * Note that for the loops herein, host endianness does not matter | ||
70 | + * with respect to the ordering of data within the 64-bit lanes. | ||
71 | + * All elements are treated equally, no matter where they are. | ||
72 | + */ | ||
73 | + | ||
74 | +void HELPER(gvec_sdot_b)(void *vd, void *vn, void *vm, uint32_t desc) | ||
75 | +{ | ||
76 | + intptr_t i, opr_sz = simd_oprsz(desc); | ||
77 | + uint32_t *d = vd; | ||
78 | + int8_t *n = vn, *m = vm; | ||
79 | + | ||
80 | + for (i = 0; i < opr_sz / 4; ++i) { | ||
81 | + d[i] += n[i * 4 + 0] * m[i * 4 + 0] | ||
82 | + + n[i * 4 + 1] * m[i * 4 + 1] | ||
83 | + + n[i * 4 + 2] * m[i * 4 + 2] | ||
84 | + + n[i * 4 + 3] * m[i * 4 + 3]; | ||
85 | + } | ||
86 | + clear_tail(d, opr_sz, simd_maxsz(desc)); | ||
87 | +} | ||
88 | + | ||
89 | +void HELPER(gvec_udot_b)(void *vd, void *vn, void *vm, uint32_t desc) | ||
90 | +{ | ||
91 | + intptr_t i, opr_sz = simd_oprsz(desc); | ||
92 | + uint32_t *d = vd; | ||
93 | + uint8_t *n = vn, *m = vm; | ||
94 | + | ||
95 | + for (i = 0; i < opr_sz / 4; ++i) { | ||
96 | + d[i] += n[i * 4 + 0] * m[i * 4 + 0] | ||
97 | + + n[i * 4 + 1] * m[i * 4 + 1] | ||
98 | + + n[i * 4 + 2] * m[i * 4 + 2] | ||
99 | + + n[i * 4 + 3] * m[i * 4 + 3]; | ||
100 | + } | ||
101 | + clear_tail(d, opr_sz, simd_maxsz(desc)); | ||
102 | +} | ||
103 | + | ||
104 | +void HELPER(gvec_sdot_h)(void *vd, void *vn, void *vm, uint32_t desc) | ||
105 | +{ | ||
106 | + intptr_t i, opr_sz = simd_oprsz(desc); | ||
107 | + uint64_t *d = vd; | ||
108 | + int16_t *n = vn, *m = vm; | ||
109 | + | ||
110 | + for (i = 0; i < opr_sz / 8; ++i) { | ||
111 | + d[i] += (int64_t)n[i * 4 + 0] * m[i * 4 + 0] | ||
112 | + + (int64_t)n[i * 4 + 1] * m[i * 4 + 1] | ||
113 | + + (int64_t)n[i * 4 + 2] * m[i * 4 + 2] | ||
114 | + + (int64_t)n[i * 4 + 3] * m[i * 4 + 3]; | ||
115 | + } | ||
116 | + clear_tail(d, opr_sz, simd_maxsz(desc)); | ||
117 | +} | ||
118 | + | ||
119 | +void HELPER(gvec_udot_h)(void *vd, void *vn, void *vm, uint32_t desc) | ||
120 | +{ | ||
121 | + intptr_t i, opr_sz = simd_oprsz(desc); | ||
122 | + uint64_t *d = vd; | ||
123 | + uint16_t *n = vn, *m = vm; | ||
124 | + | ||
125 | + for (i = 0; i < opr_sz / 8; ++i) { | ||
126 | + d[i] += (uint64_t)n[i * 4 + 0] * m[i * 4 + 0] | ||
127 | + + (uint64_t)n[i * 4 + 1] * m[i * 4 + 1] | ||
128 | + + (uint64_t)n[i * 4 + 2] * m[i * 4 + 2] | ||
129 | + + (uint64_t)n[i * 4 + 3] * m[i * 4 + 3]; | ||
130 | + } | ||
131 | + clear_tail(d, opr_sz, simd_maxsz(desc)); | ||
132 | +} | ||
133 | + | ||
134 | void HELPER(gvec_fcaddh)(void *vd, void *vn, void *vm, | ||
135 | void *vfpst, uint32_t desc) | ||
136 | { | ||
137 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
138 | index XXXXXXX..XXXXXXX 100644 | ||
139 | --- a/target/arm/sve.decode | ||
140 | +++ b/target/arm/sve.decode | ||
141 | @@ -XXX,XX +XXX,XX @@ UMIN_zzi 00100101 .. 101 011 110 ........ ..... @rdn_i8u | ||
142 | # SVE integer multiply immediate (unpredicated) | ||
143 | MUL_zzi 00100101 .. 110 000 110 ........ ..... @rdn_i8s | ||
144 | |||
145 | +# SVE integer dot product (unpredicated) | ||
146 | +DOT_zzz 01000100 1 sz:1 0 rm:5 00000 u:1 rn:5 rd:5 ra=%reg_movprfx | ||
147 | + | ||
148 | # SVE floating-point complex add (predicated) | ||
149 | FCADD 01100100 esz:2 00000 rot:1 100 pg:3 rm:5 rd:5 \ | ||
150 | rn=%reg_movprfx | ||
151 | -- | 134 | -- |
152 | 2.17.1 | 135 | 2.20.1 |
153 | 136 | ||
154 | 137 | diff view generated by jsdifflib |