[PATCH] D18955: [ARM] Avoid switching ARM/Thumb mode on .arch/.cpu directive

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 04:26:28 PDT 2016


olista01 created this revision.
olista01 added reviewers: rengolin, t.p.northover.
olista01 added a subscriber: llvm-commits.
olista01 set the repository for this revision to rL LLVM.
Herald added subscribers: rengolin, aemerson.

When we see a .arch or .cpu directive, we should try to avoid switching
ARM/Thumb mode if possible.

If we do have to switch modes, we also need to emit the correct mapping
symbol for the new ISA. We did not do this previously, so could emit
ARM code with Thumb mapping symbols (or vice-versa).

The GAS behaviour is to always stay in the same mode, and to emit an
error on any instructions seen when the current mode is not available on
the current target. We can't represent that situation easily (we assume
that Thumb mode is available if ModeThumb is set), so we differ from the
GAS behaviour when switching to a target that can't support the old
mode. I've added a warning for when this implicit mode-switch occurs.

Repository:
  rL LLVM

http://reviews.llvm.org/D18955

Files:
  lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  test/MC/ARM/directive-arch-mode-switch.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18955.53217.patch
Type: text/x-patch
Size: 3642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160411/df8dbc3f/attachment.bin>


More information about the llvm-commits mailing list