X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FCellSPU%2FSPUOperands.td;h=6f8deef5530f54fa9bd25205d67b590cec41c852;hb=fef904d0e824a2c587f8c1063b6c4fbf47fec898;hp=d788f837fc089b1309423307c262634f4c08d890;hpb=aedc637c966b6eaa3ca33e9220efe5ec34517de7;p=oota-llvm.git diff --git a/lib/Target/CellSPU/SPUOperands.td b/lib/Target/CellSPU/SPUOperands.td index d788f837fc0..6f8deef5530 100644 --- a/lib/Target/CellSPU/SPUOperands.td +++ b/lib/Target/CellSPU/SPUOperands.td @@ -1,14 +1,25 @@ -//===- SPUOperands.td - Cell SPU Instruction Operands ------*- tablegen -*-===// -// +//===-- SPUOperands.td - Cell SPU Instruction Operands -----*- tablegen -*-===// +// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -// +// //===----------------------------------------------------------------------===// // Cell SPU Instruction Operands: //===----------------------------------------------------------------------===// +// TO_IMM32 - Convert an i8/i16 to i32. +def TO_IMM32 : SDNodeXFormgetZExtValue()); +}]>; + +// TO_IMM16 - Convert an i8/i32 to i16. +def TO_IMM16 : SDNodeXFormgetTargetConstant(N->getZExtValue(), MVT::i16); +}]>; + + def LO16 : SDNodeXFormgetZExtValue(); // Transformation function: get the low 16 bits. @@ -87,12 +98,6 @@ def immU8 : PatLeaf<(imm), [{ return (N->getZExtValue() <= 0xff); }]>; -// i64ImmSExt10 predicate - True if the i64 immediate fits in a 10-bit sign -// extended field. Used by RI10Form instructions like 'ldq'. -def i64ImmSExt10 : PatLeaf<(imm), [{ - return isI64IntS10Immediate(N); -}]>; - // i32ImmSExt10 predicate - True if the i32 immediate fits in a 10-bit sign // extended field. Used by RI10Form instructions like 'ldq'. def i32ImmSExt10 : PatLeaf<(imm), [{ @@ -138,7 +143,7 @@ def immU16 : PatLeaf<(imm), [{ def imm18 : PatLeaf<(imm), [{ // imm18 predicate: True if the immediate fits into an 18-bit unsigned field. int Value = (int) N->getZExtValue(); - return ((Value & ((1 << 19) - 1)) == Value); + return isUInt<18>(Value); }]>; def lo16 : PatLeaf<(imm), [{ @@ -198,7 +203,7 @@ def FPimm_sext16 : SDNodeXFormgetValueAPF().convertToFloat(); - return getI32Imm(FloatToBits(fval) & ((1 << 19) - 1)); + return getI32Imm(FloatToBits(fval) & ((1 << 18) - 1)); }]>; def fpimmSExt16 : PatLeaf<(fpimm), [{ @@ -220,7 +225,7 @@ def hi16_f32 : PatLeaf<(fpimm), [{ def fpimm18 : PatLeaf<(fpimm), [{ if (N->getValueType(0) == MVT::f32) { uint32_t Value = FloatToBits(N->getValueAPF().convertToFloat()); - return ((Value & ((1 << 19) - 1)) == Value); + return isUInt<18>(Value); } return false; @@ -609,15 +614,15 @@ def symbolLSA: Operand { let PrintMethod = "printSymbolLSA"; } -// memory s7imm(reg) operaand -def memri7 : Operand { - let PrintMethod = "printMemRegImmS7"; +// Shuffle address memory operaand [s7imm(reg) d-format] +def shufaddr : Operand { + let PrintMethod = "printShufAddr"; let MIOperandInfo = (ops s7imm:$imm, ptr_rc:$reg); } // memory s10imm(reg) operand -def memri10 : Operand { - let PrintMethod = "printMemRegImmS10"; +def dformaddr : Operand { + let PrintMethod = "printDFormAddr"; let MIOperandInfo = (ops s10imm:$imm, ptr_rc:$reg); } @@ -649,7 +654,11 @@ def memrr : Operand { // A-form : abs (256K LSA offset) // D-form(2): [r+I7] (7-bit signed offset + reg) -def dform_addr : ComplexPattern; -def xform_addr : ComplexPattern; -def aform_addr : ComplexPattern; -def dform2_addr : ComplexPattern; +def dform_addr : ComplexPattern; +def xform_addr : ComplexPattern; +def aform_addr : ComplexPattern; +def dform2_addr : ComplexPattern;