Skip to content

Commit e777401

Browse files
authored
Use proper C types in bitops perf test (#27308)
Use matching C types in a loop when writing a bitops test [Reviewed by @bradcray]
2 parents 6390e9f + cf567d6 commit e777401

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/library/standard/BitOps/c-tests/performance/64/bitops-64.test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ int main(int argc, char** argv) {
2626

2727
printf("%s", "popcount: ");
2828
start_time = chpl_now_timevalue();
29-
for(uint64_t i=start; i<(uint32_t)start+NUM_ITER; i++) {
29+
for(uint64_t i=start; i<(uint64_t)start+NUM_ITER; i++) {
3030
accumulator += chpl_bitops_popcount_64(i);
3131
}
3232
end_time = chpl_now_timevalue();
@@ -38,7 +38,7 @@ int main(int argc, char** argv) {
3838
accumulator = 0;
3939
printf("%s", "clz: ");
4040
start_time = chpl_now_timevalue();
41-
for(uint64_t i=start; i<(uint32_t)start+NUM_ITER; i++) {
41+
for(uint64_t i=start; i<(uint64_t)start+NUM_ITER; i++) {
4242
accumulator += chpl_bitops_clz_64(i);
4343
}
4444
end_time = chpl_now_timevalue();
@@ -50,7 +50,7 @@ int main(int argc, char** argv) {
5050
accumulator = 0;
5151
printf("%s", "ctz: ");
5252
start_time = chpl_now_timevalue();
53-
for(uint64_t i=start; i<(uint32_t)start+NUM_ITER; i++) {
53+
for(uint64_t i=start; i<(uint64_t)start+NUM_ITER; i++) {
5454
accumulator += chpl_bitops_ctz_64(i);
5555
}
5656
end_time = chpl_now_timevalue();

0 commit comments

Comments
 (0)