Skip to content
Snippets Groups Projects

Various extensions to the vectorizer

Merged Daniel Bauer requested to merge hyteg/pystencils:bauerd/vec-extensions into v2.0-dev
Viewing commit 48d8dede
Show latest version
1 file
+ 9
2
Preferences
Compare changes
@@ -159,6 +159,9 @@ class X86VectorCpu(GenericVectorCpu):
self, expr: PsExpression, operands: Sequence[PsExpression]
) -> PsExpression:
match expr:
case PsCast(target_type, _) if target_type == operands[0].get_dtype():
assert len(operands) == 1
return operands[0]
case PsUnOp() | PsBinOp():
func = _x86_op_intrin(self._vector_arch, expr, expr.get_dtype())
intrinsic = func(*operands)
@@ -262,7 +265,9 @@ class X86VectorCpu(GenericVectorCpu):
addr: PsExpression = PsAddressOf(PsMemAcc(acc.pointer, acc.offset))
if addr_type:
addr = PsCast(addr_type, addr)
return load_func(addr)
intrinsic = load_func(addr)
intrinsic.dtype = load_func.return_type
return intrinsic
else:
raise NotImplementedError("Gather loads not implemented yet.")
@@ -274,7 +279,9 @@ class X86VectorCpu(GenericVectorCpu):
addr: PsExpression = PsAddressOf(PsMemAcc(acc.pointer, acc.offset))
if addr_type:
addr = PsCast(addr_type, addr)
return store_func(addr, arg)
intrinsic = store_func(addr, arg)
intrinsic.dtype = store_func.return_type
return intrinsic
else:
raise NotImplementedError("Scatter stores not implemented yet.")