diff options
| author | Michel Danzer <michel.daenzer@amd.com> | 2013-02-14 19:03:25 +0000 |
|---|---|---|
| committer | Michel Danzer <michel.daenzer@amd.com> | 2013-02-14 19:03:25 +0000 |
| commit | e9bb18b555f954dd2128e4e5bf6f2ac8bd5f052b (patch) | |
| tree | fb859dfab86ae09790315c3ab5f8bb3a39d88b15 /llvm/lib/Target/R600/InstPrinter | |
| parent | c35cfa91a8bbb152095ce3eb3691da481f34ecb1 (diff) | |
| download | bcm5719-llvm-e9bb18b555f954dd2128e4e5bf6f2ac8bd5f052b.tar.gz bcm5719-llvm-e9bb18b555f954dd2128e4e5bf6f2ac8bd5f052b.zip | |
R600/SI: Fix int_SI_fs_interp_constant
The important fix is that the constant interpolation value is stored in the
parameter slot P0, which is encoded as 2.
In addition, drop the SI_INTERP_CONST pseudo instruction, pass the parameter
slot as an operand to V_INTERP_MOV_F32 instead of hardcoding it there, and
add a special operand class for the parameter slots for type checking and
pretty printing.
NOTE: This is a candidate for the Mesa stable branch.
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 175193
Diffstat (limited to 'llvm/lib/Target/R600/InstPrinter')
| -rw-r--r-- | llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp | 15 | ||||
| -rw-r--r-- | llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp b/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp index fb17ab7ddf4..d6450a0fab9 100644 --- a/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp +++ b/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp @@ -40,6 +40,21 @@ void AMDGPUInstPrinter::printOperand(const MCInst *MI, unsigned OpNo, } } +void AMDGPUInstPrinter::printInterpSlot(const MCInst *MI, unsigned OpNum, + raw_ostream &O) { + unsigned Imm = MI->getOperand(OpNum).getImm(); + + if (Imm == 2) { + O << "P0"; + } else if (Imm == 1) { + O << "P20"; + } else if (Imm == 0) { + O << "P10"; + } else { + assert(!"Invalid interpolation parameter slot"); + } +} + void AMDGPUInstPrinter::printMemOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) { printOperand(MI, OpNo, O); diff --git a/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h b/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h index e775c4c82e7..767a7082cc2 100644 --- a/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h +++ b/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h @@ -33,6 +33,7 @@ public: private: void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O); + void printInterpSlot(const MCInst *MI, unsigned OpNum, raw_ostream &O); void printMemOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O); void printIfSet(const MCInst *MI, unsigned OpNo, raw_ostream &O, StringRef Asm); void printAbs(const MCInst *MI, unsigned OpNo, raw_ostream &O); |

