Index: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp =================================================================== --- lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp +++ lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp @@ -817,6 +817,7 @@ case ISD::FCOPYSIGN: case ISD::FNEG: case ISD::Register: + case ISD::SELECT: return true; } return false; Index: test/CodeGen/X86/fp128-select.ll =================================================================== --- test/CodeGen/X86/fp128-select.ll +++ test/CodeGen/X86/fp128-select.ll @@ -0,0 +1,17 @@ +; RUN: llc < %s -O2 -mtriple=x86_64-linux-android -mattr=+mmx | FileCheck %s +; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu -mattr=+mmx | FileCheck %s + +define void @test_select(fp128* %p, fp128* %q, i1 zeroext %c) { + %a = load fp128, fp128* %p, align 2 + %r = select i1 %c, fp128 %a, fp128 0xL00000000000000007FFF800000000000 + store fp128 %r, fp128* %q + ret void +; CHECK-LABEL test_select: +; CHECK: testb +; CHECK: movaps {{.*}}, %xmm0 +; CHECK: movaps %xmm0, (%rsi) +; CHECK: retq +; CHECK: movaps {{.*}}, %xmm0 +; CHECK: movaps %xmm0, (%rsi) +; CHECK: retq +}