2 * Copyright 2012 Christoph Bumiller
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
23 #include "codegen/nv50_ir_target_nvc0.h"
25 // CodeEmitter for GK110 encoding of the Fermi/Kepler ISA.
29 class CodeEmitterGK110
: public CodeEmitter
32 CodeEmitterGK110(const TargetNVC0
*);
34 virtual bool emitInstruction(Instruction
*);
35 virtual uint32_t getMinEncodingSize(const Instruction
*) const;
36 virtual void prepareEmission(Function
*);
38 inline void setProgramType(Program::Type pType
) { progType
= pType
; }
41 const TargetNVC0
*targNVC0
;
43 Program::Type progType
;
45 const bool writeIssueDelays
;
48 void emitForm_21(const Instruction
*, uint32_t opc2
, uint32_t opc1
);
49 void emitForm_C(const Instruction
*, uint32_t opc
, uint8_t ctg
);
50 void emitForm_L(const Instruction
*, uint32_t opc
, uint8_t ctg
, Modifier
);
52 void emitPredicate(const Instruction
*);
54 void setCAddress14(const ValueRef
&);
55 void setShortImmediate(const Instruction
*, const int s
);
56 void setImmediate32(const Instruction
*, const int s
, Modifier
);
58 void modNegAbsF32_3b(const Instruction
*, const int s
);
60 void emitCondCode(CondCode cc
, int pos
, uint8_t mask
);
61 void emitInterpMode(const Instruction
*);
62 void emitLoadStoreType(DataType ty
, const int pos
);
63 void emitCachingMode(CacheMode c
, const int pos
);
65 inline uint8_t getSRegEncoding(const ValueRef
&);
67 void emitRoundMode(RoundMode
, const int pos
, const int rintPos
);
68 void emitRoundModeF(RoundMode
, const int pos
);
69 void emitRoundModeI(RoundMode
, const int pos
);
71 void emitNegAbs12(const Instruction
*);
73 void emitNOP(const Instruction
*);
75 void emitLOAD(const Instruction
*);
76 void emitSTORE(const Instruction
*);
77 void emitMOV(const Instruction
*);
79 void emitINTERP(const Instruction
*);
80 void emitAFETCH(const Instruction
*);
81 void emitPFETCH(const Instruction
*);
82 void emitVFETCH(const Instruction
*);
83 void emitEXPORT(const Instruction
*);
84 void emitOUT(const Instruction
*);
86 void emitUADD(const Instruction
*);
87 void emitFADD(const Instruction
*);
88 void emitDADD(const Instruction
*);
89 void emitIMUL(const Instruction
*);
90 void emitFMUL(const Instruction
*);
91 void emitDMUL(const Instruction
*);
92 void emitIMAD(const Instruction
*);
93 void emitISAD(const Instruction
*);
94 void emitFMAD(const Instruction
*);
95 void emitDMAD(const Instruction
*);
97 void emitNOT(const Instruction
*);
98 void emitLogicOp(const Instruction
*, uint8_t subOp
);
99 void emitPOPC(const Instruction
*);
100 void emitINSBF(const Instruction
*);
101 void emitEXTBF(const Instruction
*);
102 void emitBFIND(const Instruction
*);
103 void emitShift(const Instruction
*);
105 void emitSFnOp(const Instruction
*, uint8_t subOp
);
107 void emitCVT(const Instruction
*);
108 void emitMINMAX(const Instruction
*);
109 void emitPreOp(const Instruction
*);
111 void emitSET(const CmpInstruction
*);
112 void emitSLCT(const CmpInstruction
*);
113 void emitSELP(const Instruction
*);
115 void emitTEXBAR(const Instruction
*);
116 void emitTEX(const TexInstruction
*);
117 void emitTEXCSAA(const TexInstruction
*);
118 void emitTXQ(const TexInstruction
*);
120 void emitQUADOP(const Instruction
*, uint8_t qOp
, uint8_t laneMask
);
122 void emitPIXLD(const Instruction
*);
124 void emitBAR(const Instruction
*);
126 void emitFlow(const Instruction
*);
128 inline void defId(const ValueDef
&, const int pos
);
129 inline void srcId(const ValueRef
&, const int pos
);
130 inline void srcId(const ValueRef
*, const int pos
);
131 inline void srcId(const Instruction
*, int s
, const int pos
);
133 inline void srcAddr32(const ValueRef
&, const int pos
); // address / 4
135 inline bool isLIMM(const ValueRef
&, DataType ty
, bool mod
= false);
138 #define GK110_GPR_ZERO 255
141 if (i->src(s).mod.neg()) code[(0x##b) / 32] |= 1 << ((0x##b) % 32)
143 if (i->src(s).mod.abs()) code[(0x##b) / 32] |= 1 << ((0x##b) % 32)
145 #define NOT_(b, s) if (i->src(s).mod & Modifier(NV50_IR_MOD_NOT)) \
146 code[(0x##b) / 32] |= 1 << ((0x##b) % 32)
148 #define FTZ_(b) if (i->ftz) code[(0x##b) / 32] |= 1 << ((0x##b) % 32)
149 #define DNZ_(b) if (i->dnz) code[(0x##b) / 32] |= 1 << ((0x##b) % 32)
151 #define SAT_(b) if (i->saturate) code[(0x##b) / 32] |= 1 << ((0x##b) % 32)
153 #define RND_(b, t) emitRoundMode##t(i->rnd, 0x##b)
155 #define SDATA(a) ((a).rep()->reg.data)
156 #define DDATA(a) ((a).rep()->reg.data)
158 void CodeEmitterGK110::srcId(const ValueRef
& src
, const int pos
)
160 code
[pos
/ 32] |= (src
.get() ? SDATA(src
).id
: GK110_GPR_ZERO
) << (pos
% 32);
163 void CodeEmitterGK110::srcId(const ValueRef
*src
, const int pos
)
165 code
[pos
/ 32] |= (src
? SDATA(*src
).id
: GK110_GPR_ZERO
) << (pos
% 32);
168 void CodeEmitterGK110::srcId(const Instruction
*insn
, int s
, int pos
)
170 int r
= insn
->srcExists(s
) ? SDATA(insn
->src(s
)).id
: GK110_GPR_ZERO
;
171 code
[pos
/ 32] |= r
<< (pos
% 32);
174 void CodeEmitterGK110::srcAddr32(const ValueRef
& src
, const int pos
)
176 code
[pos
/ 32] |= (SDATA(src
).offset
>> 2) << (pos
% 32);
179 void CodeEmitterGK110::defId(const ValueDef
& def
, const int pos
)
181 code
[pos
/ 32] |= (def
.get() ? DDATA(def
).id
: GK110_GPR_ZERO
) << (pos
% 32);
184 bool CodeEmitterGK110::isLIMM(const ValueRef
& ref
, DataType ty
, bool mod
)
186 const ImmediateValue
*imm
= ref
.get()->asImm();
188 return imm
&& (imm
->reg
.data
.u32
& ((ty
== TYPE_F32
) ? 0xfff : 0xfff00000));
192 CodeEmitterGK110::emitRoundMode(RoundMode rnd
, const int pos
, const int rintPos
)
198 case ROUND_MI
: rint
= true; /* fall through */ case ROUND_M
: n
= 1; break;
199 case ROUND_PI
: rint
= true; /* fall through */ case ROUND_P
: n
= 2; break;
200 case ROUND_ZI
: rint
= true; /* fall through */ case ROUND_Z
: n
= 3; break;
202 rint
= rnd
== ROUND_NI
;
204 assert(rnd
== ROUND_N
|| rnd
== ROUND_NI
);
207 code
[pos
/ 32] |= n
<< (pos
% 32);
208 if (rint
&& rintPos
>= 0)
209 code
[rintPos
/ 32] |= 1 << (rintPos
% 32);
213 CodeEmitterGK110::emitRoundModeF(RoundMode rnd
, const int pos
)
218 case ROUND_M
: n
= 1; break;
219 case ROUND_P
: n
= 2; break;
220 case ROUND_Z
: n
= 3; break;
223 assert(rnd
== ROUND_N
);
226 code
[pos
/ 32] |= n
<< (pos
% 32);
230 CodeEmitterGK110::emitRoundModeI(RoundMode rnd
, const int pos
)
235 case ROUND_MI
: n
= 1; break;
236 case ROUND_PI
: n
= 2; break;
237 case ROUND_ZI
: n
= 3; break;
240 assert(rnd
== ROUND_NI
);
243 code
[pos
/ 32] |= n
<< (pos
% 32);
246 void CodeEmitterGK110::emitCondCode(CondCode cc
, int pos
, uint8_t mask
)
251 case CC_FL
: n
= 0x00; break;
252 case CC_LT
: n
= 0x01; break;
253 case CC_EQ
: n
= 0x02; break;
254 case CC_LE
: n
= 0x03; break;
255 case CC_GT
: n
= 0x04; break;
256 case CC_NE
: n
= 0x05; break;
257 case CC_GE
: n
= 0x06; break;
258 case CC_LTU
: n
= 0x09; break;
259 case CC_EQU
: n
= 0x0a; break;
260 case CC_LEU
: n
= 0x0b; break;
261 case CC_GTU
: n
= 0x0c; break;
262 case CC_NEU
: n
= 0x0d; break;
263 case CC_GEU
: n
= 0x0e; break;
264 case CC_TR
: n
= 0x0f; break;
265 case CC_NO
: n
= 0x10; break;
266 case CC_NC
: n
= 0x11; break;
267 case CC_NS
: n
= 0x12; break;
268 case CC_NA
: n
= 0x13; break;
269 case CC_A
: n
= 0x14; break;
270 case CC_S
: n
= 0x15; break;
271 case CC_C
: n
= 0x16; break;
272 case CC_O
: n
= 0x17; break;
275 assert(!"invalid condition code");
278 code
[pos
/ 32] |= (n
& mask
) << (pos
% 32);
282 CodeEmitterGK110::emitPredicate(const Instruction
*i
)
284 if (i
->predSrc
>= 0) {
285 srcId(i
->src(i
->predSrc
), 18);
286 if (i
->cc
== CC_NOT_P
)
287 code
[0] |= 8 << 18; // negate
288 assert(i
->getPredicate()->reg
.file
== FILE_PREDICATE
);
295 CodeEmitterGK110::setCAddress14(const ValueRef
& src
)
297 const Storage
& res
= src
.get()->asSym()->reg
;
298 const int32_t addr
= res
.data
.offset
/ 4;
300 code
[0] |= (addr
& 0x01ff) << 23;
301 code
[1] |= (addr
& 0x3e00) >> 9;
302 code
[1] |= res
.fileIndex
<< 5;
306 CodeEmitterGK110::setShortImmediate(const Instruction
*i
, const int s
)
308 const uint32_t u32
= i
->getSrc(s
)->asImm()->reg
.data
.u32
;
309 const uint64_t u64
= i
->getSrc(s
)->asImm()->reg
.data
.u64
;
311 if (i
->sType
== TYPE_F32
) {
312 assert(!(u32
& 0x00000fff));
313 code
[0] |= ((u32
& 0x001ff000) >> 12) << 23;
314 code
[1] |= ((u32
& 0x7fe00000) >> 21);
315 code
[1] |= ((u32
& 0x80000000) >> 4);
317 if (i
->sType
== TYPE_F64
) {
318 assert(!(u64
& 0x00000fffffffffffULL
));
319 code
[0] |= ((u64
& 0x001ff00000000000ULL
) >> 44) << 23;
320 code
[1] |= ((u64
& 0x7fe0000000000000ULL
) >> 53);
321 code
[1] |= ((u64
& 0x8000000000000000ULL
) >> 36);
323 assert((u32
& 0xfff00000) == 0 || (u32
& 0xfff00000) == 0xfff00000);
324 code
[0] |= (u32
& 0x001ff) << 23;
325 code
[1] |= (u32
& 0x7fe00) >> 9;
326 code
[1] |= (u32
& 0x80000) << 8;
331 CodeEmitterGK110::setImmediate32(const Instruction
*i
, const int s
,
334 uint32_t u32
= i
->getSrc(s
)->asImm()->reg
.data
.u32
;
337 ImmediateValue
imm(i
->getSrc(s
)->asImm(), i
->sType
);
339 u32
= imm
.reg
.data
.u32
;
342 code
[0] |= u32
<< 23;
347 CodeEmitterGK110::emitForm_L(const Instruction
*i
, uint32_t opc
, uint8_t ctg
,
357 for (int s
= 0; s
< 3 && i
->srcExists(s
); ++s
) {
358 switch (i
->src(s
).getFile()) {
360 srcId(i
->src(s
), s
? 42 : 10);
363 setImmediate32(i
, s
, mod
);
373 CodeEmitterGK110::emitForm_C(const Instruction
*i
, uint32_t opc
, uint8_t ctg
)
382 switch (i
->src(0).getFile()) {
383 case FILE_MEMORY_CONST
:
384 code
[1] |= 0x4 << 28;
385 setCAddress14(i
->src(0));
388 code
[1] |= 0xc << 28;
389 srcId(i
->src(0), 23);
397 // 0x2 for GPR, c[] and 0x1 for short immediate
399 CodeEmitterGK110::emitForm_21(const Instruction
*i
, uint32_t opc2
,
402 const bool imm
= i
->srcExists(1) && i
->src(1).getFile() == FILE_IMMEDIATE
;
405 if (i
->srcExists(2) && i
->src(2).getFile() == FILE_MEMORY_CONST
)
410 code
[1] = opc1
<< 20;
413 code
[1] = (0xc << 28) | (opc2
<< 20);
420 for (int s
= 0; s
< 3 && i
->srcExists(s
); ++s
) {
421 switch (i
->src(s
).getFile()) {
422 case FILE_MEMORY_CONST
:
423 code
[1] &= (s
== 2) ? ~(0x4 << 28) : ~(0x8 << 28);
424 setCAddress14(i
->src(s
));
427 setShortImmediate(i
, s
);
430 srcId(i
->src(s
), s
? ((s
== 2) ? 42 : s1
) : 10);
433 // ignore here, can be predicate or flags, but must not be address
441 assert(imm
|| (code
[1] & (0xc << 28)));
445 CodeEmitterGK110::modNegAbsF32_3b(const Instruction
*i
, const int s
)
447 if (i
->src(s
).mod
.abs()) code
[1] &= ~(1 << 27);
448 if (i
->src(s
).mod
.neg()) code
[1] ^= (1 << 27);
452 CodeEmitterGK110::emitNOP(const Instruction
*i
)
454 code
[0] = 0x00003c02;
455 code
[1] = 0x85800000;
460 code
[0] = 0x001c3c02;
464 CodeEmitterGK110::emitFMAD(const Instruction
*i
)
466 assert(!isLIMM(i
->src(1), TYPE_F32
));
468 emitForm_21(i
, 0x0c0, 0x940);
476 bool neg1
= (i
->src(0).mod
^ i
->src(1).mod
).neg();
488 CodeEmitterGK110::emitDMAD(const Instruction
*i
)
490 assert(!i
->saturate
);
493 emitForm_21(i
, 0x1b8, 0xb38);
498 bool neg1
= (i
->src(0).mod
^ i
->src(1).mod
).neg();
510 CodeEmitterGK110::emitFMUL(const Instruction
*i
)
512 bool neg
= (i
->src(0).mod
^ i
->src(1).mod
).neg();
514 assert(i
->postFactor
>= -3 && i
->postFactor
<= 3);
516 if (isLIMM(i
->src(1), TYPE_F32
)) {
517 emitForm_L(i
, 0x200, 0x2, Modifier(0));
525 assert(i
->postFactor
== 0);
527 emitForm_21(i
, 0x234, 0xc34);
528 code
[1] |= ((i
->postFactor
> 0) ?
529 (7 - i
->postFactor
) : (0 - i
->postFactor
)) << 12;
547 CodeEmitterGK110::emitDMUL(const Instruction
*i
)
549 bool neg
= (i
->src(0).mod
^ i
->src(1).mod
).neg();
551 assert(!i
->postFactor
);
552 assert(!i
->saturate
);
556 emitForm_21(i
, 0x240, 0xc40);
570 CodeEmitterGK110::emitIMUL(const Instruction
*i
)
572 assert(!i
->src(0).mod
.neg() && !i
->src(1).mod
.neg());
573 assert(!i
->src(0).mod
.abs() && !i
->src(1).mod
.abs());
575 if (isLIMM(i
->src(1), TYPE_S32
)) {
576 emitForm_L(i
, 0x280, 2, Modifier(0));
578 assert(i
->subOp
!= NV50_IR_SUBOP_MUL_HIGH
);
580 if (i
->sType
== TYPE_S32
)
583 emitForm_21(i
, 0x21c, 0xc1c);
585 if (i
->subOp
== NV50_IR_SUBOP_MUL_HIGH
)
587 if (i
->sType
== TYPE_S32
)
593 CodeEmitterGK110::emitFADD(const Instruction
*i
)
595 if (isLIMM(i
->src(1), TYPE_F32
)) {
596 assert(i
->rnd
== ROUND_N
);
597 assert(!i
->saturate
);
599 Modifier mod
= i
->src(1).mod
^
600 Modifier(i
->op
== OP_SUB
? NV50_IR_MOD_NEG
: 0);
602 emitForm_L(i
, 0x400, 0, mod
);
608 emitForm_21(i
, 0x22c, 0xc2c);
617 modNegAbsF32_3b(i
, 1);
618 if (i
->op
== OP_SUB
) code
[1] ^= 1 << 27;
622 if (i
->op
== OP_SUB
) code
[1] ^= 1 << 16;
628 CodeEmitterGK110::emitDADD(const Instruction
*i
)
630 assert(!i
->saturate
);
633 emitForm_21(i
, 0x238, 0xc38);
638 modNegAbsF32_3b(i
, 1);
639 if (i
->op
== OP_SUB
) code
[1] ^= 1 << 27;
643 if (i
->op
== OP_SUB
) code
[1] ^= 1 << 16;
648 CodeEmitterGK110::emitUADD(const Instruction
*i
)
650 uint8_t addOp
= (i
->src(0).mod
.neg() << 1) | i
->src(1).mod
.neg();
655 assert(!i
->src(0).mod
.abs() && !i
->src(1).mod
.abs());
657 if (isLIMM(i
->src(1), TYPE_S32
)) {
658 emitForm_L(i
, 0x400, 1, Modifier((addOp
& 1) ? NV50_IR_MOD_NEG
: 0));
663 assert(!i
->defExists(1));
664 assert(i
->flagsSrc
< 0);
668 emitForm_21(i
, 0x208, 0xc08);
670 assert(addOp
!= 3); // would be add-plus-one
672 code
[1] |= addOp
<< 19;
675 code
[1] |= 1 << 18; // write carry
676 if (i
->flagsSrc
>= 0)
677 code
[1] |= 1 << 14; // add carry
685 CodeEmitterGK110::emitIMAD(const Instruction
*i
)
688 (i
->src(2).mod
.neg() << 1) | (i
->src(0).mod
.neg() ^ i
->src(1).mod
.neg());
690 emitForm_21(i
, 0x100, 0xa00);
693 code
[1] |= addOp
<< 26;
695 if (i
->sType
== TYPE_S32
)
696 code
[1] |= (1 << 19) | (1 << 24);
702 if (i
->subOp
== NV50_IR_SUBOP_MUL_HIGH
)
709 CodeEmitterGK110::emitISAD(const Instruction
*i
)
711 assert(i
->dType
== TYPE_S32
|| i
->dType
== TYPE_U32
);
713 emitForm_21(i
, 0x1f4, 0xb74);
715 if (i
->dType
== TYPE_S32
)
720 CodeEmitterGK110::emitNOT(const Instruction
*i
)
722 code
[0] = 0x0003fc02; // logop(mov2) dst, 0, not src
723 code
[1] = 0x22003800;
729 switch (i
->src(0).getFile()) {
731 code
[1] |= 0xc << 28;
732 srcId(i
->src(0), 23);
734 case FILE_MEMORY_CONST
:
735 code
[1] |= 0x4 << 28;
736 setCAddress14(i
->src(1));
745 CodeEmitterGK110::emitLogicOp(const Instruction
*i
, uint8_t subOp
)
747 if (isLIMM(i
->src(1), TYPE_S32
)) {
748 emitForm_L(i
, 0x200, 0, i
->src(1).mod
);
749 code
[1] |= subOp
<< 24;
752 emitForm_21(i
, 0x220, 0xc20);
753 code
[1] |= subOp
<< 12;
760 CodeEmitterGK110::emitPOPC(const Instruction
*i
)
762 assert(!isLIMM(i
->src(1), TYPE_S32
, true));
764 emitForm_21(i
, 0x204, 0xc04);
767 if (!(code
[0] & 0x1))
772 CodeEmitterGK110::emitINSBF(const Instruction
*i
)
774 emitForm_21(i
, 0x1f8, 0xb78);
778 CodeEmitterGK110::emitEXTBF(const Instruction
*i
)
780 emitForm_21(i
, 0x600, 0xc00);
782 if (i
->dType
== TYPE_S32
)
784 if (i
->subOp
== NV50_IR_SUBOP_EXTBF_REV
)
789 CodeEmitterGK110::emitBFIND(const Instruction
*i
)
791 emitForm_C(i
, 0x218, 0x2);
793 if (i
->dType
== TYPE_S32
)
795 if (i
->src(0).mod
== Modifier(NV50_IR_MOD_NOT
))
797 if (i
->subOp
== NV50_IR_SUBOP_BFIND_SAMT
)
802 CodeEmitterGK110::emitShift(const Instruction
*i
)
804 if (i
->op
== OP_SHR
) {
805 emitForm_21(i
, 0x214, 0xc14);
806 if (isSignedType(i
->dType
))
809 emitForm_21(i
, 0x224, 0xc24);
812 if (i
->subOp
== NV50_IR_SUBOP_SHIFT_WRAP
)
817 CodeEmitterGK110::emitPreOp(const Instruction
*i
)
819 emitForm_C(i
, 0x248, 0x2);
821 if (i
->op
== OP_PREEX2
)
829 CodeEmitterGK110::emitSFnOp(const Instruction
*i
, uint8_t subOp
)
831 code
[0] = 0x00000002 | (subOp
<< 23);
832 code
[1] = 0x84000000;
837 srcId(i
->src(0), 10);
845 CodeEmitterGK110::emitMINMAX(const Instruction
*i
)
869 emitForm_21(i
, op2
, op1
);
871 if (i
->dType
== TYPE_S32
)
873 code
[1] |= (i
->op
== OP_MIN
) ? 0x1c00 : 0x3c00; // [!]pt
879 modNegAbsF32_3b(i
, 1);
887 CodeEmitterGK110::emitCVT(const Instruction
*i
)
889 const bool f2f
= isFloatType(i
->dType
) && isFloatType(i
->sType
);
890 const bool f2i
= !isFloatType(i
->dType
) && isFloatType(i
->sType
);
891 const bool i2f
= isFloatType(i
->dType
) && !isFloatType(i
->sType
);
893 bool sat
= i
->saturate
;
894 bool abs
= i
->src(0).mod
.abs();
895 bool neg
= i
->src(0).mod
.neg();
897 RoundMode rnd
= i
->rnd
;
900 case OP_CEIL
: rnd
= f2f
? ROUND_PI
: ROUND_P
; break;
901 case OP_FLOOR
: rnd
= f2f
? ROUND_MI
: ROUND_M
; break;
902 case OP_TRUNC
: rnd
= f2f
? ROUND_ZI
: ROUND_Z
; break;
903 case OP_SAT
: sat
= true; break;
904 case OP_NEG
: neg
= !neg
; break;
905 case OP_ABS
: abs
= true; neg
= false; break;
912 if (i
->op
== OP_NEG
&& i
->dType
== TYPE_U32
)
921 else if (f2i
) op
= 0x258;
922 else if (i2f
) op
= 0x25c;
925 emitForm_C(i
, op
, 0x2);
928 if (neg
) code
[1] |= 1 << 16;
929 if (abs
) code
[1] |= 1 << 20;
930 if (sat
) code
[1] |= 1 << 21;
932 emitRoundMode(rnd
, 32 + 10, f2f
? (32 + 13) : -1);
934 code
[0] |= typeSizeofLog2(dType
) << 10;
935 code
[0] |= typeSizeofLog2(i
->sType
) << 12;
937 if (isSignedIntType(dType
))
939 if (isSignedIntType(i
->sType
))
944 CodeEmitterGK110::emitSET(const CmpInstruction
*i
)
948 if (i
->def(0).getFile() == FILE_PREDICATE
) {
950 case TYPE_F32
: op2
= 0x1d8; op1
= 0xb58; break;
951 case TYPE_F64
: op2
= 0x1c0; op1
= 0xb40; break;
957 emitForm_21(i
, op2
, op1
);
961 if (!(code
[0] & 0x1)) {
965 modNegAbsF32_3b(i
, 1);
969 // normal DST field is negated predicate result
970 code
[0] = (code
[0] & ~0xfc) | ((code
[0] << 3) & 0xe0);
977 case TYPE_F32
: op2
= 0x000; op1
= 0x800; break;
978 case TYPE_F64
: op2
= 0x080; op1
= 0x900; break;
984 emitForm_21(i
, op2
, op1
);
988 if (!(code
[0] & 0x1)) {
992 modNegAbsF32_3b(i
, 1);
996 if (i
->dType
== TYPE_F32
) {
997 if (isFloatType(i
->sType
))
1003 if (i
->sType
== TYPE_S32
)
1006 if (i
->op
!= OP_SET
) {
1008 case OP_SET_AND
: code
[1] |= 0x0 << 16; break;
1009 case OP_SET_OR
: code
[1] |= 0x1 << 16; break;
1010 case OP_SET_XOR
: code
[1] |= 0x2 << 16; break;
1015 srcId(i
->src(2), 0x2a);
1017 code
[1] |= 0x7 << 10;
1019 emitCondCode(i
->setCond
,
1020 isFloatType(i
->sType
) ? 0x33 : 0x34,
1021 isFloatType(i
->sType
) ? 0xf : 0x7);
1025 CodeEmitterGK110::emitSLCT(const CmpInstruction
*i
)
1027 CondCode cc
= i
->setCond
;
1028 if (i
->src(2).mod
.neg())
1029 cc
= reverseCondCode(cc
);
1031 if (i
->dType
== TYPE_F32
) {
1032 emitForm_21(i
, 0x1d0, 0xb50);
1034 emitCondCode(cc
, 0x33, 0xf);
1036 emitForm_21(i
, 0x1a0, 0xb20);
1037 emitCondCode(cc
, 0x34, 0x7);
1041 void CodeEmitterGK110::emitSELP(const Instruction
*i
)
1043 emitForm_21(i
, 0x250, 0x050);
1045 if ((i
->cc
== CC_NOT_P
) ^ (bool)(i
->src(2).mod
& Modifier(NV50_IR_MOD_NOT
)))
1049 void CodeEmitterGK110::emitTEXBAR(const Instruction
*i
)
1051 code
[0] = 0x0000003e | (i
->subOp
<< 23);
1052 code
[1] = 0x77000000;
1057 void CodeEmitterGK110::emitTEXCSAA(const TexInstruction
*i
)
1059 code
[0] = 0x00000002;
1060 code
[1] = 0x76c00000;
1062 code
[1] |= i
->tex
.r
<< 9;
1063 // code[1] |= i->tex.s << (9 + 8);
1065 if (i
->tex
.liveOnly
)
1066 code
[0] |= 0x80000000;
1068 defId(i
->def(0), 2);
1069 srcId(i
->src(0), 10);
1073 isNextIndependentTex(const TexInstruction
*i
)
1075 if (!i
->next
|| !isTextureOp(i
->next
->op
))
1077 if (i
->getDef(0)->interfers(i
->next
->getSrc(0)))
1079 return !i
->next
->srcExists(1) || !i
->getDef(0)->interfers(i
->next
->getSrc(1));
1083 CodeEmitterGK110::emitTEX(const TexInstruction
*i
)
1085 const bool ind
= i
->tex
.rIndirectSrc
>= 0;
1088 code
[0] = 0x00000002;
1091 code
[1] = 0x7e000000;
1094 code
[1] = 0x7e800000;
1097 code
[1] = 0x78000000;
1100 code
[1] = 0x7dc00000;
1103 code
[1] = 0x7d800000;
1109 code
[0] = 0x00000002;
1110 code
[1] = 0x76000000;
1111 code
[1] |= i
->tex
.r
<< 9;
1114 code
[0] = 0x00000002;
1115 code
[1] = 0x76800000;
1116 code
[1] |= i
->tex
.r
<< 9;
1119 code
[0] = 0x00000002;
1120 code
[1] = 0x70000000;
1121 code
[1] |= i
->tex
.r
<< 13;
1124 code
[0] = 0x00000001;
1125 code
[1] = 0x70000000;
1126 code
[1] |= i
->tex
.r
<< 15;
1129 code
[0] = 0x00000001;
1130 code
[1] = 0x60000000;
1131 code
[1] |= i
->tex
.r
<< 15;
1136 code
[1] |= isNextIndependentTex(i
) ? 0x1 : 0x2; // t : p mode
1138 if (i
->tex
.liveOnly
)
1139 code
[0] |= 0x80000000;
1143 case OP_TXB
: code
[1] |= 0x2000; break;
1144 case OP_TXL
: code
[1] |= 0x3000; break;
1148 case OP_TXLQ
: break;
1150 assert(!"invalid texture op");
1154 if (i
->op
== OP_TXF
) {
1155 if (!i
->tex
.levelZero
)
1158 if (i
->tex
.levelZero
) {
1162 if (i
->op
!= OP_TXD
&& i
->tex
.derivAll
)
1167 code
[1] |= i
->tex
.mask
<< 2;
1169 const int src1
= (i
->predSrc
== 1) ? 2 : 1; // if predSrc == 1, !srcExists(2)
1171 defId(i
->def(0), 2);
1172 srcId(i
->src(0), 10);
1175 if (i
->op
== OP_TXG
) code
[1] |= i
->tex
.gatherComp
<< 13;
1178 code
[1] |= (i
->tex
.target
.isCube() ? 3 : (i
->tex
.target
.getDim() - 1)) << 7;
1179 if (i
->tex
.target
.isArray())
1181 if (i
->tex
.target
.isShadow())
1183 if (i
->tex
.target
== TEX_TARGET_2D_MS
||
1184 i
->tex
.target
== TEX_TARGET_2D_MS_ARRAY
)
1187 if (i
->srcExists(src1
) && i
->src(src1
).getFile() == FILE_IMMEDIATE
) {
1191 if (i
->tex
.useOffsets
== 1) {
1193 case OP_TXF
: code
[1] |= 0x200; break;
1194 case OP_TXD
: code
[1] |= 0x00400000; break;
1195 default: code
[1] |= 0x800; break;
1198 if (i
->tex
.useOffsets
== 4)
1203 CodeEmitterGK110::emitTXQ(const TexInstruction
*i
)
1205 code
[0] = 0x00000002;
1206 code
[1] = 0x75400001;
1208 switch (i
->tex
.query
) {
1209 case TXQ_DIMS
: code
[0] |= 0x01 << 25; break;
1210 case TXQ_TYPE
: code
[0] |= 0x02 << 25; break;
1211 case TXQ_SAMPLE_POSITION
: code
[0] |= 0x05 << 25; break;
1212 case TXQ_FILTER
: code
[0] |= 0x10 << 25; break;
1213 case TXQ_LOD
: code
[0] |= 0x12 << 25; break;
1214 case TXQ_BORDER_COLOUR
: code
[0] |= 0x16 << 25; break;
1216 assert(!"invalid texture query");
1220 code
[1] |= i
->tex
.mask
<< 2;
1221 code
[1] |= i
->tex
.r
<< 9;
1222 if (/*i->tex.sIndirectSrc >= 0 || */i
->tex
.rIndirectSrc
>= 0)
1223 code
[1] |= 0x08000000;
1225 defId(i
->def(0), 2);
1226 srcId(i
->src(0), 10);
1232 CodeEmitterGK110::emitQUADOP(const Instruction
*i
, uint8_t qOp
, uint8_t laneMask
)
1234 code
[0] = 0x00000002 | ((qOp
& 1) << 31);
1235 code
[1] = 0x7fc00000 | (qOp
>> 1) | (laneMask
<< 12);
1237 defId(i
->def(0), 2);
1238 srcId(i
->src(0), 10);
1239 srcId(i
->srcExists(1) ? i
->src(1) : i
->src(0), 23);
1241 if (i
->op
== OP_QUADOP
&& progType
!= Program::TYPE_FRAGMENT
)
1242 code
[1] |= 1 << 9; // dall
1248 CodeEmitterGK110::emitPIXLD(const Instruction
*i
)
1250 emitForm_L(i
, 0x7f4, 2, Modifier(0));
1251 code
[1] |= i
->subOp
<< 2;
1252 code
[1] |= 0x00070000;
1256 CodeEmitterGK110::emitBAR(const Instruction
*i
)
1263 CodeEmitterGK110::emitFlow(const Instruction
*i
)
1265 const FlowInstruction
*f
= i
->asFlow();
1267 unsigned mask
; // bit 0: predicate, bit 1: target
1269 code
[0] = 0x00000000;
1273 code
[1] = f
->absolute
? 0x10800000 : 0x12000000;
1274 if (i
->srcExists(0) && i
->src(0).getFile() == FILE_MEMORY_CONST
)
1279 code
[1] = f
->absolute
? 0x11000000 : 0x13000000;
1280 if (i
->srcExists(0) && i
->src(0).getFile() == FILE_MEMORY_CONST
)
1285 case OP_EXIT
: code
[1] = 0x18000000; mask
= 1; break;
1286 case OP_RET
: code
[1] = 0x19000000; mask
= 1; break;
1287 case OP_DISCARD
: code
[1] = 0x19800000; mask
= 1; break;
1288 case OP_BREAK
: code
[1] = 0x1a000000; mask
= 1; break;
1289 case OP_CONT
: code
[1] = 0x1a800000; mask
= 1; break;
1291 case OP_JOINAT
: code
[1] = 0x14800000; mask
= 2; break;
1292 case OP_PREBREAK
: code
[1] = 0x15000000; mask
= 2; break;
1293 case OP_PRECONT
: code
[1] = 0x15800000; mask
= 2; break;
1294 case OP_PRERET
: code
[1] = 0x13800000; mask
= 2; break;
1296 case OP_QUADON
: code
[1] = 0x1b800000; mask
= 0; break;
1297 case OP_QUADPOP
: code
[1] = 0x1c000000; mask
= 0; break;
1298 case OP_BRKPT
: code
[1] = 0x00000000; mask
= 0; break;
1300 assert(!"invalid flow operation");
1306 if (i
->flagsSrc
< 0)
1318 if (f
->op
== OP_CALL
) {
1320 assert(f
->absolute
);
1321 uint32_t pcAbs
= targNVC0
->getBuiltinOffset(f
->target
.builtin
);
1322 addReloc(RelocEntry::TYPE_BUILTIN
, 0, pcAbs
, 0xff800000, 23);
1323 addReloc(RelocEntry::TYPE_BUILTIN
, 1, pcAbs
, 0x007fffff, -9);
1325 assert(!f
->absolute
);
1326 int32_t pcRel
= f
->target
.fn
->binPos
- (codeSize
+ 8);
1327 code
[0] |= (pcRel
& 0x1ff) << 23;
1328 code
[1] |= (pcRel
>> 9) & 0x7fff;
1332 int32_t pcRel
= f
->target
.bb
->binPos
- (codeSize
+ 8);
1333 if (writeIssueDelays
&& !(f
->target
.bb
->binPos
& 0x3f))
1335 // currently we don't want absolute branches
1336 assert(!f
->absolute
);
1337 code
[0] |= (pcRel
& 0x1ff) << 23;
1338 code
[1] |= (pcRel
>> 9) & 0x7fff;
1343 CodeEmitterGK110::emitAFETCH(const Instruction
*i
)
1345 uint32_t offset
= i
->src(0).get()->reg
.data
.offset
& 0x7ff;
1347 code
[0] = 0x00000002 | (offset
<< 23);
1348 code
[1] = 0x7d000000 | (offset
>> 9);
1350 if (i
->getSrc(0)->reg
.file
== FILE_SHADER_OUTPUT
)
1355 defId(i
->def(0), 2);
1356 srcId(i
->src(0).getIndirect(0), 10);
1360 CodeEmitterGK110::emitPFETCH(const Instruction
*i
)
1362 uint32_t prim
= i
->src(0).get()->reg
.data
.u32
;
1364 code
[0] = 0x00000002 | ((prim
& 0xff) << 23);
1365 code
[1] = 0x7f800000;
1369 const int src1
= (i
->predSrc
== 1) ? 2 : 1; // if predSrc == 1, !srcExists(2)
1371 defId(i
->def(0), 2);
1376 CodeEmitterGK110::emitVFETCH(const Instruction
*i
)
1378 unsigned int size
= typeSizeof(i
->dType
);
1379 uint32_t offset
= i
->src(0).get()->reg
.data
.offset
;
1381 code
[0] = 0x00000002 | (offset
<< 23);
1382 code
[1] = 0x7ec00000 | (offset
>> 9);
1383 code
[1] |= (size
/ 4 - 1) << 18;
1387 if (i
->getSrc(0)->reg
.file
== FILE_SHADER_OUTPUT
)
1388 code
[1] |= 0x8; // yes, TCPs can read from *outputs* of other threads
1392 defId(i
->def(0), 2);
1393 srcId(i
->src(0).getIndirect(0), 10);
1394 srcId(i
->src(0).getIndirect(1), 32 + 10); // vertex address
1398 CodeEmitterGK110::emitEXPORT(const Instruction
*i
)
1400 unsigned int size
= typeSizeof(i
->dType
);
1401 uint32_t offset
= i
->src(0).get()->reg
.data
.offset
;
1403 code
[0] = 0x00000002 | (offset
<< 23);
1404 code
[1] = 0x7f000000 | (offset
>> 9);
1405 code
[1] |= (size
/ 4 - 1) << 18;
1412 assert(i
->src(1).getFile() == FILE_GPR
);
1414 srcId(i
->src(0).getIndirect(0), 10);
1415 srcId(i
->src(0).getIndirect(1), 32 + 10); // vertex base address
1416 srcId(i
->src(1), 2);
1420 CodeEmitterGK110::emitOUT(const Instruction
*i
)
1422 assert(i
->src(0).getFile() == FILE_GPR
);
1424 emitForm_21(i
, 0x1f0, 0xb70);
1426 if (i
->op
== OP_EMIT
)
1428 if (i
->op
== OP_RESTART
|| i
->subOp
== NV50_IR_SUBOP_EMIT_RESTART
)
1433 CodeEmitterGK110::emitInterpMode(const Instruction
*i
)
1435 code
[1] |= (i
->ipa
& 0x3) << 21; // TODO: INTERP_SAMPLEID
1436 code
[1] |= (i
->ipa
& 0xc) << (19 - 2);
1440 CodeEmitterGK110::emitINTERP(const Instruction
*i
)
1442 const uint32_t base
= i
->getSrc(0)->reg
.data
.offset
;
1444 code
[0] = 0x00000002 | (base
<< 31);
1445 code
[1] = 0x74800000 | (base
>> 1);
1450 if (i
->op
== OP_PINTERP
)
1451 srcId(i
->src(1), 23);
1453 code
[0] |= 0xff << 23;
1455 srcId(i
->src(0).getIndirect(0), 10);
1459 defId(i
->def(0), 2);
1461 if (i
->getSampleMode() == NV50_IR_INTERP_OFFSET
)
1462 srcId(i
->src(i
->op
== OP_PINTERP
? 2 : 1), 32 + 10);
1464 code
[1] |= 0xff << 10;
1468 CodeEmitterGK110::emitLoadStoreType(DataType ty
, const int pos
)
1500 assert(!"invalid ld/st type");
1503 code
[pos
/ 32] |= n
<< (pos
% 32);
1507 CodeEmitterGK110::emitCachingMode(CacheMode c
, const int pos
)
1528 assert(!"invalid caching mode");
1531 code
[pos
/ 32] |= n
<< (pos
% 32);
1535 CodeEmitterGK110::emitSTORE(const Instruction
*i
)
1537 int32_t offset
= SDATA(i
->src(0)).offset
;
1539 switch (i
->src(0).getFile()) {
1540 case FILE_MEMORY_GLOBAL
: code
[1] = 0xe0000000; code
[0] = 0x00000000; break;
1541 case FILE_MEMORY_LOCAL
: code
[1] = 0x7a800000; code
[0] = 0x00000002; break;
1542 case FILE_MEMORY_SHARED
: code
[1] = 0x7ac00000; code
[0] = 0x00000002; break;
1544 assert(!"invalid memory file");
1548 if (i
->src(0).getFile() != FILE_MEMORY_GLOBAL
)
1551 if (code
[0] & 0x2) {
1552 emitLoadStoreType(i
->dType
, 0x33);
1553 if (i
->src(0).getFile() == FILE_MEMORY_LOCAL
)
1554 emitCachingMode(i
->cache
, 0x2f);
1556 emitLoadStoreType(i
->dType
, 0x38);
1557 emitCachingMode(i
->cache
, 0x3b);
1559 code
[0] |= offset
<< 23;
1560 code
[1] |= offset
>> 9;
1564 srcId(i
->src(1), 2);
1565 srcId(i
->src(0).getIndirect(0), 10);
1569 CodeEmitterGK110::emitLOAD(const Instruction
*i
)
1571 int32_t offset
= SDATA(i
->src(0)).offset
;
1573 switch (i
->src(0).getFile()) {
1574 case FILE_MEMORY_GLOBAL
: code
[1] = 0xc0000000; code
[0] = 0x00000000; break;
1575 case FILE_MEMORY_LOCAL
: code
[1] = 0x7a000000; code
[0] = 0x00000002; break;
1576 case FILE_MEMORY_SHARED
: code
[1] = 0x7ac00000; code
[0] = 0x00000002; break;
1577 case FILE_MEMORY_CONST
:
1578 if (!i
->src(0).isIndirect(0) && typeSizeof(i
->dType
) == 4) {
1583 code
[0] = 0x00000002;
1584 code
[1] = 0x7c800000 | (i
->src(0).get()->reg
.fileIndex
<< 7);
1585 code
[1] |= i
->subOp
<< 15;
1588 assert(!"invalid memory file");
1592 if (code
[0] & 0x2) {
1594 emitLoadStoreType(i
->dType
, 0x33);
1595 if (i
->src(0).getFile() == FILE_MEMORY_LOCAL
)
1596 emitCachingMode(i
->cache
, 0x2f);
1598 emitLoadStoreType(i
->dType
, 0x38);
1599 emitCachingMode(i
->cache
, 0x3b);
1601 code
[0] |= offset
<< 23;
1602 code
[1] |= offset
>> 9;
1606 defId(i
->def(0), 2);
1607 srcId(i
->src(0).getIndirect(0), 10);
1611 CodeEmitterGK110::getSRegEncoding(const ValueRef
& ref
)
1613 switch (SDATA(ref
).sv
.sv
) {
1614 case SV_LANEID
: return 0x00;
1615 case SV_PHYSID
: return 0x03;
1616 case SV_VERTEX_COUNT
: return 0x10;
1617 case SV_INVOCATION_ID
: return 0x11;
1618 case SV_YDIR
: return 0x12;
1619 case SV_TID
: return 0x21 + SDATA(ref
).sv
.index
;
1620 case SV_CTAID
: return 0x25 + SDATA(ref
).sv
.index
;
1621 case SV_NTID
: return 0x29 + SDATA(ref
).sv
.index
;
1622 case SV_GRIDID
: return 0x2c;
1623 case SV_NCTAID
: return 0x2d + SDATA(ref
).sv
.index
;
1624 case SV_LBASE
: return 0x34;
1625 case SV_SBASE
: return 0x30;
1626 case SV_CLOCK
: return 0x50 + SDATA(ref
).sv
.index
;
1628 assert(!"no sreg for system value");
1634 CodeEmitterGK110::emitMOV(const Instruction
*i
)
1636 if (i
->src(0).getFile() == FILE_SYSTEM_VALUE
) {
1637 code
[0] = 0x00000002 | (getSRegEncoding(i
->src(0)) << 23);
1638 code
[1] = 0x86400000;
1640 defId(i
->def(0), 2);
1642 if (i
->src(0).getFile() == FILE_IMMEDIATE
) {
1643 code
[0] = 0x00000002 | (i
->lanes
<< 14);
1644 code
[1] = 0x74000000;
1646 defId(i
->def(0), 2);
1647 setImmediate32(i
, 0, Modifier(0));
1649 if (i
->src(0).getFile() == FILE_PREDICATE
) {
1650 code
[0] = 0x00000002;
1651 code
[1] = 0x84401c07;
1653 defId(i
->def(0), 2);
1654 srcId(i
->src(0), 14);
1656 emitForm_C(i
, 0x24c, 2);
1657 code
[1] |= i
->lanes
<< 10;
1662 CodeEmitterGK110::emitInstruction(Instruction
*insn
)
1664 const unsigned int size
= (writeIssueDelays
&& !(codeSize
& 0x3f)) ? 16 : 8;
1666 if (insn
->encSize
!= 8) {
1667 ERROR("skipping unencodable instruction: ");
1671 if (codeSize
+ size
> codeSizeLimit
) {
1672 ERROR("code emitter output buffer too small\n");
1676 if (writeIssueDelays
) {
1677 int id
= (codeSize
& 0x3f) / 8 - 1;
1680 code
[0] = 0x00000000; // cf issue delay "instruction"
1681 code
[1] = 0x08000000;
1685 uint32_t *data
= code
- (id
* 2 + 2);
1688 case 0: data
[0] |= insn
->sched
<< 2; break;
1689 case 1: data
[0] |= insn
->sched
<< 10; break;
1690 case 2: data
[0] |= insn
->sched
<< 18; break;
1691 case 3: data
[0] |= insn
->sched
<< 26; data
[1] |= insn
->sched
>> 6; break;
1692 case 4: data
[1] |= insn
->sched
<< 2; break;
1693 case 5: data
[1] |= insn
->sched
<< 10; break;
1694 case 6: data
[1] |= insn
->sched
<< 18; break;
1701 // assert that instructions with multiple defs don't corrupt registers
1702 for (int d
= 0; insn
->defExists(d
); ++d
)
1703 assert(insn
->asTex() || insn
->def(d
).rep()->reg
.data
.id
>= 0);
1740 if (insn
->dType
== TYPE_F64
)
1742 else if (isFloatType(insn
->dType
))
1748 if (insn
->dType
== TYPE_F64
)
1750 else if (isFloatType(insn
->dType
))
1757 if (insn
->dType
== TYPE_F64
)
1759 else if (isFloatType(insn
->dType
))
1771 emitLogicOp(insn
, 0);
1774 emitLogicOp(insn
, 1);
1777 emitLogicOp(insn
, 2);
1787 emitSET(insn
->asCmp());
1793 emitSLCT(insn
->asCmp());
1809 emitSFnOp(insn
, 5 + 2 * insn
->subOp
);
1812 emitSFnOp(insn
, 4 + 2 * insn
->subOp
);
1837 emitTEX(insn
->asTex());
1840 emitTXQ(insn
->asTex());
1865 emitQUADOP(insn
, insn
->subOp
, insn
->lanes
);
1868 emitQUADOP(insn
, insn
->src(0).mod
.neg() ? 0x66 : 0x99, 0x4);
1871 emitQUADOP(insn
, insn
->src(0).mod
.neg() ? 0x5a : 0xa5, 0x5);
1895 ERROR("operation should have been eliminated");
1901 ERROR("operation should have been lowered\n");
1904 ERROR("unknow op\n");
1917 CodeEmitterGK110::getMinEncodingSize(const Instruction
*i
) const
1919 // No more short instruction encodings.
1924 CodeEmitterGK110::prepareEmission(Function
*func
)
1926 const Target
*targ
= func
->getProgram()->getTarget();
1928 CodeEmitter::prepareEmission(func
);
1930 if (targ
->hasSWSched
)
1931 calculateSchedDataNVC0(targ
, func
);
1934 CodeEmitterGK110::CodeEmitterGK110(const TargetNVC0
*target
)
1935 : CodeEmitter(target
),
1937 writeIssueDelays(target
->hasSWSched
)
1940 codeSize
= codeSizeLimit
= 0;
1945 TargetNVC0::createCodeEmitterGK110(Program::Type type
)
1947 CodeEmitterGK110
*emit
= new CodeEmitterGK110(this);
1948 emit
->setProgramType(type
);
1952 } // namespace nv50_ir