Skip to content

Commit ba1cc34

Browse files
krishna2803overmighty
authored andcommitted
Apply suggestions
Co-authored-by: OverMighty <[email protected]>
1 parent 2e2da52 commit ba1cc34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/posts/2025-09-10-bfloat16-in-llvm-libc.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ title: "GSoC 2025: Bfloat16 in LLVM libc"
77

88

99
## Introduction
10-
BFloat16 is a 16-bit floating-point format, introduced by Google and standardized in C++23 as `std::bfloat16_t`. It uses 1 sign bit, 8 exponent bits (the same as `float`), and 7 mantissa bits. This configuration allows BFloat16 to represent a much wider dynamic range than IEEE `binary16` (~ 3×10^38 compared to 65,504), though with lower precision. BFloat16 has become popular in AI and machine learning use-cases where it offers significant performance advantages.
10+
BFloat16 is a 16-bit floating-point format, introduced by Google and standardized in C++23 as `std::bfloat16_t`. It uses 1 sign bit, 8 exponent bits (the same as `float`), and 7 mantissa bits. This configuration allows BFloat16 to represent a much wider dynamic range than IEEE `binary16` (~3×10^38 values compared to 65,504), though with lower precision. BFloat16 has become popular in AI and machine learning use-cases where it offers significant performance advantages over IEEE `binary32` while preserving its approximate dynamic range.
1111

1212
The goal of this project was to implement the BFloat16 type in LLVM libc along with the basic math functions like `fabsbf16`, `fmaxbf16`, etc.
13-
We also want all functions to be generic, platform independent and correctly rounded for all rounding modes.
13+
We also want all functions to be generic (platform-independent) and correctly rounded for all rounding modes.
1414

1515
## What was done
1616

17-
- BFloat16 type was added to the LLVM libc (`libc/src/__support/FPUtil/bfloat16.h`) [#144463](https://github.com/llvm/llvm-project/pull/144463).
17+
- BFloat16 type was added to LLVM libc (`libc/src/__support/FPUtil/bfloat16.h`) [#144463](https://github.com/llvm/llvm-project/pull/144463).
1818
- All 70 expected basic math functions for `bfloat16` were implemented, using a generic approach that supports all libc supported architectures (ARM, RISC-V, GPUs, x86, Darwin) (see table below).
1919
- Implemented two additional basic math functions: `iscanonicalbf16` and `issignalingbf16`.
2020
- Implemented higher math functions: `sqrtbf16` [#156654](https://github.com/llvm/llvm-project/pull/156654) and `log_bf16` [#157811](https://github.com/llvm/llvm-project/pull/157811) (open).

0 commit comments

Comments
 (0)