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

Revert atomicrmw {max, min, umax, umin} #8151

Closed
wants to merge 1 commit into from

Conversation

sanxiyn
Copy link
Member

@sanxiyn sanxiyn commented Jul 31, 2013

#8039 broke ARM build, and nothing uses these yet.

@sanxiyn
Copy link
Member Author

sanxiyn commented Jul 31, 2013

Currently ARM builds for the generic ARM architecture, which lacks atomic instructions. When the architecture lacks atomic instructions, LLVM lowers atomic instructions to __sync built-in functions in the compiler runtime, but there are no such functions for max, min, umax, umin and LLVM crashes with assertions. It seems to me that fixing this requires changing the compiler runtime interface, which seems difficult.

On the other hand, specific ARM architectures do have atomic instructions. I don't know the exact architecture revision which introduced atomic instructions, but I confirmed that passing --target-feature +v7 to rustc works. (Except that ARM is currently using binutils assembler instead of LLVM assembler therefore you also need to pass -march=armv7-a to the assembler, which is annoying but temporary until we switch to LLVM assembler.)

Since atomic instructions are more efficient than __sync built-in functions, it may be a good idea to build for the more recent ARM architecture. I will make a separate pull request to do this.

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

Successfully merging this pull request may close these issues.

3 participants