Add v0 symbol mangling for f16 and f128

As discussed at <https://github.com/rust-lang/rust/pull/122106>, use the
crate encoding to represent new primitives.
This commit is contained in:
Trevor Gross 2024-04-11 14:23:25 -04:00
parent c45e831d8f
commit 809b84edba
2 changed files with 4 additions and 3 deletions

View file

@ -319,11 +319,10 @@ fn print_type(&mut self, ty: Ty<'tcx>) -> Result<(), PrintError> {
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 `_`).

View file

@ -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]*