summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorArnold Schwaighofer <aschwaighofer@apple.com>2013-05-05 01:54:46 +0000
committerArnold Schwaighofer <aschwaighofer@apple.com>2013-05-05 01:54:46 +0000
commite972d03f648d0799c041403af01fa7d6cdd5eeb1 (patch)
tree6a591db95512b8c2616516fd73edfcd7eb3fcd84 /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
parentf5183729db9f2b2f6bd3d4cbd0f72fe9c1cef7c8 (diff)
downloadbcm5719-llvm-e972d03f648d0799c041403af01fa7d6cdd5eeb1.tar.gz
bcm5719-llvm-e972d03f648d0799c041403af01fa7d6cdd5eeb1.zip
PatternMatch: Matcher for (un)ordered floating point min/max
Add support for matching 'ordered' and 'unordered' floating point min/max constructs. In LLVM we can express min/max functions as a combination of compare and select. We have support for matching such constructs for integers but not for floating point. In floating point math there is no total order because of the presence of 'NaN'. Therefore, we have to be careful to preserve the original fcmp semantics when interpreting floating point compare select combinations as a minimum or maximum function. The resulting 'ordered/unordered' floating point maximum function has to select the same value as the select/fcmp combination it is based on. ordered_max(x,y) = max(x,y) iff x and y are not NaN, y otherwise unordered_max(x,y) = max(x,y) iff x and y are not NaN, x otherwise ordered_min(x,y) = min(x,y) iff x and y are not NaN, y otherwise unordered_min(x,y) = min(x,y) iff x and y are not NaN, x otherwise This matches the behavior of the underlying select(fcmp(olt/ult/.., L, R), L, R) construct. Any code using this predicate has to preserve this semantics. A follow-up patch will use this to implement floating point min/max reductions in the vectorizer. radar://13723044 llvm-svn: 181143
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud