[clang] 9816c19 - [X86] Rename CMPCCXADD intrinsics.

Freddy Ye via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 28 00:46:04 PST 2022


Author: Freddy Ye
Date: 2022-12-28T16:45:50+08:00
New Revision: 9816c1912d56668736a2bd95ce18b7fb41653b92

URL: https://github.com/llvm/llvm-project/commit/9816c1912d56668736a2bd95ce18b7fb41653b92
DIFF: https://github.com/llvm/llvm-project/commit/9816c1912d56668736a2bd95ce18b7fb41653b92.diff

LOG: [X86] Rename CMPCCXADD intrinsics.

"__cmpccxadd_epi*" -> "_cmpccxadd_epi*"
This is to align with other intrinsics to follow single leading "_" style. Gcc
and intrinsic guide website will also apply this change.

Reviewed By: LuoYuanke, skan

Differential Revision: https://reviews.llvm.org/D140281

Added: 
    

Modified: 
    clang/docs/ReleaseNotes.rst
    clang/lib/Headers/cmpccxaddintrin.h
    clang/test/CodeGen/X86/cmpccxadd-builtins-error-32.c
    clang/test/CodeGen/X86/cmpccxadd-builtins-error.c
    clang/test/CodeGen/X86/cmpccxadd-builtins.c

Removed: 
    


################################################################################
diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 48ffafafb1bb7..776f0a97d2500 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -778,8 +778,8 @@ X86 Support in Clang
 - Switch ``AVX512-BF16`` intrinsics types from ``short`` to ``__bf16``.
 - Add support for ``PREFETCHI`` instructions.
 - Support ISA of ``CMPCCXADD``.
-  * Support intrinsic of ``__cmpccxadd_epi32``.
-  * Support intrinsic of ``__cmpccxadd_epi64``.
+  * Support intrinsic of ``_cmpccxadd_epi32``.
+  * Support intrinsic of ``_cmpccxadd_epi64``.
 - Add support for ``RAO-INT`` instructions.
   * Support intrinsic of ``_aadd_i32/64``
   * Support intrinsic of ``_aand_i32/64``

