[AArch64][FastISel] Always use an AND instruction when truncating to non-legal types.
authorJuergen Ributzka <juergen@apple.com>
Sat, 25 Jul 2015 02:16:53 +0000 (02:16 +0000)
committerJuergen Ributzka <juergen@apple.com>
Sat, 25 Jul 2015 02:16:53 +0000 (02:16 +0000)
commit6364985b582275a1d20b9d91ef0d0c3c1797325d
tree27b74ee46b4846d4f00d3dfbd2426bdec66620a6
parent3afd5bfd7bb2a7741da9c61860eb80d103be3b04
[AArch64][FastISel] Always use an AND instruction when truncating to non-legal types.

When truncating to non-legal types (such as i16, i8 and i1) always use an AND
instruction to mask out the upper bits. This was only done when the source type
was an i64, but not when the source type was an i32.

This commit fixes this and adds the missing i32 truncate tests.

This fixes rdar://problem/21990703.

llvm-svn: 243198
llvm/lib/Target/AArch64/AArch64FastISel.cpp
llvm/test/CodeGen/AArch64/arm64-fast-isel-conversion.ll
llvm/test/CodeGen/AArch64/fast-isel-address-extends.ll