@@ -153,21 +153,16 @@ aot_compile_simd_i16x8_narrow_i32x4_x86(AOTCompContext *comp_ctx,
153
153
is_signed ? "llvm.x86.sse2.packssdw.128" : "llvm.x86.sse41.packusdw" );
154
154
}
155
155
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 )
160
160
{
161
161
LLVMValueRef vector1 , vector2 , result , vector_min , vector_max , shuffle ,
162
162
vector1_clamped , vector2_clamped , vector1_trunced , vector2_trunced ,
163
163
shuffle_vector ;
164
164
LLVMValueRef v1_gt_max , v1_lt_min , v2_gt_max , v2_lt_min ;
165
165
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
-
171
166
int min_s_array [8 ] = { 0xff80 , 0xff80 , 0xff80 , 0xff80 ,
172
167
0xff80 , 0xff80 , 0xff80 , 0xff80 };
173
168
int max_s_array [8 ] = { 0x007f , 0x007f , 0x007f , 0x007f ,
@@ -290,20 +285,30 @@ aot_compile_simd_i8x16_narrow_i16x8(AOTCompContext *comp_ctx,
290
285
}
291
286
292
287
bool
293
- aot_compile_simd_i16x8_narrow_i32x4 (AOTCompContext * comp_ctx ,
288
+ aot_compile_simd_i8x16_narrow_i16x8 (AOTCompContext * comp_ctx ,
294
289
AOTFuncContext * func_ctx ,
295
290
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 )
296
306
{
297
307
LLVMValueRef vector1 , vector2 , result , vector_min , vector_max , shuffle ,
298
308
vector1_clamped , vector2_clamped , vector1_trunced , vector2_trunced ,
299
309
shuffle_vector ;
300
310
LLVMValueRef v1_gt_max , v1_lt_min , v2_gt_max , v2_lt_min ;
301
311
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
-
307
312
int min_s_array [4 ] = { 0xffff8000 , 0xffff8000 , 0xffff8000 , 0xffff8000 };
308
313
int32 max_s_array [4 ] = { 0x00007fff , 0x00007fff , 0x00007fff , 0x00007fff };
309
314
@@ -420,6 +425,21 @@ aot_compile_simd_i16x8_narrow_i32x4(AOTCompContext *comp_ctx,
420
425
return false;
421
426
}
422
427
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
+
423
443
bool
424
444
aot_compile_simd_i16x8_widen_i8x16 (AOTCompContext * comp_ctx ,
425
445
AOTFuncContext * func_ctx ,
0 commit comments