diff options
author | Julian Brown <julian@codesourcery.com> | 2006-04-26 16:24:26 +0000 |
---|---|---|
committer | Julian Brown <julian@codesourcery.com> | 2006-04-26 16:24:26 +0000 |
commit | c7643fae1d755d159165d97769df1ca62f6bedf1 (patch) | |
tree | e2ff259e7b935ee5c2d3c9e80aeaa6cf2887df97 | |
parent | d3f5377c41a971bbf1bbdf901348a78b95571602 (diff) | |
download | gdb-c7643fae1d755d159165d97769df1ca62f6bedf1.tar.gz |
* gas/config/tc-arm.c (neon_is_quarter_float): Move, and rename to...
(is_quarter_float): Rename from above. Simplify slightly.
(parse_qfloat_immediate): Parse a "quarter precision" floating-point
number.
(parse_neon_mov): Parse floating-point constants.
(neon_qfloat_bits): Fix encoding.
(neon_cmode_for_move_imm): Tweak to use floating-point encoding in
preference to integer encoding when using the F32 type.
* gas/testsuite/gas/arm/neon-const.s: New testcase. Neon floating-point
constants.
* gas/testsuite/gas/arm/neon-const.d: Expected output of above.
* gas/testsuite/gas/arm/neon-cov.d: Expect floating-point disassembly
for VMOV.F32.
* opcodes/arm-dis.c (print_insn_neon): Disassemble floating-point
constant VMOV.
-rw-r--r-- | ChangeLog.csl | 20 | ||||
-rw-r--r-- | opcodes/arm-dis.c | 27 |
2 files changed, 45 insertions, 2 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl index d0cc33389e7..271df1dab61 100644 --- a/ChangeLog.csl +++ b/ChangeLog.csl @@ -1,3 +1,23 @@ +2006-04-26 Julian Brown <julian@codesourcery.com> + + * gas/config/tc-arm.c (neon_is_quarter_float): Move, and rename to... + (is_quarter_float): Rename from above. Simplify slightly. + (parse_qfloat_immediate): Parse a "quarter precision" floating-point + number. + (parse_neon_mov): Parse floating-point constants. + (neon_qfloat_bits): Fix encoding. + (neon_cmode_for_move_imm): Tweak to use floating-point encoding in + preference to integer encoding when using the F32 type. + + * gas/testsuite/gas/arm/neon-const.s: New testcase. Neon floating-point + constants. + * gas/testsuite/gas/arm/neon-const.d: Expected output of above. + * gas/testsuite/gas/arm/neon-cov.d: Expect floating-point disassembly + for VMOV.F32. + + * opcodes/arm-dis.c (print_insn_neon): Disassemble floating-point + constant VMOV. + 2006-04-24 Julian Brown <julian@codesourcery.com> * libiberty/floatformat.c (floatformat_to_double): Fix (biased) diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c index f6cac6563c3..6ca93335d38 100644 --- a/opcodes/arm-dis.c +++ b/opcodes/arm-dis.c @@ -26,6 +26,7 @@ #include "opcode/arm.h" #include "opintl.h" #include "safe-ctype.h" +#include "floatformat.h" /* FIXME: This shouldn't be done here. */ #include "coff/internal.h" @@ -2283,6 +2284,7 @@ print_insn_neon (struct disassemble_info *info, long given, bfd_boolean thumb) unsigned long value = 0, hival = 0; unsigned shift; int size = 0; + int isfloat = 0; bits |= ((given >> 24) & 1) << 7; bits |= ((given >> 16) & 7) << 4; @@ -2339,11 +2341,12 @@ print_insn_neon (struct disassemble_info *info, long given, bfd_boolean thumb) /* floating point encoding */ int tmp; - value = (unsigned long)(bits & 0x7f) << (24 - 6); + value = (unsigned long)(bits & 0x7f) << 19; value |= (unsigned long)(bits & 0x80) << 24; tmp = bits & 0x40 ? 0x3c : 0x40; value |= (unsigned long)tmp << 24; size = 32; + isfloat = 1; } else { @@ -2363,7 +2366,27 @@ print_insn_neon (struct disassemble_info *info, long given, bfd_boolean thumb) break; case 32: - func (stream, "#%ld\t; 0x%.8lx", value, value); + if (isfloat) + { + unsigned char valbytes[4]; + double fvalue; + + /* Do this a byte at a time so we don't have to + worry about the host's endianness. */ + valbytes[0] = value & 0xff; + valbytes[1] = (value >> 8) & 0xff; + valbytes[2] = (value >> 16) & 0xff; + valbytes[3] = (value >> 24) & 0xff; + + floatformat_to_double + (&floatformat_ieee_single_little, valbytes, + &fvalue); + + func (stream, "#%.7g\t; 0x%.8lx", fvalue, + value); + } + else + func (stream, "#%ld\t; 0x%.8lx", value, value); break; case 64: |