OSDN Git Service

[ARM] GlobalISel: Legalize G_FCMP for s32
authorDiana Picus <diana.picus@linaro.org>
Thu, 6 Jul 2017 09:09:33 +0000 (09:09 +0000)
committerDiana Picus <diana.picus@linaro.org>
Thu, 6 Jul 2017 09:09:33 +0000 (09:09 +0000)
commite9e0d4fb8379df72c421a462d35afec96e094d8b
tree4330b73c16bdd0657853a2c78b95e0f7ead0a311
parentbd98e1b2fd631eb0ce93ac5fde38dfe79e664bb2
[ARM] GlobalISel: Legalize G_FCMP for s32

This covers both hard and soft float.

Hard float is easy, since it's just Legal.

Soft float is more involved, because there are several different ways to
handle it based on the predicate: one and ueq need not only one, but two
libcalls to get a result. Furthermore, we have large differences between
the values returned by the AEABI and GNU functions.

AEABI functions return a nice 1 or 0 representing true and respectively
false. GNU functions generally return a value that needs to be compared
against 0 (e.g. for ogt, the value returned by the libcall is > 0 for
true).  We could introduce redundant comparisons for AEABI as well, but
they don't seem easy to remove afterwards, so we do different processing
based on whether or not the result really needs to be compared against
something (and just truncate if it doesn't).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307243 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/GlobalISel/LegalizerHelper.cpp
lib/Target/ARM/ARMLegalizerInfo.cpp
lib/Target/ARM/ARMLegalizerInfo.h
test/CodeGen/ARM/GlobalISel/arm-legalize-fp.mir