Skip to content

Commit 2569dbf

Browse files
committed
Add f16 and f128 to the AST
1 parent c472649 commit 2569dbf

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,22 +1920,28 @@ pub struct FnSig {
19201920
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
19211921
#[derive(Encodable, Decodable, HashStable_Generic)]
19221922
pub enum FloatTy {
1923+
F16,
19231924
F32,
19241925
F64,
1926+
F128,
19251927
}
19261928

19271929
impl FloatTy {
19281930
pub fn name_str(self) -> &'static str {
19291931
match self {
1932+
FloatTy::F16 => "f16",
19301933
FloatTy::F32 => "f32",
19311934
FloatTy::F64 => "f64",
1935+
FloatTy::F128 => "f128",
19321936
}
19331937
}
19341938

19351939
pub fn name(self) -> Symbol {
19361940
match self {
1941+
FloatTy::F16 => sym::f16,
19371942
FloatTy::F32 => sym::f32,
19381943
FloatTy::F64 => sym::f64,
1944+
FloatTy::F128 => sym::f128,
19391945
}
19401946
}
19411947
}

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,8 +1991,10 @@ pub fn uint_ty(uty: ast::UintTy) -> UintTy {
19911991

19921992
pub fn float_ty(fty: ast::FloatTy) -> FloatTy {
19931993
match fty {
1994+
ast::FloatTy::F16 => FloatTy::F16,
19941995
ast::FloatTy::F32 => FloatTy::F32,
19951996
ast::FloatTy::F64 => FloatTy::F64,
1997+
ast::FloatTy::F128 => FloatTy::F128,
19961998
}
19971999
}
19982000

0 commit comments

Comments
 (0)