From 2eb4c85e42452527d46b03242f6f26c8cb216e39 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 25 May 2020 14:05:34 -0400 Subject: [PATCH] pan/mdg: Add roundmode enum Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/midgard/compiler.h | 3 +++ src/panfrost/midgard/midgard.h | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index 1765bfd8551..7e2a453584c 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -121,6 +121,9 @@ typedef struct midgard_instruction { /* Out of the union for csel (could maybe be fixed..) */ bool src_invert[MIR_SRC_COUNT]; + /* If the op supports it */ + enum midgard_roundmode roundmode; + /* Special fields for an ALU instruction */ midgard_reg_info registers; diff --git a/src/panfrost/midgard/midgard.h b/src/panfrost/midgard/midgard.h index 4e7c80585d5..bb93d0d653d 100644 --- a/src/panfrost/midgard/midgard.h +++ b/src/panfrost/midgard/midgard.h @@ -822,4 +822,11 @@ typedef union midgard_constants { } midgard_constants; +enum midgard_roundmode { + MIDGARD_RTE = 0x0, /* round to even */ + MIDGARD_RTZ = 0x1, /* round to zero */ + MIDGARD_RTN = 0x2, /* round to negative */ + MIDGARD_RTP = 0x3, /* round to positive */ +}; + #endif -- 2.30.2