lima/ppir: support ppir_op_ceil
authorErico Nunes <nunes.erico@gmail.com>
Tue, 16 Apr 2019 21:21:24 +0000 (23:21 +0200)
committerQiang Yu <yuq825@gmail.com>
Fri, 19 Apr 2019 10:22:03 +0000 (10:22 +0000)
Add a few missing ppir_op_ceil enum handling entries to implement
nir_op_fceil in lima ppir.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
src/gallium/drivers/lima/ir/pp/codegen.c
src/gallium/drivers/lima/ir/pp/nir.c
src/gallium/drivers/lima/ir/pp/node.c

index 1cce28595e62ac4d211af19261d7c2610f45993b..23d9a7aa41b677d25bfa713ea9457347ec711417 100644 (file)
@@ -300,6 +300,9 @@ static void ppir_codegen_encode_vec_add(ppir_node *node, void *code)
    case ppir_op_floor:
       f->op = ppir_codegen_vec4_acc_op_floor;
       break;
+   case ppir_op_ceil:
+      f->op = ppir_codegen_vec4_acc_op_ceil;
+      break;
    case ppir_op_fract:
       f->op = ppir_codegen_vec4_acc_op_fract;
       break;
@@ -373,6 +376,9 @@ static void ppir_codegen_encode_scl_add(ppir_node *node, void *code)
    case ppir_op_floor:
       f->op = ppir_codegen_float_acc_op_floor;
       break;
+   case ppir_op_ceil:
+      f->op = ppir_codegen_float_acc_op_ceil;
+      break;
    case ppir_op_fract:
       f->op = ppir_codegen_float_acc_op_fract;
       break;
index 669c632b96aefd065c3e58965eb9dfd082ea3ba2..a962a2b776f90dcf4bd1e6cf6dfda0d3bb201c7d 100644 (file)
@@ -134,6 +134,7 @@ static int nir_to_ppir_opcodes[nir_num_opcodes] = {
    [nir_op_fmin] = ppir_op_min,
    [nir_op_frcp] = ppir_op_rcp,
    [nir_op_ffloor] = ppir_op_floor,
+   [nir_op_fceil] = ppir_op_ceil,
    [nir_op_ffract] = ppir_op_fract,
    [nir_op_fand] = ppir_op_and,
    [nir_op_for] = ppir_op_or,
index 9c871abb4c9dd4bcc4a5846e4a5e3b21483c32ff..0f4cacb33a1c90301cda2a39b6cfe21996060caf 100644 (file)
@@ -131,6 +131,13 @@ const ppir_op_info ppir_op_infos[] = {
          PPIR_INSTR_SLOT_END
       },
    },
+   [ppir_op_ceil] = {
+      .name = "ceil",
+      .slots = (int []) {
+         PPIR_INSTR_SLOT_ALU_SCL_ADD, PPIR_INSTR_SLOT_ALU_VEC_ADD,
+         PPIR_INSTR_SLOT_END
+      },
+   },
    [ppir_op_fract] = {
       .name = "fract",
       .slots = (int []) {