gnu/gcc/fffe5e21229c9cefc072f911ae7aa1e12fe001c1
gccrs: Implement some platform-intrinsic simd function support
Generated 007t.gimple code from compiling platform_intrinsics.rs:
_1 = x == y;
_eq = VEC_COND_EXPR <_1, { -1, -1 }, { 0, 0 }>;
_2 = x != y;
_ne = VEC_COND_EXPR <_2, { -1, -1 }, { 0, 0 }>;
_3 = x < y;
_lt = VEC_COND_EXPR <_3, { -1, -1 }, { 0, 0 }>;
_4 = x <= y;
_le = VEC_COND_EXPR <_4, { -1, -1 }, { 0, 0 }>;
_5 = x > y;
_gt = VEC_COND_EXPR <_5, { -1, -1 }, { 0, 0 }>;
_6 = x >= y;
_ge = VEC_COND_EXPR <_6, { -1, -1 }, { 0, 0 }>;
_add = x + y;
_sub = x - y;
_mul = x * y;
_div = x / y;
_shl = x << y;
_shr = x >> y;
_and = x & y;
_or = x | y;
_xor = x ^ y;
gcc/rust/ChangeLog:
* Make-lang.in: Compile the new rust-compile-platform-intrinsic files.
* backend/rust-compile-base.cc (HIRCompileBase::setup_abi_options): Make the
PLATFORM_INTRINSIC case use the `cdecl` ABI.
* backend/rust-compile-platform-intrinsic.cc: New file to handle compilation of
'platform-intrinsic' extern functions.
* backend/rust-compile-platform-intrinsic.h: Header file for the formentioned file.
* backend/rust-compile-expr.cc (CompileExpr::visit (HIR::CallExpr)): Add new
conditions to compile platform-intrinsic extern functions.
* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_generic_params):
Check 'platform-intrinsic' extern functions for const parameters.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit (HIR::TupleIndexExpr)):
Fix resolved tuple expression not destructuring.
Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
8 files changed