Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nvc0_pc.h 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. /*
  2. * Copyright 2010 Christoph Bumiller
  3. *
  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:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  18. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
  19. * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  20. * SOFTWARE.
  21. */
  22. #ifndef __NVC0_COMPILER_H__
  23. #define __NVC0_COMPILER_H__
  24. #include <stdio.h>
  25. #ifndef NOUVEAU_DBG
  26. #ifdef NOUVEAU_DEBUG
  27. # define NOUVEAU_DBG(args...) debug_printf(args);
  28. #else
  29. # define NOUVEAU_DBG(args...)
  30. #endif
  31. #endif
  32. #ifndef NOUVEAU_ERR
  33. #define NOUVEAU_ERR(fmt, args...) \
  34. fprintf(stderr, "%s:%d - "fmt, __FUNCTION__, __LINE__, ##args);
  35. #endif
  36. #include "pipe/p_defines.h"
  37. #include "util/u_inlines.h"
  38. #include "util/u_memory.h"
  39. #include "util/u_double_list.h"
  40. /* pseudo opcodes */
  41. #define NV_OP_UNDEF 0
  42. #define NV_OP_BIND 1
  43. #define NV_OP_MERGE 2
  44. #define NV_OP_PHI 3
  45. #define NV_OP_SELECT 4
  46. #define NV_OP_NOP 5
  47. /**
  48. * BIND forces source operand i into the same register as destination operand i,
  49. * and the operands will be assigned consecutive registers (needed for TEX).
  50. * Beware conflicts !
  51. * SELECT forces its multiple source operands and its destination operand into
  52. * one and the same register.
  53. */
  54. /* base opcodes */
  55. #define NV_OP_LD 6
  56. #define NV_OP_ST 7
  57. #define NV_OP_MOV 8
  58. #define NV_OP_AND 9
  59. #define NV_OP_OR 10
  60. #define NV_OP_XOR 11
  61. #define NV_OP_SHL 12
  62. #define NV_OP_SHR 13
  63. #define NV_OP_NOT 14
  64. #define NV_OP_SET 15
  65. #define NV_OP_ADD 16
  66. #define NV_OP_SUB 17
  67. #define NV_OP_MUL 18
  68. #define NV_OP_MAD 19
  69. #define NV_OP_ABS 20
  70. #define NV_OP_NEG 21
  71. #define NV_OP_MAX 22
  72. #define NV_OP_MIN 23
  73. #define NV_OP_CVT 24
  74. #define NV_OP_CEIL 25
  75. #define NV_OP_FLOOR 26
  76. #define NV_OP_TRUNC 27
  77. #define NV_OP_SAD 28
  78. /* shader opcodes */
  79. #define NV_OP_VFETCH 29
  80. #define NV_OP_PFETCH 30
  81. #define NV_OP_EXPORT 31
  82. #define NV_OP_LINTERP 32
  83. #define NV_OP_PINTERP 33
  84. #define NV_OP_EMIT 34
  85. #define NV_OP_RESTART 35
  86. #define NV_OP_TEX 36
  87. #define NV_OP_TXB 37
  88. #define NV_OP_TXL 38
  89. #define NV_OP_TXF 39
  90. #define NV_OP_TXQ 40
  91. #define NV_OP_QUADOP 41
  92. #define NV_OP_DFDX 42
  93. #define NV_OP_DFDY 43
  94. #define NV_OP_KIL 44
  95. /* control flow opcodes */
  96. #define NV_OP_BRA 45
  97. #define NV_OP_CALL 46
  98. #define NV_OP_RET 47
  99. #define NV_OP_EXIT 48
  100. #define NV_OP_BREAK 49
  101. #define NV_OP_BREAKADDR 50
  102. #define NV_OP_JOINAT 51
  103. #define NV_OP_JOIN 52
  104. /* typed opcodes */
  105. #define NV_OP_ADD_F32 NV_OP_ADD
  106. #define NV_OP_ADD_B32 53
  107. #define NV_OP_MUL_F32 NV_OP_MUL
  108. #define NV_OP_MUL_B32 54
  109. #define NV_OP_ABS_F32 NV_OP_ABS
  110. #define NV_OP_ABS_S32 55
  111. #define NV_OP_NEG_F32 NV_OP_NEG
  112. #define NV_OP_NEG_S32 56
  113. #define NV_OP_MAX_F32 NV_OP_MAX
  114. #define NV_OP_MAX_S32 57
  115. #define NV_OP_MAX_U32 58
  116. #define NV_OP_MIN_F32 NV_OP_MIN
  117. #define NV_OP_MIN_S32 59
  118. #define NV_OP_MIN_U32 60
  119. #define NV_OP_SET_F32 61
  120. #define NV_OP_SET_S32 62
  121. #define NV_OP_SET_U32 63
  122. #define NV_OP_SAR 64
  123. #define NV_OP_RCP 65
  124. #define NV_OP_RSQ 66
  125. #define NV_OP_LG2 67
  126. #define NV_OP_SIN 68
  127. #define NV_OP_COS 69
  128. #define NV_OP_EX2 70
  129. #define NV_OP_PRESIN 71
  130. #define NV_OP_PREEX2 72
  131. #define NV_OP_SAT 73
  132. /* newly added opcodes */
  133. #define NV_OP_SET_F32_AND 74
  134. #define NV_OP_SET_F32_OR 75
  135. #define NV_OP_SET_F32_XOR 76
  136. #define NV_OP_SELP 77
  137. #define NV_OP_SLCT 78
  138. #define NV_OP_SLCT_F32 NV_OP_SLCT
  139. #define NV_OP_SLCT_S32 79
  140. #define NV_OP_SLCT_U32 80
  141. #define NV_OP_SUB_F32 NV_OP_SUB
  142. #define NV_OP_SUB_S32 81
  143. #define NV_OP_MAD_F32 NV_OP_MAD
  144. #define NV_OP_FSET_F32 82
  145. #define NV_OP_TXG 83
  146. #define NV_OP_COUNT 84
  147. /* nv50 files omitted */
  148. #define NV_FILE_GPR 0
  149. #define NV_FILE_COND 1
  150. #define NV_FILE_PRED 2
  151. #define NV_FILE_IMM 16
  152. #define NV_FILE_MEM_S 32
  153. #define NV_FILE_MEM_V 34
  154. #define NV_FILE_MEM_A 35
  155. #define NV_FILE_MEM_L 48
  156. #define NV_FILE_MEM_G 64
  157. #define NV_FILE_MEM_C(i) (80 + i)
  158. #define NV_IS_MEMORY_FILE(f) ((f) >= NV_FILE_MEM_S)
  159. #define NV_MOD_NEG 1
  160. #define NV_MOD_ABS 2
  161. #define NV_MOD_NOT 4
  162. #define NV_MOD_SAT 8
  163. #define NV_TYPE_U8 0x00
  164. #define NV_TYPE_S8 0x01
  165. #define NV_TYPE_U16 0x02
  166. #define NV_TYPE_S16 0x03
  167. #define NV_TYPE_U32 0x04
  168. #define NV_TYPE_S32 0x05
  169. #define NV_TYPE_P32 0x07
  170. #define NV_TYPE_F32 0x09
  171. #define NV_TYPE_F64 0x0b
  172. #define NV_TYPE_VEC(x, n) (NV_TYPE_##x | (n << 4))
  173. #define NV_TYPE_ANY 0xff
  174. #define NV_TYPE_ISINT(t) ((t) < 7)
  175. #define NV_TYPE_ISSGD(t) ((t) & 1)
  176. #define NV_CC_FL 0x0
  177. #define NV_CC_LT 0x1
  178. #define NV_CC_EQ 0x2
  179. #define NV_CC_LE 0x3
  180. #define NV_CC_GT 0x4
  181. #define NV_CC_NE 0x5
  182. #define NV_CC_GE 0x6
  183. #define NV_CC_U 0x8
  184. #define NV_CC_TR 0xf
  185. #define NV_CC_O 0x10
  186. #define NV_CC_C 0x11
  187. #define NV_CC_A 0x12
  188. #define NV_CC_S 0x13
  189. #define NV_PC_MAX_INSTRUCTIONS 2048
  190. #define NV_PC_MAX_VALUES (NV_PC_MAX_INSTRUCTIONS * 4)
  191. #define NV_PC_MAX_BASIC_BLOCKS 1024
  192. struct nv_op_info {
  193. uint base; /* e.g. ADD_S32 -> ADD */
  194. char name[12];
  195. uint8_t type;
  196. uint8_t mods;
  197. unsigned flow : 1;
  198. unsigned commutative : 1;
  199. unsigned vector : 1;
  200. unsigned predicate : 1;
  201. unsigned pseudo : 1;
  202. unsigned immediate : 3;
  203. unsigned memory : 3;
  204. };
  205. extern struct nv_op_info nvc0_op_info_table[];
  206. #define NV_BASEOP(op) (nvc0_op_info_table[op].base)
  207. #define NV_OPTYPE(op) (nvc0_op_info_table[op].type)
  208. static INLINE uint
  209. nv_op_base(uint opcode)
  210. {
  211. return nvc0_op_info_table[opcode].base;
  212. }
  213. static INLINE boolean
  214. nv_is_texture_op(uint opcode)
  215. {
  216. return (opcode >= NV_OP_TEX && opcode <= NV_OP_TXQ);
  217. }
  218. static INLINE boolean
  219. nv_is_vector_op(uint opcode)
  220. {
  221. return nvc0_op_info_table[opcode].vector ? TRUE : FALSE;
  222. }
  223. static INLINE boolean
  224. nv_op_commutative(uint opcode)
  225. {
  226. return nvc0_op_info_table[opcode].commutative ? TRUE : FALSE;
  227. }
  228. static INLINE uint8_t
  229. nv_op_supported_src_mods(uint opcode)
  230. {
  231. return nvc0_op_info_table[opcode].mods;
  232. }
  233. static INLINE boolean
  234. nv_op_predicateable(uint opcode)
  235. {
  236. return nvc0_op_info_table[opcode].predicate ? TRUE : FALSE;
  237. }
  238. static INLINE uint
  239. nv_type_order(ubyte type)
  240. {
  241. switch (type & 0xf) {
  242. case NV_TYPE_U8:
  243. case NV_TYPE_S8:
  244. return 0;
  245. case NV_TYPE_U16:
  246. case NV_TYPE_S16:
  247. return 1;
  248. case NV_TYPE_U32:
  249. case NV_TYPE_F32:
  250. case NV_TYPE_S32:
  251. case NV_TYPE_P32:
  252. return 2;
  253. case NV_TYPE_F64:
  254. return 3;
  255. }
  256. assert(0);
  257. return 0;
  258. }
  259. static INLINE uint
  260. nv_type_sizeof(ubyte type)
  261. {
  262. if (type & 0xf0)
  263. return (1 << nv_type_order(type)) * (type >> 4);
  264. return 1 << nv_type_order(type);
  265. }
  266. static INLINE uint
  267. nv_type_sizeof_base(ubyte type)
  268. {
  269. return 1 << nv_type_order(type);
  270. }
  271. struct nv_reg {
  272. uint32_t address; /* for memory locations */
  273. int id; /* for registers */
  274. ubyte file;
  275. ubyte size;
  276. union {
  277. int32_t s32;
  278. int64_t s64;
  279. uint64_t u64;
  280. uint32_t u32; /* expected to be 0 for $r63 */
  281. float f32;
  282. double f64;
  283. } imm;
  284. };
  285. struct nv_range {
  286. struct nv_range *next;
  287. int bgn;
  288. int end;
  289. };
  290. struct nv_ref;
  291. struct nv_value {
  292. struct nv_reg reg;
  293. struct nv_instruction *insn;
  294. struct nv_value *join;
  295. struct nv_ref *last_use;
  296. int n;
  297. struct nv_range *livei;
  298. int refc;
  299. struct nv_value *next;
  300. struct nv_value *prev;
  301. };
  302. struct nv_ref {
  303. struct nv_value *value;
  304. struct nv_instruction *insn;
  305. struct list_head list; /* connects uses of the same value */
  306. uint8_t mod;
  307. uint8_t flags;
  308. };
  309. #define NV_REF_FLAG_REGALLOC_PRIV (1 << 0)
  310. struct nv_basic_block;
  311. struct nv_instruction {
  312. struct nv_instruction *next;
  313. struct nv_instruction *prev;
  314. uint opcode;
  315. uint serial;
  316. struct nv_value *def[5];
  317. struct nv_ref *src[6];
  318. int8_t predicate; /* index of predicate src */
  319. int8_t indirect; /* index of pointer src */
  320. union {
  321. struct {
  322. uint8_t t; /* TIC binding */
  323. uint8_t s; /* TSC binding */
  324. } tex;
  325. struct {
  326. uint8_t d; /* output type */
  327. uint8_t s; /* input type */
  328. } cvt;
  329. } ext;
  330. struct nv_basic_block *bb;
  331. struct nv_basic_block *target; /* target block of control flow insn */
  332. unsigned cc : 5; /* condition code */
  333. unsigned fixed : 1; /* don't optimize away (prematurely) */
  334. unsigned terminator : 1;
  335. unsigned join : 1;
  336. unsigned set_cond : 4; /* 2nd byte */
  337. unsigned saturate : 1;
  338. unsigned centroid : 1;
  339. unsigned flat : 1;
  340. unsigned patch : 1;
  341. unsigned lanes : 4; /* 3rd byte */
  342. unsigned tex_dim : 2;
  343. unsigned tex_array : 1;
  344. unsigned tex_cube : 1;
  345. unsigned tex_shadow : 1; /* 4th byte */
  346. unsigned tex_live : 1;
  347. unsigned tex_mask : 4;
  348. uint8_t quadop;
  349. };
  350. static INLINE int
  351. nvi_vector_size(struct nv_instruction *nvi)
  352. {
  353. int i;
  354. assert(nvi);
  355. for (i = 0; i < 5 && nvi->def[i]; ++i);
  356. return i;
  357. }
  358. #define CFG_EDGE_FORWARD 0
  359. #define CFG_EDGE_BACK 1
  360. #define CFG_EDGE_LOOP_ENTER 2
  361. #define CFG_EDGE_LOOP_LEAVE 4
  362. #define CFG_EDGE_FAKE 8
  363. /* 'WALL' edge means where reachability check doesn't follow */
  364. /* 'LOOP' edge means just having to do with loops */
  365. #define IS_LOOP_EDGE(k) ((k) & 7)
  366. #define IS_WALL_EDGE(k) ((k) & 9)
  367. struct nv_basic_block {
  368. struct nv_instruction *entry; /* first non-phi instruction */
  369. struct nv_instruction *exit;
  370. struct nv_instruction *phi; /* very first instruction */
  371. int num_instructions;
  372. struct nv_basic_block *out[2]; /* no indirect branches -> 2 */
  373. struct nv_basic_block *in[8]; /* hope that suffices */
  374. uint num_in;
  375. ubyte out_kind[2];
  376. ubyte in_kind[8];
  377. int id;
  378. int subroutine;
  379. uint priv; /* reset to 0 after you're done */
  380. uint pass_seq;
  381. uint32_t emit_pos; /* position, size in emitted code (in bytes) */
  382. uint32_t emit_size;
  383. uint32_t live_set[NV_PC_MAX_VALUES / 32];
  384. };
  385. struct nvc0_translation_info;
  386. struct nv_pc {
  387. struct nv_basic_block **root;
  388. struct nv_basic_block *current_block;
  389. struct nv_basic_block *parent_block;
  390. int loop_nesting_bound;
  391. uint pass_seq;
  392. struct nv_value values[NV_PC_MAX_VALUES];
  393. struct nv_instruction instructions[NV_PC_MAX_INSTRUCTIONS];
  394. struct nv_ref **refs;
  395. struct nv_basic_block *bb_list[NV_PC_MAX_BASIC_BLOCKS];
  396. int num_values;
  397. int num_instructions;
  398. int num_refs;
  399. int num_blocks;
  400. int num_subroutines;
  401. int max_reg[4];
  402. uint32_t *immd_buf; /* populated on emit */
  403. unsigned immd_count;
  404. uint32_t *emit;
  405. uint32_t emit_size;
  406. uint32_t emit_pos;
  407. void *reloc_entries;
  408. unsigned num_relocs;
  409. /* optimization enables */
  410. boolean opt_reload_elim;
  411. boolean is_fragprog;
  412. };
  413. void nvc0_insn_append(struct nv_basic_block *, struct nv_instruction *);
  414. void nvc0_insn_insert_before(struct nv_instruction *, struct nv_instruction *);
  415. void nvc0_insn_insert_after(struct nv_instruction *, struct nv_instruction *);
  416. static INLINE struct nv_instruction *
  417. nv_alloc_instruction(struct nv_pc *pc, uint opcode)
  418. {
  419. struct nv_instruction *insn;
  420. insn = &pc->instructions[pc->num_instructions++];
  421. assert(pc->num_instructions < NV_PC_MAX_INSTRUCTIONS);
  422. insn->opcode = opcode;
  423. insn->cc = 0;
  424. insn->indirect = -1;
  425. insn->predicate = -1;
  426. return insn;
  427. }
  428. static INLINE struct nv_instruction *
  429. new_instruction(struct nv_pc *pc, uint opcode)
  430. {
  431. struct nv_instruction *insn = nv_alloc_instruction(pc, opcode);
  432. nvc0_insn_append(pc->current_block, insn);
  433. return insn;
  434. }
  435. static INLINE struct nv_instruction *
  436. new_instruction_at(struct nv_pc *pc, struct nv_instruction *at, uint opcode)
  437. {
  438. struct nv_instruction *insn = nv_alloc_instruction(pc, opcode);
  439. nvc0_insn_insert_after(at, insn);
  440. return insn;
  441. }
  442. static INLINE struct nv_value *
  443. new_value(struct nv_pc *pc, ubyte file, ubyte size)
  444. {
  445. struct nv_value *value = &pc->values[pc->num_values];
  446. assert(pc->num_values < NV_PC_MAX_VALUES - 1);
  447. value->n = pc->num_values++;
  448. value->join = value;
  449. value->reg.id = -1;
  450. value->reg.file = file;
  451. value->reg.size = size;
  452. return value;
  453. }
  454. static INLINE struct nv_value *
  455. new_value_like(struct nv_pc *pc, struct nv_value *like)
  456. {
  457. return new_value(pc, like->reg.file, like->reg.size);
  458. }
  459. static INLINE struct nv_ref *
  460. new_ref(struct nv_pc *pc, struct nv_value *val)
  461. {
  462. int i;
  463. struct nv_ref *ref;
  464. if ((pc->num_refs % 64) == 0) {
  465. const unsigned old_size = pc->num_refs * sizeof(struct nv_ref *);
  466. const unsigned new_size = (pc->num_refs + 64) * sizeof(struct nv_ref *);
  467. pc->refs = REALLOC(pc->refs, old_size, new_size);
  468. ref = CALLOC(64, sizeof(struct nv_ref));
  469. for (i = 0; i < 64; ++i)
  470. pc->refs[pc->num_refs + i] = &ref[i];
  471. }
  472. ref = pc->refs[pc->num_refs++];
  473. ref->value = val;
  474. LIST_INITHEAD(&ref->list);
  475. ++val->refc;
  476. return ref;
  477. }
  478. static INLINE struct nv_basic_block *
  479. new_basic_block(struct nv_pc *pc)
  480. {
  481. struct nv_basic_block *bb;
  482. if (pc->num_blocks >= NV_PC_MAX_BASIC_BLOCKS)
  483. return NULL;
  484. bb = CALLOC_STRUCT(nv_basic_block);
  485. bb->id = pc->num_blocks;
  486. pc->bb_list[pc->num_blocks++] = bb;
  487. return bb;
  488. }
  489. static INLINE void
  490. nv_reference(struct nv_pc *pc,
  491. struct nv_instruction *nvi, int c, struct nv_value *s)
  492. {
  493. struct nv_ref **d = &nvi->src[c];
  494. assert(c < 6);
  495. if (*d) {
  496. --(*d)->value->refc;
  497. LIST_DEL(&(*d)->list);
  498. }
  499. if (s) {
  500. if (!*d) {
  501. *d = new_ref(pc, s);
  502. (*d)->insn = nvi;
  503. } else {
  504. LIST_DEL(&(*d)->list);
  505. (*d)->value = s;
  506. ++(s->refc);
  507. }
  508. if (!s->last_use)
  509. s->last_use = *d;
  510. else
  511. LIST_ADDTAIL(&s->last_use->list, &(*d)->list);
  512. s->last_use = *d;
  513. (*d)->insn = nvi;
  514. } else {
  515. *d = NULL;
  516. }
  517. }
  518. /* nvc0_emit.c */
  519. void nvc0_emit_instruction(struct nv_pc *, struct nv_instruction *);
  520. /* nvc0_print.c */
  521. const char *nvc0_opcode_name(uint opcode);
  522. void nvc0_print_instruction(struct nv_instruction *);
  523. /* nvc0_pc.c */
  524. void nvc0_print_function(struct nv_basic_block *root);
  525. void nvc0_print_program(struct nv_pc *);
  526. boolean nvc0_insn_can_load(struct nv_instruction *, int s,
  527. struct nv_instruction *);
  528. boolean nvc0_insn_is_predicateable(struct nv_instruction *);
  529. int nvc0_insn_refcount(struct nv_instruction *);
  530. void nvc0_insn_delete(struct nv_instruction *);
  531. void nvc0_insns_permute(struct nv_instruction *prev, struct nv_instruction *);
  532. void nvc0_bblock_attach(struct nv_basic_block *parent,
  533. struct nv_basic_block *child, ubyte edge_kind);
  534. boolean nvc0_bblock_dominated_by(struct nv_basic_block *,
  535. struct nv_basic_block *);
  536. boolean nvc0_bblock_reachable_by(struct nv_basic_block *future,
  537. struct nv_basic_block *past,
  538. struct nv_basic_block *final);
  539. struct nv_basic_block *nvc0_bblock_dom_frontier(struct nv_basic_block *);
  540. int nvc0_pc_replace_value(struct nv_pc *pc,
  541. struct nv_value *old_val,
  542. struct nv_value *new_val);
  543. struct nv_value *nvc0_pc_find_immediate(struct nv_ref *);
  544. struct nv_value *nvc0_pc_find_constant(struct nv_ref *);
  545. typedef void (*nv_pc_pass_func)(void *priv, struct nv_basic_block *b);
  546. void nvc0_pc_pass_in_order(struct nv_basic_block *, nv_pc_pass_func, void *);
  547. int nvc0_pc_exec_pass0(struct nv_pc *pc);
  548. int nvc0_pc_exec_pass1(struct nv_pc *pc);
  549. int nvc0_pc_exec_pass2(struct nv_pc *pc);
  550. int nvc0_tgsi_to_nc(struct nv_pc *, struct nvc0_translation_info *);
  551. #endif // NV50_COMPILER_H