[Openmp-commits] [openmp] cea951d - Avoid exporting 80-bit fp functions for architectures other than Intel.

Malhar Jajoo via Openmp-commits openmp-commits at lists.llvm.org
Wed Oct 19 08:03:46 PDT 2022


Author: Malhar Jajoo
Date: 2022-10-19T15:55:19+01:00
New Revision: cea951dccd9aaa7fee8a60ecf9170d7d3cc35086

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

LOG: Avoid exporting 80-bit fp functions for architectures other than Intel.

This patch is a partial fix for [[ https://github.com/llvm/llvm-project/issues/56349 | issue ]], due to functions affected by D117473.

Implementation details:
The patch essentially creates a new macro if the architecture is either
intel32 or intel64, since the generate-def.pl cannot process boolean algebra
on macros.

Reviewed By: jlpeyton

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

Added: 
    

Modified: 
    openmp/runtime/cmake/LibompHandleFlags.cmake
    openmp/runtime/src/dllexports

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/cmake/LibompHandleFlags.cmake b/openmp/runtime/cmake/LibompHandleFlags.cmake
index 74643291737ea..aee9038520b8a 100644
--- a/openmp/runtime/cmake/LibompHandleFlags.cmake
+++ b/openmp/runtime/cmake/LibompHandleFlags.cmake
@@ -163,8 +163,10 @@ function(libomp_get_gdflags gdflags)
   set(gdflags_local)
   if(${IA32})
     set(libomp_gdflag_arch arch_32)
+    libomp_append(gdflags_local "-D IS_IA_ARCH")
   elseif(${INTEL64})
     set(libomp_gdflag_arch arch_32e)
+    libomp_append(gdflags_local "-D IS_IA_ARCH")
   else()
     set(libomp_gdflag_arch arch_${LIBOMP_ARCH})
   endif()

diff  --git a/openmp/runtime/src/dllexports b/openmp/runtime/src/dllexports
index 92f9d24171593..2fd1d90982a3d 100644
--- a/openmp/runtime/src/dllexports
+++ b/openmp/runtime/src/dllexports
@@ -688,11 +688,12 @@ kmp_set_disp_num_buffers                    890
     __kmpc_atomic_fixed2_eqv               2078
     __kmpc_atomic_fixed4_eqv               2079
     __kmpc_atomic_fixed8_eqv               2080
-
+    %ifdef IS_IA_ARCH
     __kmpc_atomic_float10_add              2081
     __kmpc_atomic_float10_sub              2082
     __kmpc_atomic_float10_mul              2083
     __kmpc_atomic_float10_div              2084
+    %endif
 
     __kmpc_atomic_cmplx4_add               2085
     __kmpc_atomic_cmplx4_sub               2086
@@ -702,10 +703,12 @@ kmp_set_disp_num_buffers                    890
     __kmpc_atomic_cmplx8_sub               2090
     __kmpc_atomic_cmplx8_mul               2091
     __kmpc_atomic_cmplx8_div               2092
+    %ifdef IS_IA_ARCH
     __kmpc_atomic_cmplx10_add              2093
     __kmpc_atomic_cmplx10_sub              2094
     __kmpc_atomic_cmplx10_mul              2095
     __kmpc_atomic_cmplx10_div              2096
+    %endif
     %ifdef HAVE_QUAD
     __kmpc_atomic_cmplx16_add              2097
     __kmpc_atomic_cmplx16_sub              2098
@@ -753,11 +756,13 @@ kmp_set_disp_num_buffers                    890
     __kmpc_atomic_float8_mul_fp            2133
     __kmpc_atomic_float8_div_fp            2134
 
+    %ifdef IS_IA_ARCH
     __kmpc_atomic_float10_add_fp           2135
     __kmpc_atomic_float10_sub_fp           2136
     __kmpc_atomic_float10_mul_fp           2137
     __kmpc_atomic_float10_div_fp           2138
     %endif
+    %endif
 
     __kmpc_atomic_fixed1_mul_float8        2169
     __kmpc_atomic_fixed1_div_float8        2170
@@ -785,9 +790,13 @@ kmp_set_disp_num_buffers                    890
     __kmpc_atomic_2                        2248
    #__kmpc_atomic_4                    # declared above #100
    #__kmpc_atomic_8                    # declared above #101
+    %ifdef IS_IA_ARCH
     __kmpc_atomic_10                       2251
+    %endif
     __kmpc_atomic_16                       2252
+    %ifdef IS_IA_ARCH
     __kmpc_atomic_20                       2253
+    %endif
     __kmpc_atomic_32                       2254
 
     %ifdef arch_32
@@ -809,8 +818,7 @@ kmp_set_disp_num_buffers                    890
     %endif
 
     # These are specific to x86 and x64
-    %ifndef arch_64
-    %ifndef arch_aarch64
+    %ifdef IS_IA_ARCH
 
         # ATOMIC extensions for OpenMP 3.1 spec (x86 and x64 only)
 
@@ -1214,8 +1222,7 @@ kmp_set_disp_num_buffers                    890
             __kmpc_atomic_float10_div_cpt_rev_fp
             %endif
 
-    %endif   # arch_aarch64
-    %endif   # arch_64
+    %endif   # IS_IA_ARCH
 
     %ifdef HAVE_QUAD
     __kmpc_atomic_fixed1u_add_fp
@@ -1233,8 +1240,10 @@ kmp_set_disp_num_buffers                    890
     %endif
 
     # OpenMP 5.1 atomics
+    %ifdef IS_IA_ARCH
     __kmpc_atomic_float10_max              2139
     __kmpc_atomic_float10_min              2140
+    %endif
     __kmpc_atomic_float10_max_cpt          2141
     __kmpc_atomic_float10_min_cpt          2142
 


        


More information about the Openmp-commits mailing list