Files
c3c/test/unit/asm/popcnt.c3
srkkov 8f7610345d More x86 instructions (#2964)
* Added most x86 cryptographic instructions

* Fixed popcnt test

* Fixed asm_ops_x64_2.c3t test

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-23 15:27:36 +01:00

26 lines
493 B
Plaintext

module test::inline_asm::popcnt @if (env::X86_64);
fn void popcntw() @test
{
short src = 0xF0;
short count = 0;
asm { popcnt count, src; }
assert(count == 4, "inline asm: popcnt failed");
}
fn void popcntl() @test
{
int src = 0xF0F0;
int count = 0;
asm { popcnt count, src; }
assert(count == 8, "inline asm: popcnt failed");
}
fn void popcntq() @test
{
long src = 0xF0F0_F0F0;
long count = 0;
asm { popcnt count, src; }
assert(count == 16, "inline asm: popcnt failed");
}