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,22 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; 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) { +; CHECK-LABEL: test_select: +; CHECK: # BB#0: +; CHECK-NEXT: testb %dl, %dl +; CHECK-NEXT: jne .LBB0_1 +; CHECK-NEXT: # BB#2: +; CHECK-NEXT: movaps {{.*}}(%rip), %xmm0 +; CHECK-NEXT: movaps %xmm0, (%rsi) +; CHECK-NEXT: retq +; CHECK-NEXT: .LBB0_1: +; CHECK-NEXT: movaps (%rdi), %xmm0 +; CHECK-NEXT: movaps %xmm0, (%rsi) +; CHECK-NEXT: retq + %a = load fp128, fp128* %p, align 2 + %r = select i1 %c, fp128 %a, fp128 0xL00000000000000007FFF800000000000 + store fp128 %r, fp128* %q + ret void +}