Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Create Getting Started Guide #31

Closed
RandomInsano opened this issue Feb 10, 2015 · 2 comments
Closed

Create Getting Started Guide #31

RandomInsano opened this issue Feb 10, 2015 · 2 comments

Comments

@RandomInsano
Copy link

How can I use your AVR fanciness? I'm doing some AVR work lately, so this seems like something worth playing with. I've got reasonable C experience, lots of Unix build fun experience, but about zero in the compiler development department.

Do you have some time to spend showing me how to start working on this? If I can get it working I'll MR a guide so others can pick this up faster.

Feel free to e-mail me at [email protected]

@dylanmckay
Copy link
Member

I'll writeup a wiki page describing the general structure of the backend, how it works, and what needs doing, thereby closing #5 in the process.

@RandomInsano
Copy link
Author

See, now if I'd seen that I wouldn't have opened this :)

Closing, adding my bits there.

dylanmckay pushed a commit that referenced this issue Jul 19, 2015
- Factor out code to query and modify the sign bit of a floatingpoint
  value as an integer. This also works if none of the targets integer
  types is big enough to hold all bits of the floatingpoint value.

- Legalize FABS(x) as FCOPYSIGN(x, 0.0) if FCOPYSIGN is available,
  otherwise perform bit manipulation on the sign bit. The previous code
  used "x >u 0 ? x : -x" which is incorrect for x being -0.0! It also
  takes 34 instructions on ARM Cortex-M4. With this patch we only
  require 5:
    vldr d0, LCPI0_0
    vmov r2, r3, d0
    lsrs r2, r3, #31
    bfi r1, r2, #31, #1
    bx lr
  (This could be further improved if the compiler would recognize that
   r2, r3 is zero).

- Only lower FCOPYSIGN(x, y) = sign(x) ? -FABS(x) : FABS(x) if FABS is
  available otherwise perform bit manipulation on the sign bit.

- Perform the sign(x) test by masking out the sign bit and comparing
  with 0 rather than shifting the sign bit to the highest position and
  testing for "<s 0". For x86 copysignl (on 80bit values) this gets us:
    testl $32768, %eax
  rather than:
    shlq $48, %rax
    sets %al
    testb %al, %al

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242107 91177308-0d34-0410-b5e6-96231b3b80d8
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants