Skip to content

Commit

Permalink
Add v0 symbol mangling for f16 and f128
Browse files Browse the repository at this point in the history
As discussed at <rust-lang#122106>, use the
crate encoding to represent new primitives.
  • Loading branch information
tgross35 committed May 14, 2024
1 parent c45e831 commit 809b84e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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

0 comments on commit 809b84e

Please sign in to comment.