mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-28 08:02:08 +00:00
[WebAssembly] Use "signed char" instead of "char" in SIMD intrinsics.
This allows people to use `int8_t` instead of `char`, -funsigned-char, and generally decouples SIMD from the specialness of `char`. And it makes intrinsics like `__builtin_wasm_add_saturate_s_i8x16` and `__builtin_wasm_add_saturate_u_i8x16` use signed and unsigned element types, respectively. Differential Revision: https://reviews.llvm.org/D85074
This commit is contained in:
parent
1d6a724aa1
commit
47f7174ffa
@ -66,67 +66,67 @@ TARGET_BUILTIN(__builtin_wasm_trunc_saturate_s_i64_f64, "LLid", "nc", "nontrappi
|
||||
TARGET_BUILTIN(__builtin_wasm_trunc_saturate_u_i64_f64, "LLid", "nc", "nontrapping-fptoint")
|
||||
|
||||
// SIMD builtins
|
||||
TARGET_BUILTIN(__builtin_wasm_swizzle_v8x16, "V16cV16cV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_swizzle_v8x16, "V16ScV16ScV16Sc", "nc", "simd128")
|
||||
|
||||
TARGET_BUILTIN(__builtin_wasm_extract_lane_s_i8x16, "iV16cIi", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_extract_lane_u_i8x16, "iV16cIi", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_extract_lane_s_i8x16, "iV16ScIi", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_extract_lane_u_i8x16, "iV16UcIUi", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_extract_lane_s_i16x8, "iV8sIi", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_extract_lane_u_i16x8, "iV8sIi", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_extract_lane_u_i16x8, "iV8UsIUi", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_extract_lane_i32x4, "iV4iIi", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_extract_lane_i64x2, "LLiV2LLiIi", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_extract_lane_f32x4, "fV4fIi", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_extract_lane_f64x2, "dV2dIi", "nc", "simd128")
|
||||
|
||||
TARGET_BUILTIN(__builtin_wasm_replace_lane_i8x16, "V16cV16cIii", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_replace_lane_i8x16, "V16ScV16ScIii", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_replace_lane_i16x8, "V8sV8sIii", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_replace_lane_i32x4, "V4iV4iIii", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_replace_lane_i64x2, "V2LLiV2LLiIiLLi", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_replace_lane_f32x4, "V4fV4fIif", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_replace_lane_f64x2, "V2dV2dIid", "nc", "simd128")
|
||||
|
||||
TARGET_BUILTIN(__builtin_wasm_add_saturate_s_i8x16, "V16cV16cV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_add_saturate_u_i8x16, "V16cV16cV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_add_saturate_s_i8x16, "V16ScV16ScV16Sc", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_add_saturate_u_i8x16, "V16UcV16UcV16Uc", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_add_saturate_s_i16x8, "V8sV8sV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_add_saturate_u_i16x8, "V8sV8sV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_add_saturate_u_i16x8, "V8UsV8UsV8Us", "nc", "simd128")
|
||||
|
||||
TARGET_BUILTIN(__builtin_wasm_sub_saturate_s_i8x16, "V16cV16cV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_sub_saturate_u_i8x16, "V16cV16cV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_sub_saturate_s_i8x16, "V16ScV16ScV16Sc", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_sub_saturate_u_i8x16, "V16UcV16UcV16Uc", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_sub_saturate_s_i16x8, "V8sV8sV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_sub_saturate_u_i16x8, "V8sV8sV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_sub_saturate_u_i16x8, "V8UsV8UsV8Us", "nc", "simd128")
|
||||
|
||||
TARGET_BUILTIN(__builtin_wasm_abs_i8x16, "V16cV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_abs_i8x16, "V16ScV16Sc", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_abs_i16x8, "V8sV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_abs_i32x4, "V4iV4i", "nc", "simd128")
|
||||
|
||||
TARGET_BUILTIN(__builtin_wasm_min_s_i8x16, "V16cV16cV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_min_u_i8x16, "V16cV16cV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_max_s_i8x16, "V16cV16cV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_max_u_i8x16, "V16cV16cV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_min_s_i8x16, "V16ScV16ScV16Sc", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_min_u_i8x16, "V16UcV16UcV16Uc", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_max_s_i8x16, "V16ScV16ScV16Sc", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_max_u_i8x16, "V16UcV16UcV16Uc", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_min_s_i16x8, "V8sV8sV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_min_u_i16x8, "V8sV8sV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_min_u_i16x8, "V8UsV8UsV8Us", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_max_s_i16x8, "V8sV8sV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_max_u_i16x8, "V8sV8sV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_max_u_i16x8, "V8UsV8UsV8Us", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_min_s_i32x4, "V4iV4iV4i", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_min_u_i32x4, "V4iV4iV4i", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_min_u_i32x4, "V4UiV4UiV4Ui", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_max_s_i32x4, "V4iV4iV4i", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_max_u_i32x4, "V4iV4iV4i", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_max_u_i32x4, "V4UiV4UiV4Ui", "nc", "simd128")
|
||||
|
||||
TARGET_BUILTIN(__builtin_wasm_avgr_u_i8x16, "V16cV16cV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_avgr_u_i16x8, "V8sV8sV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_avgr_u_i8x16, "V16UcV16UcV16Uc", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_avgr_u_i16x8, "V8UsV8UsV8Us", "nc", "simd128")
|
||||
|
||||
TARGET_BUILTIN(__builtin_wasm_bitselect, "V4iV4iV4iV4i", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_shuffle_v8x16, "V16cV16cV16cIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIi", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_shuffle_v8x16, "V16ScV16ScV16ScIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIi", "nc", "simd128")
|
||||
|
||||
TARGET_BUILTIN(__builtin_wasm_any_true_i8x16, "iV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_any_true_i8x16, "iV16Sc", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_any_true_i16x8, "iV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_any_true_i32x4, "iV4i", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_any_true_i64x2, "iV2LLi", "nc", "unimplemented-simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_all_true_i8x16, "iV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_all_true_i8x16, "iV16Sc", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_all_true_i16x8, "iV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_all_true_i32x4, "iV4i", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_all_true_i64x2, "iV2LLi", "nc", "unimplemented-simd128")
|
||||
|
||||
TARGET_BUILTIN(__builtin_wasm_bitmask_i8x16, "iV16c", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_bitmask_i8x16, "iV16Sc", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_bitmask_i16x8, "iV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_bitmask_i32x4, "iV4i", "nc", "simd128")
|
||||
|
||||
@ -164,10 +164,10 @@ TARGET_BUILTIN(__builtin_wasm_qfms_f64x2, "V2dV2dV2dV2d", "nc", "unimplemented-s
|
||||
TARGET_BUILTIN(__builtin_wasm_trunc_saturate_s_i32x4_f32x4, "V4iV4f", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_trunc_saturate_u_i32x4_f32x4, "V4iV4f", "nc", "simd128")
|
||||
|
||||
TARGET_BUILTIN(__builtin_wasm_narrow_s_i8x16_i16x8, "V16cV8sV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_narrow_u_i8x16_i16x8, "V16cV8sV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_narrow_s_i8x16_i16x8, "V16ScV8sV8s", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_narrow_u_i8x16_i16x8, "V16UcV8UsV8Us", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_narrow_s_i16x8_i32x4, "V8sV4iV4i", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_narrow_u_i16x8_i32x4, "V8sV4iV4i", "nc", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_narrow_u_i16x8_i32x4, "V8UsV4UiV4Ui", "nc", "simd128")
|
||||
|
||||
TARGET_BUILTIN(__builtin_wasm_load32_zero, "V4ii*", "nU", "simd128")
|
||||
TARGET_BUILTIN(__builtin_wasm_load64_zero, "V2LLiLLi*", "nU", "simd128")
|
||||
|
@ -18,8 +18,7 @@ typedef int32_t v128_t __attribute__((__vector_size__(16), __aligned__(16)));
|
||||
|
||||
// Internal types determined by clang builtin definitions
|
||||
typedef int32_t __v128_u __attribute__((__vector_size__(16), __aligned__(1)));
|
||||
typedef char __i8x16 __attribute__((__vector_size__(16), __aligned__(16)));
|
||||
typedef signed char __s8x16
|
||||
typedef signed char __i8x16
|
||||
__attribute__((__vector_size__(16), __aligned__(16)));
|
||||
typedef unsigned char __u8x16
|
||||
__attribute__((__vector_size__(16), __aligned__(16)));
|
||||
@ -340,17 +339,17 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_f64x2_splat(double __a) {
|
||||
|
||||
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_eq(v128_t __a,
|
||||
v128_t __b) {
|
||||
return (v128_t)((__s8x16)__a == (__s8x16)__b);
|
||||
return (v128_t)((__i8x16)__a == (__i8x16)__b);
|
||||
}
|
||||
|
||||
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_ne(v128_t __a,
|
||||
v128_t __b) {
|
||||
return (v128_t)((__s8x16)__a != (__s8x16)__b);
|
||||
return (v128_t)((__i8x16)__a != (__i8x16)__b);
|
||||
}
|
||||
|
||||
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_lt(v128_t __a,
|
||||
v128_t __b) {
|
||||
return (v128_t)((__s8x16)__a < (__s8x16)__b);
|
||||
return (v128_t)((__i8x16)__a < (__i8x16)__b);
|
||||
}
|
||||
|
||||
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_lt(v128_t __a,
|
||||
@ -360,7 +359,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_lt(v128_t __a,
|
||||
|
||||
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_gt(v128_t __a,
|
||||
v128_t __b) {
|
||||
return (v128_t)((__s8x16)__a > (__s8x16)__b);
|
||||
return (v128_t)((__i8x16)__a > (__i8x16)__b);
|
||||
}
|
||||
|
||||
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_gt(v128_t __a,
|
||||
@ -370,7 +369,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_gt(v128_t __a,
|
||||
|
||||
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_le(v128_t __a,
|
||||
v128_t __b) {
|
||||
return (v128_t)((__s8x16)__a <= (__s8x16)__b);
|
||||
return (v128_t)((__i8x16)__a <= (__i8x16)__b);
|
||||
}
|
||||
|
||||
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_le(v128_t __a,
|
||||
@ -380,7 +379,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_le(v128_t __a,
|
||||
|
||||
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_ge(v128_t __a,
|
||||
v128_t __b) {
|
||||
return (v128_t)((__s8x16)__a >= (__s8x16)__b);
|
||||
return (v128_t)((__i8x16)__a >= (__i8x16)__b);
|
||||
}
|
||||
|
||||
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_ge(v128_t __a,
|
||||
@ -602,7 +601,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_shl(v128_t __a,
|
||||
|
||||
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_shr(v128_t __a,
|
||||
int32_t __b) {
|
||||
return (v128_t)((__s8x16)__a >> __b);
|
||||
return (v128_t)((__i8x16)__a >> __b);
|
||||
}
|
||||
|
||||
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_shr(v128_t __a,
|
||||
|
@ -3,7 +3,7 @@
|
||||
// RUN: not %clang_cc1 -triple wasm64-unknown-unknown -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -target-feature +atomics -flax-vector-conversions=none -O3 -emit-llvm -o - %s 2>&1 | FileCheck %s -check-prefixes MISSING-SIMD
|
||||
|
||||
// SIMD convenience types
|
||||
typedef char i8x16 __attribute((vector_size(16)));
|
||||
typedef signed char i8x16 __attribute((vector_size(16)));
|
||||
typedef short i16x8 __attribute((vector_size(16)));
|
||||
typedef int i32x4 __attribute((vector_size(16)));
|
||||
typedef long long i64x2 __attribute((vector_size(16)));
|
||||
@ -201,7 +201,7 @@ int extract_lane_s_i8x16(i8x16 v) {
|
||||
// WEBASSEMBLY-NEXT: ret
|
||||
}
|
||||
|
||||
int extract_lane_u_i8x16(i8x16 v) {
|
||||
int extract_lane_u_i8x16(u8x16 v) {
|
||||
return __builtin_wasm_extract_lane_u_i8x16(v, 13);
|
||||
// WEBASSEMBLY: extractelement <16 x i8> %v, i32 13
|
||||
// WEBASSEMBLY-NEXT: zext
|
||||
@ -215,7 +215,7 @@ int extract_lane_s_i16x8(i16x8 v) {
|
||||
// WEBASSEMBLY-NEXT: ret
|
||||
}
|
||||
|
||||
int extract_lane_u_i16x8(i16x8 v) {
|
||||
int extract_lane_u_i16x8(u16x8 v) {
|
||||
return __builtin_wasm_extract_lane_u_i16x8(v, 7);
|
||||
// WEBASSEMBLY: extractelement <8 x i16> %v, i32 7
|
||||
// WEBASSEMBLY-NEXT: zext
|
||||
@ -291,7 +291,7 @@ i8x16 add_saturate_s_i8x16(i8x16 x, i8x16 y) {
|
||||
// WEBASSEMBLY-NEXT: ret
|
||||
}
|
||||
|
||||
i8x16 add_saturate_u_i8x16(i8x16 x, i8x16 y) {
|
||||
u8x16 add_saturate_u_i8x16(u8x16 x, u8x16 y) {
|
||||
return __builtin_wasm_add_saturate_u_i8x16(x, y);
|
||||
// WEBASSEMBLY: call <16 x i8> @llvm.uadd.sat.v16i8(
|
||||
// WEBASSEMBLY-SAME: <16 x i8> %x, <16 x i8> %y)
|
||||
@ -305,7 +305,7 @@ i16x8 add_saturate_s_i16x8(i16x8 x, i16x8 y) {
|
||||
// WEBASSEMBLY-NEXT: ret
|
||||
}
|
||||
|
||||
i16x8 add_saturate_u_i16x8(i16x8 x, i16x8 y) {
|
||||
u16x8 add_saturate_u_i16x8(u16x8 x, u16x8 y) {
|
||||
return __builtin_wasm_add_saturate_u_i16x8(x, y);
|
||||
// WEBASSEMBLY: call <8 x i16> @llvm.uadd.sat.v8i16(
|
||||
// WEBASSEMBLY-SAME: <8 x i16> %x, <8 x i16> %y)
|
||||
@ -319,7 +319,7 @@ i8x16 sub_saturate_s_i8x16(i8x16 x, i8x16 y) {
|
||||
// WEBASSEMBLY-NEXT: ret
|
||||
}
|
||||
|
||||
i8x16 sub_saturate_u_i8x16(i8x16 x, i8x16 y) {
|
||||
u8x16 sub_saturate_u_i8x16(u8x16 x, u8x16 y) {
|
||||
return __builtin_wasm_sub_saturate_u_i8x16(x, y);
|
||||
// WEBASSEMBLY: call <16 x i8> @llvm.wasm.sub.saturate.unsigned.v16i8(
|
||||
// WEBASSEMBLY-SAME: <16 x i8> %x, <16 x i8> %y)
|
||||
@ -357,7 +357,7 @@ i8x16 min_s_i8x16(i8x16 x, i8x16 y) {
|
||||
// WEBASSEMBLY-NEXT: ret <16 x i8> %1
|
||||
}
|
||||
|
||||
i8x16 min_u_i8x16(i8x16 x, i8x16 y) {
|
||||
u8x16 min_u_i8x16(u8x16 x, u8x16 y) {
|
||||
return __builtin_wasm_min_u_i8x16(x, y);
|
||||
// WEBASSEMBLY: %0 = icmp ult <16 x i8> %x, %y
|
||||
// WEBASSEMBLY-NEXT: %1 = select <16 x i1> %0, <16 x i8> %x, <16 x i8> %y
|
||||
@ -371,7 +371,7 @@ i8x16 max_s_i8x16(i8x16 x, i8x16 y) {
|
||||
// WEBASSEMBLY-NEXT: ret <16 x i8> %1
|
||||
}
|
||||
|
||||
i8x16 max_u_i8x16(i8x16 x, i8x16 y) {
|
||||
u8x16 max_u_i8x16(u8x16 x, u8x16 y) {
|
||||
return __builtin_wasm_max_u_i8x16(x, y);
|
||||
// WEBASSEMBLY: %0 = icmp ugt <16 x i8> %x, %y
|
||||
// WEBASSEMBLY-NEXT: %1 = select <16 x i1> %0, <16 x i8> %x, <16 x i8> %y
|
||||
@ -385,7 +385,7 @@ i16x8 min_s_i16x8(i16x8 x, i16x8 y) {
|
||||
// WEBASSEMBLY-NEXT: ret <8 x i16> %1
|
||||
}
|
||||
|
||||
i16x8 min_u_i16x8(i16x8 x, i16x8 y) {
|
||||
u16x8 min_u_i16x8(u16x8 x, u16x8 y) {
|
||||
return __builtin_wasm_min_u_i16x8(x, y);
|
||||
// WEBASSEMBLY: %0 = icmp ult <8 x i16> %x, %y
|
||||
// WEBASSEMBLY-NEXT: %1 = select <8 x i1> %0, <8 x i16> %x, <8 x i16> %y
|
||||
@ -399,7 +399,7 @@ i16x8 max_s_i16x8(i16x8 x, i16x8 y) {
|
||||
// WEBASSEMBLY-NEXT: ret <8 x i16> %1
|
||||
}
|
||||
|
||||
i16x8 max_u_i16x8(i16x8 x, i16x8 y) {
|
||||
u16x8 max_u_i16x8(u16x8 x, u16x8 y) {
|
||||
return __builtin_wasm_max_u_i16x8(x, y);
|
||||
// WEBASSEMBLY: %0 = icmp ugt <8 x i16> %x, %y
|
||||
// WEBASSEMBLY-NEXT: %1 = select <8 x i1> %0, <8 x i16> %x, <8 x i16> %y
|
||||
@ -413,7 +413,7 @@ i32x4 min_s_i32x4(i32x4 x, i32x4 y) {
|
||||
// WEBASSEMBLY-NEXT: ret <4 x i32> %1
|
||||
}
|
||||
|
||||
i32x4 min_u_i32x4(i32x4 x, i32x4 y) {
|
||||
u32x4 min_u_i32x4(u32x4 x, u32x4 y) {
|
||||
return __builtin_wasm_min_u_i32x4(x, y);
|
||||
// WEBASSEMBLY: %0 = icmp ult <4 x i32> %x, %y
|
||||
// WEBASSEMBLY-NEXT: %1 = select <4 x i1> %0, <4 x i32> %x, <4 x i32> %y
|
||||
@ -427,7 +427,7 @@ i32x4 max_s_i32x4(i32x4 x, i32x4 y) {
|
||||
// WEBASSEMBLY-NEXT: ret <4 x i32> %1
|
||||
}
|
||||
|
||||
i32x4 max_u_i32x4(i32x4 x, i32x4 y) {
|
||||
u32x4 max_u_i32x4(u32x4 x, u32x4 y) {
|
||||
return __builtin_wasm_max_u_i32x4(x, y);
|
||||
// WEBASSEMBLY: %0 = icmp ugt <4 x i32> %x, %y
|
||||
// WEBASSEMBLY-NEXT: %1 = select <4 x i1> %0, <4 x i32> %x, <4 x i32> %y
|
||||
@ -441,21 +441,21 @@ i16x8 sub_saturate_s_i16x8(i16x8 x, i16x8 y) {
|
||||
// WEBASSEMBLY-NEXT: ret
|
||||
}
|
||||
|
||||
i16x8 sub_saturate_u_i16x8(i16x8 x, i16x8 y) {
|
||||
u16x8 sub_saturate_u_i16x8(u16x8 x, u16x8 y) {
|
||||
return __builtin_wasm_sub_saturate_u_i16x8(x, y);
|
||||
// WEBASSEMBLY: call <8 x i16> @llvm.wasm.sub.saturate.unsigned.v8i16(
|
||||
// WEBASSEMBLY-SAME: <8 x i16> %x, <8 x i16> %y)
|
||||
// WEBASSEMBLY-NEXT: ret
|
||||
}
|
||||
|
||||
i8x16 avgr_u_i8x16(i8x16 x, i8x16 y) {
|
||||
u8x16 avgr_u_i8x16(u8x16 x, u8x16 y) {
|
||||
return __builtin_wasm_avgr_u_i8x16(x, y);
|
||||
// WEBASSEMBLY: call <16 x i8> @llvm.wasm.avgr.unsigned.v16i8(
|
||||
// WEBASSEMBLY-SAME: <16 x i8> %x, <16 x i8> %y)
|
||||
// WEBASSEMBLY-NEXT: ret
|
||||
}
|
||||
|
||||
i16x8 avgr_u_i16x8(i16x8 x, i16x8 y) {
|
||||
u16x8 avgr_u_i16x8(u16x8 x, u16x8 y) {
|
||||
return __builtin_wasm_avgr_u_i16x8(x, y);
|
||||
// WEBASSEMBLY: call <8 x i16> @llvm.wasm.avgr.unsigned.v8i16(
|
||||
// WEBASSEMBLY-SAME: <8 x i16> %x, <8 x i16> %y)
|
||||
@ -716,7 +716,7 @@ i8x16 narrow_s_i8x16_i16x8(i16x8 low, i16x8 high) {
|
||||
// WEBASSEMBLY: ret
|
||||
}
|
||||
|
||||
i8x16 narrow_u_i8x16_i16x8(i16x8 low, i16x8 high) {
|
||||
u8x16 narrow_u_i8x16_i16x8(u16x8 low, u16x8 high) {
|
||||
return __builtin_wasm_narrow_u_i8x16_i16x8(low, high);
|
||||
// WEBASSEMBLY: call <16 x i8> @llvm.wasm.narrow.unsigned.v16i8.v8i16(
|
||||
// WEBASSEMBLY-SAME: <8 x i16> %low, <8 x i16> %high)
|
||||
@ -730,7 +730,7 @@ i16x8 narrow_s_i16x8_i32x4(i32x4 low, i32x4 high) {
|
||||
// WEBASSEMBLY: ret
|
||||
}
|
||||
|
||||
i16x8 narrow_u_i16x8_i32x4(i32x4 low, i32x4 high) {
|
||||
u16x8 narrow_u_i16x8_i32x4(u32x4 low, u32x4 high) {
|
||||
return __builtin_wasm_narrow_u_i16x8_i32x4(low, high);
|
||||
// WEBASSEMBLY: call <8 x i16> @llvm.wasm.narrow.unsigned.v8i16.v4i32(
|
||||
// WEBASSEMBLY-SAME: <4 x i32> %low, <4 x i32> %high)
|
||||
|
Loading…
Reference in New Issue
Block a user