llvm.org GIT mirror llvm / 163d8ce
R600/SI: Refactor VOP3 instruction definitions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213571 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 5 years ago
2 changed file(s) with 54 addition(s) and 23 deletion(s). Raw diff Collapse all Expand all
5656 let hasSideEffects = 0;
5757 let UseNamedOperandTable = 1;
5858 let VOP3 = 1;
59
60 int Size = 8;
5961 }
6062
6163 //===----------------------------------------------------------------------===//
283283 int Subtarget = subtarget;
284284 }
285285
286 class VOP3_Pseudo pattern, string opName> :
287 VOP3Common ,
288 VOP ,
289 SIMCInstr {
290 let isPseudo = 1;
291 }
292
293 class VOP3_Real_si op, dag outs, dag ins, string asm, string opName> :
294 VOP3 ,
295 SIMCInstr;
296
286297 multiclass VOP3_m op, dag outs, dag ins, string asm, list pattern,
287298 string opName> {
288299
289 def "" : VOP3Common , VOP ,
290 SIMCInstr {
291 let isPseudo = 1;
292 }
293
294 def _si : VOP3 , SIMCInstr;
295
300 def "" : VOP3_Pseudo ;
301
302 def _si : VOP3_Real_si ;
303
304 }
305
306 multiclass VOP3_1_m op, dag outs, dag ins, string asm,
307 list pattern, string opName> {
308
309 def "" : VOP3_Pseudo ;
310
311 let src1 = 0, src1_modifiers = 0, src2 = 0, src2_modifiers = 0 in {
312
313 def _si : VOP3_Real_si <
314 {1, 1, op{6}, op{5}, op{4}, op{3}, op{2}, op{1}, op{0}},
315 outs, ins, asm, opName
316 >;
317
318 } // src1 = 0, src1_modifiers = 0, src2 = 0, src2_modifiers = 0
319 }
320
321 multiclass VOP3_2_m op, dag outs, dag ins, string asm,
322 list pattern, string opName, string revOp> {
323
324 def "" : VOP3_Pseudo ;
325
326 let src2 = 0, src2_modifiers = 0 in {
327
328 def _si : VOP3_Real_si <
329 {1, 0, 0, op{5}, op{4}, op{3}, op{2}, op{1}, op{0}},
330 outs, ins, asm, opName>,
331 VOP2_REV;
332
333 } // src2 = 0, src2_modifiers = 0
296334 }
297335
298336 // This must always be right before the operand being input modified.
308346 opName#"_e32 $dst, $src0", pattern
309347 >, VOP ;
310348
311 def _e64 : VOP3 <
312 {1, 1, op{6}, op{5}, op{4}, op{3}, op{2}, op{1}, op{0}},
349 defm _e64 : VOP3_1_m <
350 op,
313351 (outs drc:$dst),
314352 (ins InputMods:$src0_modifiers, src:$src0, i32imm:$clamp, i32imm:$omod),
315 opName#"_e64 $dst, $src0_modifiers, $clamp, $omod", []
316 >, VOP {
317 let src1 = 0;
318 let src1_modifiers = 0;
319 let src2 = 0;
320 let src2_modifiers = 0;
321 }
353 opName#"_e64 $dst, $src0_modifiers, $clamp, $omod", [], opName>;
322354 }
323355
324356 multiclass VOP1_32 op, string opName, list pattern>
340372 opName#"_e32 $dst, $src0, $src1", pattern
341373 >, VOP , VOP2_REV;
342374
343 def _e64 : VOP3 <
344 {1, 0, 0, op{5}, op{4}, op{3}, op{2}, op{1}, op{0}},
375 defm _e64 : VOP3_2_m <
376 op,
345377 (outs vrc:$dst),
346378 (ins InputMods:$src0_modifiers, arc:$src0,
347379 InputMods:$src1_modifiers, arc:$src1,
348380 i32imm:$clamp, i32imm:$omod),
349 opName#"_e64 $dst, $src0_modifiers, $src1_modifiers, $clamp, $omod", []
350 >, VOP , VOP2_REV {
351 let src2 = 0;
352 let src2_modifiers = 0;
353 }
381 opName#"_e64 $dst, $src0_modifiers, $src1_modifiers, $clamp, $omod", [],
382 opName, revOp>;
354383 }
355384
356385 multiclass VOP2_32 op, string opName, list pattern,