diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2024-03-30 00:36:45 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2024-03-30 03:32:11 -0700 |
| commit | 0601f0c66d4ea250193a64a214988da425c3a47d (patch) | |
| tree | 81f8e6d44ccc29685c877fdb97b76fa2548d5ffb /compiler/rustc_hir_analysis | |
| parent | 69fa40cb48384fad7930dce2d9a20d18fe4d1b51 (diff) | |
| download | rust-0601f0c66d4ea250193a64a214988da425c3a47d.tar.gz rust-0601f0c66d4ea250193a64a214988da425c3a47d.zip | |
De-LLVM the unchecked shifts [MCP#693]
This is just one part of the MCP, but it's the one that IMHO removes the most noise from the standard library code. Seems net simpler this way, since MIR already supported heterogeneous shifts anyway, and thus it's not more work for backends than before.
Diffstat (limited to 'compiler/rustc_hir_analysis')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/intrinsic.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs index f482ae4f5fa..3c58b6704e4 100644 --- a/compiler/rustc_hir_analysis/src/check/intrinsic.rs +++ b/compiler/rustc_hir_analysis/src/check/intrinsic.rs @@ -454,9 +454,8 @@ pub fn check_intrinsic_type( sym::unchecked_div | sym::unchecked_rem | sym::exact_div => { (1, 0, vec![param(0), param(0)], param(0)) } - sym::unchecked_shl | sym::unchecked_shr | sym::rotate_left | sym::rotate_right => { - (1, 0, vec![param(0), param(0)], param(0)) - } + sym::unchecked_shl | sym::unchecked_shr => (2, 0, vec![param(0), param(1)], param(0)), + sym::rotate_left | sym::rotate_right => (1, 0, vec![param(0), param(0)], param(0)), sym::unchecked_add | sym::unchecked_sub | sym::unchecked_mul => { (1, 0, vec![param(0), param(0)], param(0)) } |
