Skip to content

Commit

Permalink
Rollup merge of rust-lang#76766 - khyperia:generic_intrinsics, r=eddyb
Browse files Browse the repository at this point in the history
Extract some intrinsics out of rustc_codegen_llvm

A significant amount of intrinsics do not actually need backend-specific behaviors to be implemented, instead relying on methods already in rustc_codegen_ssa. So, extract those methods out to rustc_codegen_ssa, so that each backend doesn't need to reimplement the same code.

Almost everything should be a pretty direct translation. A notable not-direct-translation is `add_with_overflow` and friends being changed to `bx.checked_binop`, but it's pretty simple.

I could have been a lot more aggressive here and pulled out way more methods, and add a few new methods in the rustc_codegen_ssa "API". However, because this is my second rustc PR, I thought that moving those to a follow-up PR and doing more incremental changes here would be better (and I guess ask if this work is even desired in the first place). I'm hoping to eventually remove the mess of intrinsic handling in the backend entirely, which would be hecking fantastic ✨
  • Loading branch information
Dylan-DPC committed Sep 16, 2020
2 parents f868f02 + 21b0c12 commit 32ff2c9
Show file tree
Hide file tree
Showing 4 changed files with 606 additions and 521 deletions.
Loading

0 comments on commit 32ff2c9

Please sign in to comment.