1 //===- SystemZInstrInfo.td - SystemZ Instruction defs ---------*- tblgen-*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file describes the SystemZ instructions in TableGen format.
12 //===----------------------------------------------------------------------===//
14 include "SystemZInstrFormats.td"
16 //===----------------------------------------------------------------------===//
17 // SystemZ Specific Node Definitions.
18 //===----------------------------------------------------------------------===//
19 def SystemZretflag : SDNode<"SystemZISD::RET_FLAG", SDTNone,
20 [SDNPHasChain, SDNPOptInFlag]>;
22 let neverHasSideEffects = 1 in
23 def NOP : Pseudo<(outs), (ins), "# no-op", []>;
25 //===----------------------------------------------------------------------===//
26 // Control Flow Instructions...
29 // FIXME: Provide proper encoding!
30 let isReturn = 1, isTerminator = 1 in {
31 def RET : Pseudo<(outs), (ins), "br\t%r14", [(SystemZretflag)]>;
34 //===----------------------------------------------------------------------===//
37 // FIXME: Provide proper encoding!
38 let neverHasSideEffects = 1 in {
39 def MOV64rr : Pseudo<(outs GR64:$dst), (ins GR64:$src),
44 // FIXME: Provide proper encoding!
45 let isReMaterializable = 1, isAsCheapAsAMove = 1 in {
46 def MOV64ri : Pseudo<(outs GR64:$dst), (ins i64imm:$src),
48 [(set GR64:$dst, imm:$src)]>;
51 //===----------------------------------------------------------------------===//
52 // Arithmetic Instructions
54 let isTwoAddress = 1 in {
58 let isCommutable = 1 in { // X = ADD Y, Z == X = ADD Z, Y
59 // FIXME: Provide proper encoding!
60 def ADD64rr : Pseudo<(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
62 [(set GR64:$dst, (add GR64:$src1, GR64:$src2)),
66 // FIXME: Provide proper encoding!
67 def ADD64ri : Pseudo<(outs GR64:$dst), (ins GR64:$src1, i64imm:$src2),
68 "aghi\t{$dst, $src2}",
69 [(set GR64:$dst, (add GR64:$src1, imm:$src2)),
72 let isCommutable = 1 in { // X = OR Y, Z == X = OR Z, Y
73 // FIXME: Provide proper encoding!
74 def OR64rr : Pseudo<(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
76 [(set GR64:$dst, (or GR64:$src1, GR64:$src2))]>;
78 // FIXME: provide patterns for masked or-with-imm
80 // FIXME: Provide proper encoding!
81 def SUB64rr : Pseudo<(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
83 [(set GR64:$dst, (sub GR64:$src1, GR64:$src2))]>;
86 let isCommutable = 1 in { // X = XOR Y, Z == X = XOR Z, Y
87 // FIXME: Provide proper encoding!
88 def XOR64rr : Pseudo<(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
90 [(set GR64:$dst, (xor GR64:$src1, GR64:$src2))]>;