This is an archive of the discontinued LLVM Phabricator instance.

Keep EXTRACT_VECTOR_ELT result type as f128 for Android x86_64.
ClosedPublic

Authored by chh on Apr 14 2017, 4:18 PM.

Details

Summary

http://bugs.llvm.org/show_bug.cgi?id=32330
Android x86_64 target uses f128 type and stores f128 values
in %xmm* registers.
SoftenFloatRes_EXTRACT_VECTOR_ELT should not convert
result value from f128 to i128.

Diff Detail

Event Timeline

chh created this revision.Apr 14 2017, 4:18 PM
chh updated this revision to Diff 95504.Apr 17 2017, 4:03 PM
pirama edited edge metadata.

LGTM. Adding some other contributors to SelectionDAG to review.

test/CodeGen/X86/fp128-extract.ll
12

Remove hidden, local_unnamed_addr and align?

13

I also think the simplified version of the test below is preferable because it's easier to understand why the test fails without this fix.

define fp128 @foo(<2 x double> %x) {
    %a = fpext <2 x double> %x to <2 x fp128>
    %1 = extractelement <2 x fp128> %a, i32 0
    %2 = extractelement <2 x fp128> %a, i32 1
    %3 = fmul fp128 %1, %2
    ret fp128 %3
}

If you want to test this extended pattern from boost, consider adding both?

chh updated this revision to Diff 95603.Apr 18 2017, 11:03 AM
chh marked 2 inline comments as done.
niravd edited edge metadata.Apr 18 2017, 11:50 AM

This also LGTM. Minor comments inline.

test/CodeGen/X86/fp128-extract.ll
13

Is TestExtract representive of pr32330 ? If so you should name it as such.

niravd accepted this revision.Apr 18 2017, 11:50 AM
This revision is now accepted and ready to land.Apr 18 2017, 11:50 AM
chh added inline comments.Apr 18 2017, 12:30 PM
test/CodeGen/X86/fp128-extract.ll
13

This test case is extremely simplified to contain only the extractelement operation,
which I believe is the only opcode missed.
With this change, we can now compile pr32330 test case and found no regression with Android source.

This revision was automatically updated to reflect the committed changes.