Skip to content

Commit 3a7b8d3

Browse files
committed
C front-end: add support for __bf16
This is treated the same as _Float16, matching the specification at https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/low-level-sys-info.tex (section "Special Types"). This type is required for/tested by regression test SIMD1 when using GCC 13.
1 parent 14f9014 commit 3a7b8d3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/ansi-c/compiler_headers/clang_builtins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
'v': 'void',
4444
'w': 'wchar_t',
4545
'x': '_Float16',
46-
'y': '_Float16', # would be '__bf16', but we don't support that yet
46+
'y': '__bf16',
4747
'z': '__CPROVER_size_t'
4848
}
4949

src/ansi-c/scanner.l

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,12 @@ void ansi_c_scanner_init()
530530
return make_identifier();
531531
}
532532

533+
"__bf16" { if(PARSER.ts_18661_3_Floatn_types)
534+
{ loc(); return TOK_GCC_FLOAT16; }
535+
else
536+
return make_identifier();
537+
}
538+
533539
"_Float32" { if(PARSER.ts_18661_3_Floatn_types)
534540
{ loc(); return TOK_GCC_FLOAT32; }
535541
else

0 commit comments

Comments
 (0)