mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-11 04:01:01 +00:00
PPC popcnt[dw] do not have record forms
The instruction definitions incorrectly specified that popcntd and popcntw have record forms; they do not. This mistake was causing invalid code generation. llvm-svn: 195272
This commit is contained in:
parent
b17e18e8f4
commit
fb82ed6bb5
@ -529,16 +529,16 @@ defm SRADI : XSForm_1rc<31, 413, (outs g8rc:$rA), (ins g8rc:$rS, u6imm:$SH),
|
|||||||
defm CNTLZD : XForm_11r<31, 58, (outs g8rc:$rA), (ins g8rc:$rS),
|
defm CNTLZD : XForm_11r<31, 58, (outs g8rc:$rA), (ins g8rc:$rS),
|
||||||
"cntlzd", "$rA, $rS", IntGeneral,
|
"cntlzd", "$rA, $rS", IntGeneral,
|
||||||
[(set i64:$rA, (ctlz i64:$rS))]>;
|
[(set i64:$rA, (ctlz i64:$rS))]>;
|
||||||
defm POPCNTD : XForm_11r<31, 506, (outs g8rc:$rA), (ins g8rc:$rS),
|
def POPCNTD : XForm_11<31, 506, (outs g8rc:$rA), (ins g8rc:$rS),
|
||||||
"popcntd", "$rA, $rS", IntGeneral,
|
"popcntd $rA, $rS", IntGeneral,
|
||||||
[(set i64:$rA, (ctpop i64:$rS))]>;
|
[(set i64:$rA, (ctpop i64:$rS))]>;
|
||||||
|
|
||||||
// popcntw also does a population count on the high 32 bits (storing the
|
// popcntw also does a population count on the high 32 bits (storing the
|
||||||
// results in the high 32-bits of the output). We'll ignore that here (which is
|
// results in the high 32-bits of the output). We'll ignore that here (which is
|
||||||
// safe because we never separately use the high part of the 64-bit registers).
|
// safe because we never separately use the high part of the 64-bit registers).
|
||||||
defm POPCNTW : XForm_11r<31, 378, (outs gprc:$rA), (ins gprc:$rS),
|
def POPCNTW : XForm_11<31, 378, (outs gprc:$rA), (ins gprc:$rS),
|
||||||
"popcntw", "$rA, $rS", IntGeneral,
|
"popcntw $rA, $rS", IntGeneral,
|
||||||
[(set i32:$rA, (ctpop i32:$rS))]>;
|
[(set i32:$rA, (ctpop i32:$rS))]>;
|
||||||
|
|
||||||
defm DIVD : XOForm_1r<31, 489, 0, (outs g8rc:$rT), (ins g8rc:$rA, g8rc:$rB),
|
defm DIVD : XOForm_1r<31, 489, 0, (outs g8rc:$rT), (ins g8rc:$rA, g8rc:$rB),
|
||||||
"divd", "$rT, $rA, $rB", IntDivD,
|
"divd", "$rT, $rA, $rB", IntDivD,
|
||||||
|
@ -134,3 +134,19 @@ entry:
|
|||||||
; CHECK-NOT: fsubs. 0, 1, 2
|
; CHECK-NOT: fsubs. 0, 1, 2
|
||||||
; CHECK: stfs 0, 0(5)
|
; CHECK: stfs 0, 0(5)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare i64 @llvm.ctpop.i64(i64);
|
||||||
|
|
||||||
|
define signext i64 @fooct(i64 signext %a, i64 signext %b, i64* nocapture %c) #0 {
|
||||||
|
entry:
|
||||||
|
%sub = sub nsw i64 %a, %b
|
||||||
|
%subc = call i64 @llvm.ctpop.i64(i64 %sub)
|
||||||
|
store i64 %subc, i64* %c, align 4
|
||||||
|
%cmp = icmp sgt i64 %subc, 0
|
||||||
|
%cond = select i1 %cmp, i64 %a, i64 %b
|
||||||
|
ret i64 %cond
|
||||||
|
|
||||||
|
; CHECK: @fooct
|
||||||
|
; CHECK-NOT: popcntd.
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user