diff options
author | Asiri Rathnayake <asiri.rathnayake@arm.com> | 2016-07-07 10:55:39 +0000 |
---|---|---|
committer | Asiri Rathnayake <asiri.rathnayake@arm.com> | 2016-07-07 10:55:39 +0000 |
commit | f33c3423ec8e9dc319e464675804399a605409ed (patch) | |
tree | c98e74eefed02c49e018e656dc2934bc3cbcd6f0 /libunwind/src/Unwind-EHABI.cpp | |
parent | 130802b33974b3c3cb85140f4f92128f2bfe65eb (diff) | |
download | bcm5719-llvm-f33c3423ec8e9dc319e464675804399a605409ed.tar.gz bcm5719-llvm-f33c3423ec8e9dc319e464675804399a605409ed.zip |
[libunwind][ARM] Improve unwinder stack usage - Make WMMX support optional
These registers are only available on a limited set of ARM targets (those
based on XScale). Other targets should not have to pay the cost of these.
This patch shaves off about ~300 bytes of stack usage and ~1KB of code-size.
Differential revision: http://reviews.llvm.org/D21991
Reviewers: bcraig, compnerd
Change-Id: I2d7a1911a193bd70b123e78747e1a7d1482463c7
llvm-svn: 274744
Diffstat (limited to 'libunwind/src/Unwind-EHABI.cpp')
-rw-r--r-- | libunwind/src/Unwind-EHABI.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/libunwind/src/Unwind-EHABI.cpp b/libunwind/src/Unwind-EHABI.cpp index 5950c6902e3..b6a0b414107 100644 --- a/libunwind/src/Unwind-EHABI.cpp +++ b/libunwind/src/Unwind-EHABI.cpp @@ -351,6 +351,7 @@ _Unwind_Reason_Code _Unwind_VRS_Interpret( } case 0xc0: { switch (byte) { +#if defined(__ARM_WMMX) case 0xc0: case 0xc1: case 0xc2: @@ -378,6 +379,7 @@ _Unwind_Reason_Code _Unwind_VRS_Interpret( _Unwind_VRS_Pop(context, _UVRSC_WMMXC, v, _UVRSD_DOUBLE); break; } +#endif case 0xc8: case 0xc9: { uint8_t v = getByte(data, offset++); @@ -771,13 +773,6 @@ _Unwind_VRS_Set(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, *(unw_word_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; - case _UVRSC_WMMXC: - if (representation != _UVRSD_UINT32 || regno > 3) - return _UVRSR_FAILED; - return unw_set_reg(cursor, (unw_regnum_t)(UNW_ARM_WC0 + regno), - *(unw_word_t *)valuep) == UNW_ESUCCESS - ? _UVRSR_OK - : _UVRSR_FAILED; case _UVRSC_VFP: if (representation != _UVRSD_VFPX && representation != _UVRSD_DOUBLE) return _UVRSR_FAILED; @@ -794,6 +789,14 @@ _Unwind_VRS_Set(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, *(unw_fpreg_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; +#if defined(__ARM_WMMX) + case _UVRSC_WMMXC: + if (representation != _UVRSD_UINT32 || regno > 3) + return _UVRSR_FAILED; + return unw_set_reg(cursor, (unw_regnum_t)(UNW_ARM_WC0 + regno), + *(unw_word_t *)valuep) == UNW_ESUCCESS + ? _UVRSR_OK + : _UVRSR_FAILED; case _UVRSC_WMMXD: if (representation != _UVRSD_DOUBLE || regno > 31) return _UVRSR_FAILED; @@ -801,6 +804,7 @@ _Unwind_VRS_Set(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, *(unw_fpreg_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; +#endif } _LIBUNWIND_ABORT("unsupported register class"); } @@ -819,13 +823,6 @@ _Unwind_VRS_Get_Internal(_Unwind_Context *context, (unw_word_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; - case _UVRSC_WMMXC: - if (representation != _UVRSD_UINT32 || regno > 3) - return _UVRSR_FAILED; - return unw_get_reg(cursor, (unw_regnum_t)(UNW_ARM_WC0 + regno), - (unw_word_t *)valuep) == UNW_ESUCCESS - ? _UVRSR_OK - : _UVRSR_FAILED; case _UVRSC_VFP: if (representation != _UVRSD_VFPX && representation != _UVRSD_DOUBLE) return _UVRSR_FAILED; @@ -842,6 +839,14 @@ _Unwind_VRS_Get_Internal(_Unwind_Context *context, (unw_fpreg_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; +#if defined(__ARM_WMMX) + case _UVRSC_WMMXC: + if (representation != _UVRSD_UINT32 || regno > 3) + return _UVRSR_FAILED; + return unw_get_reg(cursor, (unw_regnum_t)(UNW_ARM_WC0 + regno), + (unw_word_t *)valuep) == UNW_ESUCCESS + ? _UVRSR_OK + : _UVRSR_FAILED; case _UVRSC_WMMXD: if (representation != _UVRSD_DOUBLE || regno > 31) return _UVRSR_FAILED; @@ -849,6 +854,7 @@ _Unwind_VRS_Get_Internal(_Unwind_Context *context, (unw_fpreg_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; +#endif } _LIBUNWIND_ABORT("unsupported register class"); } |