[FastISel][AArch64] Fix a latent bug in floating-point materialization.
authorJuergen Ributzka <juergen@apple.com>
Fri, 15 Aug 2014 18:55:55 +0000 (18:55 +0000)
committerJuergen Ributzka <juergen@apple.com>
Fri, 15 Aug 2014 18:55:55 +0000 (18:55 +0000)
commit9ad3f9b8e1d41cbd0bd1518086cf9aa0132db9b5
tree9b89bc3fe78d6f3d719b747b919b7ad6d76cf9a7
parentdb9a5cb2eaa722b73ebf5fa9de982d8cae1b690f
[FastISel][AArch64] Fix a latent bug in floating-point materialization.

The floating-point value positive zero (+0.0) is a valid immedate value
according to isFPImmLegal. As a result AArch64 FastISel went ahead and
used the immediate version of fmov to materialize the constant.

The problem is that the immediate version of fmov cannot encode an imediate for
postive zero. Instead a fmov from the zero register was supposed to be used in
this case.

This fix adds handling for this special case and uses fmov from the zero
register to materialize a positive zero (negative zeroes go to the constant
pool).

There is no test case for this, because this code is currently dead. It will be
enabled in a future commit and I will add a test case in a separate commit
after that.

This fixes <rdar://problem/18027157>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215753 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64FastISel.cpp