Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support AVR target features #3

Open
dylanmckay opened this issue Nov 26, 2014 · 3 comments
Open

Support AVR target features #3

dylanmckay opened this issue Nov 26, 2014 · 3 comments

Comments

@dylanmckay
Copy link
Collaborator

Once AVR-LLVM supports target features (see here), clang should support them too.

Ideally, without passing any extra arguments, clang would compile code for the lowest common denominator, assuming that there are no extra features and that only the core instruction set is supported. It should then be possible to pass flags such as clang --enable-avr-features=fmul,call or suchlike.

We could also do as AVR-GCC does - maintain a list of AVR devices and then map them to their supported features. For example, passing -mcpu=atmega328p will notify GCC to use all of the features supported by the Atmega328p. This is much easier but then we would need to update clang for every new AVR device, as opposed to updating it for every new feature.

We could even support both.

@4ntoine
Copy link
Owner

4ntoine commented Nov 27, 2014

Few ideas:

  • i'suggest avr-clang to be as compatible with avr-gcc on arguments as possible
  • can we keep features-for-the-mcus-file separately to avoid recompiling clang every time new mcu is added? Then we will be able to edit the file and avr-clang will just parse it just in time.
  • how to design it better? Are MCUs subtarget's or other LLVM/Clang entities? I'm not familiar with LLVM/Clang so deeply..

@4ntoine
Copy link
Owner

4ntoine commented Nov 27, 2014

Add -mcpu to be passed to LLVM tools like llc

4ntoine added a commit that referenced this issue Dec 22, 2014
… for me defines for some MCUs (TODO: support other).
4ntoine added a commit that referenced this issue Dec 23, 2014
@4ntoine
Copy link
Owner

4ntoine commented Dec 24, 2014

now -target-cpu avr2 is added for Clang compiler command-line by default.

4ntoine added a commit that referenced this issue Dec 24, 2014
…dded to declaration), added 'signal' attribute, 'used' attribute checked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants