qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] target/arm: copro decode cleanup
@ 2020-08-03 11:18 Peter Maydell
  2020-08-03 11:18 ` [PATCH 1/7] target/arm: Pull handling of XScale insns out of disas_coproc_insn() Peter Maydell
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Peter Maydell @ 2020-08-03 11:18 UTC (permalink / raw)
  To: qemu-arm, qemu-devel

This patchset cleans up the handling of copro instructions in
the A32/T32 decoder, converting the MRC/MCR/MRRC/MCRR insns
to decodetree.

The main motivation here was correcting how we do NOCP checks for
M-profile: the architecture specifies that the NOCP exception when a
coprocessor is not present or disabled should cover the entire wide
range of coprocessor-space encodings, and should take precedence over
UNDEF exceptions.  (This is the opposite of A-profile, where checking
for a disabled FPU has to happen last.) This is mandatory from
v8.1M and recommended for v8.0M, but we were having UNDEFs in the
VFP encodings taking precedence over NOCP. The patchset's solution
to this is to have a decodetree decoder which matches (a) the
two or three insns which are defined to not get this NOCP behaviour
and (b) the area of the encoding space which does need to be NOCP'd
if the coprocessor is not present, and invoke this before any of
the other decoding.

The rest is mostly cleanup: we split out the XScale decode handling
from disas_coproc_insn() and then convert the normal coproc
insns to decodetree patterns in a32.decode and t32.decode.
After these patches, the only remaining "legacy decoder" code
is disas_xscale_insn()/disas_iwmmxt_insn(). The conversion does
fix a minor underdecoding: we weren't checking that bits [24:21]
of MRRC/MCRR were 0b0010, so some patterns that should have been
UNDEFed as LDC/STC were instead treated as MRRC/MCRR.

It's hard to see it ever being worthwhile to convert the
xscale/iwmmxt decode to decodetree -- we don't have the same
requirement to be able to add new insn support to it. I
suppose we could replace checks like 
 if ((insn & 0x0e000f00) == 0x0c000100)
in disas_arm_insn() with a single decodetree pattern in
a32.decode that invoked disas_iwmmxt_insn(), but I dunno that
that's really any neater...

thanks
-- PMM

Peter Maydell (7):
  target/arm: Pull handling of XScale insns out of disas_coproc_insn()
  target/arm: Separate decode from handling of coproc insns
  target/arm: Convert A32 coprocessor insns to decodetree
  target/arm: Tidy up disas_arm_insn()
  target/arm: Do M-profile NOCP checks early and via decodetree
  target/arm: Convert T32 coprocessor insns to decodetree
  target/arm: Remove ARCH macro

 target/arm/a32.decode          |  19 +++
 target/arm/m-nocp.decode       |  42 ++++++
 target/arm/t32.decode          |  19 +++
 target/arm/vfp.decode          |   2 -
 target/arm/helper.c            |  29 ++++
 target/arm/translate-vfp.inc.c |  52 +++++--
 target/arm/translate.c         | 240 +++++++++++++++++----------------
 target/arm/Makefile.objs       |   6 +
 8 files changed, 284 insertions(+), 125 deletions(-)
 create mode 100644 target/arm/m-nocp.decode

-- 
2.20.1



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-08-05  3:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-03 11:18 [PATCH 0/7] target/arm: copro decode cleanup Peter Maydell
2020-08-03 11:18 ` [PATCH 1/7] target/arm: Pull handling of XScale insns out of disas_coproc_insn() Peter Maydell
2020-08-04 14:49   ` Richard Henderson
2020-08-03 11:18 ` [PATCH 2/7] target/arm: Separate decode from handling of coproc insns Peter Maydell
2020-08-04 14:53   ` Richard Henderson
2020-08-03 11:18 ` [PATCH 3/7] target/arm: Convert A32 coprocessor insns to decodetree Peter Maydell
2020-08-05  2:53   ` Richard Henderson
2020-08-03 11:18 ` [PATCH 4/7] target/arm: Tidy up disas_arm_insn() Peter Maydell
2020-08-05  2:57   ` Richard Henderson
2020-08-03 11:18 ` [PATCH 5/7] target/arm: Do M-profile NOCP checks early and via decodetree Peter Maydell
2020-08-05  3:04   ` Richard Henderson
2020-08-03 11:18 ` [PATCH 6/7] target/arm: Convert T32 coprocessor insns to decodetree Peter Maydell
2020-08-05  3:05   ` Richard Henderson
2020-08-03 11:18 ` [PATCH 7/7] target/arm: Remove ARCH macro Peter Maydell
2020-08-05  3:07   ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).