llvm.org GIT mirror llvm / 9df203d
Clean up the Legal/Expand logic for SPARC popc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200141 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 6 years ago
3 changed file(s) with 10 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
14621462 setOperationAction(ISD::BR_CC, MVT::i64, Custom);
14631463 setOperationAction(ISD::SELECT_CC, MVT::i64, Custom);
14641464
1465 if (Subtarget->usePopc())
1466 setOperationAction(ISD::CTPOP, MVT::i64, Legal);
1465 setOperationAction(ISD::CTPOP, MVT::i64,
1466 Subtarget->usePopc() ? Legal : Expand);
14671467 setOperationAction(ISD::CTTZ , MVT::i64, Expand);
14681468 setOperationAction(ISD::CTTZ_ZERO_UNDEF, MVT::i64, Expand);
14691469 setOperationAction(ISD::CTLZ , MVT::i64, Expand);
15191519 setOperationAction(ISD::FSINCOS, MVT::f32, Expand);
15201520 setOperationAction(ISD::FREM , MVT::f32, Expand);
15211521 setOperationAction(ISD::FMA , MVT::f32, Expand);
1522 setOperationAction(ISD::CTPOP, MVT::i32, Expand);
15231522 setOperationAction(ISD::CTTZ , MVT::i32, Expand);
15241523 setOperationAction(ISD::CTTZ_ZERO_UNDEF, MVT::i32, Expand);
15251524 setOperationAction(ISD::CTLZ , MVT::i32, Expand);
15691568
15701569 setStackPointerRegisterToSaveRestore(SP::O6);
15711570
1572 if (Subtarget->isV9() && Subtarget->usePopc())
1573 setOperationAction(ISD::CTPOP, MVT::i32, Legal);
1571 setOperationAction(ISD::CTPOP, MVT::i32,
1572 Subtarget->usePopc() ? Legal : Expand);
15741573
15751574 if (Subtarget->isV9() && Subtarget->hasHardQuad()) {
15761575 setOperationAction(ISD::LOAD, MVT::f128, Legal);
4040
4141 // Parse features string.
4242 ParseSubtargetFeatures(CPUName, FS);
43
44 // Popc is a v9-only instruction.
45 if (!IsV9)
46 UsePopc = false;
4347 }
4448
4549
None ; RUN: llc < %s -march=sparcv9 -disable-sparc-delay-filler -disable-sparc-leaf-proc | FileCheck %s
1 ; RUN: llc < %s -march=sparcv9 | FileCheck %s -check-prefix=OPT
0 ; RUN: llc < %s -march=sparcv9 -mattr=+popc -disable-sparc-delay-filler -disable-sparc-leaf-proc | FileCheck %s
1 ; RUN: llc < %s -march=sparcv9 -mattr=+popc | FileCheck %s -check-prefix=OPT
22
33 ; CHECK-LABEL: ret2:
44 ; CHECK: or %g0, %i1, %i0