blob: fac21330b37635ad9f3c54c441429d810df3b695 [file] [log] [blame]
Jia Liu31d157a2012-02-18 12:03:15 +00001//===-- PPCInstr64Bit.td - The PowerPC 64-bit Support ------*- tablegen -*-===//
2//
Chris Lattner956f43c2006-06-16 20:22:01 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Jia Liu31d157a2012-02-18 12:03:15 +00007//
Chris Lattner956f43c2006-06-16 20:22:01 +00008//===----------------------------------------------------------------------===//
9//
10// This file describes the PowerPC 64-bit instructions. These patterns are used
11// both when in ppc64 mode and when in "use 64-bit extensions in 32-bit" mode.
12//
13//===----------------------------------------------------------------------===//
14
Chris Lattnerf27bb6d2006-06-20 21:23:06 +000015//===----------------------------------------------------------------------===//
16// 64-bit operands.
17//
Chris Lattner041e9d32006-06-26 23:53:10 +000018def s16imm64 : Operand<i64> {
19 let PrintMethod = "printS16ImmOperand";
20}
21def u16imm64 : Operand<i64> {
22 let PrintMethod = "printU16ImmOperand";
23}
Chris Lattnerf27bb6d2006-06-20 21:23:06 +000024def symbolHi64 : Operand<i64> {
25 let PrintMethod = "printSymbolHi";
Chris Lattner85cf7d72010-11-15 06:33:39 +000026 let EncoderMethod = "getHA16Encoding";
Chris Lattnerf27bb6d2006-06-20 21:23:06 +000027}
28def symbolLo64 : Operand<i64> {
29 let PrintMethod = "printSymbolLo";
Chris Lattner85cf7d72010-11-15 06:33:39 +000030 let EncoderMethod = "getLO16Encoding";
Chris Lattnerf27bb6d2006-06-20 21:23:06 +000031}
Hal Finkelc10d5e92012-09-05 19:22:27 +000032def tocentry : Operand<iPTR> {
Ulrich Weigand880d82e2013-03-19 19:50:30 +000033 let MIOperandInfo = (ops i64imm:$imm);
Hal Finkelc10d5e92012-09-05 19:22:27 +000034}
Bill Schmidt34a9d4b2012-11-27 17:35:46 +000035def memrs : Operand<iPTR> { // memri where the immediate is a symbolLo64
36 let PrintMethod = "printMemRegImm";
37 let EncoderMethod = "getMemRIXEncoding";
Hal Finkela548afc2013-03-19 18:51:05 +000038 let MIOperandInfo = (ops symbolLo64:$off, ptr_rc_nor0:$reg);
Bill Schmidt34a9d4b2012-11-27 17:35:46 +000039}
Bill Schmidtd7802bf2012-12-04 16:18:08 +000040def tlsreg : Operand<i64> {
41 let EncoderMethod = "getTLSRegEncoding";
42}
Bill Schmidt57ac1f42012-12-11 20:30:11 +000043def tlsgd : Operand<i64> {}
Chris Lattnerf27bb6d2006-06-20 21:23:06 +000044
Chris Lattnerb410dc92006-06-20 23:18:58 +000045//===----------------------------------------------------------------------===//
46// 64-bit transformation functions.
47//
Chris Lattnerf27bb6d2006-06-20 21:23:06 +000048
Chris Lattnerb410dc92006-06-20 23:18:58 +000049def SHL64 : SDNodeXForm<imm, [{
50 // Transformation function: 63 - imm
Dan Gohmanf5aeb1a2008-09-12 16:56:44 +000051 return getI32Imm(63 - N->getZExtValue());
Chris Lattnerb410dc92006-06-20 23:18:58 +000052}]>;
53
54def SRL64 : SDNodeXForm<imm, [{
55 // Transformation function: 64 - imm
Dan Gohmanf5aeb1a2008-09-12 16:56:44 +000056 return N->getZExtValue() ? getI32Imm(64 - N->getZExtValue()) : getI32Imm(0);
Chris Lattnerb410dc92006-06-20 23:18:58 +000057}]>;
58
59def HI32_48 : SDNodeXForm<imm, [{
60 // Transformation function: shift the immediate value down into the low bits.
Dan Gohmanf5aeb1a2008-09-12 16:56:44 +000061 return getI32Imm((unsigned short)(N->getZExtValue() >> 32));
Chris Lattnerb410dc92006-06-20 23:18:58 +000062}]>;
63
64def HI48_64 : SDNodeXForm<imm, [{
65 // Transformation function: shift the immediate value down into the low bits.
Dan Gohmanf5aeb1a2008-09-12 16:56:44 +000066 return getI32Imm((unsigned short)(N->getZExtValue() >> 48));
Chris Lattnerb410dc92006-06-20 23:18:58 +000067}]>;
Chris Lattnerf27bb6d2006-06-20 21:23:06 +000068
Chris Lattner956f43c2006-06-16 20:22:01 +000069
70//===----------------------------------------------------------------------===//
Chris Lattner6a5339b2006-11-14 18:44:47 +000071// Calls.
72//
73
74let Defs = [LR8] in
Will Schmidt91638152012-10-04 18:14:28 +000075 def MovePCtoLR8 : Pseudo<(outs), (ins), "#MovePCtoLR8", []>,
Chris Lattner6a5339b2006-11-14 18:44:47 +000076 PPC970_Unit_BRU;
77
Tilmann Scheller2a9ddfb2009-07-03 06:47:08 +000078// Darwin ABI Calls.
Roman Divackye46137f2012-03-06 16:41:49 +000079let isCall = 1, PPC970_Unit = 7, Defs = [LR8] in {
Chris Lattner6a5339b2006-11-14 18:44:47 +000080 // Convenient aliases for call instructions
Dale Johannesenb384ab92008-10-29 18:26:45 +000081 let Uses = [RM] in {
Tilmann Scheller2a9ddfb2009-07-03 06:47:08 +000082 def BL8_Darwin : IForm<18, 0, 1,
Jakob Stoklund Olesen68c10a22012-07-13 20:44:29 +000083 (outs), (ins calltarget:$func),
Tilmann Scheller2a9ddfb2009-07-03 06:47:08 +000084 "bl $func", BrB, []>; // See Pat patterns below.
85 def BLA8_Darwin : IForm<18, 1, 1,
Jakob Stoklund Olesen68c10a22012-07-13 20:44:29 +000086 (outs), (ins aaddr:$func),
Tilmann Scheller2a9ddfb2009-07-03 06:47:08 +000087 "bla $func", BrB, [(PPCcall_Darwin (i64 imm:$func))]>;
Dale Johannesenb384ab92008-10-29 18:26:45 +000088 }
89 let Uses = [CTR8, RM] in {
Tilmann Scheller2a9ddfb2009-07-03 06:47:08 +000090 def BCTRL8_Darwin : XLForm_2_ext<19, 528, 20, 0, 1,
Jakob Stoklund Olesen68c10a22012-07-13 20:44:29 +000091 (outs), (ins),
Tilmann Scheller2a9ddfb2009-07-03 06:47:08 +000092 "bctrl", BrB,
93 [(PPCbctrl_Darwin)]>, Requires<[In64BitMode]>;
Dale Johannesen639076f2008-10-23 20:41:28 +000094 }
Chris Lattner6a5339b2006-11-14 18:44:47 +000095}
96
Tilmann Scheller2a9ddfb2009-07-03 06:47:08 +000097// ELF 64 ABI Calls = Darwin ABI Calls
Nicolas Geoffrayec58d9f2007-04-03 12:35:28 +000098// Used to define BL8_ELF and BLA8_ELF
Roman Divackye46137f2012-03-06 16:41:49 +000099let isCall = 1, PPC970_Unit = 7, Defs = [LR8] in {
Chris Lattner9f0bc652007-02-25 05:34:32 +0000100 // Convenient aliases for call instructions
Dale Johannesenb384ab92008-10-29 18:26:45 +0000101 let Uses = [RM] in {
102 def BL8_ELF : IForm<18, 0, 1,
Jakob Stoklund Olesen68c10a22012-07-13 20:44:29 +0000103 (outs), (ins calltarget:$func),
Hal Finkel5b00cea2012-03-31 14:45:15 +0000104 "bl $func", BrB, []>; // See Pat patterns below.
105
106 let isCodeGenOnly = 1 in
107 def BL8_NOP_ELF : IForm_and_DForm_4_zero<18, 0, 1, 24,
Jakob Stoklund Olesen68c10a22012-07-13 20:44:29 +0000108 (outs), (ins calltarget:$func),
Hal Finkel5b00cea2012-03-31 14:45:15 +0000109 "bl $func\n\tnop", BrB, []>;
110
Bill Schmidt57ac1f42012-12-11 20:30:11 +0000111 let isCodeGenOnly = 1 in
112 def BL8_NOP_ELF_TLSGD : IForm_and_DForm_4_zero<18, 0, 1, 24,
113 (outs), (ins calltarget:$func, tlsgd:$sym),
114 "bl $func($sym)\n\tnop", BrB, []>;
115
Bill Schmidt349c2782012-12-12 19:29:35 +0000116 let isCodeGenOnly = 1 in
117 def BL8_NOP_ELF_TLSLD : IForm_and_DForm_4_zero<18, 0, 1, 24,
118 (outs), (ins calltarget:$func, tlsgd:$sym),
119 "bl $func($sym)\n\tnop", BrB, []>;
120
Dale Johannesenb384ab92008-10-29 18:26:45 +0000121 def BLA8_ELF : IForm<18, 1, 1,
Jakob Stoklund Olesen68c10a22012-07-13 20:44:29 +0000122 (outs), (ins aaddr:$func),
Tilmann Scheller2a9ddfb2009-07-03 06:47:08 +0000123 "bla $func", BrB, [(PPCcall_SVR4 (i64 imm:$func))]>;
Hal Finkel5b00cea2012-03-31 14:45:15 +0000124
125 let isCodeGenOnly = 1 in
126 def BLA8_NOP_ELF : IForm_and_DForm_4_zero<18, 1, 1, 24,
Jakob Stoklund Olesen68c10a22012-07-13 20:44:29 +0000127 (outs), (ins aaddr:$func),
Hal Finkel5b00cea2012-03-31 14:45:15 +0000128 "bla $func\n\tnop", BrB,
129 [(PPCcall_nop_SVR4 (i64 imm:$func))]>;
Dale Johannesenb384ab92008-10-29 18:26:45 +0000130 }
Hal Finkel31610392012-02-24 17:54:01 +0000131 let Uses = [X11, CTR8, RM] in {
Dale Johannesen639076f2008-10-23 20:41:28 +0000132 def BCTRL8_ELF : XLForm_2_ext<19, 528, 20, 0, 1,
Jakob Stoklund Olesen68c10a22012-07-13 20:44:29 +0000133 (outs), (ins),
Evan Cheng152b7e12007-10-23 06:42:42 +0000134 "bctrl", BrB,
Tilmann Scheller2a9ddfb2009-07-03 06:47:08 +0000135 [(PPCbctrl_SVR4)]>, Requires<[In64BitMode]>;
Dale Johannesen639076f2008-10-23 20:41:28 +0000136 }
Chris Lattner9f0bc652007-02-25 05:34:32 +0000137}
138
139
Chris Lattner6a5339b2006-11-14 18:44:47 +0000140// Calls
Tilmann Scheller2a9ddfb2009-07-03 06:47:08 +0000141def : Pat<(PPCcall_Darwin (i64 tglobaladdr:$dst)),
142 (BL8_Darwin tglobaladdr:$dst)>;
143def : Pat<(PPCcall_Darwin (i64 texternalsym:$dst)),
144 (BL8_Darwin texternalsym:$dst)>;
Nicolas Geoffray63f8fb12007-02-27 13:01:19 +0000145
Tilmann Scheller2a9ddfb2009-07-03 06:47:08 +0000146def : Pat<(PPCcall_SVR4 (i64 tglobaladdr:$dst)),
Chris Lattner9f0bc652007-02-25 05:34:32 +0000147 (BL8_ELF tglobaladdr:$dst)>;
Hal Finkel5b00cea2012-03-31 14:45:15 +0000148def : Pat<(PPCcall_nop_SVR4 (i64 tglobaladdr:$dst)),
149 (BL8_NOP_ELF tglobaladdr:$dst)>;
150
Tilmann Scheller2a9ddfb2009-07-03 06:47:08 +0000151def : Pat<(PPCcall_SVR4 (i64 texternalsym:$dst)),
Chris Lattner9f0bc652007-02-25 05:34:32 +0000152 (BL8_ELF texternalsym:$dst)>;
Hal Finkel5b00cea2012-03-31 14:45:15 +0000153def : Pat<(PPCcall_nop_SVR4 (i64 texternalsym:$dst)),
154 (BL8_NOP_ELF texternalsym:$dst)>;
155
Tilmann Scheller6b16eff2009-08-15 11:54:46 +0000156def : Pat<(PPCnop),
157 (NOP)>;
Chris Lattner6a5339b2006-11-14 18:44:47 +0000158
Evan Cheng53301922008-07-12 02:23:19 +0000159// Atomic operations
Dan Gohman533297b2009-10-29 18:10:34 +0000160let usesCustomInserter = 1 in {
Jakob Stoklund Olesencf3a7482011-04-04 17:07:09 +0000161 let Defs = [CR0] in {
Evan Cheng53301922008-07-12 02:23:19 +0000162 def ATOMIC_LOAD_ADD_I64 : Pseudo<
Will Schmidt91638152012-10-04 18:14:28 +0000163 (outs G8RC:$dst), (ins memrr:$ptr, G8RC:$incr), "#ATOMIC_LOAD_ADD_I64",
Dale Johannesen140a8bb2008-08-25 21:09:52 +0000164 [(set G8RC:$dst, (atomic_load_add_64 xoaddr:$ptr, G8RC:$incr))]>;
Dale Johannesenbdab93a2008-08-25 22:34:37 +0000165 def ATOMIC_LOAD_SUB_I64 : Pseudo<
Will Schmidt91638152012-10-04 18:14:28 +0000166 (outs G8RC:$dst), (ins memrr:$ptr, G8RC:$incr), "#ATOMIC_LOAD_SUB_I64",
Dale Johannesenbdab93a2008-08-25 22:34:37 +0000167 [(set G8RC:$dst, (atomic_load_sub_64 xoaddr:$ptr, G8RC:$incr))]>;
168 def ATOMIC_LOAD_OR_I64 : Pseudo<
Will Schmidt91638152012-10-04 18:14:28 +0000169 (outs G8RC:$dst), (ins memrr:$ptr, G8RC:$incr), "#ATOMIC_LOAD_OR_I64",
Dale Johannesenbdab93a2008-08-25 22:34:37 +0000170 [(set G8RC:$dst, (atomic_load_or_64 xoaddr:$ptr, G8RC:$incr))]>;
171 def ATOMIC_LOAD_XOR_I64 : Pseudo<
Will Schmidt91638152012-10-04 18:14:28 +0000172 (outs G8RC:$dst), (ins memrr:$ptr, G8RC:$incr), "#ATOMIC_LOAD_XOR_I64",
Dale Johannesenbdab93a2008-08-25 22:34:37 +0000173 [(set G8RC:$dst, (atomic_load_xor_64 xoaddr:$ptr, G8RC:$incr))]>;
174 def ATOMIC_LOAD_AND_I64 : Pseudo<
Will Schmidt91638152012-10-04 18:14:28 +0000175 (outs G8RC:$dst), (ins memrr:$ptr, G8RC:$incr), "#ATOMIC_LOAD_AND_i64",
Dale Johannesenbdab93a2008-08-25 22:34:37 +0000176 [(set G8RC:$dst, (atomic_load_and_64 xoaddr:$ptr, G8RC:$incr))]>;
177 def ATOMIC_LOAD_NAND_I64 : Pseudo<
Will Schmidt91638152012-10-04 18:14:28 +0000178 (outs G8RC:$dst), (ins memrr:$ptr, G8RC:$incr), "#ATOMIC_LOAD_NAND_I64",
Dale Johannesenbdab93a2008-08-25 22:34:37 +0000179 [(set G8RC:$dst, (atomic_load_nand_64 xoaddr:$ptr, G8RC:$incr))]>;
180
Dale Johannesen5f0cfa22008-08-22 03:49:10 +0000181 def ATOMIC_CMP_SWAP_I64 : Pseudo<
Will Schmidt91638152012-10-04 18:14:28 +0000182 (outs G8RC:$dst), (ins memrr:$ptr, G8RC:$old, G8RC:$new), "#ATOMIC_CMP_SWAP_I64",
Dale Johannesen5f0cfa22008-08-22 03:49:10 +0000183 [(set G8RC:$dst,
Dale Johannesen140a8bb2008-08-25 21:09:52 +0000184 (atomic_cmp_swap_64 xoaddr:$ptr, G8RC:$old, G8RC:$new))]>;
Dale Johannesenbdab93a2008-08-25 22:34:37 +0000185
Dale Johannesen140a8bb2008-08-25 21:09:52 +0000186 def ATOMIC_SWAP_I64 : Pseudo<
Will Schmidt91638152012-10-04 18:14:28 +0000187 (outs G8RC:$dst), (ins memrr:$ptr, G8RC:$new), "#ATOMIC_SWAP_I64",
Dale Johannesen140a8bb2008-08-25 21:09:52 +0000188 [(set G8RC:$dst, (atomic_swap_64 xoaddr:$ptr, G8RC:$new))]>;
Dale Johannesen5f0cfa22008-08-22 03:49:10 +0000189 }
Evan Cheng8608f2e2008-04-19 02:30:38 +0000190}
191
Evan Cheng53301922008-07-12 02:23:19 +0000192// Instructions to support atomic operations
193def LDARX : XForm_1<31, 84, (outs G8RC:$rD), (ins memrr:$ptr),
194 "ldarx $rD, $ptr", LdStLDARX,
195 [(set G8RC:$rD, (PPClarx xoaddr:$ptr))]>;
196
197let Defs = [CR0] in
198def STDCX : XForm_1<31, 214, (outs), (ins G8RC:$rS, memrr:$dst),
199 "stdcx. $rS, $dst", LdStSTDCX,
200 [(PPCstcx G8RC:$rS, xoaddr:$dst)]>,
201 isDOT;
202
Dale Johannesenb384ab92008-10-29 18:26:45 +0000203let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, Uses = [RM] in
Arnold Schwaighofer30e62c02008-04-30 09:16:33 +0000204def TCRETURNdi8 :Pseudo< (outs),
Jakob Stoklund Olesen68c10a22012-07-13 20:44:29 +0000205 (ins calltarget:$dst, i32imm:$offset),
Arnold Schwaighofer30e62c02008-04-30 09:16:33 +0000206 "#TC_RETURNd8 $dst $offset",
207 []>;
208
Dale Johannesenb384ab92008-10-29 18:26:45 +0000209let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, Uses = [RM] in
Jakob Stoklund Olesen68c10a22012-07-13 20:44:29 +0000210def TCRETURNai8 :Pseudo<(outs), (ins aaddr:$func, i32imm:$offset),
Arnold Schwaighofer30e62c02008-04-30 09:16:33 +0000211 "#TC_RETURNa8 $func $offset",
212 [(PPCtc_return (i64 imm:$func), imm:$offset)]>;
213
Dale Johannesenb384ab92008-10-29 18:26:45 +0000214let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, Uses = [RM] in
Jakob Stoklund Olesen68c10a22012-07-13 20:44:29 +0000215def TCRETURNri8 : Pseudo<(outs), (ins CTRRC8:$dst, i32imm:$offset),
Arnold Schwaighofer30e62c02008-04-30 09:16:33 +0000216 "#TC_RETURNr8 $dst $offset",
217 []>;
218
219
220let isTerminator = 1, isBarrier = 1, PPC970_Unit = 7, isBranch = 1,
Roman Divacky0c9b5592011-06-03 15:47:49 +0000221 isIndirectBranch = 1, isCall = 1, Uses = [CTR8, RM] in {
222 let isReturn = 1 in {
223 def TAILBCTR8 : XLForm_2_ext<19, 528, 20, 0, 0, (outs), (ins), "bctr", BrB, []>,
224 Requires<[In64BitMode]>;
225 }
Arnold Schwaighofer30e62c02008-04-30 09:16:33 +0000226
Roman Divacky0c9b5592011-06-03 15:47:49 +0000227 def BCTR8 : XLForm_2_ext<19, 528, 20, 0, 0, (outs), (ins), "bctr", BrB, []>,
228 Requires<[In64BitMode]>;
229}
Arnold Schwaighofer30e62c02008-04-30 09:16:33 +0000230
231
232let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, PPC970_Unit = 7,
Dale Johannesenb384ab92008-10-29 18:26:45 +0000233 isBarrier = 1, isCall = 1, isReturn = 1, Uses = [RM] in
Arnold Schwaighofer30e62c02008-04-30 09:16:33 +0000234def TAILB8 : IForm<18, 0, 0, (outs), (ins calltarget:$dst),
235 "b $dst", BrB,
236 []>;
237
238
239let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, PPC970_Unit = 7,
Dale Johannesenb384ab92008-10-29 18:26:45 +0000240 isBarrier = 1, isCall = 1, isReturn = 1, Uses = [RM] in
Arnold Schwaighofer30e62c02008-04-30 09:16:33 +0000241def TAILBA8 : IForm<18, 0, 0, (outs), (ins aaddr:$dst),
242 "ba $dst", BrB,
243 []>;
244
245def : Pat<(PPCtc_return (i64 tglobaladdr:$dst), imm:$imm),
246 (TCRETURNdi8 tglobaladdr:$dst, imm:$imm)>;
247
248def : Pat<(PPCtc_return (i64 texternalsym:$dst), imm:$imm),
249 (TCRETURNdi8 texternalsym:$dst, imm:$imm)>;
250
251def : Pat<(PPCtc_return CTRRC8:$dst, imm:$imm),
252 (TCRETURNri8 CTRRC8:$dst, imm:$imm)>;
253
Hal Finkel99f823f2012-06-08 15:38:21 +0000254let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, PPC970_Unit = 7 in {
255 let Defs = [CTR8], Uses = [CTR8] in {
Ulrich Weigand18430432012-11-13 19:15:52 +0000256 def BDZ8 : BForm_1<16, 18, 0, 0, (outs), (ins condbrtarget:$dst),
257 "bdz $dst">;
258 def BDNZ8 : BForm_1<16, 16, 0, 0, (outs), (ins condbrtarget:$dst),
259 "bdnz $dst">;
Hal Finkel99f823f2012-06-08 15:38:21 +0000260 }
261}
262
Hal Finkel234bb382011-12-07 06:34:06 +0000263// 64-but CR instructions
264def MTCRF8 : XFXForm_5<31, 144, (outs crbitm:$FXM), (ins G8RC:$rS),
265 "mtcrf $FXM, $rS", BrMCRX>,
266 PPC970_MicroCode, PPC970_Unit_CRU;
267
268def MFCR8pseud: XFXForm_3<31, 19, (outs G8RC:$rT), (ins crbitm:$FXM),
Will Schmidt91638152012-10-04 18:14:28 +0000269 "#MFCR8pseud", SprMFCR>,
Hal Finkel234bb382011-12-07 06:34:06 +0000270 PPC970_MicroCode, PPC970_Unit_CRU;
271
272def MFCR8 : XFXForm_3<31, 19, (outs G8RC:$rT), (ins),
273 "mfcr $rT", SprMFCR>,
274 PPC970_MicroCode, PPC970_Unit_CRU;
Arnold Schwaighofer30e62c02008-04-30 09:16:33 +0000275
Chris Lattner6a5339b2006-11-14 18:44:47 +0000276//===----------------------------------------------------------------------===//
277// 64-bit SPR manipulation instrs.
278
Dale Johannesen639076f2008-10-23 20:41:28 +0000279let Uses = [CTR8] in {
Evan Cheng64d80e32007-07-19 01:14:50 +0000280def MFCTR8 : XFXForm_1_ext<31, 339, 9, (outs G8RC:$rT), (ins),
281 "mfctr $rT", SprMFSPR>,
Chris Lattner6a5339b2006-11-14 18:44:47 +0000282 PPC970_DGroup_First, PPC970_Unit_FXU;
Dale Johannesen639076f2008-10-23 20:41:28 +0000283}
284let Pattern = [(PPCmtctr G8RC:$rS)], Defs = [CTR8] in {
Evan Cheng64d80e32007-07-19 01:14:50 +0000285def MTCTR8 : XFXForm_7_ext<31, 467, 9, (outs), (ins G8RC:$rS),
286 "mtctr $rS", SprMTSPR>,
Chris Lattner6a5339b2006-11-14 18:44:47 +0000287 PPC970_DGroup_First, PPC970_Unit_FXU;
Chris Lattner2e6b77d2006-06-27 18:36:44 +0000288}
Chris Lattner563ecfb2006-06-27 18:18:41 +0000289
Hal Finkel8cc34742012-08-04 14:10:46 +0000290let Pattern = [(set G8RC:$rT, readcyclecounter)] in
Hal Finkelf45717e2012-08-06 21:21:44 +0000291def MFTB8 : XFXForm_1_ext<31, 339, 268, (outs G8RC:$rT), (ins),
292 "mfspr $rT, 268", SprMFTB>,
Hal Finkel8cc34742012-08-04 14:10:46 +0000293 PPC970_DGroup_First, PPC970_Unit_FXU;
Hal Finkel8da94ad2012-08-07 17:04:20 +0000294// Note that encoding mftb using mfspr is now the preferred form,
295// and has been since at least ISA v2.03. The mftb instruction has
296// now been phased out. Using mfspr, however, is known not to work on
297// the POWER3.
Hal Finkel8cc34742012-08-04 14:10:46 +0000298
Evan Cheng071a2792007-09-11 19:55:27 +0000299let Defs = [X1], Uses = [X1] in
Will Schmidt91638152012-10-04 18:14:28 +0000300def DYNALLOC8 : Pseudo<(outs G8RC:$result), (ins G8RC:$negsize, memri:$fpsi),"#DYNALLOC8",
Jim Laskey2f616bf2006-11-16 22:43:37 +0000301 [(set G8RC:$result,
Evan Cheng071a2792007-09-11 19:55:27 +0000302 (PPCdynalloc G8RC:$negsize, iaddr:$fpsi))]>;
Jim Laskey2f616bf2006-11-16 22:43:37 +0000303
Dale Johannesen639076f2008-10-23 20:41:28 +0000304let Defs = [LR8] in {
Evan Cheng64d80e32007-07-19 01:14:50 +0000305def MTLR8 : XFXForm_7_ext<31, 467, 8, (outs), (ins G8RC:$rS),
306 "mtlr $rS", SprMTSPR>,
Chris Lattner6a5339b2006-11-14 18:44:47 +0000307 PPC970_DGroup_First, PPC970_Unit_FXU;
Dale Johannesen639076f2008-10-23 20:41:28 +0000308}
309let Uses = [LR8] in {
Evan Cheng64d80e32007-07-19 01:14:50 +0000310def MFLR8 : XFXForm_1_ext<31, 339, 8, (outs G8RC:$rT), (ins),
311 "mflr $rT", SprMFSPR>,
Chris Lattner6a5339b2006-11-14 18:44:47 +0000312 PPC970_DGroup_First, PPC970_Unit_FXU;
Dale Johannesen639076f2008-10-23 20:41:28 +0000313}
Chris Lattner6a5339b2006-11-14 18:44:47 +0000314
Chris Lattner563ecfb2006-06-27 18:18:41 +0000315//===----------------------------------------------------------------------===//
Chris Lattner956f43c2006-06-16 20:22:01 +0000316// Fixed point instructions.
317//
318
319let PPC970_Unit = 1 in { // FXU Operations.
320
Hal Finkelf3c38282012-08-28 02:10:33 +0000321let isReMaterializable = 1, isAsCheapAsAMove = 1, isMoveImm = 1 in {
Evan Cheng64d80e32007-07-19 01:14:50 +0000322def LI8 : DForm_2_r0<14, (outs G8RC:$rD), (ins symbolLo64:$imm),
Hal Finkel16803092012-06-12 19:01:24 +0000323 "li $rD, $imm", IntSimple,
Chris Lattner0ea70b22006-06-20 22:34:10 +0000324 [(set G8RC:$rD, immSExt16:$imm)]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000325def LIS8 : DForm_2_r0<15, (outs G8RC:$rD), (ins symbolHi64:$imm),
Hal Finkel16803092012-06-12 19:01:24 +0000326 "lis $rD, $imm", IntSimple,
Chris Lattner0ea70b22006-06-20 22:34:10 +0000327 [(set G8RC:$rD, imm16ShiftedSExt:$imm)]>;
Hal Finkelf3c38282012-08-28 02:10:33 +0000328}
Chris Lattner0ea70b22006-06-20 22:34:10 +0000329
330// Logical ops.
Evan Cheng64d80e32007-07-19 01:14:50 +0000331def NAND8: XForm_6<31, 476, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
Hal Finkel16803092012-06-12 19:01:24 +0000332 "nand $rA, $rS, $rB", IntSimple,
Chris Lattnerf2c5bca2006-06-20 23:11:59 +0000333 [(set G8RC:$rA, (not (and G8RC:$rS, G8RC:$rB)))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000334def AND8 : XForm_6<31, 28, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
Hal Finkel16803092012-06-12 19:01:24 +0000335 "and $rA, $rS, $rB", IntSimple,
Chris Lattnerf2c5bca2006-06-20 23:11:59 +0000336 [(set G8RC:$rA, (and G8RC:$rS, G8RC:$rB))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000337def ANDC8: XForm_6<31, 60, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
Hal Finkel16803092012-06-12 19:01:24 +0000338 "andc $rA, $rS, $rB", IntSimple,
Chris Lattnerf2c5bca2006-06-20 23:11:59 +0000339 [(set G8RC:$rA, (and G8RC:$rS, (not G8RC:$rB)))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000340def OR8 : XForm_6<31, 444, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
Hal Finkel16803092012-06-12 19:01:24 +0000341 "or $rA, $rS, $rB", IntSimple,
Chris Lattnerf2c5bca2006-06-20 23:11:59 +0000342 [(set G8RC:$rA, (or G8RC:$rS, G8RC:$rB))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000343def NOR8 : XForm_6<31, 124, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
Hal Finkel16803092012-06-12 19:01:24 +0000344 "nor $rA, $rS, $rB", IntSimple,
Chris Lattnerf2c5bca2006-06-20 23:11:59 +0000345 [(set G8RC:$rA, (not (or G8RC:$rS, G8RC:$rB)))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000346def ORC8 : XForm_6<31, 412, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
Hal Finkel16803092012-06-12 19:01:24 +0000347 "orc $rA, $rS, $rB", IntSimple,
Chris Lattnerf2c5bca2006-06-20 23:11:59 +0000348 [(set G8RC:$rA, (or G8RC:$rS, (not G8RC:$rB)))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000349def EQV8 : XForm_6<31, 284, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
Hal Finkel16803092012-06-12 19:01:24 +0000350 "eqv $rA, $rS, $rB", IntSimple,
Chris Lattnerf2c5bca2006-06-20 23:11:59 +0000351 [(set G8RC:$rA, (not (xor G8RC:$rS, G8RC:$rB)))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000352def XOR8 : XForm_6<31, 316, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
Hal Finkel16803092012-06-12 19:01:24 +0000353 "xor $rA, $rS, $rB", IntSimple,
Chris Lattnerf2c5bca2006-06-20 23:11:59 +0000354 [(set G8RC:$rA, (xor G8RC:$rS, G8RC:$rB))]>;
355
Hal Finkela548afc2013-03-19 18:51:05 +0000356// Moves between 32-bit and 64-bit registers (used for copy resolution
357// after register allocation).
358let isCodeGenOnly = 1 in {
359def OR8_32 : XForm_6<31, 444, (outs G8RC:$rA), (ins GPRC:$rS, GPRC:$rB),
360 "or $rA, $rS, $rB", IntSimple, []>;
361def OR_64 : XForm_6<31, 444, (outs GPRC:$rA), (ins G8RC:$rS, G8RC:$rB),
362 "or $rA, $rS, $rB", IntSimple, []>;
363}
364
Chris Lattnerf2c5bca2006-06-20 23:11:59 +0000365// Logical ops with immediate.
Evan Cheng64d80e32007-07-19 01:14:50 +0000366def ANDIo8 : DForm_4<28, (outs G8RC:$dst), (ins G8RC:$src1, u16imm:$src2),
Chris Lattner0ea70b22006-06-20 22:34:10 +0000367 "andi. $dst, $src1, $src2", IntGeneral,
368 [(set G8RC:$dst, (and G8RC:$src1, immZExt16:$src2))]>,
369 isDOT;
Evan Cheng64d80e32007-07-19 01:14:50 +0000370def ANDISo8 : DForm_4<29, (outs G8RC:$dst), (ins G8RC:$src1, u16imm:$src2),
Chris Lattner0ea70b22006-06-20 22:34:10 +0000371 "andis. $dst, $src1, $src2", IntGeneral,
372 [(set G8RC:$dst, (and G8RC:$src1,imm16ShiftedZExt:$src2))]>,
373 isDOT;
Evan Cheng64d80e32007-07-19 01:14:50 +0000374def ORI8 : DForm_4<24, (outs G8RC:$dst), (ins G8RC:$src1, u16imm:$src2),
Hal Finkel16803092012-06-12 19:01:24 +0000375 "ori $dst, $src1, $src2", IntSimple,
Chris Lattner0ea70b22006-06-20 22:34:10 +0000376 [(set G8RC:$dst, (or G8RC:$src1, immZExt16:$src2))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000377def ORIS8 : DForm_4<25, (outs G8RC:$dst), (ins G8RC:$src1, u16imm:$src2),
Hal Finkel16803092012-06-12 19:01:24 +0000378 "oris $dst, $src1, $src2", IntSimple,
Chris Lattner0ea70b22006-06-20 22:34:10 +0000379 [(set G8RC:$dst, (or G8RC:$src1, imm16ShiftedZExt:$src2))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000380def XORI8 : DForm_4<26, (outs G8RC:$dst), (ins G8RC:$src1, u16imm:$src2),
Hal Finkel16803092012-06-12 19:01:24 +0000381 "xori $dst, $src1, $src2", IntSimple,
Chris Lattner0ea70b22006-06-20 22:34:10 +0000382 [(set G8RC:$dst, (xor G8RC:$src1, immZExt16:$src2))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000383def XORIS8 : DForm_4<27, (outs G8RC:$dst), (ins G8RC:$src1, u16imm:$src2),
Hal Finkel16803092012-06-12 19:01:24 +0000384 "xoris $dst, $src1, $src2", IntSimple,
Chris Lattner0ea70b22006-06-20 22:34:10 +0000385 [(set G8RC:$dst, (xor G8RC:$src1, imm16ShiftedZExt:$src2))]>;
386
Evan Cheng64d80e32007-07-19 01:14:50 +0000387def ADD8 : XOForm_1<31, 266, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
Hal Finkel16803092012-06-12 19:01:24 +0000388 "add $rT, $rA, $rB", IntSimple,
Chris Lattner956f43c2006-06-16 20:22:01 +0000389 [(set G8RC:$rT, (add G8RC:$rA, G8RC:$rB))]>;
Bill Schmidtd7802bf2012-12-04 16:18:08 +0000390// ADD8 has a special form: reg = ADD8(reg, sym@tls) for use by the
391// initial-exec thread-local storage model.
392def ADD8TLS : XOForm_1<31, 266, 0, (outs G8RC:$rT), (ins G8RC:$rA, tlsreg:$rB),
Bill Schmidtdfebc4c2012-12-13 18:45:54 +0000393 "add $rT, $rA, $rB@tls", IntSimple,
Bill Schmidtd7802bf2012-12-04 16:18:08 +0000394 [(set G8RC:$rT, (add G8RC:$rA, tglobaltlsaddr:$rB))]>;
Chris Lattnerccde4cb2007-05-17 06:52:46 +0000395
Dale Johannesen8dffc812009-09-18 20:15:22 +0000396let Defs = [CARRY] in {
Evan Cheng64d80e32007-07-19 01:14:50 +0000397def ADDC8 : XOForm_1<31, 10, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
Chris Lattnerccde4cb2007-05-17 06:52:46 +0000398 "addc $rT, $rA, $rB", IntGeneral,
399 [(set G8RC:$rT, (addc G8RC:$rA, G8RC:$rB))]>,
400 PPC970_DGroup_Cracked;
Dale Johannesen8dffc812009-09-18 20:15:22 +0000401def ADDIC8 : DForm_2<12, (outs G8RC:$rD), (ins G8RC:$rA, s16imm64:$imm),
402 "addic $rD, $rA, $imm", IntGeneral,
403 [(set G8RC:$rD, (addc G8RC:$rA, immSExt16:$imm))]>;
404}
Hal Finkela548afc2013-03-19 18:51:05 +0000405def ADDI8 : DForm_2<14, (outs G8RC:$rD), (ins G8RC_NOX0:$rA, s16imm64:$imm),
Hal Finkel16803092012-06-12 19:01:24 +0000406 "addi $rD, $rA, $imm", IntSimple,
Hal Finkela548afc2013-03-19 18:51:05 +0000407 [(set G8RC:$rD, (add G8RC_NOX0:$rA, immSExt16:$imm))]>;
408def ADDI8L : DForm_2<14, (outs G8RC:$rD), (ins G8RC_NOX0:$rA, symbolLo64:$imm),
Hal Finkel16803092012-06-12 19:01:24 +0000409 "addi $rD, $rA, $imm", IntSimple,
Hal Finkela548afc2013-03-19 18:51:05 +0000410 [(set G8RC:$rD, (add G8RC_NOX0:$rA, immSExt16:$imm))]>;
411def ADDIS8 : DForm_2<15, (outs G8RC:$rD), (ins G8RC_NOX0:$rA, symbolHi64:$imm),
Hal Finkel16803092012-06-12 19:01:24 +0000412 "addis $rD, $rA, $imm", IntSimple,
Hal Finkela548afc2013-03-19 18:51:05 +0000413 [(set G8RC:$rD, (add G8RC_NOX0:$rA,
414 imm16ShiftedSExt:$imm))]>;
Chris Lattner0ea70b22006-06-20 22:34:10 +0000415
Dale Johannesen8dffc812009-09-18 20:15:22 +0000416let Defs = [CARRY] in {
Evan Cheng64d80e32007-07-19 01:14:50 +0000417def SUBFIC8: DForm_2< 8, (outs G8RC:$rD), (ins G8RC:$rA, s16imm64:$imm),
Chris Lattner563ecfb2006-06-27 18:18:41 +0000418 "subfic $rD, $rA, $imm", IntGeneral,
419 [(set G8RC:$rD, (subc immSExt16:$imm, G8RC:$rA))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000420def SUBFC8 : XOForm_1<31, 8, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
Chris Lattnerccde4cb2007-05-17 06:52:46 +0000421 "subfc $rT, $rA, $rB", IntGeneral,
422 [(set G8RC:$rT, (subc G8RC:$rB, G8RC:$rA))]>,
423 PPC970_DGroup_Cracked;
Dale Johannesen8dffc812009-09-18 20:15:22 +0000424}
425def SUBF8 : XOForm_1<31, 40, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
426 "subf $rT, $rA, $rB", IntGeneral,
427 [(set G8RC:$rT, (sub G8RC:$rB, G8RC:$rA))]>;
428def NEG8 : XOForm_3<31, 104, 0, (outs G8RC:$rT), (ins G8RC:$rA),
Hal Finkel16803092012-06-12 19:01:24 +0000429 "neg $rT, $rA", IntSimple,
Dale Johannesen8dffc812009-09-18 20:15:22 +0000430 [(set G8RC:$rT, (ineg G8RC:$rA))]>;
431let Uses = [CARRY], Defs = [CARRY] in {
432def ADDE8 : XOForm_1<31, 138, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
433 "adde $rT, $rA, $rB", IntGeneral,
434 [(set G8RC:$rT, (adde G8RC:$rA, G8RC:$rB))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000435def ADDME8 : XOForm_3<31, 234, 0, (outs G8RC:$rT), (ins G8RC:$rA),
Chris Lattnerccde4cb2007-05-17 06:52:46 +0000436 "addme $rT, $rA", IntGeneral,
Chris Lattner9f036412010-02-21 03:12:16 +0000437 [(set G8RC:$rT, (adde G8RC:$rA, -1))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000438def ADDZE8 : XOForm_3<31, 202, 0, (outs G8RC:$rT), (ins G8RC:$rA),
Chris Lattnerccde4cb2007-05-17 06:52:46 +0000439 "addze $rT, $rA", IntGeneral,
440 [(set G8RC:$rT, (adde G8RC:$rA, 0))]>;
Dale Johannesen8dffc812009-09-18 20:15:22 +0000441def SUBFE8 : XOForm_1<31, 136, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
442 "subfe $rT, $rA, $rB", IntGeneral,
443 [(set G8RC:$rT, (sube G8RC:$rB, G8RC:$rA))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000444def SUBFME8 : XOForm_3<31, 232, 0, (outs G8RC:$rT), (ins G8RC:$rA),
Chris Lattnerccde4cb2007-05-17 06:52:46 +0000445 "subfme $rT, $rA", IntGeneral,
Chris Lattner9f036412010-02-21 03:12:16 +0000446 [(set G8RC:$rT, (sube -1, G8RC:$rA))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000447def SUBFZE8 : XOForm_3<31, 200, 0, (outs G8RC:$rT), (ins G8RC:$rA),
Chris Lattnerccde4cb2007-05-17 06:52:46 +0000448 "subfze $rT, $rA", IntGeneral,
449 [(set G8RC:$rT, (sube 0, G8RC:$rA))]>;
Dale Johannesen8dffc812009-09-18 20:15:22 +0000450}
Chris Lattnerccde4cb2007-05-17 06:52:46 +0000451
Chris Lattnerf27bb6d2006-06-20 21:23:06 +0000452
Evan Cheng64d80e32007-07-19 01:14:50 +0000453def MULHD : XOForm_1<31, 73, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
Chris Lattner956f43c2006-06-16 20:22:01 +0000454 "mulhd $rT, $rA, $rB", IntMulHW,
455 [(set G8RC:$rT, (mulhs G8RC:$rA, G8RC:$rB))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000456def MULHDU : XOForm_1<31, 9, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
Chris Lattner956f43c2006-06-16 20:22:01 +0000457 "mulhdu $rT, $rA, $rB", IntMulHWU,
458 [(set G8RC:$rT, (mulhu G8RC:$rA, G8RC:$rB))]>;
459
Evan Chengcaf778a2007-08-01 23:07:38 +0000460def CMPD : XForm_16_ext<31, 0, (outs CRRC:$crD), (ins G8RC:$rA, G8RC:$rB),
Chris Lattner956f43c2006-06-16 20:22:01 +0000461 "cmpd $crD, $rA, $rB", IntCompare>, isPPC64;
Evan Chengcaf778a2007-08-01 23:07:38 +0000462def CMPLD : XForm_16_ext<31, 32, (outs CRRC:$crD), (ins G8RC:$rA, G8RC:$rB),
Chris Lattner956f43c2006-06-16 20:22:01 +0000463 "cmpld $crD, $rA, $rB", IntCompare>, isPPC64;
Evan Chengcaf778a2007-08-01 23:07:38 +0000464def CMPDI : DForm_5_ext<11, (outs CRRC:$crD), (ins G8RC:$rA, s16imm:$imm),
Chris Lattner041e9d32006-06-26 23:53:10 +0000465 "cmpdi $crD, $rA, $imm", IntCompare>, isPPC64;
Evan Chengcaf778a2007-08-01 23:07:38 +0000466def CMPLDI : DForm_6_ext<10, (outs CRRC:$dst), (ins G8RC:$src1, u16imm:$src2),
Chris Lattner041e9d32006-06-26 23:53:10 +0000467 "cmpldi $dst, $src1, $src2", IntCompare>, isPPC64;
Chris Lattner956f43c2006-06-16 20:22:01 +0000468
Evan Cheng64d80e32007-07-19 01:14:50 +0000469def SLD : XForm_6<31, 27, (outs G8RC:$rA), (ins G8RC:$rS, GPRC:$rB),
Chris Lattner956f43c2006-06-16 20:22:01 +0000470 "sld $rA, $rS, $rB", IntRotateD,
Chris Lattneraf8ee842008-03-07 20:18:24 +0000471 [(set G8RC:$rA, (PPCshl G8RC:$rS, GPRC:$rB))]>, isPPC64;
Evan Cheng64d80e32007-07-19 01:14:50 +0000472def SRD : XForm_6<31, 539, (outs G8RC:$rA), (ins G8RC:$rS, GPRC:$rB),
Chris Lattner956f43c2006-06-16 20:22:01 +0000473 "srd $rA, $rS, $rB", IntRotateD,
Chris Lattneraf8ee842008-03-07 20:18:24 +0000474 [(set G8RC:$rA, (PPCsrl G8RC:$rS, GPRC:$rB))]>, isPPC64;
Dale Johannesen8dffc812009-09-18 20:15:22 +0000475let Defs = [CARRY] in {
Evan Cheng64d80e32007-07-19 01:14:50 +0000476def SRAD : XForm_6<31, 794, (outs G8RC:$rA), (ins G8RC:$rS, GPRC:$rB),
Chris Lattner956f43c2006-06-16 20:22:01 +0000477 "srad $rA, $rS, $rB", IntRotateD,
Chris Lattneraf8ee842008-03-07 20:18:24 +0000478 [(set G8RC:$rA, (PPCsra G8RC:$rS, GPRC:$rB))]>, isPPC64;
Dale Johannesen8dffc812009-09-18 20:15:22 +0000479}
Chris Lattner94c96cc2006-12-06 21:46:13 +0000480
Evan Cheng64d80e32007-07-19 01:14:50 +0000481def EXTSB8 : XForm_11<31, 954, (outs G8RC:$rA), (ins G8RC:$rS),
Hal Finkel16803092012-06-12 19:01:24 +0000482 "extsb $rA, $rS", IntSimple,
Chris Lattner94c96cc2006-12-06 21:46:13 +0000483 [(set G8RC:$rA, (sext_inreg G8RC:$rS, i8))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000484def EXTSH8 : XForm_11<31, 922, (outs G8RC:$rA), (ins G8RC:$rS),
Hal Finkel16803092012-06-12 19:01:24 +0000485 "extsh $rA, $rS", IntSimple,
Chris Lattner94c96cc2006-12-06 21:46:13 +0000486 [(set G8RC:$rA, (sext_inreg G8RC:$rS, i16))]>;
487
Evan Cheng64d80e32007-07-19 01:14:50 +0000488def EXTSW : XForm_11<31, 986, (outs G8RC:$rA), (ins G8RC:$rS),
Hal Finkel16803092012-06-12 19:01:24 +0000489 "extsw $rA, $rS", IntSimple,
Chris Lattner956f43c2006-06-16 20:22:01 +0000490 [(set G8RC:$rA, (sext_inreg G8RC:$rS, i32))]>, isPPC64;
491/// EXTSW_32 - Just like EXTSW, but works on '32-bit' registers.
Evan Cheng64d80e32007-07-19 01:14:50 +0000492def EXTSW_32 : XForm_11<31, 986, (outs GPRC:$rA), (ins GPRC:$rS),
Hal Finkel16803092012-06-12 19:01:24 +0000493 "extsw $rA, $rS", IntSimple,
Chris Lattner956f43c2006-06-16 20:22:01 +0000494 [(set GPRC:$rA, (PPCextsw_32 GPRC:$rS))]>, isPPC64;
Evan Cheng64d80e32007-07-19 01:14:50 +0000495def EXTSW_32_64 : XForm_11<31, 986, (outs G8RC:$rA), (ins GPRC:$rS),
Hal Finkel16803092012-06-12 19:01:24 +0000496 "extsw $rA, $rS", IntSimple,
Chris Lattner041e9d32006-06-26 23:53:10 +0000497 [(set G8RC:$rA, (sext GPRC:$rS))]>, isPPC64;
Chris Lattner956f43c2006-06-16 20:22:01 +0000498
Dale Johannesen8dffc812009-09-18 20:15:22 +0000499let Defs = [CARRY] in {
Evan Cheng64d80e32007-07-19 01:14:50 +0000500def SRADI : XSForm_1<31, 413, (outs G8RC:$rA), (ins G8RC:$rS, u6imm:$SH),
Hal Finkel8dc440a2012-08-28 02:49:14 +0000501 "sradi $rA, $rS, $SH", IntRotateDI,
Chris Lattnere4172be2006-06-27 20:07:26 +0000502 [(set G8RC:$rA, (sra G8RC:$rS, (i32 imm:$SH)))]>, isPPC64;
Dale Johannesen8dffc812009-09-18 20:15:22 +0000503}
Evan Cheng64d80e32007-07-19 01:14:50 +0000504def CNTLZD : XForm_11<31, 58, (outs G8RC:$rA), (ins G8RC:$rS),
Chris Lattnerb6ead972007-03-25 04:44:03 +0000505 "cntlzd $rA, $rS", IntGeneral,
506 [(set G8RC:$rA, (ctlz G8RC:$rS))]>;
507
Evan Cheng64d80e32007-07-19 01:14:50 +0000508def DIVD : XOForm_1<31, 489, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
Chris Lattner956f43c2006-06-16 20:22:01 +0000509 "divd $rT, $rA, $rB", IntDivD,
510 [(set G8RC:$rT, (sdiv G8RC:$rA, G8RC:$rB))]>, isPPC64,
511 PPC970_DGroup_First, PPC970_DGroup_Cracked;
Evan Cheng64d80e32007-07-19 01:14:50 +0000512def DIVDU : XOForm_1<31, 457, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
Chris Lattner956f43c2006-06-16 20:22:01 +0000513 "divdu $rT, $rA, $rB", IntDivD,
514 [(set G8RC:$rT, (udiv G8RC:$rA, G8RC:$rB))]>, isPPC64,
515 PPC970_DGroup_First, PPC970_DGroup_Cracked;
Evan Cheng64d80e32007-07-19 01:14:50 +0000516def MULLD : XOForm_1<31, 233, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
Chris Lattner956f43c2006-06-16 20:22:01 +0000517 "mulld $rT, $rA, $rB", IntMulHD,
518 [(set G8RC:$rT, (mul G8RC:$rA, G8RC:$rB))]>, isPPC64;
519
Chris Lattner041e9d32006-06-26 23:53:10 +0000520
Chris Lattner8e28b5c2006-11-15 23:24:18 +0000521let isCommutable = 1 in {
Chris Lattner956f43c2006-06-16 20:22:01 +0000522def RLDIMI : MDForm_1<30, 3,
Evan Cheng64d80e32007-07-19 01:14:50 +0000523 (outs G8RC:$rA), (ins G8RC:$rSi, G8RC:$rS, u6imm:$SH, u6imm:$MB),
Hal Finkel8dc440a2012-08-28 02:49:14 +0000524 "rldimi $rA, $rS, $SH, $MB", IntRotateDI,
Chris Lattner8e28b5c2006-11-15 23:24:18 +0000525 []>, isPPC64, RegConstraint<"$rSi = $rA">,
526 NoEncode<"$rSi">;
Chris Lattner956f43c2006-06-16 20:22:01 +0000527}
528
529// Rotate instructions.
Evan Cheng67c906d2007-09-04 20:20:29 +0000530def RLDCL : MDForm_1<30, 0,
Adhemerval Zanellaedf5e9a2012-10-26 12:09:58 +0000531 (outs G8RC:$rA), (ins G8RC:$rS, GPRC:$rB, u6imm:$MBE),
532 "rldcl $rA, $rS, $rB, $MBE", IntRotateD,
Evan Cheng67c906d2007-09-04 20:20:29 +0000533 []>, isPPC64;
Chris Lattner956f43c2006-06-16 20:22:01 +0000534def RLDICL : MDForm_1<30, 0,
Adhemerval Zanellaedf5e9a2012-10-26 12:09:58 +0000535 (outs G8RC:$rA), (ins G8RC:$rS, u6imm:$SH, u6imm:$MBE),
536 "rldicl $rA, $rS, $SH, $MBE", IntRotateDI,
Chris Lattner956f43c2006-06-16 20:22:01 +0000537 []>, isPPC64;
538def RLDICR : MDForm_1<30, 1,
Adhemerval Zanellaedf5e9a2012-10-26 12:09:58 +0000539 (outs G8RC:$rA), (ins G8RC:$rS, u6imm:$SH, u6imm:$MBE),
540 "rldicr $rA, $rS, $SH, $MBE", IntRotateDI,
Chris Lattner956f43c2006-06-16 20:22:01 +0000541 []>, isPPC64;
Hal Finkel234bb382011-12-07 06:34:06 +0000542
543def RLWINM8 : MForm_2<21,
544 (outs G8RC:$rA), (ins G8RC:$rS, u5imm:$SH, u5imm:$MB, u5imm:$ME),
545 "rlwinm $rA, $rS, $SH, $MB, $ME", IntGeneral,
546 []>;
547
Ulrich Weigandbc40df32012-11-13 19:14:19 +0000548def ISEL8 : AForm_4<31, 15,
Hal Finkela548afc2013-03-19 18:51:05 +0000549 (outs G8RC:$rT), (ins G8RC_NOX0:$rA, G8RC:$rB, pred:$cond),
Hal Finkel009f7af2012-06-22 23:10:08 +0000550 "isel $rT, $rA, $rB, $cond", IntGeneral,
551 []>;
Chris Lattner041e9d32006-06-26 23:53:10 +0000552} // End FXU Operations.
Chris Lattner956f43c2006-06-16 20:22:01 +0000553
554
555//===----------------------------------------------------------------------===//
556// Load/Store instructions.
557//
558
559
Chris Lattner518f9c72006-07-14 04:42:02 +0000560// Sign extending loads.
Dan Gohman15511cf2008-12-03 18:15:48 +0000561let canFoldAsLoad = 1, PPC970_Unit = 2 in {
Evan Cheng64d80e32007-07-19 01:14:50 +0000562def LHA8: DForm_1<42, (outs G8RC:$rD), (ins memri:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000563 "lha $rD, $src", LdStLHA,
Evan Cheng466685d2006-10-09 20:57:25 +0000564 [(set G8RC:$rD, (sextloadi16 iaddr:$src))]>,
Chris Lattner518f9c72006-07-14 04:42:02 +0000565 PPC970_DGroup_Cracked;
Evan Cheng64d80e32007-07-19 01:14:50 +0000566def LWA : DSForm_1<58, 2, (outs G8RC:$rD), (ins memrix:$src),
Chris Lattner047854f2006-06-20 00:38:36 +0000567 "lwa $rD, $src", LdStLWA,
Hal Finkel08a215c2013-03-18 23:00:58 +0000568 [(set G8RC:$rD,
569 (aligned4sextloadi32 ixaddr:$src))]>, isPPC64,
Chris Lattner047854f2006-06-20 00:38:36 +0000570 PPC970_DGroup_Cracked;
Evan Cheng64d80e32007-07-19 01:14:50 +0000571def LHAX8: XForm_1<31, 343, (outs G8RC:$rD), (ins memrr:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000572 "lhax $rD, $src", LdStLHA,
Evan Cheng466685d2006-10-09 20:57:25 +0000573 [(set G8RC:$rD, (sextloadi16 xaddr:$src))]>,
Chris Lattner518f9c72006-07-14 04:42:02 +0000574 PPC970_DGroup_Cracked;
Evan Cheng64d80e32007-07-19 01:14:50 +0000575def LWAX : XForm_1<31, 341, (outs G8RC:$rD), (ins memrr:$src),
Chris Lattner956f43c2006-06-16 20:22:01 +0000576 "lwax $rD, $src", LdStLHA,
Evan Cheng466685d2006-10-09 20:57:25 +0000577 [(set G8RC:$rD, (sextloadi32 xaddr:$src))]>, isPPC64,
Chris Lattner956f43c2006-06-16 20:22:01 +0000578 PPC970_DGroup_Cracked;
Chris Lattner518f9c72006-07-14 04:42:02 +0000579
Chris Lattner94e509c2006-11-10 23:58:45 +0000580// Update forms.
Dan Gohman41474ba2008-12-03 02:30:17 +0000581let mayLoad = 1 in
Ulrich Weigand8353d1e2013-03-19 19:52:30 +0000582def LHAU8 : DForm_1<43, (outs G8RC:$rD, ptr_rc_nor0:$ea_result),
583 (ins memri:$addr),
584 "lhau $rD, $addr", LdStLHAU,
585 []>, RegConstraint<"$addr.reg = $ea_result">,
Chris Lattner8e28b5c2006-11-15 23:24:18 +0000586 NoEncode<"$ea_result">;
Chris Lattner94e509c2006-11-10 23:58:45 +0000587// NO LWAU!
588
Hal Finkela548afc2013-03-19 18:51:05 +0000589def LHAUX8 : XForm_1<31, 375, (outs G8RC:$rD, ptr_rc_nor0:$ea_result),
Hal Finkel0fcdd8b2012-06-20 15:43:03 +0000590 (ins memrr:$addr),
Hal Finkel8dc440a2012-08-28 02:49:14 +0000591 "lhaux $rD, $addr", LdStLHAU,
Hal Finkel0fcdd8b2012-06-20 15:43:03 +0000592 []>, RegConstraint<"$addr.offreg = $ea_result">,
593 NoEncode<"$ea_result">;
Hal Finkela548afc2013-03-19 18:51:05 +0000594def LWAUX : XForm_1<31, 373, (outs G8RC:$rD, ptr_rc_nor0:$ea_result),
Hal Finkel0fcdd8b2012-06-20 15:43:03 +0000595 (ins memrr:$addr),
Hal Finkel8dc440a2012-08-28 02:49:14 +0000596 "lwaux $rD, $addr", LdStLHAU,
Hal Finkel0fcdd8b2012-06-20 15:43:03 +0000597 []>, RegConstraint<"$addr.offreg = $ea_result">,
598 NoEncode<"$ea_result">, isPPC64;
Chris Lattner94e509c2006-11-10 23:58:45 +0000599}
600
Chris Lattner518f9c72006-07-14 04:42:02 +0000601// Zero extending loads.
Dan Gohman15511cf2008-12-03 18:15:48 +0000602let canFoldAsLoad = 1, PPC970_Unit = 2 in {
Evan Cheng64d80e32007-07-19 01:14:50 +0000603def LBZ8 : DForm_1<34, (outs G8RC:$rD), (ins memri:$src),
Hal Finkel20b529b2012-04-01 04:44:16 +0000604 "lbz $rD, $src", LdStLoad,
Evan Cheng466685d2006-10-09 20:57:25 +0000605 [(set G8RC:$rD, (zextloadi8 iaddr:$src))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000606def LHZ8 : DForm_1<40, (outs G8RC:$rD), (ins memri:$src),
Hal Finkel20b529b2012-04-01 04:44:16 +0000607 "lhz $rD, $src", LdStLoad,
Evan Cheng466685d2006-10-09 20:57:25 +0000608 [(set G8RC:$rD, (zextloadi16 iaddr:$src))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000609def LWZ8 : DForm_1<32, (outs G8RC:$rD), (ins memri:$src),
Hal Finkel20b529b2012-04-01 04:44:16 +0000610 "lwz $rD, $src", LdStLoad,
Evan Cheng466685d2006-10-09 20:57:25 +0000611 [(set G8RC:$rD, (zextloadi32 iaddr:$src))]>, isPPC64;
Chris Lattner518f9c72006-07-14 04:42:02 +0000612
Evan Cheng64d80e32007-07-19 01:14:50 +0000613def LBZX8 : XForm_1<31, 87, (outs G8RC:$rD), (ins memrr:$src),
Hal Finkel20b529b2012-04-01 04:44:16 +0000614 "lbzx $rD, $src", LdStLoad,
Evan Cheng466685d2006-10-09 20:57:25 +0000615 [(set G8RC:$rD, (zextloadi8 xaddr:$src))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000616def LHZX8 : XForm_1<31, 279, (outs G8RC:$rD), (ins memrr:$src),
Hal Finkel20b529b2012-04-01 04:44:16 +0000617 "lhzx $rD, $src", LdStLoad,
Evan Cheng466685d2006-10-09 20:57:25 +0000618 [(set G8RC:$rD, (zextloadi16 xaddr:$src))]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000619def LWZX8 : XForm_1<31, 23, (outs G8RC:$rD), (ins memrr:$src),
Hal Finkel20b529b2012-04-01 04:44:16 +0000620 "lwzx $rD, $src", LdStLoad,
Evan Cheng466685d2006-10-09 20:57:25 +0000621 [(set G8RC:$rD, (zextloadi32 xaddr:$src))]>;
Chris Lattner94e509c2006-11-10 23:58:45 +0000622
623
624// Update forms.
Dan Gohman41474ba2008-12-03 02:30:17 +0000625let mayLoad = 1 in {
Hal Finkela548afc2013-03-19 18:51:05 +0000626def LBZU8 : DForm_1<35, (outs G8RC:$rD, ptr_rc_nor0:$ea_result), (ins memri:$addr),
Hal Finkel8dc440a2012-08-28 02:49:14 +0000627 "lbzu $rD, $addr", LdStLoadUpd,
Chris Lattner8e28b5c2006-11-15 23:24:18 +0000628 []>, RegConstraint<"$addr.reg = $ea_result">,
629 NoEncode<"$ea_result">;
Hal Finkela548afc2013-03-19 18:51:05 +0000630def LHZU8 : DForm_1<41, (outs G8RC:$rD, ptr_rc_nor0:$ea_result), (ins memri:$addr),
Hal Finkel8dc440a2012-08-28 02:49:14 +0000631 "lhzu $rD, $addr", LdStLoadUpd,
Chris Lattner8e28b5c2006-11-15 23:24:18 +0000632 []>, RegConstraint<"$addr.reg = $ea_result">,
633 NoEncode<"$ea_result">;
Hal Finkela548afc2013-03-19 18:51:05 +0000634def LWZU8 : DForm_1<33, (outs G8RC:$rD, ptr_rc_nor0:$ea_result), (ins memri:$addr),
Hal Finkel8dc440a2012-08-28 02:49:14 +0000635 "lwzu $rD, $addr", LdStLoadUpd,
Chris Lattner8e28b5c2006-11-15 23:24:18 +0000636 []>, RegConstraint<"$addr.reg = $ea_result">,
637 NoEncode<"$ea_result">;
Hal Finkel0fcdd8b2012-06-20 15:43:03 +0000638
Hal Finkela548afc2013-03-19 18:51:05 +0000639def LBZUX8 : XForm_1<31, 119, (outs G8RC:$rD, ptr_rc_nor0:$ea_result),
Hal Finkel0fcdd8b2012-06-20 15:43:03 +0000640 (ins memrr:$addr),
Hal Finkel8dc440a2012-08-28 02:49:14 +0000641 "lbzux $rD, $addr", LdStLoadUpd,
Hal Finkel0fcdd8b2012-06-20 15:43:03 +0000642 []>, RegConstraint<"$addr.offreg = $ea_result">,
643 NoEncode<"$ea_result">;
Hal Finkela548afc2013-03-19 18:51:05 +0000644def LHZUX8 : XForm_1<31, 311, (outs G8RC:$rD, ptr_rc_nor0:$ea_result),
Hal Finkel0fcdd8b2012-06-20 15:43:03 +0000645 (ins memrr:$addr),
Hal Finkel8dc440a2012-08-28 02:49:14 +0000646 "lhzux $rD, $addr", LdStLoadUpd,
Hal Finkel0fcdd8b2012-06-20 15:43:03 +0000647 []>, RegConstraint<"$addr.offreg = $ea_result">,
648 NoEncode<"$ea_result">;
Hal Finkela548afc2013-03-19 18:51:05 +0000649def LWZUX8 : XForm_1<31, 55, (outs G8RC:$rD, ptr_rc_nor0:$ea_result),
Hal Finkel0fcdd8b2012-06-20 15:43:03 +0000650 (ins memrr:$addr),
Hal Finkel8dc440a2012-08-28 02:49:14 +0000651 "lwzux $rD, $addr", LdStLoadUpd,
Hal Finkel0fcdd8b2012-06-20 15:43:03 +0000652 []>, RegConstraint<"$addr.offreg = $ea_result">,
653 NoEncode<"$ea_result">;
Chris Lattner94e509c2006-11-10 23:58:45 +0000654}
Dan Gohman41474ba2008-12-03 02:30:17 +0000655}
Chris Lattner518f9c72006-07-14 04:42:02 +0000656
657
658// Full 8-byte loads.
Dan Gohman15511cf2008-12-03 18:15:48 +0000659let canFoldAsLoad = 1, PPC970_Unit = 2 in {
Evan Cheng64d80e32007-07-19 01:14:50 +0000660def LD : DSForm_1<58, 0, (outs G8RC:$rD), (ins memrix:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000661 "ld $rD, $src", LdStLD,
Hal Finkel08a215c2013-03-18 23:00:58 +0000662 [(set G8RC:$rD, (aligned4load ixaddr:$src))]>, isPPC64;
Bill Schmidt34a9d4b2012-11-27 17:35:46 +0000663def LDrs : DSForm_1<58, 0, (outs G8RC:$rD), (ins memrs:$src),
664 "ld $rD, $src", LdStLD,
665 []>, isPPC64;
666// The following three definitions are selected for small code model only.
667// Otherwise, we need to create two instructions to form a 32-bit offset,
668// so we have a custom matcher for TOC_ENTRY in PPCDAGToDAGIsel::Select().
Chris Lattnerab638642010-11-15 03:48:58 +0000669def LDtoc: Pseudo<(outs G8RC:$rD), (ins tocentry:$disp, G8RC:$reg),
Will Schmidt91638152012-10-04 18:14:28 +0000670 "#LDtoc",
Chris Lattnerab638642010-11-15 03:48:58 +0000671 [(set G8RC:$rD,
Tilmann Scheller6b16eff2009-08-15 11:54:46 +0000672 (PPCtoc_entry tglobaladdr:$disp, G8RC:$reg))]>, isPPC64;
Roman Divacky9fb8b492012-08-24 16:26:02 +0000673def LDtocJTI: Pseudo<(outs G8RC:$rD), (ins tocentry:$disp, G8RC:$reg),
Will Schmidt91638152012-10-04 18:14:28 +0000674 "#LDtocJTI",
Roman Divacky9fb8b492012-08-24 16:26:02 +0000675 [(set G8RC:$rD,
676 (PPCtoc_entry tjumptable:$disp, G8RC:$reg))]>, isPPC64;
677def LDtocCPT: Pseudo<(outs G8RC:$rD), (ins tocentry:$disp, G8RC:$reg),
Will Schmidt91638152012-10-04 18:14:28 +0000678 "#LDtocCPT",
Roman Divacky9fb8b492012-08-24 16:26:02 +0000679 [(set G8RC:$rD,
680 (PPCtoc_entry tconstpool:$disp, G8RC:$reg))]>, isPPC64;
Hal Finkel31610392012-02-24 17:54:01 +0000681
682let hasSideEffects = 1 in {
Adhemerval Zanella18560fa2012-10-25 14:29:13 +0000683let RST = 2, DS = 2 in
684def LDinto_toc: DSForm_1a<58, 0, (outs), (ins G8RC:$reg),
Tilmann Scheller3a84dae2009-12-18 13:00:15 +0000685 "ld 2, 8($reg)", LdStLD,
686 [(PPCload_toc G8RC:$reg)]>, isPPC64;
Chris Lattner142b5312010-11-14 22:48:15 +0000687
Adhemerval Zanella18560fa2012-10-25 14:29:13 +0000688let RST = 2, DS = 10, RA = 1 in
689def LDtoc_restore : DSForm_1a<58, 0, (outs), (ins),
Tilmann Scheller3a84dae2009-12-18 13:00:15 +0000690 "ld 2, 40(1)", LdStLD,
Chris Lattner6135a962010-11-14 22:22:59 +0000691 [(PPCtoc_restore)]>, isPPC64;
Hal Finkel31610392012-02-24 17:54:01 +0000692}
Evan Cheng64d80e32007-07-19 01:14:50 +0000693def LDX : XForm_1<31, 21, (outs G8RC:$rD), (ins memrr:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000694 "ldx $rD, $src", LdStLD,
695 [(set G8RC:$rD, (load xaddr:$src))]>, isPPC64;
Chris Lattner94e509c2006-11-10 23:58:45 +0000696
Dan Gohman41474ba2008-12-03 02:30:17 +0000697let mayLoad = 1 in
Hal Finkela548afc2013-03-19 18:51:05 +0000698def LDU : DSForm_1<58, 1, (outs G8RC:$rD, ptr_rc_nor0:$ea_result), (ins memrix:$addr),
Hal Finkel8dc440a2012-08-28 02:49:14 +0000699 "ldu $rD, $addr", LdStLDU,
Chris Lattner8e28b5c2006-11-15 23:24:18 +0000700 []>, RegConstraint<"$addr.reg = $ea_result">, isPPC64,
701 NoEncode<"$ea_result">;
Chris Lattner94e509c2006-11-10 23:58:45 +0000702
Hal Finkela548afc2013-03-19 18:51:05 +0000703def LDUX : XForm_1<31, 53, (outs G8RC:$rD, ptr_rc_nor0:$ea_result),
Hal Finkel0fcdd8b2012-06-20 15:43:03 +0000704 (ins memrr:$addr),
Hal Finkel8dc440a2012-08-28 02:49:14 +0000705 "ldux $rD, $addr", LdStLDU,
Hal Finkel0fcdd8b2012-06-20 15:43:03 +0000706 []>, RegConstraint<"$addr.offreg = $ea_result">,
707 NoEncode<"$ea_result">, isPPC64;
Chris Lattner956f43c2006-06-16 20:22:01 +0000708}
Chris Lattner518f9c72006-07-14 04:42:02 +0000709
Tilmann Scheller3a84dae2009-12-18 13:00:15 +0000710def : Pat<(PPCload ixaddr:$src),
711 (LD ixaddr:$src)>;
712def : Pat<(PPCload xaddr:$src),
713 (LDX xaddr:$src)>;
714
Bill Schmidt53b0b0e2013-02-21 17:12:27 +0000715// Support for medium and large code model.
Bill Schmidt34a9d4b2012-11-27 17:35:46 +0000716def ADDIStocHA: Pseudo<(outs G8RC:$rD), (ins G8RC:$reg, tocentry:$disp),
717 "#ADDIStocHA",
718 [(set G8RC:$rD,
719 (PPCaddisTocHA G8RC:$reg, tglobaladdr:$disp))]>,
720 isPPC64;
721def LDtocL: Pseudo<(outs G8RC:$rD), (ins tocentry:$disp, G8RC:$reg),
722 "#LDtocL",
723 [(set G8RC:$rD,
724 (PPCldTocL tglobaladdr:$disp, G8RC:$reg))]>, isPPC64;
725def ADDItocL: Pseudo<(outs G8RC:$rD), (ins G8RC:$reg, tocentry:$disp),
726 "#ADDItocL",
727 [(set G8RC:$rD,
728 (PPCaddiTocL G8RC:$reg, tglobaladdr:$disp))]>, isPPC64;
729
Bill Schmidtd7802bf2012-12-04 16:18:08 +0000730// Support for thread-local storage.
Bill Schmidtb453e162012-12-14 17:02:38 +0000731def ADDISgotTprelHA: Pseudo<(outs G8RC:$rD), (ins G8RC:$reg, symbolHi64:$disp),
732 "#ADDISgotTprelHA",
733 [(set G8RC:$rD,
734 (PPCaddisGotTprelHA G8RC:$reg,
735 tglobaltlsaddr:$disp))]>,
736 isPPC64;
737def LDgotTprelL: Pseudo<(outs G8RC:$rD), (ins symbolLo64:$disp, G8RC:$reg),
738 "#LDgotTprelL",
739 [(set G8RC:$rD,
740 (PPCldGotTprelL tglobaltlsaddr:$disp, G8RC:$reg))]>,
741 isPPC64;
Bill Schmidtd7802bf2012-12-04 16:18:08 +0000742def : Pat<(PPCaddTls G8RC:$in, tglobaltlsaddr:$g),
743 (ADD8TLS G8RC:$in, tglobaltlsaddr:$g)>;
Bill Schmidt57ac1f42012-12-11 20:30:11 +0000744def ADDIStlsgdHA: Pseudo<(outs G8RC:$rD), (ins G8RC:$reg, symbolHi64:$disp),
745 "#ADDIStlsgdHA",
746 [(set G8RC:$rD,
Bill Schmidt1e18b862012-12-13 20:57:10 +0000747 (PPCaddisTlsgdHA G8RC:$reg, tglobaltlsaddr:$disp))]>,
Bill Schmidt57ac1f42012-12-11 20:30:11 +0000748 isPPC64;
749def ADDItlsgdL : Pseudo<(outs G8RC:$rD), (ins G8RC:$reg, symbolLo64:$disp),
750 "#ADDItlsgdL",
751 [(set G8RC:$rD,
Bill Schmidt1e18b862012-12-13 20:57:10 +0000752 (PPCaddiTlsgdL G8RC:$reg, tglobaltlsaddr:$disp))]>,
Bill Schmidt57ac1f42012-12-11 20:30:11 +0000753 isPPC64;
754def GETtlsADDR : Pseudo<(outs G8RC:$rD), (ins G8RC:$reg, tlsgd:$sym),
755 "#GETtlsADDR",
756 [(set G8RC:$rD,
Bill Schmidt1e18b862012-12-13 20:57:10 +0000757 (PPCgetTlsAddr G8RC:$reg, tglobaltlsaddr:$sym))]>,
Bill Schmidt57ac1f42012-12-11 20:30:11 +0000758 isPPC64;
Bill Schmidt349c2782012-12-12 19:29:35 +0000759def ADDIStlsldHA: Pseudo<(outs G8RC:$rD), (ins G8RC:$reg, symbolHi64:$disp),
760 "#ADDIStlsldHA",
761 [(set G8RC:$rD,
Bill Schmidt1e18b862012-12-13 20:57:10 +0000762 (PPCaddisTlsldHA G8RC:$reg, tglobaltlsaddr:$disp))]>,
Bill Schmidt349c2782012-12-12 19:29:35 +0000763 isPPC64;
764def ADDItlsldL : Pseudo<(outs G8RC:$rD), (ins G8RC:$reg, symbolLo64:$disp),
765 "#ADDItlsldL",
766 [(set G8RC:$rD,
Bill Schmidt1e18b862012-12-13 20:57:10 +0000767 (PPCaddiTlsldL G8RC:$reg, tglobaltlsaddr:$disp))]>,
Bill Schmidt349c2782012-12-12 19:29:35 +0000768 isPPC64;
769def GETtlsldADDR : Pseudo<(outs G8RC:$rD), (ins G8RC:$reg, tlsgd:$sym),
770 "#GETtlsldADDR",
771 [(set G8RC:$rD,
Bill Schmidt1e18b862012-12-13 20:57:10 +0000772 (PPCgetTlsldAddr G8RC:$reg, tglobaltlsaddr:$sym))]>,
Bill Schmidt349c2782012-12-12 19:29:35 +0000773 isPPC64;
774def ADDISdtprelHA: Pseudo<(outs G8RC:$rD), (ins G8RC:$reg, symbolHi64:$disp),
775 "#ADDISdtprelHA",
776 [(set G8RC:$rD,
Bill Schmidt1e18b862012-12-13 20:57:10 +0000777 (PPCaddisDtprelHA G8RC:$reg,
778 tglobaltlsaddr:$disp))]>,
Bill Schmidt349c2782012-12-12 19:29:35 +0000779 isPPC64;
780def ADDIdtprelL : Pseudo<(outs G8RC:$rD), (ins G8RC:$reg, symbolLo64:$disp),
781 "#ADDIdtprelL",
782 [(set G8RC:$rD,
Bill Schmidt1e18b862012-12-13 20:57:10 +0000783 (PPCaddiDtprelL G8RC:$reg, tglobaltlsaddr:$disp))]>,
Bill Schmidt349c2782012-12-12 19:29:35 +0000784 isPPC64;
Bill Schmidtd7802bf2012-12-04 16:18:08 +0000785
Chris Lattner9c9fbf82008-01-06 05:53:26 +0000786let PPC970_Unit = 2 in {
Chris Lattner518f9c72006-07-14 04:42:02 +0000787// Truncating stores.
Evan Cheng64d80e32007-07-19 01:14:50 +0000788def STB8 : DForm_1<38, (outs), (ins G8RC:$rS, memri:$src),
Hal Finkel20b529b2012-04-01 04:44:16 +0000789 "stb $rS, $src", LdStStore,
Evan Cheng8b2794a2006-10-13 21:14:26 +0000790 [(truncstorei8 G8RC:$rS, iaddr:$src)]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000791def STH8 : DForm_1<44, (outs), (ins G8RC:$rS, memri:$src),
Hal Finkel20b529b2012-04-01 04:44:16 +0000792 "sth $rS, $src", LdStStore,
Evan Cheng8b2794a2006-10-13 21:14:26 +0000793 [(truncstorei16 G8RC:$rS, iaddr:$src)]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000794def STW8 : DForm_1<36, (outs), (ins G8RC:$rS, memri:$src),
Hal Finkel20b529b2012-04-01 04:44:16 +0000795 "stw $rS, $src", LdStStore,
Evan Cheng8b2794a2006-10-13 21:14:26 +0000796 [(truncstorei32 G8RC:$rS, iaddr:$src)]>;
Evan Cheng64d80e32007-07-19 01:14:50 +0000797def STBX8 : XForm_8<31, 215, (outs), (ins G8RC:$rS, memrr:$dst),
Hal Finkel20b529b2012-04-01 04:44:16 +0000798 "stbx $rS, $dst", LdStStore,
Evan Cheng8b2794a2006-10-13 21:14:26 +0000799 [(truncstorei8 G8RC:$rS, xaddr:$dst)]>,
Chris Lattner518f9c72006-07-14 04:42:02 +0000800 PPC970_DGroup_Cracked;
Evan Cheng64d80e32007-07-19 01:14:50 +0000801def STHX8 : XForm_8<31, 407, (outs), (ins G8RC:$rS, memrr:$dst),
Hal Finkel20b529b2012-04-01 04:44:16 +0000802 "sthx $rS, $dst", LdStStore,
Evan Cheng8b2794a2006-10-13 21:14:26 +0000803 [(truncstorei16 G8RC:$rS, xaddr:$dst)]>,
Chris Lattner518f9c72006-07-14 04:42:02 +0000804 PPC970_DGroup_Cracked;
Evan Cheng64d80e32007-07-19 01:14:50 +0000805def STWX8 : XForm_8<31, 151, (outs), (ins G8RC:$rS, memrr:$dst),
Hal Finkel20b529b2012-04-01 04:44:16 +0000806 "stwx $rS, $dst", LdStStore,
Evan Cheng8b2794a2006-10-13 21:14:26 +0000807 [(truncstorei32 G8RC:$rS, xaddr:$dst)]>,
Chris Lattner518f9c72006-07-14 04:42:02 +0000808 PPC970_DGroup_Cracked;
Chris Lattner80df01d2006-11-16 00:57:19 +0000809// Normal 8-byte stores.
Evan Cheng64d80e32007-07-19 01:14:50 +0000810def STD : DSForm_1<62, 0, (outs), (ins G8RC:$rS, memrix:$dst),
Chris Lattner80df01d2006-11-16 00:57:19 +0000811 "std $rS, $dst", LdStSTD,
Hal Finkel08a215c2013-03-18 23:00:58 +0000812 [(aligned4store G8RC:$rS, ixaddr:$dst)]>, isPPC64;
Evan Cheng64d80e32007-07-19 01:14:50 +0000813def STDX : XForm_8<31, 149, (outs), (ins G8RC:$rS, memrr:$dst),
Chris Lattner80df01d2006-11-16 00:57:19 +0000814 "stdx $rS, $dst", LdStSTD,
815 [(store G8RC:$rS, xaddr:$dst)]>, isPPC64,
816 PPC970_DGroup_Cracked;
Chris Lattner80df01d2006-11-16 00:57:19 +0000817// STD_32/STDX_32 - Just like STD/STDX, but uses a '32-bit' input register.
Evan Cheng64d80e32007-07-19 01:14:50 +0000818def STD_32 : DSForm_1<62, 0, (outs), (ins GPRC:$rT, memrix:$dst),
Chris Lattner80df01d2006-11-16 00:57:19 +0000819 "std $rT, $dst", LdStSTD,
820 [(PPCstd_32 GPRC:$rT, ixaddr:$dst)]>, isPPC64;
Evan Cheng64d80e32007-07-19 01:14:50 +0000821def STDX_32 : XForm_8<31, 149, (outs), (ins GPRC:$rT, memrr:$dst),
Chris Lattner80df01d2006-11-16 00:57:19 +0000822 "stdx $rT, $dst", LdStSTD,
823 [(PPCstd_32 GPRC:$rT, xaddr:$dst)]>, isPPC64,
824 PPC970_DGroup_Cracked;
Chris Lattner956f43c2006-06-16 20:22:01 +0000825}
826
Ulrich Weigand5882e3d2013-03-19 19:52:04 +0000827// Stores with Update (pre-inc).
828let PPC970_Unit = 2, mayStore = 1 in {
829def STBU8 : DForm_1<39, (outs ptr_rc_nor0:$ea_res), (ins G8RC:$rS, memri:$dst),
830 "stbu $rS, $dst", LdStStoreUpd, []>,
831 RegConstraint<"$dst.reg = $ea_res">, NoEncode<"$ea_res">;
832def STHU8 : DForm_1<45, (outs ptr_rc_nor0:$ea_res), (ins G8RC:$rS, memri:$dst),
833 "sthu $rS, $dst", LdStStoreUpd, []>,
834 RegConstraint<"$dst.reg = $ea_res">, NoEncode<"$ea_res">;
835def STWU8 : DForm_1<37, (outs ptr_rc_nor0:$ea_res), (ins G8RC:$rS, memri:$dst),
836 "stwu $rS, $dst", LdStStoreUpd, []>,
837 RegConstraint<"$dst.reg = $ea_res">, NoEncode<"$ea_res">;
838def STDU : DSForm_1<62, 1, (outs ptr_rc_nor0:$ea_res), (ins G8RC:$rS, memrix:$dst),
839 "stdu $rS, $dst", LdStSTDU, []>,
840 RegConstraint<"$dst.reg = $ea_res">, NoEncode<"$ea_res">,
841 isPPC64;
842
843def STBUX8: XForm_8<31, 247, (outs ptr_rc_nor0:$ea_res), (ins G8RC:$rS, memrr:$dst),
844 "stbux $rS, $dst", LdStStoreUpd, []>,
845 RegConstraint<"$dst.offreg = $ea_res">, NoEncode<"$ea_res">,
846 PPC970_DGroup_Cracked;
847def STHUX8: XForm_8<31, 439, (outs ptr_rc_nor0:$ea_res), (ins G8RC:$rS, memrr:$dst),
848 "sthux $rS, $dst", LdStStoreUpd, []>,
849 RegConstraint<"$dst.offreg = $ea_res">, NoEncode<"$ea_res">,
850 PPC970_DGroup_Cracked;
851def STWUX8: XForm_8<31, 183, (outs ptr_rc_nor0:$ea_res), (ins G8RC:$rS, memrr:$dst),
852 "stwux $rS, $dst", LdStStoreUpd, []>,
853 RegConstraint<"$dst.offreg = $ea_res">, NoEncode<"$ea_res">,
854 PPC970_DGroup_Cracked;
855def STDUX : XForm_8<31, 181, (outs ptr_rc_nor0:$ea_res), (ins G8RC:$rS, memrr:$dst),
856 "stdux $rS, $dst", LdStSTDU, []>,
857 RegConstraint<"$dst.offreg = $ea_res">, NoEncode<"$ea_res">,
858 PPC970_DGroup_Cracked, isPPC64;
859}
860
861// Patterns to match the pre-inc stores. We can't put the patterns on
862// the instruction definitions directly as ISel wants the address base
863// and offset to be separate operands, not a single complex operand.
864def : Pat<(pre_truncsti8 G8RC:$rS, ptr_rc_nor0:$ptrreg, iaddroff:$ptroff),
865 (STBU8 G8RC:$rS, iaddroff:$ptroff, ptr_rc_nor0:$ptrreg)>;
866def : Pat<(pre_truncsti16 G8RC:$rS, ptr_rc_nor0:$ptrreg, iaddroff:$ptroff),
867 (STHU8 G8RC:$rS, iaddroff:$ptroff, ptr_rc_nor0:$ptrreg)>;
868def : Pat<(pre_truncsti32 G8RC:$rS, ptr_rc_nor0:$ptrreg, iaddroff:$ptroff),
869 (STWU8 G8RC:$rS, iaddroff:$ptroff, ptr_rc_nor0:$ptrreg)>;
870def : Pat<(aligned4pre_store G8RC:$rS, ptr_rc_nor0:$ptrreg, iaddroff:$ptroff),
871 (STDU G8RC:$rS, iaddroff:$ptroff, ptr_rc_nor0:$ptrreg)>;
872
873def : Pat<(pre_truncsti8 G8RC:$rS, ptr_rc:$ptrreg, xaddroff:$ptroff),
874 (STBUX8 G8RC:$rS, xaddroff:$ptroff, ptr_rc:$ptrreg)>;
875def : Pat<(pre_truncsti16 G8RC:$rS, ptr_rc:$ptrreg, xaddroff:$ptroff),
876 (STHUX8 G8RC:$rS, xaddroff:$ptroff, ptr_rc:$ptrreg)>;
877def : Pat<(pre_truncsti32 G8RC:$rS, ptr_rc:$ptrreg, xaddroff:$ptroff),
878 (STWUX8 G8RC:$rS, xaddroff:$ptroff, ptr_rc:$ptrreg)>;
879def : Pat<(pre_store G8RC:$rS, ptr_rc:$ptrreg, xaddroff:$ptroff),
880 (STDUX G8RC:$rS, xaddroff:$ptroff, ptr_rc:$ptrreg)>;
Chris Lattner956f43c2006-06-16 20:22:01 +0000881
882
883//===----------------------------------------------------------------------===//
884// Floating point instructions.
885//
886
887
Dale Johannesenb384ab92008-10-29 18:26:45 +0000888let PPC970_Unit = 3, Uses = [RM] in { // FPU Operations.
Evan Cheng64d80e32007-07-19 01:14:50 +0000889def FCFID : XForm_26<63, 846, (outs F8RC:$frD), (ins F8RC:$frB),
Chris Lattner956f43c2006-06-16 20:22:01 +0000890 "fcfid $frD, $frB", FPGeneral,
891 [(set F8RC:$frD, (PPCfcfid F8RC:$frB))]>, isPPC64;
Evan Cheng64d80e32007-07-19 01:14:50 +0000892def FCTIDZ : XForm_26<63, 815, (outs F8RC:$frD), (ins F8RC:$frB),
Chris Lattner956f43c2006-06-16 20:22:01 +0000893 "fctidz $frD, $frB", FPGeneral,
894 [(set F8RC:$frD, (PPCfctidz F8RC:$frB))]>, isPPC64;
895}
896
897
898//===----------------------------------------------------------------------===//
899// Instruction Patterns
900//
Chris Lattner0ea70b22006-06-20 22:34:10 +0000901
Chris Lattner956f43c2006-06-16 20:22:01 +0000902// Extensions and truncates to/from 32-bit regs.
903def : Pat<(i64 (zext GPRC:$in)),
Hal Finkel0a3e33b2012-06-09 22:10:19 +0000904 (RLDICL (INSERT_SUBREG (i64 (IMPLICIT_DEF)), GPRC:$in, sub_32),
905 0, 32)>;
Chris Lattner956f43c2006-06-16 20:22:01 +0000906def : Pat<(i64 (anyext GPRC:$in)),
Hal Finkel0a3e33b2012-06-09 22:10:19 +0000907 (INSERT_SUBREG (i64 (IMPLICIT_DEF)), GPRC:$in, sub_32)>;
Chris Lattner956f43c2006-06-16 20:22:01 +0000908def : Pat<(i32 (trunc G8RC:$in)),
Hal Finkel0a3e33b2012-06-09 22:10:19 +0000909 (EXTRACT_SUBREG G8RC:$in, sub_32)>;
Chris Lattner956f43c2006-06-16 20:22:01 +0000910
Chris Lattner518f9c72006-07-14 04:42:02 +0000911// Extending loads with i64 targets.
Evan Cheng466685d2006-10-09 20:57:25 +0000912def : Pat<(zextloadi1 iaddr:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000913 (LBZ8 iaddr:$src)>;
Evan Cheng466685d2006-10-09 20:57:25 +0000914def : Pat<(zextloadi1 xaddr:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000915 (LBZX8 xaddr:$src)>;
Evan Cheng466685d2006-10-09 20:57:25 +0000916def : Pat<(extloadi1 iaddr:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000917 (LBZ8 iaddr:$src)>;
Evan Cheng466685d2006-10-09 20:57:25 +0000918def : Pat<(extloadi1 xaddr:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000919 (LBZX8 xaddr:$src)>;
Evan Cheng466685d2006-10-09 20:57:25 +0000920def : Pat<(extloadi8 iaddr:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000921 (LBZ8 iaddr:$src)>;
Evan Cheng466685d2006-10-09 20:57:25 +0000922def : Pat<(extloadi8 xaddr:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000923 (LBZX8 xaddr:$src)>;
Evan Cheng466685d2006-10-09 20:57:25 +0000924def : Pat<(extloadi16 iaddr:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000925 (LHZ8 iaddr:$src)>;
Evan Cheng466685d2006-10-09 20:57:25 +0000926def : Pat<(extloadi16 xaddr:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000927 (LHZX8 xaddr:$src)>;
Evan Cheng466685d2006-10-09 20:57:25 +0000928def : Pat<(extloadi32 iaddr:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000929 (LWZ8 iaddr:$src)>;
Evan Cheng466685d2006-10-09 20:57:25 +0000930def : Pat<(extloadi32 xaddr:$src),
Chris Lattner518f9c72006-07-14 04:42:02 +0000931 (LWZX8 xaddr:$src)>;
932
Chris Lattneraf8ee842008-03-07 20:18:24 +0000933// Standard shifts. These are represented separately from the real shifts above
934// so that we can distinguish between shifts that allow 6-bit and 7-bit shift
935// amounts.
936def : Pat<(sra G8RC:$rS, GPRC:$rB),
937 (SRAD G8RC:$rS, GPRC:$rB)>;
938def : Pat<(srl G8RC:$rS, GPRC:$rB),
939 (SRD G8RC:$rS, GPRC:$rB)>;
940def : Pat<(shl G8RC:$rS, GPRC:$rB),
941 (SLD G8RC:$rS, GPRC:$rB)>;
942
Chris Lattner956f43c2006-06-16 20:22:01 +0000943// SHL/SRL
Chris Lattner563ecfb2006-06-27 18:18:41 +0000944def : Pat<(shl G8RC:$in, (i32 imm:$imm)),
Chris Lattner956f43c2006-06-16 20:22:01 +0000945 (RLDICR G8RC:$in, imm:$imm, (SHL64 imm:$imm))>;
Chris Lattner563ecfb2006-06-27 18:18:41 +0000946def : Pat<(srl G8RC:$in, (i32 imm:$imm)),
Chris Lattner956f43c2006-06-16 20:22:01 +0000947 (RLDICL G8RC:$in, (SRL64 imm:$imm), imm:$imm)>;
Chris Lattnerf27bb6d2006-06-20 21:23:06 +0000948
Evan Cheng67c906d2007-09-04 20:20:29 +0000949// ROTL
950def : Pat<(rotl G8RC:$in, GPRC:$sh),
951 (RLDCL G8RC:$in, GPRC:$sh, 0)>;
952def : Pat<(rotl G8RC:$in, (i32 imm:$imm)),
953 (RLDICL G8RC:$in, imm:$imm, 0)>;
954
Chris Lattnerf27bb6d2006-06-20 21:23:06 +0000955// Hi and Lo for Darwin Global Addresses.
956def : Pat<(PPChi tglobaladdr:$in, 0), (LIS8 tglobaladdr:$in)>;
957def : Pat<(PPClo tglobaladdr:$in, 0), (LI8 tglobaladdr:$in)>;
958def : Pat<(PPChi tconstpool:$in , 0), (LIS8 tconstpool:$in)>;
959def : Pat<(PPClo tconstpool:$in , 0), (LI8 tconstpool:$in)>;
960def : Pat<(PPChi tjumptable:$in , 0), (LIS8 tjumptable:$in)>;
961def : Pat<(PPClo tjumptable:$in , 0), (LI8 tjumptable:$in)>;
Bob Wilson3d90dbe2009-11-04 21:31:18 +0000962def : Pat<(PPChi tblockaddress:$in, 0), (LIS8 tblockaddress:$in)>;
963def : Pat<(PPClo tblockaddress:$in, 0), (LI8 tblockaddress:$in)>;
Roman Divackyfd42ed62012-06-04 17:36:38 +0000964def : Pat<(PPChi tglobaltlsaddr:$g, G8RC:$in),
965 (ADDIS8 G8RC:$in, tglobaltlsaddr:$g)>;
966def : Pat<(PPClo tglobaltlsaddr:$g, G8RC:$in),
967 (ADDI8L G8RC:$in, tglobaltlsaddr:$g)>;
Chris Lattnerf27bb6d2006-06-20 21:23:06 +0000968def : Pat<(add G8RC:$in, (PPChi tglobaladdr:$g, 0)),
969 (ADDIS8 G8RC:$in, tglobaladdr:$g)>;
970def : Pat<(add G8RC:$in, (PPChi tconstpool:$g, 0)),
971 (ADDIS8 G8RC:$in, tconstpool:$g)>;
972def : Pat<(add G8RC:$in, (PPChi tjumptable:$g, 0)),
973 (ADDIS8 G8RC:$in, tjumptable:$g)>;
Bob Wilson3d90dbe2009-11-04 21:31:18 +0000974def : Pat<(add G8RC:$in, (PPChi tblockaddress:$g, 0)),
975 (ADDIS8 G8RC:$in, tblockaddress:$g)>;
Hal Finkel08a215c2013-03-18 23:00:58 +0000976
977// Patterns to match r+r indexed loads and stores for
978// addresses without at least 4-byte alignment.
979def : Pat<(i64 (unaligned4sextloadi32 xoaddr:$src)),
980 (LWAX xoaddr:$src)>;
981def : Pat<(i64 (unaligned4load xoaddr:$src)),
982 (LDX xoaddr:$src)>;
983def : Pat<(unaligned4store G8RC:$rS, xoaddr:$dst),
984 (STDX G8RC:$rS, xoaddr:$dst)>;
985