From 860f15abfc3adc84bd9c7fe7b558d630ae381bb0 Mon Sep 17 00:00:00 2001 From: Nora Abi Akar <nora.abiakar@gmail.com> Date: Wed, 27 Nov 2019 17:53:27 +0100 Subject: [PATCH] Modcc: parse `fabs` instead of `abs` (#907) Also emit "abs" in cexpr_emit.cpp because the simd backend implements abs Fixes #887 --- modcc/printer/cexpr_emit.cpp | 2 +- modcc/token.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modcc/printer/cexpr_emit.cpp b/modcc/printer/cexpr_emit.cpp index 26390877..62aecf2e 100644 --- a/modcc/printer/cexpr_emit.cpp +++ b/modcc/printer/cexpr_emit.cpp @@ -52,7 +52,7 @@ void CExprEmitter::visit(UnaryExpression* e) { {tok::cos, "cos"}, {tok::sin, "sin"}, {tok::log, "log"}, - {tok::abs, "fabs"}, + {tok::abs, "abs"}, {tok::exprelr, "exprelr"} }; diff --git a/modcc/token.cpp b/modcc/token.cpp index fb327663..bd9a2957 100644 --- a/modcc/token.cpp +++ b/modcc/token.cpp @@ -64,7 +64,7 @@ static Keyword keywords[] = { {"sin", tok::sin}, {"cos", tok::cos}, {"log", tok::log}, - {"abs", tok::abs}, + {"fabs", tok::abs}, {"exprelr", tok::exprelr}, {"CONDUCTANCE", tok::conductance}, {nullptr, tok::reserved}, @@ -134,7 +134,7 @@ static TokenString token_strings[] = { {"max", tok::max}, {"exp", tok::exp}, {"log", tok::log}, - {"abs", tok::abs}, + {"fabs", tok::abs}, {"exprelr", tok::exprelr}, {"cos", tok::cos}, {"sin", tok::sin}, -- GitLab