• Home
  • Raw
  • Download

Lines Matching refs:cur

42 static boolean is_alpha_underscore( const char *cur )  in is_alpha_underscore()  argument
45 (*cur >= 'a' && *cur <= 'z') || in is_alpha_underscore()
46 (*cur >= 'A' && *cur <= 'Z') || in is_alpha_underscore()
47 *cur == '_'; in is_alpha_underscore()
50 static boolean is_digit( const char *cur ) in is_digit() argument
52 return *cur >= '0' && *cur <= '9'; in is_digit()
55 static boolean is_digit_alpha_underscore( const char *cur ) in is_digit_alpha_underscore() argument
57 return is_digit( cur ) || is_alpha_underscore( cur ); in is_digit_alpha_underscore()
91 const char *cur = *pcur; in str_match_no_case() local
93 while (*str != '\0' && *str == uprcase( *cur )) { in str_match_no_case()
95 cur++; in str_match_no_case()
98 *pcur = cur; in str_match_no_case()
112 const char *cur = *pcur; in str_match_nocase_whole() local
114 if (str_match_no_case(&cur, str) && in str_match_nocase_whole()
115 !is_digit_alpha_underscore(cur)) { in str_match_nocase_whole()
116 *pcur = cur; in str_match_nocase_whole()
171 const char *cur = *pcur; in eat_white() local
174 return *pcur > cur; in eat_white()
182 const char *cur = *pcur; in parse_uint() local
184 if (is_digit( cur )) { in parse_uint()
185 *val = *cur++ - '0'; in parse_uint()
186 while (is_digit( cur )) in parse_uint()
187 *val = *val * 10 + *cur++ - '0'; in parse_uint()
188 *pcur = cur; in parse_uint()
196 const char *cur = *pcur; in parse_int() local
197 int sign = (*cur == '-' ? -1 : 1); in parse_int()
199 if (*cur == '+' || *cur == '-') in parse_int()
200 cur++; in parse_int()
202 if (parse_uint(&cur, (uint *)val)) { in parse_int()
204 *pcur = cur; in parse_int()
213 const char *cur = *pcur; in parse_identifier() local
215 if (is_alpha_underscore( cur )) { in parse_identifier()
216 ret[i++] = *cur++; in parse_identifier()
217 while (is_alpha_underscore( cur ) || is_digit( cur )) { in parse_identifier()
220 ret[i++] = *cur++; in parse_identifier()
223 *pcur = cur; in parse_identifier()
233 const char *cur = *pcur; in parse_float() local
237 if (*cur == '0' && *(cur + 1) == 'x') { in parse_float()
239 fi.ui = strtoul(cur, NULL, 16); in parse_float()
241 cur += 10; in parse_float()
245 *val = (float) atof( cur ); in parse_float()
246 if (*cur == '-' || *cur == '+') in parse_float()
247 cur++; in parse_float()
248 if (is_digit( cur )) { in parse_float()
249 cur++; in parse_float()
251 while (is_digit( cur )) in parse_float()
252 cur++; in parse_float()
254 if (*cur == '.') { in parse_float()
255 cur++; in parse_float()
256 if (is_digit( cur )) { in parse_float()
257 cur++; in parse_float()
259 while (is_digit( cur )) in parse_float()
260 cur++; in parse_float()
265 if (uprcase( *cur ) == 'E') { in parse_float()
266 cur++; in parse_float()
267 if (*cur == '-' || *cur == '+') in parse_float()
268 cur++; in parse_float()
269 if (is_digit( cur )) { in parse_float()
270 cur++; in parse_float()
271 while (is_digit( cur )) in parse_float()
272 cur++; in parse_float()
279 *pcur = cur; in parse_float()
285 const char *cur = *pcur; in parse_double() local
291 v.dval = strtod(cur, (char**)pcur); in parse_double()
292 if (*pcur == cur) in parse_double()
303 const char *cur = *pcur; in parse_int64() local
309 v.i64val = strtoll(cur, (char**)pcur, 0); in parse_int64()
310 if (*pcur == cur) in parse_int64()
321 const char *cur = *pcur; in parse_uint64() local
327 v.u64val = strtoull(cur, (char**)pcur, 0); in parse_uint64()
328 if (*pcur == cur) in parse_uint64()
340 const char *cur; member
356 while (itr != ctx->cur) { in report_error()
378 if (str_match_nocase_whole( &ctx->cur, "FRAG" )) in parse_header()
380 else if (str_match_nocase_whole( &ctx->cur, "VERT" )) in parse_header()
382 else if (str_match_nocase_whole( &ctx->cur, "GEOM" )) in parse_header()
384 else if (str_match_nocase_whole( &ctx->cur, "TESS_CTRL" )) in parse_header()
386 else if (str_match_nocase_whole( &ctx->cur, "TESS_EVAL" )) in parse_header()
388 else if (str_match_nocase_whole( &ctx->cur, "COMP" )) in parse_header()
410 const char *cur = ctx->cur; in parse_label() local
412 if (parse_uint( &cur, val )) { in parse_label()
413 eat_opt_white( &cur ); in parse_label()
414 if (*cur == ':') { in parse_label()
415 cur++; in parse_label()
416 ctx->cur = cur; in parse_label()
429 const char *cur = *pcur; in parse_file() local
431 if (str_match_nocase_whole( &cur, tgsi_file_name(i) )) { in parse_file()
432 *pcur = cur; in parse_file()
445 const char *cur; in parse_opt_writemask() local
447 cur = ctx->cur; in parse_opt_writemask()
448 eat_opt_white( &cur ); in parse_opt_writemask()
449 if (*cur == '.') { in parse_opt_writemask()
450 cur++; in parse_opt_writemask()
452 eat_opt_white( &cur ); in parse_opt_writemask()
453 if (uprcase( *cur ) == 'X') { in parse_opt_writemask()
454 cur++; in parse_opt_writemask()
457 if (uprcase( *cur ) == 'Y') { in parse_opt_writemask()
458 cur++; in parse_opt_writemask()
461 if (uprcase( *cur ) == 'Z') { in parse_opt_writemask()
462 cur++; in parse_opt_writemask()
465 if (uprcase( *cur ) == 'W') { in parse_opt_writemask()
466 cur++; in parse_opt_writemask()
475 ctx->cur = cur; in parse_opt_writemask()
491 if (!parse_file( &ctx->cur, file )) { in parse_register_file_bracket()
495 eat_opt_white( &ctx->cur ); in parse_register_file_bracket()
496 if (*ctx->cur != '[') { in parse_register_file_bracket()
500 ctx->cur++; in parse_register_file_bracket()
516 eat_opt_white( &ctx->cur ); in parse_register_file_bracket_index()
517 if (!parse_uint( &ctx->cur, &uindex )) { in parse_register_file_bracket_index()
535 eat_opt_white( &ctx->cur ); in parse_register_1d()
536 if (*ctx->cur != ']') { in parse_register_1d()
540 ctx->cur++; in parse_register_1d()
559 const char *cur; in parse_register_bracket() local
564 eat_opt_white( &ctx->cur ); in parse_register_bracket()
566 cur = ctx->cur; in parse_register_bracket()
567 if (parse_file( &cur, &brackets->ind_file )) { in parse_register_bracket()
571 eat_opt_white( &ctx->cur ); in parse_register_bracket()
573 if (*ctx->cur == '.') { in parse_register_bracket()
574 ctx->cur++; in parse_register_bracket()
575 eat_opt_white(&ctx->cur); in parse_register_bracket()
577 switch (uprcase(*ctx->cur)) { in parse_register_bracket()
594 ctx->cur++; in parse_register_bracket()
595 eat_opt_white(&ctx->cur); in parse_register_bracket()
598 if (*ctx->cur == '+' || *ctx->cur == '-') in parse_register_bracket()
599 parse_int( &ctx->cur, &brackets->index ); in parse_register_bracket()
604 if (!parse_uint( &ctx->cur, &uindex )) { in parse_register_bracket()
612 eat_opt_white( &ctx->cur ); in parse_register_bracket()
613 if (*ctx->cur != ']') { in parse_register_bracket()
617 ctx->cur++; in parse_register_bracket()
618 if (*ctx->cur == '(') { in parse_register_bracket()
619 ctx->cur++; in parse_register_bracket()
620 eat_opt_white( &ctx->cur ); in parse_register_bracket()
621 if (!parse_uint( &ctx->cur, &brackets->ind_array )) { in parse_register_bracket()
625 eat_opt_white( &ctx->cur ); in parse_register_bracket()
626 if (*ctx->cur != ')') { in parse_register_bracket()
630 ctx->cur++; in parse_register_bracket()
641 const char *cur = ctx->cur; in parse_opt_register_src_bracket() local
645 eat_opt_white( &cur ); in parse_opt_register_src_bracket()
646 if (cur[0] == '[') { in parse_opt_register_src_bracket()
647 ++cur; in parse_opt_register_src_bracket()
648 ctx->cur = cur; in parse_opt_register_src_bracket()
694 eat_opt_white( &ctx->cur ); in parse_register_dcl_bracket()
696 if (!parse_uint( &ctx->cur, &uindex )) { in parse_register_dcl_bracket()
699 if (ctx->cur[0] == ']' && ctx->implied_array_size != 0) { in parse_register_dcl_bracket()
709 eat_opt_white( &ctx->cur ); in parse_register_dcl_bracket()
711 if (ctx->cur[0] == '.' && ctx->cur[1] == '.') { in parse_register_dcl_bracket()
714 ctx->cur += 2; in parse_register_dcl_bracket()
715 eat_opt_white( &ctx->cur ); in parse_register_dcl_bracket()
716 if (!parse_uint( &ctx->cur, &uindex )) { in parse_register_dcl_bracket()
721 eat_opt_white( &ctx->cur ); in parse_register_dcl_bracket()
728 if (*ctx->cur != ']') { in parse_register_dcl_bracket()
732 ctx->cur++; in parse_register_dcl_bracket()
747 const char *cur; in parse_register_dcl() local
758 cur = ctx->cur; in parse_register_dcl()
759 eat_opt_white( &cur ); in parse_register_dcl()
761 if (cur[0] == '[') { in parse_register_dcl()
765 ++cur; in parse_register_dcl()
766 ctx->cur = cur; in parse_register_dcl()
813 const char *cur; in parse_dst_operand() local
822 cur = ctx->cur; in parse_dst_operand()
823 eat_opt_white( &cur ); in parse_dst_operand()
863 const char *cur = ctx->cur; in parse_optional_swizzle() local
867 eat_opt_white( &cur ); in parse_optional_swizzle()
868 if (*cur == '.') { in parse_optional_swizzle()
871 cur++; in parse_optional_swizzle()
872 eat_opt_white( &cur ); in parse_optional_swizzle()
874 if (uprcase( *cur ) == 'X') in parse_optional_swizzle()
876 else if (uprcase( *cur ) == 'Y') in parse_optional_swizzle()
878 else if (uprcase( *cur ) == 'Z') in parse_optional_swizzle()
880 else if (uprcase( *cur ) == 'W') in parse_optional_swizzle()
886 cur++; in parse_optional_swizzle()
889 ctx->cur = cur; in parse_optional_swizzle()
905 if (*ctx->cur == '-') { in parse_src_operand()
906 ctx->cur++; in parse_src_operand()
907 eat_opt_white( &ctx->cur ); in parse_src_operand()
911 if (*ctx->cur == '|') { in parse_src_operand()
912 ctx->cur++; in parse_src_operand()
913 eat_opt_white( &ctx->cur ); in parse_src_operand()
958 eat_opt_white( &ctx->cur ); in parse_src_operand()
959 if (*ctx->cur != '|') { in parse_src_operand()
963 ctx->cur++; in parse_src_operand()
1005 const char *cur = *pcur; in match_inst() local
1009 if (str_match_nocase_whole(&cur, mnemonic)) { in match_inst()
1010 *pcur = cur; in match_inst()
1016 if (str_match_no_case(&cur, mnemonic)) { in match_inst()
1018 if (str_match_no_case(&cur, "_SAT")) { in match_inst()
1019 *pcur = cur; in match_inst()
1023 if (str_match_no_case(&cur, "_PRECISE")) { in match_inst()
1024 *pcur = cur; in match_inst()
1028 if (!is_digit_alpha_underscore(cur)) in match_inst()
1045 const char *cur; in parse_instruction() local
1052 eat_opt_white( &ctx->cur ); in parse_instruction()
1054 cur = ctx->cur; in parse_instruction()
1057 if (match_inst(&cur, &saturate, &precise, info)) { in parse_instruction()
1059 ctx->cur = cur; in parse_instruction()
1062 else if (*cur == '\0' || eat_white( &cur )) { in parse_instruction()
1063 ctx->cur = cur; in parse_instruction()
1105 eat_opt_white( &ctx->cur ); in parse_instruction()
1106 if (*ctx->cur != ',') { in parse_instruction()
1110 ctx->cur++; in parse_instruction()
1111 eat_opt_white( &ctx->cur ); in parse_instruction()
1126 if (str_match_nocase_whole( &ctx->cur, tgsi_texture_names[j] )) { in parse_instruction()
1139 cur = ctx->cur; in parse_instruction()
1140 eat_opt_white( &cur ); in parse_instruction()
1141 for (i = 0; inst.Instruction.Texture && *cur == ',' && i < TGSI_FULL_MAX_TEX_OFFSETS; i++) { in parse_instruction()
1142 cur++; in parse_instruction()
1143 eat_opt_white( &cur ); in parse_instruction()
1144 ctx->cur = cur; in parse_instruction()
1147 cur = ctx->cur; in parse_instruction()
1148 eat_opt_white( &cur ); in parse_instruction()
1152 cur = ctx->cur; in parse_instruction()
1153 eat_opt_white(&cur); in parse_instruction()
1155 for (; inst.Instruction.Memory && *cur == ','; in parse_instruction()
1156 ctx->cur = cur, eat_opt_white(&cur)) { in parse_instruction()
1159 cur++; in parse_instruction()
1160 eat_opt_white(&cur); in parse_instruction()
1162 j = str_match_name_from_array(&cur, tgsi_memory_names, in parse_instruction()
1169 j = str_match_name_from_array(&cur, tgsi_texture_names, in parse_instruction()
1176 j = str_match_format(&cur); in parse_instruction()
1182 ctx->cur = cur; in parse_instruction()
1187 cur = ctx->cur; in parse_instruction()
1188 eat_opt_white( &cur ); in parse_instruction()
1189 if (info->is_branch && *cur == ':') { in parse_instruction()
1192 cur++; in parse_instruction()
1193 eat_opt_white( &cur ); in parse_instruction()
1194 if (!parse_uint( &cur, &target )) { in parse_instruction()
1200 ctx->cur = cur; in parse_instruction()
1223 eat_opt_white( &ctx->cur ); in parse_immediate_data()
1224 if (*ctx->cur != '{') { in parse_immediate_data()
1228 ctx->cur++; in parse_immediate_data()
1230 eat_opt_white( &ctx->cur ); in parse_immediate_data()
1232 if (*ctx->cur != ',') { in parse_immediate_data()
1236 ctx->cur++; in parse_immediate_data()
1237 eat_opt_white( &ctx->cur ); in parse_immediate_data()
1242 ret = parse_double(&ctx->cur, &values[i].Uint, &values[i+1].Uint); in parse_immediate_data()
1246 ret = parse_int64(&ctx->cur, &values[i].Uint, &values[i+1].Uint); in parse_immediate_data()
1250 ret = parse_uint64(&ctx->cur, &values[i].Uint, &values[i+1].Uint); in parse_immediate_data()
1254 ret = parse_float(&ctx->cur, &values[i].Float); in parse_immediate_data()
1257 ret = parse_uint(&ctx->cur, &values[i].Uint); in parse_immediate_data()
1260 ret = parse_int(&ctx->cur, &values[i].Int); in parse_immediate_data()
1273 eat_opt_white( &ctx->cur ); in parse_immediate_data()
1274 if (*ctx->cur != '}') { in parse_immediate_data()
1278 ctx->cur++; in parse_immediate_data()
1290 const char *cur, *cur2; in parse_declaration() local
1294 if (!eat_white( &ctx->cur )) { in parse_declaration()
1321 cur = ctx->cur; in parse_declaration()
1322 eat_opt_white( &cur ); in parse_declaration()
1323 if (*cur == ',') { in parse_declaration()
1324 cur2 = cur; in parse_declaration()
1347 ctx->cur = cur = cur2; in parse_declaration()
1351 if (*cur == ',' && !is_vs_input) { in parse_declaration()
1354 cur++; in parse_declaration()
1355 eat_opt_white( &cur ); in parse_declaration()
1358 if (str_match_nocase_whole(&cur, tgsi_texture_names[i])) { in parse_declaration()
1368 cur2 = cur; in parse_declaration()
1386 cur = cur2; in parse_declaration()
1390 ctx->cur = cur; in parse_declaration()
1394 if (str_match_nocase_whole(&cur, tgsi_texture_names[i])) { in parse_declaration()
1403 eat_opt_white( &cur ); in parse_declaration()
1404 if (*cur != ',') { in parse_declaration()
1408 ++cur; in parse_declaration()
1409 eat_opt_white( &cur ); in parse_declaration()
1412 if (str_match_nocase_whole(&cur, tgsi_return_type_names[i])) { in parse_declaration()
1439 cur2 = cur; in parse_declaration()
1444 cur = cur2; in parse_declaration()
1456 ctx->cur = cur; in parse_declaration()
1458 if (str_match_nocase_whole(&cur, "ATOMIC")) { in parse_declaration()
1460 ctx->cur = cur; in parse_declaration()
1463 if (str_match_nocase_whole(&cur, "GLOBAL")) { in parse_declaration()
1466 ctx->cur = cur; in parse_declaration()
1467 } else if (str_match_nocase_whole(&cur, "SHARED")) { in parse_declaration()
1469 ctx->cur = cur; in parse_declaration()
1470 } else if (str_match_nocase_whole(&cur, "PRIVATE")) { in parse_declaration()
1472 ctx->cur = cur; in parse_declaration()
1473 } else if (str_match_nocase_whole(&cur, "INPUT")) { in parse_declaration()
1475 ctx->cur = cur; in parse_declaration()
1478 if (str_match_nocase_whole(&cur, "LOCAL")) { in parse_declaration()
1480 ctx->cur = cur; in parse_declaration()
1483 cur = ctx->cur; in parse_declaration()
1484 eat_opt_white( &cur ); in parse_declaration()
1485 if (*cur == ',') { in parse_declaration()
1486 cur++; in parse_declaration()
1487 eat_opt_white( &cur ); in parse_declaration()
1490 if (str_match_nocase_whole(&cur, tgsi_semantic_names[i])) { in parse_declaration()
1493 cur2 = cur; in parse_declaration()
1511 cur = cur2; in parse_declaration()
1517 ctx->cur = cur; in parse_declaration()
1525 cur = ctx->cur; in parse_declaration()
1526 eat_opt_white( &cur ); in parse_declaration()
1527 if (*cur == ',' && in parse_declaration()
1529 cur++; in parse_declaration()
1530 eat_opt_white(&cur); in parse_declaration()
1531 if (str_match_nocase_whole(&cur, "STREAM")) { in parse_declaration()
1534 eat_opt_white(&cur); in parse_declaration()
1535 if (*cur != '(') { in parse_declaration()
1539 cur++; in parse_declaration()
1542 eat_opt_white(&cur); in parse_declaration()
1543 if (!parse_uint(&cur, &stream[i])) { in parse_declaration()
1548 eat_opt_white(&cur); in parse_declaration()
1550 if (*cur != ',') { in parse_declaration()
1554 cur++; in parse_declaration()
1558 if (*cur != ')') { in parse_declaration()
1562 cur++; in parse_declaration()
1569 ctx->cur = cur; in parse_declaration()
1573 cur = ctx->cur; in parse_declaration()
1574 eat_opt_white( &cur ); in parse_declaration()
1575 if (*cur == ',' && !is_vs_input) { in parse_declaration()
1578 cur++; in parse_declaration()
1579 eat_opt_white( &cur ); in parse_declaration()
1581 if (str_match_nocase_whole( &cur, tgsi_interpolate_names[i] )) { in parse_declaration()
1585 ctx->cur = cur; in parse_declaration()
1591 cur = ctx->cur; in parse_declaration()
1592 eat_opt_white( &cur ); in parse_declaration()
1593 if (*cur == ',' && !is_vs_input) { in parse_declaration()
1596 cur++; in parse_declaration()
1597 eat_opt_white( &cur ); in parse_declaration()
1599 if (str_match_nocase_whole( &cur, tgsi_interpolate_locations[i] )) { in parse_declaration()
1602 ctx->cur = cur; in parse_declaration()
1608 cur = ctx->cur; in parse_declaration()
1609 eat_opt_white( &cur ); in parse_declaration()
1610 if (*cur == ',' && !is_vs_input) { in parse_declaration()
1611 cur++; in parse_declaration()
1612 eat_opt_white( &cur ); in parse_declaration()
1613 if (str_match_nocase_whole( &cur, tgsi_invariant_name )) { in parse_declaration()
1615 ctx->cur = cur; in parse_declaration()
1641 if (*ctx->cur == '[') { in parse_immediate()
1644 ++ctx->cur; in parse_immediate()
1646 eat_opt_white( &ctx->cur ); in parse_immediate()
1647 if (!parse_uint( &ctx->cur, &uindex )) { in parse_immediate()
1657 eat_opt_white( &ctx->cur ); in parse_immediate()
1658 if (*ctx->cur != ']') { in parse_immediate()
1663 ctx->cur++; in parse_immediate()
1666 if (!eat_white( &ctx->cur )) { in parse_immediate()
1671 if (str_match_nocase_whole(&ctx->cur, tgsi_immediate_type_names[type])) in parse_immediate()
1704 const char *cur = *pcur; in parse_primitive() local
1706 if (str_match_nocase_whole( &cur, tgsi_primitive_names[i])) { in parse_primitive()
1708 *pcur = cur; in parse_primitive()
1721 const char *cur = *pcur; in parse_fs_coord_origin() local
1723 if (str_match_nocase_whole( &cur, tgsi_fs_coord_origin_names[i])) { in parse_fs_coord_origin()
1725 *pcur = cur; in parse_fs_coord_origin()
1738 const char *cur = *pcur; in parse_fs_coord_pixel_center() local
1740 if (str_match_nocase_whole( &cur, tgsi_fs_coord_pixel_center_names[i])) { in parse_fs_coord_pixel_center()
1742 *pcur = cur; in parse_fs_coord_pixel_center()
1755 const char *cur = *pcur; in parse_property_next_shader() local
1757 if (str_match_nocase_whole( &cur, tgsi_processor_type_names[i])) { in parse_property_next_shader()
1759 *pcur = cur; in parse_property_next_shader()
1774 if (!eat_white( &ctx->cur )) { in parse_property()
1778 if (!parse_identifier( &ctx->cur, id, sizeof(id) )) { in parse_property()
1793 eat_opt_white( &ctx->cur ); in parse_property()
1797 if (!parse_primitive(&ctx->cur, &values[0] )) { in parse_property()
1807 if (!parse_fs_coord_origin(&ctx->cur, &values[0] )) { in parse_property()
1813 if (!parse_fs_coord_pixel_center(&ctx->cur, &values[0] )) { in parse_property()
1819 if (!parse_property_next_shader(&ctx->cur, &values[0] )) { in parse_property()
1826 if (!parse_uint(&ctx->cur, &values[0] )) { in parse_property()
1852 eat_opt_white( &ctx->cur ); in translate()
1860 while (*ctx->cur != '\0') { in translate()
1862 if (!eat_white( &ctx->cur )) { in translate()
1867 if (*ctx->cur == '\0') in translate()
1873 else if (str_match_nocase_whole( &ctx->cur, "DCL" )) { in translate()
1877 else if (str_match_nocase_whole( &ctx->cur, "IMM" )) { in translate()
1881 else if (str_match_nocase_whole( &ctx->cur, "PROPERTY" )) { in translate()
1902 ctx.cur = text; in tgsi_text_translate()