mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-13 07:50:50 +00:00
Reverting 222792
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222793 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9980f8c78d
commit
7c45f13db6
@ -16,47 +16,6 @@ include "HexagonOperands.td"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Compare
|
||||
//===----------------------------------------------------------------------===//
|
||||
let hasSideEffects = 0, isCompare = 1, InputType = "imm", isExtendable = 1,
|
||||
opExtendable = 2 in
|
||||
class T_CMP <string mnemonic, bits<2> MajOp, bit isNot, Operand ImmOp>
|
||||
: ALU32Inst <(outs PredRegs:$dst),
|
||||
(ins IntRegs:$src1, ImmOp:$src2),
|
||||
"$dst = "#!if(isNot, "!","")#mnemonic#"($src1, #$src2)",
|
||||
[], "",ALU32_2op_tc_2early_SLOT0123 >, ImmRegRel {
|
||||
bits<2> dst;
|
||||
bits<5> src1;
|
||||
bits<10> src2;
|
||||
let CextOpcode = mnemonic;
|
||||
let opExtentBits = !if(!eq(mnemonic, "cmp.gtu"), 9, 10);
|
||||
let isExtentSigned = !if(!eq(mnemonic, "cmp.gtu"), 0, 1);
|
||||
|
||||
let IClass = 0b0111;
|
||||
|
||||
let Inst{27-24} = 0b0101;
|
||||
let Inst{23-22} = MajOp;
|
||||
let Inst{21} = !if(!eq(mnemonic, "cmp.gtu"), 0, src2{9});
|
||||
let Inst{20-16} = src1;
|
||||
let Inst{13-5} = src2{8-0};
|
||||
let Inst{4} = isNot;
|
||||
let Inst{3-2} = 0b00;
|
||||
let Inst{1-0} = dst;
|
||||
}
|
||||
|
||||
def C2_cmpeqi : T_CMP <"cmp.eq", 0b00, 0, s10Ext>;
|
||||
def C2_cmpgti : T_CMP <"cmp.gt", 0b01, 0, s10Ext>;
|
||||
def C2_cmpgtui : T_CMP <"cmp.gtu", 0b10, 0, u9Ext>;
|
||||
|
||||
class T_CMP_pat <InstHexagon MI, PatFrag OpNode, PatLeaf ImmPred>
|
||||
: Pat<(i1 (OpNode (i32 IntRegs:$src1), ImmPred:$src2)),
|
||||
(MI IntRegs:$src1, ImmPred:$src2)>;
|
||||
|
||||
def : T_CMP_pat <C2_cmpeqi, seteq, s10ImmPred>;
|
||||
def : T_CMP_pat <C2_cmpgti, setgt, s10ImmPred>;
|
||||
def : T_CMP_pat <C2_cmpgtui, setugt, u9ImmPred>;
|
||||
|
||||
// Multi-class for logical operators.
|
||||
multiclass ALU32_rr_ri<string OpcStr, SDNode OpNode> {
|
||||
def rr : ALU32_rr<(outs IntRegs:$dst), (ins IntRegs:$b, IntRegs:$c),
|
||||
|
@ -1,10 +0,0 @@
|
||||
;; RUN: llc -mtriple=hexagon-unknown-elf -filetype=obj %s -o - \
|
||||
;; RUN: | llvm-objdump -s - | FileCheck %s
|
||||
|
||||
define i1 @foo (i32 %a)
|
||||
{
|
||||
%1 = icmp eq i32 %a, 42
|
||||
ret i1 %1
|
||||
}
|
||||
|
||||
; CHECK: 0000 40450075 00400000 00c09f52
|
@ -1,10 +0,0 @@
|
||||
;; RUN: llc -mtriple=hexagon-unknown-elf -filetype=obj %s -o - \
|
||||
;; RUN: | llvm-objdump -s - | FileCheck %s
|
||||
|
||||
define i1 @foo (i32 %a)
|
||||
{
|
||||
%1 = icmp sgt i32 %a, 42
|
||||
ret i1 %1
|
||||
}
|
||||
|
||||
; CHECK: 0000 40454075 00400000 00c09f52
|
@ -1,10 +0,0 @@
|
||||
;; RUN: llc -mtriple=hexagon-unknown-elf -filetype=obj %s -o - \
|
||||
;; RUN: | llvm-objdump -s - | FileCheck %s
|
||||
|
||||
define i1 @foo (i32 %a)
|
||||
{
|
||||
%1 = icmp ugt i32 %a, 42
|
||||
ret i1 %1
|
||||
}
|
||||
|
||||
; CHECK: 0000 40458075 00400000 00c09f52
|
Loading…
x
Reference in New Issue
Block a user