summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-03-02 15:01:30 +0100
committerSamuel Pitoiset <[email protected]>2018-03-05 11:04:30 +0100
commit459e33900ff7f569ecfe12bf876d2a3e77cb6747 (patch)
tree35531b64ee99ecbb90756c7f0c7bfb6cef9662b2 /src/gallium
parentfe0647df5a70a4954d9399f0860a12ff691a88ee (diff)
ac: add ac_build_fract()
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c
index cec33c38b4e..c9ebc90d915 100644
--- a/src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c
+++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c
@@ -400,22 +400,19 @@ static void emit_frac(const struct lp_build_tgsi_action *action,
struct lp_build_emit_data *emit_data)
{
struct si_shader_context *ctx = si_shader_context(bld_base);
- char *intr;
+ unsigned bitsize;
if (emit_data->info->opcode == TGSI_OPCODE_FRC)
- intr = "llvm.floor.f32";
+ bitsize = 32;
else if (emit_data->info->opcode == TGSI_OPCODE_DFRAC)
- intr = "llvm.floor.f64";
+ bitsize = 64;
else {
assert(0);
return;
}
- LLVMValueRef floor = lp_build_intrinsic(ctx->ac.builder, intr, emit_data->dst_type,
- &emit_data->args[0], 1,
- LP_FUNC_ATTR_READNONE);
- emit_data->output[emit_data->chan] = LLVMBuildFSub(ctx->ac.builder,
- emit_data->args[0], floor, "");
+ emit_data->output[emit_data->chan] =
+ ac_build_fract(&ctx->ac, emit_data->args[0], bitsize);
}
static void emit_f2i(const struct lp_build_tgsi_action *action,