ldc-developers/ldc — Issue #64: Can't handle intrinsics with more than 1 parameter
Author: redstar
Created: 2012-01-14 22:49:15+00:00
State: open

Compiling core.bitop with LDC2 from llvm-3.1 branch results in following error message:

src\core\bitop.d: Error: module core.bitop Intrinsic prototype has incorrect number of arguments!
i64 (i64)* @llvm.cttz.i64
is_zero_undef argument of bit counting intrinsics must be a constant int
%tmp1 = call i64 @llvm.cttz.i64(i64 %tmp) nounwind readnone
Broken module found, compilation terminated.
Intrinsic prototype has incorrect number of arguments!
i64 (i64)* @llvm.ctlz.i64
is_zero_undef argument of bit counting intrinsics must be a constant int
%tmp1 = call i64 @llvm.ctlz.i64(i64 %tmp) nounwind readnone
Broken module found, compilation terminated.

Root cause seems to be that the cttz and ctlz intrinsics require 2 parameters but only one is passed. Adding the 2nd parameter results in a different error message. It seems that intrinsics with more than 1 parameter are not supported.