mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-05 09:31:03 +03:00
18 lines
362 B
D
18 lines
362 B
D
// REQUIRES: atleast_llvm500
|
|
// REQUIRES: host_X86
|
|
|
|
// RUN: %ldc -run %s
|
|
|
|
import core.simd;
|
|
import ldc.intrinsics;
|
|
|
|
void main()
|
|
{
|
|
const float4 f = [ 1, -2, 3, -4 ];
|
|
const abs = llvm_fabs(f);
|
|
assert(abs == [ 1, 2, 3, 4 ]);
|
|
|
|
const int4 i = [ 0b0, 0b10, 0b101, 0b100011 ];
|
|
const numOnes = llvm_ctpop(i);
|
|
assert(numOnes == [ 0, 1, 2, 3 ]);
|
|
}
|