mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Add support for 64-bit logical NOR.
llvm-svn: 141029
This commit is contained in:
parent
ae50204423
commit
76c268271d
@ -72,6 +72,12 @@ class LogicI64<bits<6> op, string instr_asm, SDNode OpNode>:
|
|||||||
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
||||||
[(set CPU64Regs:$dst, (OpNode CPU64Regs:$b, immZExt16:$c))], IIAlu>;
|
[(set CPU64Regs:$dst, (OpNode CPU64Regs:$b, immZExt16:$c))], IIAlu>;
|
||||||
|
|
||||||
|
let isCommutable = 1 in
|
||||||
|
class LogicNOR64<bits<6> op, bits<6> func, string instr_asm>:
|
||||||
|
FR<op, func, (outs CPU64Regs:$dst), (ins CPU64Regs:$b, CPU64Regs:$c),
|
||||||
|
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
||||||
|
[(set CPU64Regs:$dst, (not (or CPU64Regs:$b, CPU64Regs:$c)))], IIAlu>;
|
||||||
|
|
||||||
// Shifts
|
// Shifts
|
||||||
class LogicR_shift_rotate_imm64<bits<6> func, bits<5> _rs, string instr_asm,
|
class LogicR_shift_rotate_imm64<bits<6> func, bits<5> _rs, string instr_asm,
|
||||||
SDNode OpNode, PatFrag PF>:
|
SDNode OpNode, PatFrag PF>:
|
||||||
@ -141,6 +147,7 @@ def DSUBu : ArithR64<0x00, 0x2f, "dsubu", sub, IIAlu>;
|
|||||||
def DAND : LogicR64<0x24, "and", and>;
|
def DAND : LogicR64<0x24, "and", and>;
|
||||||
def DOR : LogicR64<0x25, "or", or>;
|
def DOR : LogicR64<0x25, "or", or>;
|
||||||
def DXOR : LogicR64<0x26, "xor", xor>;
|
def DXOR : LogicR64<0x26, "xor", xor>;
|
||||||
|
def DNOR : LogicNOR64<0x00, 0x27, "nor">;
|
||||||
|
|
||||||
/// Shift Instructions
|
/// Shift Instructions
|
||||||
def DSLL : LogicR_shift_rotate_imm64<0x38, 0x00, "dsll", shl, immZExt5>;
|
def DSLL : LogicR_shift_rotate_imm64<0x38, 0x00, "dsll", shl, immZExt5>;
|
||||||
|
@ -133,3 +133,11 @@ entry:
|
|||||||
ret i64 %tmp1
|
ret i64 %tmp1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define i64 @f20(i64 %a, i64 %b) nounwind readnone {
|
||||||
|
entry:
|
||||||
|
; CHECK: nor
|
||||||
|
%or = or i64 %b, %a
|
||||||
|
%neg = xor i64 %or, -1
|
||||||
|
ret i64 %neg
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user