Skip to content

Commit c6c41b7

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web' (#1)
2 parents fad9480 + de694dd commit c6c41b7

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

llvm/lib/SYCLLowerIR/LowerESIMD.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ class ESIMDIntrinDescTable {
346346
{"uushl_sat", {"uushl.sat", {a(0), a(1)}}},
347347
{"rol", {"rol", {a(0), a(1)}}},
348348
{"ror", {"ror", {a(0), a(1)}}},
349+
{"rndd", {"rndd", {a(0)}}},
350+
{"rnde", {"rnde", {a(0)}}},
351+
{"rndu", {"rndu", {a(0)}}},
352+
{"rndz", {"rndz", {a(0)}}},
349353
{"umulh", {"umulh", {a(0), a(1)}}},
350354
{"smulh", {"smulh", {a(0), a(1)}}},
351355
{"frc", {"frc", {a(0)}}},

llvm/test/SYCLLowerIR/esimd_lower_intrins.ll

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,38 @@ define dso_local i32 @FUNC_46() {
327327
ret i32 %call
328328
}
329329

330+
define dso_local spir_func <16 x float> @FUNC_47() {
331+
%a_1 = alloca <16 x float>
332+
%1 = load <16 x float>, <16 x float>* %a_1
333+
%ret_val = call spir_func <16 x float> @_Z12__esimd_rnddILi16EEN2cl4sycl3ext5intel12experimental5esimd6detail11vector_typeIfXT_EE4typeES9_(<16 x float> %1)
334+
; CHECK: %{{[0-9a-zA-Z_.]+}} = call <16 x float> @llvm.genx.rndd.v16f32(<16 x float> %{{[0-9a-zA-Z_.]+}})
335+
ret <16 x float> %ret_val
336+
}
337+
338+
define dso_local spir_func <16 x float> @FUNC_48() {
339+
%a_1 = alloca <16 x float>
340+
%1 = load <16 x float>, <16 x float>* %a_1
341+
%ret_val = call spir_func <16 x float> @_Z12__esimd_rnduILi16EEN2cl4sycl3ext5intel12experimental5esimd6detail11vector_typeIfXT_EE4typeES9_(<16 x float> %1)
342+
; CHECK: %{{[0-9a-zA-Z_.]+}} = call <16 x float> @llvm.genx.rndu.v16f32(<16 x float> %{{[0-9a-zA-Z_.]+}})
343+
ret <16 x float> %ret_val
344+
}
345+
346+
define dso_local spir_func <16 x float> @FUNC_49() {
347+
%a_1 = alloca <16 x float>
348+
%1 = load <16 x float>, <16 x float>* %a_1
349+
%ret_val = call spir_func <16 x float> @_Z12__esimd_rndzILi16EEN2cl4sycl3ext5intel12experimental5esimd6detail11vector_typeIfXT_EE4typeES9_(<16 x float> %1)
350+
; CHECK: %{{[0-9a-zA-Z_.]+}} = call <16 x float> @llvm.genx.rndz.v16f32(<16 x float> %{{[0-9a-zA-Z_.]+}})
351+
ret <16 x float> %ret_val
352+
}
353+
354+
define dso_local spir_func <16 x float> @FUNC_50() {
355+
%a_1 = alloca <16 x float>
356+
%1 = load <16 x float>, <16 x float>* %a_1
357+
%ret_val = call spir_func <16 x float> @_Z12__esimd_rndeILi16EEN2cl4sycl3ext5intel12experimental5esimd6detail11vector_typeIfXT_EE4typeES9_(<16 x float> %1)
358+
; CHECK: %{{[0-9a-zA-Z_.]+}} = call <16 x float> @llvm.genx.rnde.v16f32(<16 x float> %{{[0-9a-zA-Z_.]+}})
359+
ret <16 x float> %ret_val
360+
}
361+
330362
declare dso_local i32 @_Z15__esimd_lane_idv()
331363

332364
declare dso_local spir_func <32 x i32> @_Z20__esimd_flat_atomic0ILN2cm3gen14CmAtomicOpTypeE2EjLi32ELNS1_9CacheHintE0ELS3_0EENS1_13__vector_typeIT0_XT1_EE4typeENS4_IyXT1_EE4typeENS4_ItXT1_EE4typeE(<32 x i64> %0, <32 x i16> %1)
@@ -371,6 +403,10 @@ declare dso_local spir_func <8 x i32> @_Z22__esimd_slm_block_readIiLi8EEN2cl4syc
371403
declare dso_local spir_func void @_Z16__esimd_sbarrierN2cl4sycl5INTEL3gpu17EsimdSbarrierTypeE(i8 %0)
372404
declare dso_local spir_func <8 x i32> @_Z18__esimd_rdindirectIiLi16ELi8ELi0EEN2cl4sycl5INTEL3gpu11vector_typeIT_XT1_EE4typeENS4_IS5_XT0_EE4typeENS4_ItXT1_EE4typeE(<16 x i32>, <8 x i16>)
373405
declare dso_local spir_func <16 x i32> @_Z18__esimd_wrindirectIiLi16ELi8ELi0EEN2cl4sycl5INTEL3gpu11vector_typeIT_XT0_EE4typeES7_NS4_IS5_XT1_EE4typeENS4_ItXT1_EE4typeESB_(<16 x i32>, <8 x i32>, <8 x i16>, <8 x i16>)
406+
declare dso_local spir_func <16 x float> @_Z12__esimd_rnddILi16EEN2cl4sycl3ext5intel12experimental5esimd6detail11vector_typeIfXT_EE4typeES9_(<16 x float>)
407+
declare dso_local spir_func <16 x float> @_Z12__esimd_rnduILi16EEN2cl4sycl3ext5intel12experimental5esimd6detail11vector_typeIfXT_EE4typeES9_(<16 x float>)
408+
declare dso_local spir_func <16 x float> @_Z12__esimd_rndzILi16EEN2cl4sycl3ext5intel12experimental5esimd6detail11vector_typeIfXT_EE4typeES9_(<16 x float>)
409+
declare dso_local spir_func <16 x float> @_Z12__esimd_rndeILi16EEN2cl4sycl3ext5intel12experimental5esimd6detail11vector_typeIfXT_EE4typeES9_(<16 x float>)
374410

375411
attributes #0 = { "genx_byte_offset"="192" "genx_volatile" }
376412

sycl/include/sycl/ext/intel/experimental/esimd/detail/esimd_math_intrin.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ __esimd_rndu(__SEIEED::vector_type_t<float, SZ> src0) {
10541054

10551055
for (int i = 0; i < SZ; i++) {
10561056
SIMDCF_ELEMENT_SKIP(i);
1057-
if (src0.get(i) - floor(src0.get(i)) > 0.0f) {
1057+
if (src0[i] - floor(src0[i]) > 0.0f) {
10581058
increment = 1;
10591059
} else {
10601060
increment = 0;

sycl/include/sycl/ext/intel/experimental/esimd/esimd_math.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ ESIMD_NODEBUG ESIMD_INLINE
12241224
template <typename T, int SZ> \
12251225
ESIMD_NODEBUG ESIMD_INLINE simd<T, SZ> esimd_##name(simd<float, SZ> src0, \
12261226
int flag = GENX_NOSAT) { \
1227-
simd<float, SZ> Result = __esimd_##name(src0.data()); \
1227+
simd<float, SZ> Result = __esimd_##name<SZ>(src0.data()); \
12281228
if (flag != GENX_SAT) \
12291229
return Result; \
12301230
return esimd_sat<T>(Result); \

0 commit comments

Comments
 (0)