setTruncStoreAction(MVT::f80, MVT::f16, Expand);
if (Subtarget.hasPOPCNT()) {
- setOperationAction(ISD::CTPOP , MVT::i8 , Promote);
+ setOperationPromotedToType(ISD::CTPOP, MVT::i8, MVT::i32);
} else {
setOperationAction(ISD::CTPOP , MVT::i8 , Expand);
setOperationAction(ISD::CTPOP , MVT::i16 , Expand);
; CHECK-LABEL: test4:
; CHECK: # BB#0:
; CHECK-NEXT: andl $127, %edi
-; CHECK-NEXT: popcntw %di, %ax
-; CHECK-NEXT: # kill: %al<def> %al<kill> %ax<kill>
+; CHECK-NEXT: popcntl %edi, %eax
+; CHECK-NEXT: # kill: %al<def> %al<kill> %eax<kill>
; CHECK-NEXT: retq
%x2 = and i8 %x, 127
%count = tail call i8 @llvm.ctpop.i8(i8 %x2)
; X32-POPCNT-LABEL: cnt8:
; X32-POPCNT: # BB#0:
; X32-POPCNT-NEXT: movzbl {{[0-9]+}}(%esp), %eax
-; X32-POPCNT-NEXT: popcntw %ax, %ax
-; X32-POPCNT-NEXT: # kill: %al<def> %al<kill> %ax<kill>
+; X32-POPCNT-NEXT: popcntl %eax, %eax
+; X32-POPCNT-NEXT: # kill: %al<def> %al<kill> %eax<kill>
; X32-POPCNT-NEXT: retl
;
; X64-POPCNT-LABEL: cnt8:
; X64-POPCNT: # BB#0:
; X64-POPCNT-NEXT: movzbl %dil, %eax
-; X64-POPCNT-NEXT: popcntw %ax, %ax
-; X64-POPCNT-NEXT: # kill: %al<def> %al<kill> %ax<kill>
+; X64-POPCNT-NEXT: popcntl %eax, %eax
+; X64-POPCNT-NEXT: # kill: %al<def> %al<kill> %eax<kill>
; X64-POPCNT-NEXT: retq
%cnt = tail call i8 @llvm.ctpop.i8(i8 %x)
ret i8 %cnt