689 Commits

Author SHA1 Message Date
Antoni Boucher
c4e7c04de9 Fix location of check for sized floating-point types 2024-06-21 16:12:05 +02:00
Robert Zakrzewski
0dad11feb9 Do not use target dependent Float32
fix formatting
2024-06-21 16:12:05 +02:00
Robert Zakrzewski
b94cb8c01c Add missing types in the type_kind function
reorder type_kind

reorder type_kind

reorder type_kind

fix

fix

fix

fix
2024-06-21 16:12:05 +02:00
Robert Zakrzewski
d0977e3e2a Add support for Float16, Float32, Float64 and Float128
Upgrade libgccjit.version

Limit new Floatxx types to master branch only

apply rustfmt

Make new types available only when requested

Make new types available only when requested

Check if Float16 and Float128 are supported by the target platform

Replace Float with Float32 and Double with Float64 if target dependent type is defined

Add support for Float16|32|64|128 in the builder

Fix cargo fmt errors

Update gccjit wrapper

update hash of ligccjit
2024-06-21 16:12:05 +02:00
Andy Sadler
a0b4d735e3
simd: implement pointer provenance intrinsics
This adds support for the simd variants of the pointer provenance
intrinsics, which are `simd_cast_ptr`, `simd_expose_addr`, and
`simd_from_exposed_addr`.

The preconditions for each intrinsic are adapted from rustc_codegen_llvm
to preserve compatibility.  Each of these intrinsics are implemented as
calling the non-simd variant of each intrinsic on each lane.

This is enough to enable the UI test `ui/simd/intrinsic/ptr-cast.rs` to
pass.

Signed-off-by: Andy Sadler <andrewsadler122@gmail.com>
2024-05-08 20:51:21 -05:00
Antoni Boucher
9ed0543964 Some more fixes and workarounds for Aarch64 2024-04-29 11:07:54 -04:00
Antoni Boucher
65e8717e45 Some fixes for aarch64 2024-04-24 20:15:15 -04:00
antoyo
41839175b0
Merge pull request #498 from rust-lang/fix/pass-indirect-with-params
Fix PassMode::Indirect with params
2024-04-22 09:44:46 -04:00
Antoni Boucher
f9a0c3fb0f Fix PassMode::Indirect with params 2024-04-22 09:14:28 -04:00
antoyo
4a52f9579a
Merge pull request #500 from rust-lang/fix/type-kind
Implement more type kinds
2024-04-19 21:53:40 -04:00
antoyo
9941c3590d
Merge pull request #499 from rust-lang/fix/unreachable-in-get_fn
Fix panic when calling get_fn for a variable
2024-04-19 21:26:48 -04:00
Antoni Boucher
89ee0f997c Implement more type kinds 2024-04-19 21:23:56 -04:00
Antoni Boucher
9b628f8e82 Fix panic when calling get_fn for a variable 2024-04-19 20:57:40 -04:00
Antoni Boucher
7cd561efd6 Fix check for main function already declared 2024-04-19 20:55:59 -04:00
Robert Zakrzewski
94ca8283af add missing mappings from register classes to dummy output types
fix formatting

Replace LLVM with GCC
2024-03-24 17:22:40 +01:00
antoyo
7ff5d39980
Merge pull request #469 from tempdragon/master
Clippy related fixes
2024-03-16 10:34:22 -04:00
tempdragon
0a493514d7 fix(lifetime): Add lifetimes back. 2024-03-16 21:30:04 +08:00
tempdragon
3b01fba0f5 fix(intrinsic/mod.rs): Update comments 2024-03-16 21:16:41 +08:00
tempdragon
653118e797 feat(clippy): Suppress lint suspicious_else_formatting temporarily 2024-03-16 12:08:39 +08:00
tempdragon
390f9064e1 revert(lifetime): Add "needless" lifetime(s) and allow it in clippy
This reverts commit ad97b8c061e6f39a52daaf036c9721e17510c30c.
2024-03-16 10:17:35 +08:00
tempdragon
878f572d0e fix(comments): Add some info and revert else if
1. Put the `else if` comment in intrinsic/mod.rs away
2. Add TODO to debuginfo.rs in `make_mir_scope()`
2024-03-16 10:07:52 +08:00
tempdragon
817d2f298e fix(pattern_type_mismatch)): Fix mismatch with ref/deref 2024-03-16 09:43:16 +08:00
Guillaume Gomez
6c9156717e Regen intrinsics conversions 2024-03-13 16:44:54 +01:00
tempdragon
a7d39b852a fix(from_low_high): Renamed according to clippy requirements
Changed for clippy naming convention requirement:
```
warning: methods called `from_*` usually take no `self`
   --> src/int.rs:996:22
    |
996 |     fn from_low_high(&self, typ: Type<'gcc>, low: i64, high: i64) -> RValue<'gcc> {
    |                      ^^^^^
    |
    = help: consider choosing a less ambiguous name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
    = note: `#[warn(clippy::wrong_self_convention)]` on by default
