use of com.oracle.svm.shadowed.org.bytedeco.llvm.global.LLVM in project graal by oracle.
the class LLVMIRBuilder method buildNeg.
public LLVMValueRef buildNeg(LLVMValueRef a) {
LLVMTypeRef type = LLVM.LLVMTypeOf(a);
UnaryBuilder unaryBuilder;
switch(LLVM.LLVMGetTypeKind(type)) {
case LLVM.LLVMIntegerTypeKind:
unaryBuilder = LLVM::LLVMBuildNeg;
break;
case LLVM.LLVMFloatTypeKind:
case LLVM.LLVMDoubleTypeKind:
unaryBuilder = LLVM::LLVMBuildFNeg;
break;
default:
throw shouldNotReachHere(dumpTypes("invalid negation type", type));
}
return unaryBuilder.build(builder, a, DEFAULT_INSTR_NAME);
}
use of com.oracle.svm.shadowed.org.bytedeco.llvm.global.LLVM in project graal by oracle.
the class LLVMIRBuilder method buildIntrinsicOp.
private LLVMValueRef buildIntrinsicOp(String name, LLVMTypeRef retType, LLVMValueRef... args) {
String intrinsicName = "llvm." + name + "." + intrinsicType(retType);
LLVMTypeRef intrinsicType = functionType(retType, Arrays.stream(args).map(LLVM::LLVMTypeOf).toArray(LLVMTypeRef[]::new));
return buildIntrinsicCall(intrinsicName, intrinsicType, args);
}
Aggregations