This patch adds instruction selection patterns for the TT, TTT, TTA, and TTAT
instructions and tests for llvm.arm.cmse.tt, llvm.arm.cmse.ttt,
llvm.arm.cmse.tta, and llvm.arm.cmse.ttat intrinsics (added in a previous
patch).
Patch by Javed Absar.
Differential D70407
[ARM] Generate CMSE instructions from CMSE intrinsics chill on Nov 18 2019, 10:27 AM. Authored by Tokens
Details This patch adds instruction selection patterns for the TT, TTT, TTA, and TTAT Patch by Javed Absar.
Diff Detail Event Timeline
Comment Actions Awesome I'll test it out with my use case and report back if it works :) and thank you so much for your work. Comment Actions Yep. Still LGTM. I have just added a lot of little formatting suggestions. You are free to ignore any or all of them if you disagree. Whatever you think is best. No need for a re-review. Oh, and @sigvartmh, I believe this is something like step 4 out of 8 or so. It will not yet do the register clearing that you would expect from a CMSE implementation, for example. That will be the interesting part.
Comment Actions @dmgreen That's fine by me. I do understand that this can take some time to add everything which is needed. As always thank you so much for working on this :) Question: Is this sufficient to generate code which sets the processor into non-secure handler/thread mode? I'm fine with not having everything clean up all the registeres etc. I'm just going to use it for testing purposes at the moment to prepare a build system to handle llvm as a back-end for ARMv8-m. Comment Actions No, this is not enough. In the incoming patches, the only mode-change relevant things would be CMSE entry functions returning via BXNS, and calling The assembly support should be compete already, though. Comment Actions Will commit next week, since we're on the move and might not be able to promptly react to breakage. |
I would make it look something like this, which I think is pretty standard for the arm backend. Maybe something like: