Skip to content
Snippets Groups Projects
Commit 5cee4ded authored by Martin Bauer's avatar Martin Bauer
Browse files

Fix in vectorization when directly storing constants

parent b3d7062a
Branches
Tags
No related merge requests found
...@@ -164,8 +164,14 @@ class CBackend: ...@@ -164,8 +164,14 @@ class CBackend:
if aligned: if aligned:
instr = 'stream' if nontemporal else 'storeA' instr = 'stream' if nontemporal else 'storeA'
rhs_type = get_type_of_expression(node.rhs)
if type(rhs_type) is not VectorType:
rhs = cast_func(node.rhs, VectorType(rhs_type))
else:
rhs = node.rhs
return self._vectorInstructionSet[instr].format("&" + self.sympy_printer.doprint(node.lhs.args[0]), return self._vectorInstructionSet[instr].format("&" + self.sympy_printer.doprint(node.lhs.args[0]),
self.sympy_printer.doprint(node.rhs)) + ';' self.sympy_printer.doprint(rhs)) + ';'
else: else:
return "%s = %s;" % (self.sympy_printer.doprint(node.lhs), self.sympy_printer.doprint(node.rhs)) return "%s = %s;" % (self.sympy_printer.doprint(node.lhs), self.sympy_printer.doprint(node.rhs))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment