From 6bfb1a8344d58aa47a28cff87f508088233e70f6 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sat, 3 Aug 2013 11:33:49 -0700 Subject: [PATCH] glsl: Add bitcast_i2f() to ir_builder. Reviewed-by: Kenneth Graunke Reviewed-by: Chad Versace --- src/glsl/ir_builder.cpp | 24 ++++++++++++++++++++++++ src/glsl/ir_builder.h | 4 ++++ 2 files changed, 28 insertions(+) diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp index 8fb30a02a99..5e1da17a62f 100644 --- a/src/glsl/ir_builder.cpp +++ b/src/glsl/ir_builder.cpp @@ -303,12 +303,24 @@ f2i(operand a) return expr(ir_unop_f2i, a); } +ir_expression* +bitcast_f2i(operand a) +{ + return expr(ir_unop_bitcast_f2i, a); +} + ir_expression* i2f(operand a) { return expr(ir_unop_i2f, a); } +ir_expression* +bitcast_i2f(operand a) +{ + return expr(ir_unop_bitcast_i2f, a); +} + ir_expression* i2u(operand a) { @@ -327,12 +339,24 @@ f2u(operand a) return expr(ir_unop_f2u, a); } +ir_expression* +bitcast_f2u(operand a) +{ + return expr(ir_unop_bitcast_f2u, a); +} + ir_expression* u2f(operand a) { return expr(ir_unop_u2f, a); } +ir_expression* +bitcast_u2f(operand a) +{ + return expr(ir_unop_bitcast_u2f, a); +} + ir_if* if_tree(operand condition, ir_instruction *then_branch) diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h index 690ac74ebcd..59985beb2c6 100644 --- a/src/glsl/ir_builder.h +++ b/src/glsl/ir_builder.h @@ -151,9 +151,13 @@ ir_expression *lshift(operand a, operand b); ir_expression *rshift(operand a, operand b); ir_expression *f2i(operand a); +ir_expression *bitcast_f2i(operand a); ir_expression *i2f(operand a); +ir_expression *bitcast_i2f(operand a); ir_expression *f2u(operand a); +ir_expression *bitcast_f2u(operand a); ir_expression *u2f(operand a); +ir_expression *bitcast_u2f(operand a); ir_expression *i2u(operand a); ir_expression *u2i(operand a); -- 2.30.2