Commit Graph

1636 Commits

Author SHA1 Message Date
bjorn3 052d5ccf5d Implement __isb for AArch64
This is necessary for the mutex implementation of libstd when there is
contention. Seems like I hadn't hit this before by sheer luck.
2022-11-28 13:03:47 +00:00
bjorn3 f851dfacfe Rustfmt 2022-11-27 18:34:07 +00:00
bjorn3 75838d9e8b Implement more llvm simd intrinsics for AArch64 2022-11-27 18:32:29 +00:00
bjorn3 1367983198 Begin implementing llvm simd intrinsics for aarch64 2022-11-27 18:09:57 +00:00
bjorn3 ef6400d6be Split x86 specific intrinsics into intrinsics/llvm_x86.rs 2022-11-27 17:17:47 +00:00
bjorn3 d23eb65ea0 Sync from rust 66ccf36f16 2022-11-22 19:21:05 +01:00
bjorn3 a449d0d143 Rustfmt 2022-11-21 17:00:28 +00:00
bjorn3 cf923724cc Fix discriminant handling 2022-11-21 16:29:09 +00:00
Matthias Krüger d3817e2339 Rollup merge of #104605 - RalfJung:clf_consts, r=bjorn3
deduplicate constant evaluation in cranelift backend

The cranelift backend had two matches on `ConstantKind`, which can be avoided, and used this `eval_for_mir` that nothing else uses... this makes things more consistent with the (better-tested) LLVM backend.

I noticed this because cranelift was the only user of `eval_for_mir`. However `try_eval_for_mir` still has one other user in `eval`... the odd thing is that the interpreter has its own `eval_mir_constant` which seems to duplicate the same functionality and does not use `try_eval_for_mir`. No idea what is happening here.

r? ``@bjorn3``
Cc ``@lcnr``
2022-11-21 14:11:12 +01:00
bjorn3 d6b54a5433 Sync from rust 5e6de2369c 2022-11-19 15:23:58 +01:00
Ralf Jung a3c89a7ade deduplicate constant evaluation in cranelift backend
also sync LLVM and cranelift structure a bit
2022-11-19 14:08:12 +01:00
Dylan DPC 5fd3e4dabb Rollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3
Improve generating Custom entry function

This commit is aimed at making compiler-generated entry functions (Basically just C `main` right now) more generic so other targets can do similar things for custom entry. This was initially implemented as part of https://github.com/rust-lang/rust/pull/100316.

Currently, this moves the entry function name and Call convention to the target spec.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-19 11:54:43 +05:30
Ayush Singh 6ee9712cd4 Use custom entry name in cranelift
This is a continuation of 9f0a8620bd for
cranelift.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-17 15:28:47 +05:30
Ralf Jung 2d0c41a9a3 cleanup and dedupe CTFE and Miri error reporting 2022-11-16 10:13:29 +01:00
bors 03e3cc5b77 Auto merge of #104054 - RalfJung:byte-provenance, r=oli-obk
interpret: support for per-byte provenance

Also factors the provenance map into its own module.

The third commit does the same for the init mask. I can move it in a separate PR if you prefer.

Fixes https://github.com/rust-lang/miri/issues/2181

r? `@oli-obk`
2022-11-15 17:37:15 +00:00
Ralf Jung f5caaea98a add is_sized method on Abi and Layout, and use it 2022-11-13 12:23:53 +01:00
Joshua Nelson ade426fa83 Fix rustdoc --version when used with download-rustc
Previously, rustdoc would unconditionally report the version that *rustc* was compiled with.
That showed things like `nightly-2022-10-30`, which wasn't right, since this was a `dev` build compiled from source.

Fix it by changing `rustc_driver::version` to a macro expanded at invocation time.
2022-11-09 02:54:51 -06:00
Ralf Jung b5523e3e7a fix cranelift and gcc 2022-11-06 14:17:10 +01:00
bjorn3 7941cba900 Remove some commented out code 2022-11-03 13:48:16 +00:00
bjorn3 736fac8ab9 Sync from rust 432b1a4277 2022-11-03 12:09:35 +01:00
Amanieu d'Antras b166ad0b1e Rewrite implementation of #[alloc_error_handler]
The new implementation doesn't use weak lang items and instead changes
`#[alloc_error_handler]` to an attribute macro just like
`#[global_allocator]`.

