From fbdd3181201434598ed2cc91ba2ef37e11aae175 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mon, 20 May 2013 15:02:08 +0000 Subject: [PATCH] R600/SI: Use the same names for VOP3 operands and encoding fields MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This makes it possible to reorder the operands without breaking the encoding. Reviewed-by: Michel Dänzer git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182283 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/R600/SIInstrFormats.td | 62 +++++++++++++++---------------- lib/Target/R600/SIInstrInfo.td | 12 +++--- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/lib/Target/R600/SIInstrFormats.td b/lib/Target/R600/SIInstrFormats.td index f737ddd2807..51f323d88ae 100644 --- a/lib/Target/R600/SIInstrFormats.td +++ b/lib/Target/R600/SIInstrFormats.td @@ -185,25 +185,25 @@ class VOP2 op, dag outs, dag ins, string asm, list pattern> : class VOP3 op, dag outs, dag ins, string asm, list pattern> : Enc64 { - bits<8> VDST; - bits<9> SRC0; - bits<9> SRC1; - bits<9> SRC2; - bits<3> ABS; - bits<1> CLAMP; - bits<2> OMOD; - bits<3> NEG; - - let Inst{7-0} = VDST; - let Inst{10-8} = ABS; - let Inst{11} = CLAMP; + bits<8> dst; + bits<9> src0; + bits<9> src1; + bits<9> src2; + bits<3> abs; + bits<1> clamp; + bits<2> omod; + bits<3> neg; + + let Inst{7-0} = dst; + let Inst{10-8} = abs; + let Inst{11} = clamp; let Inst{25-17} = op; let Inst{31-26} = 0x34; //encoding - let Inst{40-32} = SRC0; - let Inst{49-41} = SRC1; - let Inst{58-50} = SRC2; - let Inst{60-59} = OMOD; - let Inst{63-61} = NEG; + let Inst{40-32} = src0; + let Inst{49-41} = src1; + let Inst{58-50} = src2; + let Inst{60-59} = omod; + let Inst{63-61} = neg; let mayLoad = 0; let mayStore = 0; @@ -213,23 +213,23 @@ class VOP3 op, dag outs, dag ins, string asm, list pattern> : class VOP3b op, dag outs, dag ins, string asm, list pattern> : Enc64 { - bits<8> VDST; - bits<9> SRC0; - bits<9> SRC1; - bits<9> SRC2; - bits<7> SDST; - bits<2> OMOD; - bits<3> NEG; + bits<8> dst; + bits<9> src0; + bits<9> src1; + bits<9> src2; + bits<7> sdst; + bits<2> omod; + bits<3> neg; - let Inst{7-0} = VDST; - let Inst{14-8} = SDST; + let Inst{7-0} = dst; + let Inst{14-8} = sdst; let Inst{25-17} = op; let Inst{31-26} = 0x34; //encoding - let Inst{40-32} = SRC0; - let Inst{49-41} = SRC1; - let Inst{58-50} = SRC2; - let Inst{60-59} = OMOD; - let Inst{63-61} = NEG; + let Inst{40-32} = src0; + let Inst{49-41} = src1; + let Inst{58-50} = src2; + let Inst{60-59} = omod; + let Inst{63-61} = neg; let mayLoad = 0; let mayStore = 0; diff --git a/lib/Target/R600/SIInstrInfo.td b/lib/Target/R600/SIInstrInfo.td index c8aecb707ee..11c8f9df916 100644 --- a/lib/Target/R600/SIInstrInfo.td +++ b/lib/Target/R600/SIInstrInfo.td @@ -163,8 +163,8 @@ multiclass VOP1_Helper op, RegisterClass drc, RegisterClass src, i32imm:$omod, i32imm:$neg), opName#"_e64 $dst, $src0, $abs, $clamp, $omod, $neg", [] >, VOP { - let SRC1 = SIOperand.ZERO; - let SRC2 = SIOperand.ZERO; + let src1 = SIOperand.ZERO; + let src2 = SIOperand.ZERO; } } @@ -189,7 +189,7 @@ multiclass VOP2_Helper op, RegisterClass vrc, RegisterClass arc, i32imm:$omod, i32imm:$neg), opName#"_e64 $dst, $src0, $src1, $abs, $clamp, $omod, $neg", [] >, VOP , VOP2_REV { - let SRC2 = SIOperand.ZERO; + let src2 = SIOperand.ZERO; } } @@ -217,11 +217,11 @@ multiclass VOP2b_32 op, string opName, list pattern, i32imm:$omod, i32imm:$neg), opName#"_e64 $dst, $src0, $src1, $abs, $clamp, $omod, $neg", [] >, VOP , VOP2_REV { - let SRC2 = SIOperand.ZERO; + let src2 = SIOperand.ZERO; /* the VOP2 variant puts the carry out into VCC, the VOP3 variant can write it into any SGPR. We currently don't use the carry out, so for now hardcode it to VCC as well */ - let SDST = SIOperand.VCC; + let sdst = SIOperand.VCC; } } @@ -244,7 +244,7 @@ multiclass VOPC_Helper op, RegisterClass vrc, RegisterClass arc, [(set SReg_64:$dst, (i1 (setcc (vt arc:$src0), arc:$src1, cond)))] ) >, VOP { - let SRC2 = SIOperand.ZERO; + let src2 = SIOperand.ZERO; } } -- 2.40.0