# compiler-rt: correct use_thumb_1 flag · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/aff2e47821aaad5cac74ed8a3cac2e72283b594b)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: aff2e47821aaad5cac74ed8a3cac2e72283b594b

Requested commit: aff2e47821aaad5cac74ed8a3cac2e72283b594b

Commit: aff2e47821aaad5cac74ed8a3cac2e72283b594b

Tree: a34d36b0b6a4e628a5be0bb883e03607bf877194

Author: vegecode

Committer: Andrew Kelley

## Message

````
compiler-rt: correct use_thumb_1 flag

The flag is for generating correct arm-thumb interwork veneers in the
assembly code __aeabi_{memcpy,memset,etc} functions.

Armv6m only does thumb code generation regardless of whether arm or
thumb is selected and armv6t2 uses the newer thumb 2 set. All other
versions that zig supports pre-armv7 need the veneers and hence the
flag. Armv5 is actually armv5t.

Relevant code from clang/lib/Basic/Targets/Arm.cpp

```c
bool ARMTargetInfo::isThumb() const {
  return ArchISA == llvm::ARM::ISAKind::THUMB;
  }

bool ARMTargetInfo::supportsThumb() const {
  return CPUAttr.count('T') || ArchVersion >= 6;
}

bool ARMTargetInfo::supportsThumb2() const {
  return CPUAttr.equals("6T2") ||
    (ArchVersion >= 7 && !CPUAttr.equals("8M_BASE"));
}
```

Also see

http://www.llvm.org/svn/llvm-project/llvm/trunk/lib/Target/ARM/ARM.td

````

## Parents

- [dea1027f9799e6ce0f7f2594c6b555d9675c281a](https://git.cafe/gitcafe/zig/commit/dea1027f9799e6ce0f7f2594c6b555d9675c281a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/aff2e47821aaad5cac74ed8a3cac2e72283b594b?format=markdown)
