@@ -153,21 +153,16 @@ aot_compile_simd_i16x8_narrow_i32x4_x86(AOTCompContext *comp_ctx,
153153 is_signed ? "llvm.x86.sse2.packssdw.128" : "llvm.x86.sse41.packusdw" );
154154}
155155
156- bool
157- aot_compile_simd_i8x16_narrow_i16x8 (AOTCompContext * comp_ctx ,
158- AOTFuncContext * func_ctx ,
159- bool is_signed )
156+ static bool
157+ aot_compile_simd_i8x16_narrow_i16x8_common (AOTCompContext * comp_ctx ,
158+ AOTFuncContext * func_ctx ,
159+ bool is_signed )
160160{
161161 LLVMValueRef vector1 , vector2 , result , vector_min , vector_max , shuffle ,
162162 vector1_clamped , vector2_clamped , vector1_trunced , vector2_trunced ,
163163 shuffle_vector ;
164164 LLVMValueRef v1_gt_max , v1_lt_min , v2_gt_max , v2_lt_min ;
165165
166- if (is_target_x86 (comp_ctx )) {
167- return aot_compile_simd_i8x16_narrow_i16x8_x86 (comp_ctx , func_ctx ,
168- is_signed );
169- }
170-
171166 int min_s_array [8 ] = { 0xff80 , 0xff80 , 0xff80 , 0xff80 ,
172167 0xff80 , 0xff80 , 0xff80 , 0xff80 };
173168 int max_s_array [8 ] = { 0x007f , 0x007f , 0x007f , 0x007f ,
@@ -290,20 +285,30 @@ aot_compile_simd_i8x16_narrow_i16x8(AOTCompContext *comp_ctx,
290285}
291286
292287bool
293- aot_compile_simd_i16x8_narrow_i32x4 (AOTCompContext * comp_ctx ,
288+ aot_compile_simd_i8x16_narrow_i16x8 (AOTCompContext * comp_ctx ,
294289 AOTFuncContext * func_ctx ,
295290 bool is_signed )
291+ {
292+ if (is_target_x86 (comp_ctx )) {
293+ return aot_compile_simd_i8x16_narrow_i16x8_x86 (comp_ctx , func_ctx ,
294+ is_signed );
295+ }
296+ else {
297+ return aot_compile_simd_i8x16_narrow_i16x8_common (comp_ctx , func_ctx ,
298+ is_signed );
299+ }
300+ }
301+
302+ static bool
303+ aot_compile_simd_i16x8_narrow_i32x4_common (AOTCompContext * comp_ctx ,
304+ AOTFuncContext * func_ctx ,
305+ bool is_signed )
296306{
297307 LLVMValueRef vector1 , vector2 , result , vector_min , vector_max , shuffle ,
298308 vector1_clamped , vector2_clamped , vector1_trunced , vector2_trunced ,
299309 shuffle_vector ;
300310 LLVMValueRef v1_gt_max , v1_lt_min , v2_gt_max , v2_lt_min ;
301311
302- if (is_target_x86 (comp_ctx )) {
303- return aot_compile_simd_i16x8_narrow_i32x4_x86 (comp_ctx , func_ctx ,
304- is_signed );
305- }
306-
307312 int min_s_array [4 ] = { 0xffff8000 , 0xffff8000 , 0xffff8000 , 0xffff8000 };
308313 int32 max_s_array [4 ] = { 0x00007fff , 0x00007fff , 0x00007fff , 0x00007fff };
309314
@@ -420,6 +425,21 @@ aot_compile_simd_i16x8_narrow_i32x4(AOTCompContext *comp_ctx,
420425 return false;
421426}
422427
428+ bool
429+ aot_compile_simd_i16x8_narrow_i32x4 (AOTCompContext * comp_ctx ,
430+ AOTFuncContext * func_ctx ,
431+ bool is_signed )
432+ {
433+ if (is_target_x86 (comp_ctx )) {
434+ return aot_compile_simd_i16x8_narrow_i32x4_x86 (comp_ctx , func_ctx ,
435+ is_signed );
436+ }
437+ else {
438+ return aot_compile_simd_i16x8_narrow_i32x4_common (comp_ctx , func_ctx ,
439+ is_signed );
440+ }
441+ }
442+
423443bool
424444aot_compile_simd_i16x8_widen_i8x16 (AOTCompContext * comp_ctx ,
425445 AOTFuncContext * func_ctx ,
0 commit comments