diff mbox

[1/3] assembler: Fix assert when setting 3src sources

Message ID 20161130011559.19838-1-hoegsberg@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kristian Høgsberg Nov. 30, 2016, 1:15 a.m. UTC
We need to map the type to the 3src encoding before comparing to
insn->bits1.da3src.src_reg_type, which is 3src encoded.

Signed-off-by: Kristian H. Kristensen <hoegsberg@gmail.com>
---
 assembler/brw_eu_emit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Lionel Landwerlin Nov. 30, 2016, 5:02 p.m. UTC | #1
Hi,

This series is

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>

Thanks!

On 30/11/16 01:15, Kristian H. Kristensen wrote:
> We need to map the type to the 3src encoding before comparing to
> insn->bits1.da3src.src_reg_type, which is 3src encoded.
>
> Signed-off-by: Kristian H. Kristensen <hoegsberg@gmail.com>
> ---
>   assembler/brw_eu_emit.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/assembler/brw_eu_emit.c b/assembler/brw_eu_emit.c
> index 23f0da5..d4fadff 100644
> --- a/assembler/brw_eu_emit.c
> +++ b/assembler/brw_eu_emit.c
> @@ -874,7 +874,7 @@ brw_set_3src_src1(struct brw_compile *p,
>      assert(src1.file == BRW_GENERAL_REGISTER_FILE);
>      assert(src1.address_mode == BRW_ADDRESS_DIRECT);
>      assert(src1.nr < 128);
> -   assert(src1.type == insn->bits1.da3src.src_reg_type);
> +   assert(get_3src_type(src1.type) == insn->bits1.da3src.src_reg_type);
>      insn->bits2.da3src.src1_swizzle = src1.dw1.bits.swizzle;
>      insn->bits2.da3src.src1_subreg_nr_low = get_3src_subreg_nr(src1) & 0x3;
>      insn->bits3.da3src.src1_subreg_nr_high = get_3src_subreg_nr(src1) >> 2;
> @@ -892,7 +892,7 @@ brw_set_3src_src2(struct brw_compile *p,
>      assert(src2.file == BRW_GENERAL_REGISTER_FILE);
>      assert(src2.address_mode == BRW_ADDRESS_DIRECT);
>      assert(src2.nr < 128);
> -   assert(src2.type == insn->bits1.da3src.src_reg_type);
> +   assert(get_3src_type(src2.type) == insn->bits1.da3src.src_reg_type);
>      insn->bits3.da3src.src2_swizzle = src2.dw1.bits.swizzle;
>      insn->bits3.da3src.src2_subreg_nr = get_3src_subreg_nr(src2);
>      insn->bits3.da3src.src2_rep_ctrl = src2.vstride == BRW_VERTICAL_STRIDE_0;
diff mbox

Patch

diff --git a/assembler/brw_eu_emit.c b/assembler/brw_eu_emit.c
index 23f0da5..d4fadff 100644
--- a/assembler/brw_eu_emit.c
+++ b/assembler/brw_eu_emit.c
@@ -874,7 +874,7 @@  brw_set_3src_src1(struct brw_compile *p,
    assert(src1.file == BRW_GENERAL_REGISTER_FILE);
    assert(src1.address_mode == BRW_ADDRESS_DIRECT);
    assert(src1.nr < 128);
-   assert(src1.type == insn->bits1.da3src.src_reg_type);
+   assert(get_3src_type(src1.type) == insn->bits1.da3src.src_reg_type);
    insn->bits2.da3src.src1_swizzle = src1.dw1.bits.swizzle;
    insn->bits2.da3src.src1_subreg_nr_low = get_3src_subreg_nr(src1) & 0x3;
    insn->bits3.da3src.src1_subreg_nr_high = get_3src_subreg_nr(src1) >> 2;
@@ -892,7 +892,7 @@  brw_set_3src_src2(struct brw_compile *p,
    assert(src2.file == BRW_GENERAL_REGISTER_FILE);
    assert(src2.address_mode == BRW_ADDRESS_DIRECT);
    assert(src2.nr < 128);
-   assert(src2.type == insn->bits1.da3src.src_reg_type);
+   assert(get_3src_type(src2.type) == insn->bits1.da3src.src_reg_type);
    insn->bits3.da3src.src2_swizzle = src2.dw1.bits.swizzle;
    insn->bits3.da3src.src2_subreg_nr = get_3src_subreg_nr(src2);
    insn->bits3.da3src.src2_rep_ctrl = src2.vstride == BRW_VERTICAL_STRIDE_0;