[PATCH] Support APSR_nzcv as operand for Thumb2 mrc

Tim Northover t.p.northover at gmail.com
Tue Jun 25 02:56:33 PDT 2013


Hi Mihail,

> Please review the attached patch.
> This adds APSR_nzcv as a valid operand for Thumb2 mrc instructions.

I realise this is just extending ARM behaviour to Thumb2 but I think
the MCInst representation is dodgy, as evidenced by the "pc" variants
printing again with a "pc" instead of "apsr_nzcv". These are the same
instructions so there should only be one valid MCInst representing
them.

If we really, really want to support pre-UAL syntax output at some
point in the future that should be handled by some policy decision
acting on the canonical MCInst for a particular instruction instead.

I think you should be able to handle things reasonably neatly (i.e.
without instruction-specific MRC/... hacks) by adding a
"RegisterOperand" class for GPRwithAPSR that links into the AsmParser
and switches a parsed "pc" to an "apsr".

Cheers.

Tim.



More information about the llvm-commits mailing list