```
2024-03-11 12:55:28 +08:00
tempdragon
3fd9db31bf fix(fmt): Rewrite a condition according to clippy
This looks like an (inverted) exclusive-or but I still leave it as it is in clippy.
2024-03-11 12:41:37 +08:00
tempdragon
d2cda90e4e fix(clippy): redundant variables in simd.rs 2024-03-11 12:36:39 +08:00
tempdragon
091de55db8 fix(fmt): Try to comply to the format requirement 2024-03-11 12:31:16 +08:00
tempdragon
ad97b8c061 fix(liftime): Gen. by cargo clippy
cmd: `cargo clippy --fix --lib -p rustc_codegen_gcc --allow-dirtyxs`
2024-03-11 12:20:36 +08:00
tempdragon
8d4d87859b fix(clippy): Clone-related clippy workarounds
1. Use `clone_from` in place of `clone()` in `builder.rs`
2. Change `&name` to `name.clone()` in `debuginfo.rs`(Is this really
efficient? But I can't find other workarounds.)
2024-03-11 12:13:30 +08:00
tempdragon
c6b75581d0 fix(declare.rs): Clone name when buiding without the master feat. 2024-03-11 10:24:22 +08:00
tempdragon
9ea3c19055 fix(fmt/style): Further apply Clippy suggestions manually
1. Fix Pattern Type Mismatch by Adding deref's
2. Move commented `else if` to previous block in `intrinsic.rs`
2024-03-11 10:24:22 +08:00
tempdragon
6f76488b2f fix(fmt/style): Remove unncessary clones, into's and deref's 2024-03-11 10:24:22 +08:00
Guillaume Gomez
f7622d11a7 fmt 2024-03-10 22:08:21 +01:00
Guillaume Gomez
5a89328710 Merge branch 'master' into sync_branch_name 2024-03-10 17:18:06 +01:00
Guillaume Gomez
ed5c3bc397 Fix cg_gcc merge 2024-03-10 01:01:52 +01:00
Guillaume Gomez
d9a491b776 Merge remote-tracking branch 'upstream/master' into HEAD 2024-03-09 18:04:39 +01:00
Matthias Krüger
568d3949c1 Rollup merge of #119365 - nbdd0121:asm-goto, r=Amanieu
Add asm goto support to `asm!`

Tracking issue: #119364

This PR implements asm-goto support, using the syntax described in "future possibilities" section of [RFC2873](https://rust-lang.github.io/rfcs/2873-inline-asm.html#asm-goto).

Currently I have only implemented the `label` part, not the `fallthrough` part (i.e. fallthrough is implicit). This doesn't reduce the expressive though, since you can use label-break to get arbitrary control flow or simply set a value and rely on jump threading optimisation to get the desired control flow. I can add that later if deemed necessary.

r? ``@Amanieu``
cc ``@ojeda``
2024-03-08 08:19:17 +01:00
Guillaume Gomez
17aa31bfe2 Fix cg_gcc build 2024-03-05 20:17:29 +01:00
Guillaume Gomez
faebf73983 Merge commit 'b385428e3ddf330805241e7758e773f933357c4b' into subtree-update_cg_gcc_2024-03-05 2024-03-05 19:58:36 +01:00
Antoni Boucher
cd75da1f2c Fix formatting 2024-03-05 08:33:42 -05:00
Antoni Boucher
1605928023 Merge branch 'master' into sync_from_rust_2024_03_04 2024-03-05 08:21:27 -05:00
antoyo
e4ec64a1c4
Merge pull request #459 from tempdragon/master
fix(fmt/style): Clippy-generated Code Correction
2024-03-04 08:07:26 -05:00
antoyo
3937fd15b5
Merge pull request #460 from mu001999/patch-1
Remove unused structs
2024-03-03 20:21:05 -05:00
bors
1abbf610fe Auto merge of #121665 - erikdesjardins:ptradd, r=nikic
Always generate GEP i8 / ptradd for struct offsets

This implements #98615, and goes a bit further to remove `struct_gep` entirely.

Upstream LLVM is in the beginning stages of [migrating to `ptradd`](https://discourse.llvm.org/t/rfc-replacing-getelementptr-with-ptradd/68699). LLVM 19 will [canonicalize](https://github.com/llvm/llvm-project/pull/68882) all constant-offset GEPs to i8, which has roughly the same effect as this change.

Fixes #121719.

Split out from #121577.

r? `@nikic`
2024-03-03 22:21:53 +00:00
Antoni Boucher
56dc8de1db Switch to the new set_special_chars_allowed_in_func_names API 2024-03-01 12:21:31 -05:00
bors
27b669adc2 Auto merge of #121728 - tgross35:f16-f128-step1-ty-updates, r=compiler-errors
Add stubs in IR and ABI for `f16` and `f128`

This is the very first step toward the changes in https://github.com/rust-lang/rust/pull/114607 and the [`f16` and `f128` RFC](https://rust-lang.github.io/rfcs/3453-f16-and-f128.html). It adds the types to `rustc_type_ir::FloatTy` and `rustc_abi::Primitive`, and just propagates those out as `unimplemented!` stubs where necessary.

These types do not parse yet so there is no feature gate, and it should be okay to use `unimplemented!`.

The next steps will probably be AST support with parsing and the feature gate.

r? `@compiler-errors`
cc `@Nilstrieb` suggested breaking the PR up in https://github.com/rust-lang/rust/pull/120645#issuecomment-1925900572
2024-03-01 03:36:11 +00:00
r01and
1b124a9bbd
Format codes 2024-02-29 23:26:34 +08:00
r01and
6f54eeb070
Remove unused structs 2024-02-29 23:13:09 +08:00
tempdragon
aeffc2fcaa fix(fmt/style): Clippy-generated Code Correction
Modifications to Commit:
	Modified:     src/allocator.rs
	Modified:     src/asm.rs
	Modified:     src/back/lto.rs
	Modified:     src/consts.rs
	Modified:     src/debuginfo.rs
	Modified:     src/intrinsic/mod.rs
	Modified:     src/lib.rs
	Modified:     src/mono_item.rs
	Modified:     src/type_.rs
	Modified:     tests/lang_tests_common.rs
2024-02-29 10:33:11 +08:00
Antoni Boucher
c2c68e3f4d Format the code 2024-02-28 17:49:16 -05:00