[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 22/24] target-arm: A64: Add floating-point<->inte
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH v2 22/24] target-arm: A64: Add floating-point<->integer conversion instructions |
Date: |
Mon, 6 Jan 2014 13:11:19 +0000 |
From: Will Newton <address@hidden>
Add support for the AArch64 floating-point <-> integer conversion
instructions to disas_fpintconv. In the process we can rearrange
and simplify the detection of unallocated encodings a little.
We also correct a typo in the instruction encoding diagram for this
instruction group: bit 21 is 1, not 0.
Signed-off-by: Will Newton <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
target-arm/translate-a64.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
index ec8abc7..9b23d37 100644
--- a/target-arm/translate-a64.c
+++ b/target-arm/translate-a64.c
@@ -3904,7 +3904,7 @@ static void handle_fmov(DisasContext *s, int rd, int rn,
int type, bool itof)
/* C3.6.30 Floating point <-> integer conversions
* 31 30 29 28 24 23 22 21 20 19 18 16 15 10 9 5 4 0
* +----+---+---+-----------+------+---+-------+-----+-------------+----+----+
- * | sf | 0 | S | 1 1 1 1 0 | type | 0 | rmode | opc | 0 0 0 0 0 0 | Rn | Rd |
+ * | sf | 0 | S | 1 1 1 1 0 | type | 1 | rmode | opc | 0 0 0 0 0 0 | Rn | Rd |
* +----+---+---+-----------+------+---+-------+-----+-------------+----+----+
*/
static void disas_fp_int_conv(DisasContext *s, uint32_t insn)
@@ -3917,10 +3917,20 @@ static void disas_fp_int_conv(DisasContext *s, uint32_t
insn)
bool sbit = extract32(insn, 29, 1);
bool sf = extract32(insn, 31, 1);
- if (!sbit && (rmode < 2) && (opcode > 5)) {
+ if (sbit) {
+ unallocated_encoding(s);
+ return;
+ }
+
+ if (opcode > 5) {
/* FMOV */
bool itof = opcode & 1;
+ if (rmode >= 2) {
+ unallocated_encoding(s);
+ return;
+ }
+
switch (sf << 3 | type << 1 | rmode) {
case 0x0: /* 32 bit */
case 0xa: /* 64 bit */
@@ -3935,7 +3945,14 @@ static void disas_fp_int_conv(DisasContext *s, uint32_t
insn)
handle_fmov(s, rd, rn, type, itof);
} else {
/* actual FP conversions */
- unsupported_encoding(s, insn);
+ bool itof = extract32(opcode, 1, 1);
+
+ if (type > 1 || (rmode != 0 && opcode > 1)) {
+ unallocated_encoding(s);
+ return;
+ }
+
+ handle_fpfpcvt(s, rd, rn, opcode, itof, rmode, 64, sf, type);
}
}
--
1.8.5
- [Qemu-devel] [PATCH v2 00/24] A64 decoder patchset 6: rest of floating point, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 15/24] softfloat: Refactor code handling various rounding modes, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 06/24] softfloat: Only raise Invalid when conversions to int are out of range, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 22/24] target-arm: A64: Add floating-point<->integer conversion instructions,
Peter Maydell <=
- [Qemu-devel] [PATCH v2 23/24] target-arm: A64: Add 1-source 32-to-32 and 64-to-64 FP instructions, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 17/24] target-arm: Prepare VFP_CONV_FIX helpers for A64 uses, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 07/24] softfloat: Fix factor 2 error for scalbn on denormal inputs, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 20/24] target-arm: A64: Add extra VFP fixed point conversion helpers, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 16/24] softfloat: Add support for ties-away rounding, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 10/24] softfloat: Fix float64_to_uint32, Peter Maydell, 2014/01/06