[LLVMdev] CPUStringIsValid() into MCSubtargetInfo and use it for ARM .cpu parsing

Sumanth Gundapaneni sgundapa at codeaurora.org
Wed Jan 28 19:30:57 PST 2015


Tim,
       How about the below option ?

1. Specify an existing generic armv7 CPU or the CPU which is close my custom variant. My custom variant can be treated as "cortex-a9" + hwdiv.
    So my CPU here is "cortex-a9"
2. Specify the ".arch_extension idiv" which is available as an extension for my custom variant. 
3. Teach LLVM & Clang about your CPU's features, either locally or upstream. 
4. Pass "-mhwdiv=arm,thumb" to Clang (or less if you only have hwdiv in one mode).

--Sumanth G
-----Original Message-----
From: Tim Northover [mailto:t.p.northover at gmail.com] 
Sent: Tuesday, January 27, 2015 6:44 PM
To: Sumanth Gundapaneni
Cc: LLVM Developers Mailing List; Roman Divacky; Ana Pazos
Subject: Re: [LLVMdev] CPUStringIsValid() into MCSubtargetInfo and use it for ARM .cpu parsing

Hi Sumanth,

> Shouldn’t the eabi attributes be honored ?

EABI attributes are instructions for the linker on which object files are compatible with each other, not instructions for the assembler (and trying to make them so sounds like a recipe for confusion to me).
>From the ARM ABI addenda:

"Build attributes record data that a linker needs to reason mechanically about the compatibility, or incompatibility, of a set of relocatable files."

> What should be the approach to fix the issue which I am facing?

There are a few options here:
1. Specify an existing CPU that has hardware division (notably,
Cortex-A9 doesn't).
2. Teach LLVM & Clang about your CPU's features, either locally or upstream.
3. Pass "-mhwdiv=arm,thumb" to Clang (or less if you only have hwdiv in one mode).

Cheers.

Tim.





More information about the llvm-dev mailing list