[Mesa-dev] [PATCH 1/2] r600g: Support I2D/U2D/D2I/D2U

Dave Airlie airlied at gmail.com
Thu Sep 10 17:41:08 PDT 2015


On 11 September 2015 at 06:00, Glenn Kennard <glenn.kennard at gmail.com> wrote:
> int <-> float <-> double conversion, matches what the blob does
>
> Signed-off-by: Glenn Kennard <glenn.kennard at gmail.com>
> ---
>  src/gallium/drivers/r600/r600_shader.c | 95 +++++++++++++++++++++++++++++++---
>  1 file changed, 87 insertions(+), 8 deletions(-)
>
> diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
> index f2c9e16..1c642fd 100644
> --- a/src/gallium/drivers/r600/r600_shader.c
> +++ b/src/gallium/drivers/r600/r600_shader.c
> @@ -3058,6 +3058,85 @@ static int tgsi_dfracexp(struct r600_shader_ctx *ctx)
>         return 0;
>  }
>
> +static int cypress_int_double(struct r600_shader_ctx *ctx)
> +{
> +       struct tgsi_full_instruction *inst = &ctx->parse.FullToken.FullInstruction;
> +       struct r600_bytecode_alu alu;
> +       int i, r;
> +       int lasti = tgsi_last_instruction(inst->Dst[0].Register.WriteMask);
> +
> +       if (inst->Instruction.Opcode == TGSI_OPCODE_I2D ||
> +               inst->Instruction.Opcode == TGSI_OPCODE_U2D) {

It does seem like two functions would make more sense here, they don't share
that much code.

cypress_int_to_double
and
cypress_double_to_int

Dave.


More information about the mesa-dev mailing list