Skip to content

Commit

Permalink
Auto merge of #123816 - tgross35:f16-f128-mangling, r=michaelwoerister
Browse files Browse the repository at this point in the history
Add v0 symbol mangling for `f16` and `f128`

As discussed at <#122106>, use the crate encoding to represent new primitives.
  • Loading branch information
bors committed May 14, 2024
2 parents 31026b7 + 792a9bd commit bdfd941
Show file tree
Hide file tree
Showing 6 changed files with 924 additions and 244 deletions.
5 changes: 2 additions & 3 deletions compiler/rustc_symbol_mangling/src/v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,10 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> {
ty::Uint(UintTy::U64) => "y",
ty::Uint(UintTy::U128) => "o",
ty::Uint(UintTy::Usize) => "j",
// FIXME(f16_f128): update these once `rustc-demangle` supports the new types
ty::Float(FloatTy::F16) => unimplemented!("f16_f128"),
ty::Float(FloatTy::F16) => "C3f16",
ty::Float(FloatTy::F32) => "f",
ty::Float(FloatTy::F64) => "d",
ty::Float(FloatTy::F128) => unimplemented!("f16_f128"),
ty::Float(FloatTy::F128) => "C4f128",
ty::Never => "z",

// Placeholders (should be demangled as `_`).
Expand Down
2 changes: 2 additions & 0 deletions src/doc/rustc/src/symbol-mangling/v0.md
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,8 @@ The type encodings based on the initial tag character are:
* `z` — `!`
* `p` — [placeholder] `_`
Remaining primitives are encoded as a crate production, e.g. `C4f128`.
* `A` — An [array][reference-array] `[T; N]`.
> <span id="array-type">array-type</span> → `A` *[type]* *[const]*
Expand Down
Loading

0 comments on commit bdfd941

Please sign in to comment.