about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/intrinsics
AgeCommit message (Collapse)AuthorLines
2024-04-19Do intrinsic changes in `rustc_codegen_cranelift`Maybe Waffle-3/+7
2024-04-03Rollup merge of #123419 - petrochenkov:zeroindex, r=compiler-errorsMatthias Krüger-1/+1
rustc_index: Add a `ZERO` constant to index types It is commonly used.
2024-04-03rustc_index: Add a `ZERO` constant to index typesVadim Petrochenkov-1/+1
It is commonly used.
2024-04-03rename `expose_addr` to `expose_provenance`joboet-1/+1
2024-04-02Rollup merge of #122935 - RalfJung:with-exposed-provenance, r=AmanieuJacob Pratt-1/+1
rename ptr::from_exposed_addr -> ptr::with_exposed_provenance As discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/To.20expose.20or.20not.20to.20expose/near/427757066). The old name, `from_exposed_addr`, makes little sense as it's not the address that is exposed, it's the provenance. (`ptr.expose_addr()` stays unchanged as we haven't found a better option yet. The intended interpretation is "expose the provenance and return the address".) The new name nicely matches `ptr::without_provenance`.
2024-03-28Merge commit '09fae60a86b848a2fc0ad219ecc4e438dc1eef86' into ↵bjorn3-0/+5
sync_cg_clif-2024-03-28
2024-03-23also rename the SIMD intrinsicRalf Jung-1/+1
2024-03-19Make ptr_guaranteed_cmp a rustc_intrinsic and favor its body over backends ↵Oli Scherer-7/+0
implementing it
2024-03-18Avoid various uses of `Option<Span>` in favor of using `DUMMY_SP` in the few ↵Oli Scherer-3/+5
cases that used `None`
2024-03-08Merge commit '54cbb6e7531f95e086d5c3dd0d5e73bfbe3545ba' into ↵bjorn3-2/+186
sync_cg_clif-2024-03-08
2024-03-04Add a scheme for moving away from `extern "rust-intrinsic"` entirelyOli Scherer-1/+11
2024-02-26rename 'try' intrinsic to 'catch_unwind'Ralf Jung-2/+2
2024-02-21remove simd_reduce_{min,max}_nanlessRalf Jung-2/+2
2024-02-20Add "algebraic" versions of the fast-math intrinsicsBen Kimock-6/+15
2024-02-12Give const_deallocate a default bodyOli Scherer-5/+0
2024-02-12Teach llvm backend how to fall back to default bodiesOli Scherer-11/+5
2024-02-12Add intrinsic body fallback to cranelift and use itOli Scherer-32/+25
2024-01-26Merge commit '3e50cf65025f96854d6597e80449b0d64ad89589' into ↵bjorn3-199/+183
sync_cg_clif-2024-01-26
2024-01-25Auto merge of #119911 - NCGThompson:is-statically-known, r=oli-obkbors-0/+6
Replacement of #114390: Add new intrinsic `is_var_statically_known` and optimize pow for powers of two This adds a new intrinsic `is_val_statically_known` that lowers to [``@llvm.is.constant.*`](https://llvm.org/docs/LangRef.html#llvm-is-constant-intrinsic).` It also applies the intrinsic in the int_pow methods to recognize and optimize the idiom `2isize.pow(x)`. See #114390 for more discussion. While I have extended the scope of the power of two optimization from #114390, I haven't added any new uses for the intrinsic. That can be done in later pull requests. Note: When testing or using the library, be sure to use `--stage 1` or higher. Otherwise, the intrinsic will be a noop and the doctests will be skipped. If you are trying out edits, you may be interested in [`--keep-stage 0`](https://rustc-dev-guide.rust-lang.org/building/suggested.html#faster-builds-with---keep-stage). Fixes #47234 Resolves #114390 `@Centri3`
2024-01-23Further Implement `is_val_statically_known`Nicholas Thompson-0/+6
2024-01-15compiler: Lower fn call arg spans down to MIRMartin Nordholts-66/+70
To enable improved accuracy of diagnostics in upcoming commits.
2023-12-26Auto merge of #119146 - nnethercote:rm-DiagCtxt-api-duplication, ↵bors-21/+25
r=compiler-errors Remove `DiagCtxt` API duplication `DiagCtxt` defines the internal API for creating and emitting diagnostics: methods like `struct_err`, `struct_span_warn`, `note`, `create_fatal`, `emit_bug`. There are over 50 methods. Some of these methods are then duplicated across several other types: `Session`, `ParseSess`, `Parser`, `ExtCtxt`, and `MirBorrowckCtxt`. `Session` duplicates the most, though half the ones it does are unused. Each duplicated method just calls forward to the corresponding method in `DiagCtxt`. So this duplication exists to (in the best case) shorten chains like `ecx.tcx.sess.parse_sess.dcx.emit_err()` to `ecx.emit_err()`. This API duplication is ugly and has been bugging me for a while. And it's inconsistent: there's no real logic about which methods are duplicated, and the use of `#[rustc_lint_diagnostic]` and `#[track_caller]` attributes vary across the duplicates. This PR removes the duplicated API methods and makes all diagnostic creation and emission go through `DiagCtxt`. It also adds `dcx` getter methods to several types to shorten chains. This approach scales *much* better than API duplication; indeed, the PR adds `dcx()` to numerous types that didn't have API duplication: `TyCtxt`, `LoweringCtxt`, `ConstCx`, `FnCtxt`, `TypeErrCtxt`, `InferCtxt`, `CrateLoader`, `CheckAttrVisitor`, and `Resolver`. These result in a lot of changes from `foo.tcx.sess.emit_err()` to `foo.dcx().emit_err()`. (You could do this with more types, but it gets into diminishing returns territory for types that don't emit many diagnostics.) After all these changes, some call sites are more verbose, some are less verbose, and many are the same. The total number of lines is reduced, mostly because of the removed API duplication. And consistency is increased, because calls to `emit_err` and friends are always preceded with `.dcx()` or `.dcx`. r? `@compiler-errors`
2023-12-24Fix borked subtree syncsbjorn3-1/+1
2023-12-24Merge commit '26c02eb2904da9a53d2220d4f3069b19a3c81d3d' into ↵bjorn3-0/+31
sync_cg_clif-2023-12-24
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-21/+25
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-19Merge commit '3a9bf729322fb5035518f99b9d76a742bf7c124e' into ↵bjorn3-11/+9
sync_cg_clif-2023-12-19
2023-12-10remove redundant importssurechen-7/+0
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-12-09Add simd_masked_{load,store} platform-intrinsicsJakub Okoński-1/+51
This maps to the LLVM intrinsics: llvm.masked.load and llvm.masked.store
2023-11-25Merge commit '710c67909d034e1c663174a016ca82b95c2d6c12' into ↵bjorn3-22/+350
sync_cg_clif-2023-11-25
2023-11-16Merge commit 'def04540a4e2541b995195c752c751295606a388' into ↵bjorn3-59/+307
sync_cg_clif-2023-11-16
2023-11-10Merge commit 'c84d1871dc4456539b7b578830268ab3539915d0' into ↵bjorn3-50/+567
sync_cg_clif-2023-11-10
2023-10-29Merge commit 'dde58803fd6cbb270c7a437f36a8a3a29fbef679' into ↵bjorn3-76/+0
sync_cg_clif-2023-10-29
2023-10-28Auto merge of #116609 - eduardosm:bump-stdarch, r=workingjubileebors-35/+0
Bump stdarch submodule and remove special handling for LLVM intrinsics that are no longer needed Bumps stdarch to pull https://github.com/rust-lang/stdarch/pull/1477, which reimplemented some functions with portable SIMD intrinsics instead of arch specific LLVM intrinsics. Handling of those LLVM intrinsics is removed from cranelift codegen and miri. cc `@RalfJung` `@bjorn3`
2023-10-24Merge commit '93a5433f17ab5ed48cc88f1e69b0713b16183373' into ↵bjorn3-0/+137
sync_cg_clif-2023-10-24
2023-10-12Remove from cranelift codegen LLVM intrinsics that are no longer neededEduardo Sánchez Muñoz-35/+0
2023-10-09Merge commit '81dc066758ec150b43822d4a0c84aae20fe10f40' into ↵bjorn3-26/+73
sync_cg_clif-2023-10-09
2023-09-18Prototype using const generic for simd_shuffle IDX arrayOli Scherer-1/+49
2023-09-14cleanup op_to_const a bit; rename ConstValue::ByRef → IndirectRalf Jung-1/+1
2023-09-14use AllocId instead of Allocation in ConstValue::ByRefRalf Jung-1/+2
2023-09-05Remove special handling in codegen for some AVX and SSE2 shift by immediate ↵Eduardo Sánchez Muñoz-240/+0
intrinsics Those were removed from stdarch in https://github.com/rust-lang/stdarch/pull/1463 (`simd_shl` and `simd_shr` are used instead)
2023-09-05Remove special handling in codegen for some SSE2 "storeu" intrinsicsEduardo Sánchez Muñoz-8/+0
Those were removed from stdarch in https://github.com/rust-lang/stdarch/pull/1463 (`<*mut _>::write_unaligned` is used instead)
2023-08-06Apply suggestions from code reviewscottmcm-0/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2023-08-06Add a new `compare_bytes` intrinsic instead of calling `memcmp` directlyScott McMurray-0/+13
2023-08-03Forbid old-style `simd_shuffleN` intrinsicsOli Scherer-32/+22
2023-07-22Merge commit '1eded3619d0e55d57521a259bf27a03906fdfad0' into ↵bjorn3-33/+244
sync_cg_clif-2023-07-22
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-24/+36
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-1/+1
2023-06-19Remove unchecked_add/sub/mul/shl/shr from CTFE/cg_ssa/cg_clifScott McMurray-17/+3
2023-06-15Merge commit '8830dccd1d4c74f1f69b0d3bd982a3f1fcde5807' into ↵bjorn3-13/+323
sync_cg_clif-2023-06-15
2023-06-01remove unchecked_div/_rem from cg_craneliftScott McMurray-4/+1