diff options
| author | Misha Brukman <brukman+llvm@gmail.com> | 2003-05-31 04:22:26 +0000 | 
|---|---|---|
| committer | Misha Brukman <brukman+llvm@gmail.com> | 2003-05-31 04:22:26 +0000 | 
| commit | 87cbd97710c20b3b19bb0a52bcc2381572b6fea7 (patch) | |
| tree | 9df8ad5d5cb33ad58a99461cb46cc95bab98c2ca /llvm/lib | |
| parent | 1656f61b93412834edbc19d314d96a7c05a70fef (diff) | |
| download | bcm5719-llvm-87cbd97710c20b3b19bb0a52bcc2381572b6fea7.tar.gz bcm5719-llvm-87cbd97710c20b3b19bb0a52bcc2381572b6fea7.zip | |
The actual order of parameters in a 2-reg-immediate assembly instructions is
"rs1, imm, rd": most importantly, rd goes last.
llvm-svn: 6456
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/Sparc/SparcV9_F3.td | 36 | 
1 files changed, 34 insertions, 2 deletions
| diff --git a/llvm/lib/Target/Sparc/SparcV9_F3.td b/llvm/lib/Target/Sparc/SparcV9_F3.td index d639ed58c9e..5083dad70ed 100644 --- a/llvm/lib/Target/Sparc/SparcV9_F3.td +++ b/llvm/lib/Target/Sparc/SparcV9_F3.td @@ -56,17 +56,47 @@ class F3_rs1rs2 : F3_rs1 {    set Inst{4-0} = rs2;  } +// F3_rs1rs2 - Common class of instructions that only have rs1 and rs2 fields +class F3_rs1rs2rd : F3_rs1rs2 { +  bits<5> rd; +  set Inst{29-25} = rd; +  set Inst{4-0} = rs2; +} +  // F3_rs1simm13 - Common class of instructions that only have rs1 and simm13  class F3_rs1simm13 : F3_rs1 {    bits<13> simm13;    set Inst{12-0} = simm13;  } +class F3_rs1simm13rd : F3_rs1simm13 { +  bits<5> rd; +  set Inst{29-25} = rd; +} +  // Specific F3 classes...  // -class F3_1<bits<2> opVal, bits<6> op3val, string name> : F3_rdrs1rs2 { +class F3_1<bits<2> opVal, bits<6> op3val, string name> : F3_rs1rs2rd { +  set op  = opVal; +  set op3 = op3val; +  set Name = name; +  set Inst{13} = 0;   // i field = 0 +  //set Inst{12-5} = dontcare; +} + +class F3_2<bits<2> opVal, bits<6> op3val, string name> : F3_rs1simm13rd { +  set op  = opVal; +  set op3 = op3val; +  set Name = name; +  set Inst{13} = 1;   // i field = 1 +} + +#if 0 +// The ordering is actually incorrect in these: in the assemble syntax, +// rd appears last! +class F3_1a<bits<2> opVal, bits<6> op3val, string name> : F3_rdrs1rs2 {    set op  = opVal;    set op3 = op3val;    set Name = name; @@ -74,12 +104,14 @@ class F3_1<bits<2> opVal, bits<6> op3val, string name> : F3_rdrs1rs2 {    //set Inst{12-5} = dontcare;  } -class F3_2<bits<2> opVal, bits<6> op3val, string name> : F3_rdsimm13rs1 { +class F3_2a<bits<2> opVal, bits<6> op3val, string name> : F3_rdsimm13rs1 {    set op  = opVal;    set op3 = op3val;    set Name = name;    set Inst{13} = 1;   // i field = 1  } +#endif +  class F3_3<bits<2> opVal, bits<6> op3val, string name> : F3_rs1rs2 {    set op   = opVal; | 

