This is an archive of the discontinued LLVM Phabricator instance.

[Builtins][ARM] Force ARM state for bswap for pre-ARMv6
Needs ReviewPublic

Authored by weimingz on Aug 15 2017, 11:45 AM.

Details

Reviewers
rengolin
compnerd
Summary

The instructions for bswp guarded by "__ARM_ARCH < 6" is ARM code. E.g., bic (immediate), eor (register-shifted register).
This patch forces ARM state even if -mthumb is used (e.g. -mthumb is passed as a global option by build system)

Diff Detail

Event Timeline

weimingz created this revision.Aug 15 2017, 11:45 AM
efriedma added inline comments.
lib/builtins/arm/bswapdi2.S
30

This doesn't do the right thing: the function symbol will still be decorated with .thumb_func, so this will try to execute ARM instructions in Thumb mode (and probably crash).

weimingz updated this revision to Diff 111231.Aug 15 2017, 12:57 PM

guard the "DEFINE_CODE_STATE" with "__ARM_ARCH < 6" check.