From 5aabf352af333e3ef20c031f42beeafee2c4f07c Mon Sep 17 00:00:00 2001 From: Barry Wardell Date: Sat, 18 Jun 2011 23:46:31 +0200 Subject: Add Scalar[] which can be used to prevent vectorisation and use it for tests in conditionals. Also add a couple more simplification rules for the vectorisation. --- Tools/CodeGen/CalculationFunction.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Tools/CodeGen/CalculationFunction.m') diff --git a/Tools/CodeGen/CalculationFunction.m b/Tools/CodeGen/CalculationFunction.m index d2e626b..e9b6c13 100644 --- a/Tools/CodeGen/CalculationFunction.m +++ b/Tools/CodeGen/CalculationFunction.m @@ -615,13 +615,13 @@ equationLoop[eqs_, cleancalc_, gfs_, shorts_, incs_, groups_, pddefs_, Which[ SameQ[Head[eq2[[2]]], IfThen], ret = assignVariableFromExpression[eq2[[1]], - eq2[[2]] /. IfThen[cond_, x__]:> IfThen[cond, x], declare2, vectorize];, + eq2[[2]] /. IfThen[cond_, x__]:> IfThen[Scalar[cond], x], declare2, vectorize];, SameQ[Head[eq2], IfThenGroup], vars = eq2[[2,All,1]]; cond = eq2[[1]]; preDeclare = Pick[vars, declare2]; ret = {Map[DeclareVariableNoInit[#, DataType[]] &, Complement[Union[preDeclare], localName/@gfsInRHS]], {"\n"}, - Conditional[generateCodeFromExpression[cond, vectorize], + Conditional[generateCodeFromExpression[Scalar[cond], False], Riffle[assignVariableFromExpression[#[[1]], #[[2]], False, vectorize]& /@ eq2[[2]], "\n"], Riffle[assignVariableFromExpression[#[[1]], #[[2]], False, vectorize]& /@ eq2[[3]], "\n"]]};, True, -- cgit v1.2.3