[PATCH] [lbc++abi] [unwinder] Support Cortex-m0

Jonathan Roelofs jonathan at codesourcery.com
Tue Sep 16 08:10:23 PDT 2014


>>! In D5314#14, @compnerd wrote:
> Please drop `ARM_RETURN` and use `JMP(lr)`.  That is duplicating an existing macro which is already in use.
Sure, I'll copy over the ARM part of compiler_rt's assembly.h
> 
> Im not sure I understand why you are creating a new macro for the thumb check.  `__ARM_ARCH_ISA_THUMB == 1` is sufficient to identify if you only have Thumb-1.  However, do you really want to use thumb instructions if you only have Thumb-1?
Sorry, bad name. What I meant here is to have a macro that means "doesn't have the ARM instruction set" (i.e. v6m, v6sm, v7m). I think this is what I actually mean:


```
#if !defined(__ARM_ARCH_ISA_ARM)
```

> 
> I dont understand the need for the `ARM_HAS_NO_VFP`.  Isn't `__VFP_FP__` usable for your check there?  I don't think we need yet another macro, particularly if there is one that is defined by the compiler.
No, `__VFP_FP__` isn't the right one for this.  The best reference I can find for what that one means is this: https://wiki.debian.org/ArmEabiPort "Note that `__VFP_FP__` does not mean that VFP code generation has been selected. It only speaks of the floating point data format in use and is normally set when soft-float has been selected."

After some digging around in http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053c/IHI0053C_acle_2_0.pdf I think `__ARM_FP` is the right one to use, but it looks like clang doesn't ever define that one on 32bit arm. I should probably fix that first....
> 
> Finally, is `__ARM_WMMX` supposed to be defined for ARMv6M/s?
I don't know of any v6m/v6sm's with iWMMX instructions (and therefore `__ARM_WMMX`), but it might be possible that could exist, hence the:

```
#if (!defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)) || __ARM_WMMX
```

My assembler barfs on the coprocessor instructions in those blocks, so maybe it's not possible to have iWMMX instructions on a v6m part?

http://reviews.llvm.org/D5314






More information about the cfe-commits mailing list