llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-driver

@llvm/pr-subscribers-backend-amdgpu

Author: Brox Chen (broxigarchen)

<details>
<summary>Changes</summary>

Add a true16 clang option to turn on true16 mode(by default off) in GFX11Plus 
amdgpu. 

This allows to turn on true16 and enable testing for this feature. This patch 
be removed after we validated true16 feature and set it to be the default mode.

---
Full diff: https://github.com/llvm/llvm-project/pull/133298.diff


3 Files Affected:

- (modified) clang/include/clang/Driver/Options.td (+3) 
- (modified) clang/lib/Driver/ToolChains/AMDGPU.cpp (+4) 
- (modified) clang/test/Driver/amdgpu-features.c (+5) 


``````````diff
diff --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index a7fcb160d3867..68179d7835440 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -5182,6 +5182,9 @@ defm wavefrontsize64 : SimpleMFlag<"wavefrontsize64",
 defm amdgpu_precise_memory_op
     : SimpleMFlag<"amdgpu-precise-memory-op", "Enable", "Disable",
                   " precise memory mode (AMDGPU only)">;
+defm real_true16: SimpleMFlag<"real-true16",
+  "enable real-true16 in GFX11Plus", "enable real-true16 mode",
+  " real-true16 mode (AMDGPU only)">;
 
 def munsafe_fp_atomics : Flag<["-"], "munsafe-fp-atomics">,
   Visibility<[ClangOption, CC1Option]>, Alias<fatomic_ignore_denormal_mode>;
diff --git a/clang/lib/Driver/ToolChains/AMDGPU.cpp 
b/clang/lib/Driver/ToolChains/AMDGPU.cpp
index 1c5bb08568801..ce0cba5aa536a 100644
--- a/clang/lib/Driver/ToolChains/AMDGPU.cpp
+++ b/clang/lib/Driver/ToolChains/AMDGPU.cpp
@@ -707,6 +707,10 @@ void amdgpu::getAMDGPUTargetFeatures(const Driver &D,
                    options::OPT_mno_amdgpu_precise_memory_op, false))
     Features.push_back("+precise-memory");
 
+  if (Args.hasFlag(options::OPT_mreal_true16, options::OPT_mno_real_true16,
+                   false))
+    Features.push_back("+real-true16");
+
   handleTargetFeaturesGroup(D, Triple, Args, Features,
                             options::OPT_m_amdgpu_Features_Group);
 }
diff --git a/clang/test/Driver/amdgpu-features.c 
b/clang/test/Driver/amdgpu-features.c
index 864744db203e9..f46f0251cadfc 100644
--- a/clang/test/Driver/amdgpu-features.c
+++ b/clang/test/Driver/amdgpu-features.c
@@ -38,3 +38,8 @@
 
 // RUN: %clang -### -target amdgcn -mcpu=gfx1010 -mno-amdgpu-precise-memory-op 
%s 2>&1 | FileCheck --check-prefix=NO-PREC-MEM %s
 // NO-PREC-MEM-NOT: {{".*precise-memory"}}
+
+// RUN: %clang -### -target amdgcn -mcpu=gfx1100 -mreal-true16 %s 2>&1 | 
FileCheck --check-prefix=REAL16 %s
+// RUN: %clang -### -target amdgcn -mcpu=gfx1100 -mno-real-true16 %s 2>&1 | 
FileCheck --check-prefix=NO-REAL16 %s
+// REAL16: "-target-feature" "+real-true16"
+// NO-REAL16-NOT: {{".*real-true16"}}

``````````

</details>


https://github.com/llvm/llvm-project/pull/133298
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to