[llvm] AMDGPU: Fix the double rounding issue in v2f64 -> v2f16 conversion (PR #135659)

Changpeng Fang via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 21 10:25:28 PDT 2025


================
@@ -0,0 +1,213 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -mtriple=amdgcn -mcpu=gfx950 -global-isel=0 < %s | FileCheck -check-prefixes=GFX950,GFX950-SAFE-SDAG %s
+; RUN: llc -mtriple=amdgcn -mcpu=gfx950 -global-isel=0 < %s | FileCheck -check-prefixes=GFX950,GFX950-SAFE-GISEL %s
+; RUN: llc -mtriple=amdgcn -mcpu=gfx950 -global-isel=0 -enable-unsafe-fp-math < %s | FileCheck -check-prefixes=GFX950,GFX950-UNSAFE %s
+; RUN: llc -mtriple=amdgcn -mcpu=gfx950 -global-isel=0 -enable-unsafe-fp-math < %s | FileCheck -check-prefixes=GFX950,GFX950-UNSAFE %s
+
----------------
changpeng wrote:

> Globalisel part untested, this does not have any globalisel=1 run lines.
**Oops, Will make a NFC change to add globalisel=1, Thanks.**

> Also why the fpmath suffix, this does not involve fpmath metadata

Remove that suffix? And remove the -enable-unsafe-fp-math related checks because they are already in fptrunc.f16.ll.

> These cases should just be in the other fptrunc test?

Ideally the tests should be in fptrunc.fp16.ll. But that file only checks with -enable-unsafe-fp-math. And we need to check without that flag. It is too messy to test in the same file for multiple dimensional checks (asics, isel, unsafe, ...).
My intention is to focus on tests on gfx950 (hasCvtPkF16F32Inst), v2f16, and without unsafe fpmath flags. 

So we may need to give a specific file name to avoid confusions.

https://github.com/llvm/llvm-project/pull/135659


More information about the llvm-commits mailing list