Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

bitrig support #31

Closed
wants to merge 2 commits into from
Closed

bitrig support #31

wants to merge 2 commits into from

Conversation

dhuseby
Copy link

@dhuseby dhuseby commented Feb 7, 2015

This adds support for Bitrig at the revision (2d54c4f) currently used by Rust.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pcwalton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@alexcrichton alexcrichton assigned alexcrichton and unassigned pcwalton Feb 8, 2015
@alexcrichton
Copy link
Member

I asked this on the jemalloc PR as well, but have you sent this upstream as well?

@dhuseby
Copy link
Author

dhuseby commented Feb 11, 2015

@alexcrichton I'm upstreaming the patch here.

@alexcrichton
Copy link
Member

Thanks! Feel free to ping this PR whenever that gets merged and I'll merge this in.

@dhuseby
Copy link
Author

dhuseby commented Mar 2, 2015

@alexcrichton
Copy link
Member

Nice! Do you want to cherry-pick those commits back onto our current branch? I think we're going to try to stay at 3.6 for awhile but we can definitely backport the relevant commits.

@dhuseby
Copy link
Author

dhuseby commented Mar 3, 2015

@alexcrichton I'll cherry-pick the change back to this branch and update this PR today.

@dhuseby
Copy link
Author

dhuseby commented Mar 3, 2015

@alexcrichton new PR with cherry picked revision is here: #38

@dhuseby dhuseby closed this Mar 3, 2015
alexcrichton pushed a commit that referenced this pull request Jul 16, 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
alexcrichton pushed a commit that referenced this pull request Nov 16, 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

Differential Revision: http://reviews.llvm.org/D11172

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252839 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

Successfully merging this pull request may close these issues.

4 participants