#include "util/u_math.h"
#include "gallivm/lp_bld.h"
+#include "gallivm/lp_bld_debug.h"
#include "gallivm/lp_bld_init.h"
#include "gallivm/lp_bld_arit.h"
LLVMContextRef context,
const struct unary_test_t *test)
{
+ struct lp_type type = lp_type_float_vec(32);
LLVMTypeRef i32t = LLVMInt32TypeInContext(context);
LLVMTypeRef f32t = LLVMFloatTypeInContext(context);
- LLVMTypeRef v4f32t = LLVMVectorType(f32t, 4);
+ LLVMTypeRef vf32t = lp_build_vec_type(gallivm, type);
LLVMTypeRef args[1] = { f32t };
LLVMValueRef func = LLVMAddFunction(module, test->name, LLVMFunctionType(f32t, args, Elements(args), 0));
LLVMValueRef arg1 = LLVMGetParam(func, 0);
struct lp_build_context bld;
- lp_build_context_init(&bld, gallivm, lp_float32_vec4_type());
+ lp_build_context_init(&bld, gallivm, lp_type_float_vec(32));
LLVMSetFunctionCallConv(func, LLVMCCallConv);
LLVMPositionBuilderAtEnd(builder, block);
/* scalar to vector */
- arg1 = LLVMBuildInsertElement(builder, LLVMGetUndef(v4f32t), arg1, index0, "");
+ arg1 = LLVMBuildInsertElement(builder, LLVMGetUndef(vf32t), arg1, index0, "");
ret = test->builder(&bld, arg1);