The attribute will generate the `__rg_oom` function which is called by
the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom`
function is defined in any crate then the compiler shim will call
`__rdl_oom` in the alloc crate which will simply panic.

This also fixes link errors with `-C link-dead-code` with
`default_alloc_error_handler`: `__rg_oom` was previously defined in the
alloc crate and would attempt to reference the `oom` lang item, even if
it didn't exist. This worked as long as `__rg_oom` was excluded from
linking since it was not called.

This is a prerequisite for the stabilization of
`default_alloc_error_handler` (#102318).
2022-10-31 16:32:57 +00:00
bjorn3 777d4732dc Fix transmuting from vector type to ScalarPair type
Fixes #1292
2022-10-29 13:47:10 +00:00
bjorn3 5513583f3f Stop using a deprecated function 2022-10-27 14:49:24 +00:00
Maybe Waffle 33a92bc8b0 Update tooling 2022-10-27 18:41:26 +04:00
Daniel Paoliello e3311e4717 Support raw-dylib functions being used inside inlined functions 2022-10-24 16:17:38 -07:00
bjorn3 9950bd1dc5 Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into sync_cg_clif-2022-10-23 2022-10-23 16:22:55 +02:00
bjorn3 b930e2d722 Revert "Stop using a depracated function"
This reverts commit b1791eef6a.
2022-10-23 16:16:58 +02:00
bjorn3 342bac9807 Fix drop for dyn* 2022-10-23 15:09:28 +02:00
bjorn3 2470ad30e6 Allow dyn* upcasting 2022-10-23 15:09:11 +02:00
bjorn3 57984be8ea Sync from rust e64f1110c0 2022-10-23 13:44:16 +02:00
bjorn3 b1791eef6a Stop using a depracated function 2022-10-21 10:58:33 +00:00
Rageking8 54ee5ac073 more dupe word typos 2022-10-14 12:57:56 +08:00
bjorn3 7bf4e19cc1 Sync from rust bb93450ec4 2022-10-11 16:45:58 +02:00
ouz-a 187b76965a Remove mir::CastKind::Misc 2022-10-06 15:32:41 +03:00
bjorn3 f90bc3009a Enable stack probing on x86_64
Cranelift now supports inline stack probes on x86_64
2022-09-26 16:20:11 +00:00
Afonso Bordado 0035f09c5a Avoid masking shift amounts
Cranelift 0.87 now follows its own documentation regarding
shift amounts, and implicitly masks them if the arch requires it. [0]

[0]: https://github.com/bytecodealliance/wasmtime/commit/05089321740a07757dff0a285176b2651a49aae2
2022-09-26 16:20:11 +00:00
bjorn3 72992c483c Update to Cranelift 0.88.0 2022-09-26 16:20:11 +00:00
bjorn3 f82016891a Fix cpuid replacement shim 2022-09-25 14:58:33 +02:00
bjorn3 241eae76e2 Monomorphize ConstantKind::Unevaluated in mir_operand_get_const_val 2022-09-25 14:44:51 +02:00
bjorn3 5ed4377677 Fix ConstantKind::Ty codegen 2022-09-25 14:35:21 +02:00
bjorn3 385003e4c1 Sync from rust 8e9c93df46 2022-09-25 13:55:23 +02:00
b-naber 7e250da20f rename Unevaluated to UnevaluatedConst 2022-09-23 14:27:34 +02:00
b-naber 3c5882018f introduce mir::Unevaluated 2022-09-22 12:35:28 +02:00
bors 6eeefe2ce6 Auto merge of #99806 - oli-obk:unconstrained_opaque_type, r=estebank
Allow patterns to constrain the hidden type of opaque types

fixes #96572

reverts a revert as original PR was a perf regression that was fixed by reverting it: https://github.com/rust-lang/rust/pull/99368#issuecomment-1186587864)

TODO:

* check if https://github.com/rust-lang/rust/issues/99685 is avoided
2022-09-20 12:09:52 +00:00
bors 6214e085ed Auto merge of #98588 - b-naber:valtrees-cleanup, r=lcnr
Use only ty::Unevaluated<'tcx, ()> in type system

r? `@lcnr`
2022-09-17 03:04:22 +00:00
Oli Scherer 93af5f5999 Revert "Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank""
This reverts commit 4a742a691e.
2022-09-16 11:36:39 +00:00
b-naber d7c77313cb nits 2022-09-15 22:27:41 +02:00
bjorn3 b023e2f7d0 Fix bundled static libraries 2022-09-15 16:05:27 +00:00
bjorn3 879c86ff30 Implement dyn* support 2022-09-15 14:08:30 +00:00
bjorn3 75d24552aa Sync from rust 00fcc82df2 2022-09-15 14:53:37 +02:00