diff options
| author | Shilei Tian <i@tianshilei.me> | 2024-10-08 09:49:20 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-08 09:49:20 -0400 |
| commit | 88a239d292da80f260788c0817a07cbc0a8ac758 (patch) | |
| tree | c9f5970284b742f67d938b2bc5fa95554c45b696 /lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py | |
| parent | 48ac846fbc7568b220d8fe3f796c4f26e117ab26 (diff) | |
[AMDGPU] Adopt new lowering sequence for `fdiv16` (#109295)
The current lowering of `fdiv16` can generate incorrectly rounded result
in some cases. The new sequence was provided by the HW team, as shown
below written in C++.
```
half fdiv(half a, half b) {
float a32 = float(a);
float b32 = float(b);
float r32 = 1.0f / b32;
float q32 = a32 * r32;
float e32 = -b32 * q32 + a32;
q32 = e32 * r32 + q32;
e32 = -b32 * q32 + a32;
float tmp = e32 * r32;
uin32_t tmp32 = std::bit_cast<uint32_t>(tmp);
tmp32 = tmp32 & 0xff800000;
tmp = std::bit_cast<float>(tmp32);
q32 = tmp + q32;
half q16 = half(q32);
q16 = div_fixup_f16(q16);
return q16;
}
```
Fixes SWDEV-477608.
Diffstat (limited to 'lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py')
0 files changed, 0 insertions, 0 deletions
