--- gcc/brig/brigfrontend/brig-basic-inst-handler.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
>From fee48e53063309a58a9a3050df26395ae1615111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20J=C3=A4=C3=A4skel=C3=A4inen?= <pekka.jaaskelai...@parmance.com> Date: Thu, 12 Oct 2017 15:55:11 +0200 Subject: [PATCH 8/8] [BRIGFE] Fix handling of NOPs --- gcc/brig/brigfrontend/brig-basic-inst-handler.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/brig/brigfrontend/brig-basic-inst-handler.cc b/gcc/brig/brigfrontend/brig-basic-inst-handler.cc index c8224ae..75e1cfa 100644 --- a/gcc/brig/brigfrontend/brig-basic-inst-handler.cc +++ b/gcc/brig/brigfrontend/brig-basic-inst-handler.cc @@ -447,6 +447,8 @@ size_t brig_basic_inst_handler::operator () (const BrigBase *base) { const BrigInstBase *brig_inst = (const BrigInstBase *) base; + if (brig_inst->opcode == BRIG_OPCODE_NOP) + return base->byteCount; tree_stl_vec operands = build_operands (*brig_inst); @@ -466,11 +468,9 @@ brig_basic_inst_handler::operator () (const BrigBase *base) BrigType16_t brig_inst_type = brig_inst->type; - if (brig_inst->opcode == BRIG_OPCODE_NOP) - return base->byteCount; - else if (brig_inst->opcode == BRIG_OPCODE_FIRSTBIT - || brig_inst->opcode == BRIG_OPCODE_LASTBIT - || brig_inst->opcode == BRIG_OPCODE_SAD) + if (brig_inst->opcode == BRIG_OPCODE_FIRSTBIT + || brig_inst->opcode == BRIG_OPCODE_LASTBIT + || brig_inst->opcode == BRIG_OPCODE_SAD) /* These instructions are reported to be always 32b in HSAIL, but we want to treat them according to their input argument's type to select the correct instruction/builtin. */ -- 2.7.4