diff  --git a/clang/lib/Headers/cmpccxaddintrin.h b/clang/lib/Headers/cmpccxaddintrin.h
index 093ca1f64e660..6957498996c89 100644
--- a/clang/lib/Headers/cmpccxaddintrin.h
+++ b/clang/lib/Headers/cmpccxaddintrin.h
@@ -58,11 +58,11 @@ typedef enum {
 ///
 /// \returns a integer which is the original value of first operand.
 
-#define __cmpccxadd_epi32(__A, __B, __C, __D)                                  \
+#define _cmpccxadd_epi32(__A, __B, __C, __D)                                   \
   ((int)(__builtin_ia32_cmpccxadd32((void *)(__A), (int)(__B), (int)(__C),     \
                                     (int)(__D))))
 
-#define __cmpccxadd_epi64(__A, __B, __C, __D)                                  \
+#define _cmpccxadd_epi64(__A, __B, __C, __D)                                   \
   ((long long)(__builtin_ia32_cmpccxadd64((void *)(__A), (long long)(__B),     \
                                           (long long)(__C), (int)(__D))))
 

diff  --git a/clang/test/CodeGen/X86/cmpccxadd-builtins-error-32.c b/clang/test/CodeGen/X86/cmpccxadd-builtins-error-32.c
index 1b6c7c412592f..512365b689b79 100644
--- a/clang/test/CodeGen/X86/cmpccxadd-builtins-error-32.c
+++ b/clang/test/CodeGen/X86/cmpccxadd-builtins-error-32.c
@@ -4,5 +4,5 @@
 #include <immintrin.h>
 
 int test_cmpccxadd32(void *__A, int __B, int __C) {
-  return __cmpccxadd_epi32(__A, __B, __C, 0); // expected-error {{call to undeclared function '__cmpccxadd_epi32'}}
+  return _cmpccxadd_epi32(__A, __B, __C, 0); // expected-error {{call to undeclared function '_cmpccxadd_epi32'}}
 }

diff  --git a/clang/test/CodeGen/X86/cmpccxadd-builtins-error.c b/clang/test/CodeGen/X86/cmpccxadd-builtins-error.c
index 0b329aa8baa84..30515b48e8589 100644
--- a/clang/test/CodeGen/X86/cmpccxadd-builtins-error.c
+++ b/clang/test/CodeGen/X86/cmpccxadd-builtins-error.c
@@ -4,9 +4,9 @@
 #include <immintrin.h>
 
 int test_cmpccxadd32(void *__A, int __B, int __C) {
-  return __cmpccxadd_epi32(__A, __B, __C, 16); // expected-error {{argument value 16 is outside the valid range [0, 15]}}
+  return _cmpccxadd_epi32(__A, __B, __C, 16); // expected-error {{argument value 16 is outside the valid range [0, 15]}}
 }
 
 long long test_cmpccxadd64(void *__A, long long __B, long long __C) {
-  return __cmpccxadd_epi64(__A, __B, __C, 16); // expected-error {{argument value 16 is outside the valid range [0, 15]}}
+  return _cmpccxadd_epi64(__A, __B, __C, 16); // expected-error {{argument value 16 is outside the valid range [0, 15]}}
 }

diff  --git a/clang/test/CodeGen/X86/cmpccxadd-builtins.c b/clang/test/CodeGen/X86/cmpccxadd-builtins.c
index bb7b19c5def85..6daed3a1b17b6 100644
--- a/clang/test/CodeGen/X86/cmpccxadd-builtins.c
+++ b/clang/test/CodeGen/X86/cmpccxadd-builtins.c
@@ -7,191 +7,191 @@
 int test_cmpbexadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmpbexadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 0)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_O);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_O);
 }
 
 long long test_cmpbexadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmpbexadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 0)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_O);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_O);
 }
 
 int test_cmpbxadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmpbxadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 1)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NO);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NO);
 }
 
 long long test_cmpbxadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmpbxadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 1)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NO);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NO);
 }
 
 int test_cmplexadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmplexadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 2)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_B);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_B);
 }
 
 long long test_cmplexadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmplexadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 2)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_B);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_B);
 }
 
 int test_cmplxadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmplxadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 3)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NB);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NB);
 }
 
 long long test_cmplxadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmplxadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 3)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NB);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NB);
 }
 
 int test_cmpnbexadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmpnbexadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 4)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_Z);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_Z);
 }
 
 long long test_cmpnbexadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmpnbexadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 4)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_Z);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_Z);
 }
 
 int test_cmpnbxadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmpnbxadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 5)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NZ);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NZ);
 }
 
 long long test_cmpnbxadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmpnbxadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 5)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NZ);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NZ);
 }
 
 int test_cmpnlexadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmpnlexadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 6)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_BE);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_BE);
 }
 
 long long test_cmpnlexadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmpnlexadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 6)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_BE);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_BE);
 }
 
 int test_cmpnlxadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmpnlxadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 7)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NBE);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NBE);
 }
 
 long long test_cmpnlxadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmpnlxadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 7)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NBE);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NBE);
 }
 
 int test_cmpnoxadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmpnoxadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 8)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_S);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_S);
 }
 
 long long test_cmpnoxadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmpnoxadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 8)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_S);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_S);
 }
 
 int test_cmpnpxadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmpnpxadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 9)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NS);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NS);
 }
 
 long long test_cmpnpxadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmpnpxadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 9)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NS);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NS);
 }
 
 int test_cmpnsxadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmpnsxadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 10)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_P);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_P);
 }
 
 long long test_cmpnsxadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmpnsxadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 10)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_P);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_P);
 }
 
 int test_cmpnzxadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmpnzxadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 11)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NP);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NP);
 }
 
 long long test_cmpnzxadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmpnzxadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 11)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NP);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NP);
 }
 
 int test_cmpoxadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmpoxadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 12)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_L);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_L);
 }
 
 long long test_cmpoxadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmpoxadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 12)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_L);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_L);
 }
 
 int test_cmppxadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmppxadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 13)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NL);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NL);
 }
 
 long long test_cmppxadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmppxadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 13)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NL);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NL);
 }
 
 int test_cmpsxadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmpsxadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 14)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_LE);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_LE);
 }
 
 long long test_cmpsxadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmpsxadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 14)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_LE);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_LE);
 }
 
 int test_cmpzxadd32(void *__A, int __B, int __C) {
   // CHECK-LABEL: @test_cmpzxadd32(
   // CHECK: call i32 @llvm.x86.cmpccxadd32(ptr %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 15)
-  return __cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NLE);
+  return _cmpccxadd_epi32(__A, __B, __C, _CMPCCX_NLE);
 }
 
 long long test_cmpzxadd64(void *__A, long long __B, long long __C) {
   // CHECK-LABEL: @test_cmpzxadd64(
   // CHECK: call i64 @llvm.x86.cmpccxadd64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i32 15)
-  return __cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NLE);
+  return _cmpccxadd_epi64(__A, __B, __C, _CMPCCX_NLE);
 }


        


More information about the cfe-commits mailing list