Debian Codegraph @

gcc/testsuite/g++.target/loongarch/bstrins-compile.C

raw
1 /* { dg-do compile } */
2 /* { dg-options "-std=c++14 -O2 -march=loongarch64 -mabi=lp64d" } */
3 /* { dg-final { scan-assembler "bstrins\\.d.*7,4" } } */
4 /* { dg-final { scan-assembler "bstrins\\.d.*15,4" } } */
5 /* { dg-final { scan-assembler "bstrins\\.d.*31,4" } } */
6 /* { dg-final { scan-assembler "bstrins\\.d.*47,4" } } */
7 /* { dg-final { scan-assembler "bstrins\\.d.*3,0" } } */
8
9 typedef unsigned long u64;
10
11 template <u64 mask>
12 u64
13 test (u64 a, u64 b)
14 {
15 return (a & mask) | (b & ~mask);
16 }
17
18 template u64 test<0x0000'0000'0000'00f0l> (u64, u64);
19 template u64 test<0x0000'0000'0000'fff0l> (u64, u64);
20 template u64 test<0x0000'0000'ffff'fff0l> (u64, u64);
21 template u64 test<0x0000'ffff'ffff'fff0l> (u64, u64);
22 template u64 test<0xffff'ffff'ffff'fff0l> (u64, u64);