mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
* Optimize vector load / store. Fixes to alignment. Support typedef with `@simd` and `@align` #2543. Update vector ABI #2542 * Fix alignment issue with indirect arguments.
35 lines
739 B
Plaintext
35 lines
739 B
Plaintext
// #target: macos-aarch64
|
|
module test;
|
|
typedef Int8x16 = ichar[<16>] @simd;
|
|
typedef Float32x4 = float[<4>] @simd;
|
|
|
|
struct HFAv4
|
|
{
|
|
Float32x4[4] arr;
|
|
}
|
|
|
|
struct MixedHFAv4
|
|
{
|
|
Float32x4[3] arr;
|
|
Int8x16 b;
|
|
}
|
|
|
|
fn HFAv4 test(HFAv4 a0, HFAv4 a1, HFAv4 a2)
|
|
{
|
|
return a2;
|
|
}
|
|
|
|
fn MixedHFAv4 test_mixed(MixedHFAv4 a0, MixedHFAv4 a1, MixedHFAv4 a2)
|
|
{
|
|
return a2;
|
|
}
|
|
|
|
/* #expect: test.ll
|
|
|
|
%.introspect = type { i8, i64, ptr, i64, i64, i64, [0 x i64] }
|
|
%HFAv4 = type { [4 x <4 x float>] }
|
|
%MixedHFAv4 = type { [3 x <4 x float>], <16 x i8> }
|
|
|
|
define %HFAv4 @test.test([4 x <4 x float>] %0, [4 x <4 x float>] %1, [4 x <4 x float>] %2) #0 {
|
|
define %MixedHFAv4 @test.test_mixed([4 x <4 x float>] %0, [4 x <4 x float>] %1, [4 x <4 x float>] %2) #0 {
|