Question

I have a compile-time constant and I need to pass it to an intrinsic through its arguments e.g.

@1 = private constant [4 x i8] c"dev\00", align 1

// intrinsic
define linkonce i32 @myIntrinsic( i32 %p0 ) alwaysinline {
%r0 = call i32 asm sideeffect " instr $0(add_constant_here);", "=r"(i32 %p0)
ret i32 %r0
}

Unfortunately I know that inline asm only deals with string literals, is there any other way that I can accomplish this?

Was it helpful?

Solution

Simple and easy: I wrote my own inline string.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top