summaryrefslogtreecommitdiff
path: root/src/arch/hsail
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2016-12-02 18:01:58 -0500
committerBrandon Potter <brandon.potter@amd.com>2016-12-02 18:01:58 -0500
commit3d0a537862dc66f7bd1ffb0965651a14297f2e80 (patch)
tree0b559156ac456597897f1bb05d13b8b079e15d66 /src/arch/hsail
parent900fd15622f905d53e233ec17e11bc5a1aaf680e (diff)
downloadgem5-3d0a537862dc66f7bd1ffb0965651a14297f2e80.tar.xz
hsail: disable asserts to allow immediate operands i.e. 0 with loads
Diffstat (limited to 'src/arch/hsail')
-rw-r--r--src/arch/hsail/operand.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/arch/hsail/operand.cc b/src/arch/hsail/operand.cc
index 747382a33..993d3521f 100644
--- a/src/arch/hsail/operand.cc
+++ b/src/arch/hsail/operand.cc
@@ -317,14 +317,25 @@ AddrOperandBase::parseAddr(const BrigOperandAddress *op, const BrigObject *obj)
const BrigDirective *d =
(BrigDirective*)obj->getCodeSectionEntry(op->symbol);
- assert(d->kind == BRIG_KIND_DIRECTIVE_VARIABLE);
+ /**
+ * HSAIL does not properly handle immediate offsets for instruction types
+ * that utilize them. It currently only supports instructions that use
+ * variables instead. Again, these pop up in code that is never executed
+ * (i.e. the HCC AMP codes) so we just hack it here to let us pass through
+ * the HSAIL object initialization. If such code is ever called, we would
+ * have to implement this properly.
+ */
+ if (d->kind != BRIG_KIND_DIRECTIVE_VARIABLE) {
+ warn("HSAIL implementation does not support instructions with "
+ "address calculations where the operand is not a variable\n");
+ }
+
const BrigDirectiveVariable *sym = (BrigDirectiveVariable*)d;
name = obj->getString(sym->name);
if (sym->segment != BRIG_SEGMENT_ARG) {
storageElement =
obj->currentCode->storageMap->findSymbol(sym->segment, name);
- assert(storageElement);
offset = 0;
} else {
// sym->name does not work for BRIG_SEGMENT_ARG for the following case: