2009-07-16 14:20:24 +00:00
|
|
|
//===- SystemZInstrFP.td - SystemZ FP Instruction defs --------*- tblgen-*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file describes the SystemZ (binary) floating point instructions in
|
|
|
|
// TableGen format.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// FIXME: multiclassify!
|
|
|
|
|
2009-07-16 14:22:15 +00:00
|
|
|
let usesCustomDAGSchedInserter = 1 in {
|
|
|
|
def SelectF32 : Pseudo<(outs FP32:$dst), (ins FP32:$src1, FP32:$src2, i8imm:$cc),
|
|
|
|
"# SelectF32 PSEUDO",
|
|
|
|
[(set FP32:$dst,
|
|
|
|
(SystemZselect FP32:$src1, FP32:$src2, imm:$cc))]>;
|
|
|
|
def SelectF64 : Pseudo<(outs FP64:$dst), (ins FP64:$src1, FP64:$src2, i8imm:$cc),
|
|
|
|
"# SelectF64 PSEUDO",
|
|
|
|
[(set FP64:$dst,
|
|
|
|
(SystemZselect FP64:$src1, FP64:$src2, imm:$cc))]>;
|
|
|
|
}
|
|
|
|
|
2009-07-16 14:20:24 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Move Instructions
|
|
|
|
|
|
|
|
let neverHasSideEffects = 1 in {
|
|
|
|
def FMOV32rr : Pseudo<(outs FP32:$dst), (ins FP32:$src),
|
|
|
|
"ler\t{$dst, $src}",
|
|
|
|
[]>;
|
|
|
|
def FMOV64rr : Pseudo<(outs FP64:$dst), (ins FP64:$src),
|
|
|
|
"ldr\t{$dst, $src}",
|
|
|
|
[]>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let canFoldAsLoad = 1, isReMaterializable = 1, mayHaveSideEffects = 1 in {
|
|
|
|
def FMOV32rm : Pseudo<(outs FP32:$dst), (ins rriaddr12:$src),
|
|
|
|
"le\t{$dst, $src}",
|
|
|
|
[(set FP32:$dst, (load rriaddr12:$src))]>;
|
|
|
|
def FMOV32rmy : Pseudo<(outs FP32:$dst), (ins rriaddr:$src),
|
|
|
|
"ley\t{$dst, $src}",
|
|
|
|
[(set FP32:$dst, (load rriaddr:$src))]>;
|
|
|
|
def FMOV64rm : Pseudo<(outs FP64:$dst), (ins rriaddr12:$src),
|
|
|
|
"ld\t{$dst, $src}",
|
|
|
|
[(set FP64:$dst, (load rriaddr12:$src))]>;
|
|
|
|
def FMOV64rmy : Pseudo<(outs FP64:$dst), (ins rriaddr:$src),
|
|
|
|
"ldy\t{$dst, $src}",
|
|
|
|
[(set FP64:$dst, (load rriaddr:$src))]>;
|
|
|
|
}
|
|
|
|
|
|
|
|
def FMOV32mr : Pseudo<(outs), (ins rriaddr12:$dst, FP32:$src),
|
|
|
|
"ste\t{$src, $dst}",
|
|
|
|
[(store FP32:$src, rriaddr12:$dst)]>;
|
|
|
|
def FMOV32mry : Pseudo<(outs), (ins rriaddr:$dst, FP32:$src),
|
|
|
|
"stey\t{$src, $dst}",
|
|
|
|
[(store FP32:$src, rriaddr:$dst)]>;
|
|
|
|
def FMOV64mr : Pseudo<(outs), (ins rriaddr12:$dst, FP64:$src),
|
|
|
|
"std\t{$src, $dst}",
|
|
|
|
[(store FP64:$src, rriaddr12:$dst)]>;
|
|
|
|
def FMOV64mry : Pseudo<(outs), (ins rriaddr:$dst, FP64:$src),
|
|
|
|
"stdy\t{$src, $dst}",
|
|
|
|
[(store FP64:$src, rriaddr:$dst)]>;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Arithmetic Instructions
|
|
|
|
|
2009-07-16 14:21:12 +00:00
|
|
|
|
2009-07-16 14:22:30 +00:00
|
|
|
let Defs = [PSW] in {
|
2009-07-16 14:21:12 +00:00
|
|
|
def FNEG32rr : Pseudo<(outs FP32:$dst), (ins FP32:$src),
|
2009-07-16 14:23:30 +00:00
|
|
|
"lcebr\t{$dst, $src}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP32:$dst, (fneg FP32:$src)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:21:12 +00:00
|
|
|
def FNEG64rr : Pseudo<(outs FP64:$dst), (ins FP64:$src),
|
2009-07-16 14:23:30 +00:00
|
|
|
"lcdbr\t{$dst, $src}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP64:$dst, (fneg FP64:$src)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:21:27 +00:00
|
|
|
|
|
|
|
def FABS32rr : Pseudo<(outs FP32:$dst), (ins FP32:$src),
|
2009-07-16 14:24:01 +00:00
|
|
|
"lpebr\t{$dst, $src}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP32:$dst, (fabs FP32:$src)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:21:27 +00:00
|
|
|
def FABS64rr : Pseudo<(outs FP64:$dst), (ins FP64:$src),
|
2009-07-16 14:24:01 +00:00
|
|
|
"lpdbr\t{$dst, $src}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP64:$dst, (fabs FP64:$src)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:21:27 +00:00
|
|
|
|
2009-07-16 14:23:44 +00:00
|
|
|
def FNABS32rr : Pseudo<(outs FP32:$dst), (ins FP32:$src),
|
2009-07-16 14:24:01 +00:00
|
|
|
"lnebr\t{$dst, $src}",
|
2009-07-16 14:23:44 +00:00
|
|
|
[(set FP32:$dst, (fneg(fabs FP32:$src))),
|
|
|
|
(implicit PSW)]>;
|
|
|
|
def FNABS64rr : Pseudo<(outs FP64:$dst), (ins FP64:$src),
|
2009-07-16 14:24:01 +00:00
|
|
|
"lndbr\t{$dst, $src}",
|
2009-07-16 14:23:44 +00:00
|
|
|
[(set FP64:$dst, (fneg(fabs FP64:$src))),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:24:01 +00:00
|
|
|
}
|
2009-07-16 14:23:44 +00:00
|
|
|
|
2009-07-16 14:24:01 +00:00
|
|
|
let isTwoAddress = 1 in {
|
|
|
|
let Defs = [PSW] in {
|
2009-07-16 14:20:24 +00:00
|
|
|
let isCommutable = 1 in { // X = ADD Y, Z == X = ADD Z, Y
|
|
|
|
def FADD32rr : Pseudo<(outs FP32:$dst), (ins FP32:$src1, FP32:$src2),
|
|
|
|
"aebr\t{$dst, $src2}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP32:$dst, (fadd FP32:$src1, FP32:$src2)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:20:24 +00:00
|
|
|
def FADD64rr : Pseudo<(outs FP64:$dst), (ins FP64:$src1, FP64:$src2),
|
|
|
|
"adbr\t{$dst, $src2}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP64:$dst, (fadd FP64:$src1, FP64:$src2)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:20:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
def FADD32rm : Pseudo<(outs FP32:$dst), (ins FP32:$src1, rriaddr:$src2),
|
|
|
|
"aeb\t{$dst, $src2}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP32:$dst, (fadd FP32:$src1, (load rriaddr:$src2))),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:20:24 +00:00
|
|
|
def FADD64rm : Pseudo<(outs FP64:$dst), (ins FP64:$src1, rriaddr:$src2),
|
|
|
|
"adb\t{$dst, $src2}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP64:$dst, (fadd FP64:$src1, (load rriaddr:$src2))),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:20:24 +00:00
|
|
|
|
|
|
|
def FSUB32rr : Pseudo<(outs FP32:$dst), (ins FP32:$src1, FP32:$src2),
|
|
|
|
"sebr\t{$dst, $src2}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP32:$dst, (fsub FP32:$src1, FP32:$src2)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:20:24 +00:00
|
|
|
def FSUB64rr : Pseudo<(outs FP64:$dst), (ins FP64:$src1, FP64:$src2),
|
|
|
|
"sdbr\t{$dst, $src2}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP64:$dst, (fsub FP64:$src1, FP64:$src2)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:20:24 +00:00
|
|
|
|
|
|
|
def FSUB32rm : Pseudo<(outs FP32:$dst), (ins FP32:$src1, rriaddr:$src2),
|
|
|
|
"seb\t{$dst, $src2}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP32:$dst, (fsub FP32:$src1, (load rriaddr:$src2))),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:20:24 +00:00
|
|
|
def FSUB64rm : Pseudo<(outs FP64:$dst), (ins FP64:$src1, rriaddr:$src2),
|
|
|
|
"sdb\t{$dst, $src2}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP64:$dst, (fsub FP64:$src1, (load rriaddr:$src2))),
|
|
|
|
(implicit PSW)]>;
|
|
|
|
} // Defs = [PSW]
|
2009-07-16 14:20:24 +00:00
|
|
|
|
|
|
|
let isCommutable = 1 in { // X = MUL Y, Z == X = MUL Z, Y
|
|
|
|
def FMUL32rr : Pseudo<(outs FP32:$dst), (ins FP32:$src1, FP32:$src2),
|
|
|
|
"meebr\t{$dst, $src2}",
|
|
|
|
[(set FP32:$dst, (fmul FP32:$src1, FP32:$src2))]>;
|
|
|
|
def FMUL64rr : Pseudo<(outs FP64:$dst), (ins FP64:$src1, FP64:$src2),
|
|
|
|
"mdbr\t{$dst, $src2}",
|
|
|
|
[(set FP64:$dst, (fmul FP64:$src1, FP64:$src2))]>;
|
|
|
|
}
|
|
|
|
|
|
|
|
def FMUL32rm : Pseudo<(outs FP32:$dst), (ins FP32:$src1, rriaddr:$src2),
|
|
|
|
"meeb\t{$dst, $src2}",
|
|
|
|
[(set FP32:$dst, (fmul FP32:$src1, (load rriaddr:$src2)))]>;
|
|
|
|
def FMUL64rm : Pseudo<(outs FP64:$dst), (ins FP64:$src1, rriaddr:$src2),
|
|
|
|
"mdb\t{$dst, $src2}",
|
|
|
|
[(set FP64:$dst, (fmul FP64:$src1, (load rriaddr:$src2)))]>;
|
|
|
|
|
2009-07-16 14:23:16 +00:00
|
|
|
def FMADD32rr : Pseudo<(outs FP32:$dst), (ins FP32:$src1, FP32:$src2, FP32:$src3),
|
|
|
|
"maebr\t{$dst, $src3, $src2}",
|
|
|
|
[(set FP32:$dst, (fadd (fmul FP32:$src2, FP32:$src3),
|
|
|
|
FP32:$src1))]>;
|
|
|
|
def FMADD32rm : Pseudo<(outs FP32:$dst), (ins FP32:$src1, rriaddr:$src2, FP32:$src3),
|
|
|
|
"maeb\t{$dst, $src3, $src2}",
|
|
|
|
[(set FP32:$dst, (fadd (fmul (load rriaddr:$src2),
|
|
|
|
FP32:$src3),
|
|
|
|
FP32:$src1))]>;
|
|
|
|
|
|
|
|
def FMADD64rr : Pseudo<(outs FP64:$dst), (ins FP64:$src1, FP64:$src2, FP64:$src3),
|
|
|
|
"madbr\t{$dst, $src3, $src2}",
|
|
|
|
[(set FP64:$dst, (fadd (fmul FP64:$src2, FP64:$src3),
|
|
|
|
FP64:$src1))]>;
|
|
|
|
def FMADD64rm : Pseudo<(outs FP64:$dst), (ins FP64:$src1, rriaddr:$src2, FP64:$src3),
|
|
|
|
"madb\t{$dst, $src3, $src2}",
|
|
|
|
[(set FP64:$dst, (fadd (fmul (load rriaddr:$src2),
|
|
|
|
FP64:$src3),
|
|
|
|
FP64:$src1))]>;
|
|
|
|
|
|
|
|
def FMSUB32rr : Pseudo<(outs FP32:$dst), (ins FP32:$src1, FP32:$src2, FP32:$src3),
|
|
|
|
"msebr\t{$dst, $src3, $src2}",
|
|
|
|
[(set FP32:$dst, (fsub (fmul FP32:$src2, FP32:$src3),
|
|
|
|
FP32:$src1))]>;
|
|
|
|
def FMSUB32rm : Pseudo<(outs FP32:$dst), (ins FP32:$src1, rriaddr:$src2, FP32:$src3),
|
|
|
|
"mseb\t{$dst, $src3, $src2}",
|
|
|
|
[(set FP32:$dst, (fsub (fmul (load rriaddr:$src2),
|
|
|
|
FP32:$src3),
|
|
|
|
FP32:$src1))]>;
|
|
|
|
|
|
|
|
def FMSUB64rr : Pseudo<(outs FP64:$dst), (ins FP64:$src1, FP64:$src2, FP64:$src3),
|
|
|
|
"msdbr\t{$dst, $src3, $src2}",
|
|
|
|
[(set FP64:$dst, (fsub (fmul FP64:$src2, FP64:$src3),
|
|
|
|
FP64:$src1))]>;
|
|
|
|
def FMSUB64rm : Pseudo<(outs FP64:$dst), (ins FP64:$src1, rriaddr:$src2, FP64:$src3),
|
|
|
|
"msdb\t{$dst, $src3, $src2}",
|
|
|
|
[(set FP64:$dst, (fsub (fmul (load rriaddr:$src2),
|
|
|
|
FP64:$src3),
|
|
|
|
FP64:$src1))]>;
|
|
|
|
|
2009-07-16 14:20:24 +00:00
|
|
|
def FDIV32rr : Pseudo<(outs FP32:$dst), (ins FP32:$src1, FP32:$src2),
|
|
|
|
"debr\t{$dst, $src2}",
|
|
|
|
[(set FP32:$dst, (fdiv FP32:$src1, FP32:$src2))]>;
|
|
|
|
def FDIV64rr : Pseudo<(outs FP64:$dst), (ins FP64:$src1, FP64:$src2),
|
|
|
|
"ddbr\t{$dst, $src2}",
|
|
|
|
[(set FP64:$dst, (fdiv FP64:$src1, FP64:$src2))]>;
|
|
|
|
|
|
|
|
def FDIV32rm : Pseudo<(outs FP32:$dst), (ins FP32:$src1, rriaddr:$src2),
|
|
|
|
"deb\t{$dst, $src2}",
|
|
|
|
[(set FP32:$dst, (fdiv FP32:$src1, (load rriaddr:$src2)))]>;
|
|
|
|
def FDIV64rm : Pseudo<(outs FP64:$dst), (ins FP64:$src1, rriaddr:$src2),
|
|
|
|
"ddb\t{$dst, $src2}",
|
|
|
|
[(set FP64:$dst, (fdiv FP64:$src1, (load rriaddr:$src2)))]>;
|
|
|
|
|
|
|
|
} // isTwoAddress = 1
|
|
|
|
|
|
|
|
def FROUND64r32 : Pseudo<(outs FP32:$dst), (ins FP64:$src),
|
|
|
|
"ledbr\t{$dst, $src}",
|
|
|
|
[(set FP32:$dst, (fround FP64:$src))]>;
|
|
|
|
|
2009-07-16 14:22:30 +00:00
|
|
|
def FEXT32r64 : Pseudo<(outs FP64:$dst), (ins FP32:$src),
|
|
|
|
"ldebr\t{$dst, $src}",
|
|
|
|
[(set FP64:$dst, (fextend FP32:$src))]>;
|
2009-07-16 14:22:46 +00:00
|
|
|
def FEXT32m64 : Pseudo<(outs FP64:$dst), (ins rriaddr:$src),
|
|
|
|
"ldeb\t{$dst, $src}",
|
|
|
|
[(set FP64:$dst, (fextend (load rriaddr:$src)))]>;
|
2009-07-16 14:22:30 +00:00
|
|
|
|
|
|
|
let Defs = [PSW] in {
|
2009-07-16 14:20:24 +00:00
|
|
|
def FCONVFP32 : Pseudo<(outs FP32:$dst), (ins GR32:$src),
|
|
|
|
"cefbr\t{$dst, $src}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP32:$dst, (sint_to_fp GR32:$src)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:20:39 +00:00
|
|
|
def FCONVFP32r64: Pseudo<(outs FP32:$dst), (ins GR64:$src),
|
|
|
|
"cegbr\t{$dst, $src}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP32:$dst, (sint_to_fp GR64:$src)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:20:39 +00:00
|
|
|
|
|
|
|
def FCONVFP64r32: Pseudo<(outs FP64:$dst), (ins GR32:$src),
|
|
|
|
"cdfbr\t{$dst, $src}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP64:$dst, (sint_to_fp GR32:$src)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:20:24 +00:00
|
|
|
def FCONVFP64 : Pseudo<(outs FP64:$dst), (ins GR64:$src),
|
|
|
|
"cdgbr\t{$dst, $src}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set FP64:$dst, (sint_to_fp GR64:$src)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:20:24 +00:00
|
|
|
|
2009-07-16 14:21:57 +00:00
|
|
|
def FCONVGR32 : Pseudo<(outs GR32:$dst), (ins FP32:$src),
|
|
|
|
"cfebr\t{$dst, $src}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set GR32:$dst, (fp_to_sint FP32:$src)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:21:57 +00:00
|
|
|
def FCONVGR32r64: Pseudo<(outs GR32:$dst), (ins FP64:$src),
|
|
|
|
"cgebr\t{$dst, $src}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set GR32:$dst, (fp_to_sint FP64:$src)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:21:57 +00:00
|
|
|
|
|
|
|
def FCONVGR64r32: Pseudo<(outs GR64:$dst), (ins FP32:$src),
|
|
|
|
"cfdbr\t{$dst, $src}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set GR64:$dst, (fp_to_sint FP32:$src)),
|
|
|
|
(implicit PSW)]>;
|
2009-07-16 14:21:57 +00:00
|
|
|
def FCONVGR64 : Pseudo<(outs GR64:$dst), (ins FP64:$src),
|
|
|
|
"cgdbr\t{$dst, $src}",
|
2009-07-16 14:22:30 +00:00
|
|
|
[(set GR64:$dst, (fp_to_sint FP64:$src)),
|
|
|
|
(implicit PSW)]>;
|
|
|
|
} // Defs = [PSW]
|
2009-07-16 14:21:57 +00:00
|
|
|
|
2009-07-16 14:20:24 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Test instructions (like AND but do not produce any result)
|
|
|
|
|
|
|
|
// Integer comparisons
|
|
|
|
let Defs = [PSW] in {
|
|
|
|
def FCMP32rr : Pseudo<(outs), (ins FP32:$src1, FP32:$src2),
|
|
|
|
"cebr\t$src1, $src2",
|
|
|
|
[(SystemZcmp FP32:$src1, FP32:$src2), (implicit PSW)]>;
|
|
|
|
def FCMP64rr : Pseudo<(outs), (ins FP64:$src1, FP64:$src2),
|
|
|
|
"cdbr\t$src1, $src2",
|
|
|
|
[(SystemZcmp FP64:$src1, FP64:$src2), (implicit PSW)]>;
|
|
|
|
|
|
|
|
def FCMP32rm : Pseudo<(outs), (ins FP32:$src1, rriaddr:$src2),
|
|
|
|
"ceb\t$src1, $src2",
|
|
|
|
[(SystemZcmp FP32:$src1, (load rriaddr:$src2)),
|
|
|
|
(implicit PSW)]>;
|
|
|
|
def FCMP64rm : Pseudo<(outs), (ins FP64:$src1, rriaddr:$src2),
|
|
|
|
"cdb\t$src1, $src2",
|
|
|
|
[(SystemZcmp FP64:$src1, (load rriaddr:$src2)),
|
|
|
|
(implicit PSW)]>;
|
|
|
|
} // Defs = [PSW]
|