523 |
523 |
524 int neednum = 1; |
524 int neednum = 1; |
525 int regnum = 0; |
525 int regnum = 0; |
526 RegisterType regtype = REG_TYPE_TEMP; |
526 RegisterType regtype = REG_TYPE_TEMP; |
527 |
527 |
528 if (check_token_segment(ctx, "r")) |
528 // Watch out for substrings! oDepth must be checked before oD, since |
|
529 // the latter will match either case. |
|
530 if (check_token_segment(ctx, "oDepth")) |
|
531 { |
|
532 regtype = REG_TYPE_DEPTHOUT; |
|
533 neednum = 0; |
|
534 } // else if |
|
535 else if (check_token_segment(ctx, "vFace")) |
|
536 { |
|
537 regtype = REG_TYPE_MISCTYPE; |
|
538 regnum = (int) MISCTYPE_TYPE_FACE; |
|
539 neednum = 0; |
|
540 } // else if |
|
541 else if (check_token_segment(ctx, "vPos")) |
|
542 { |
|
543 regtype = REG_TYPE_MISCTYPE; |
|
544 regnum = (int) MISCTYPE_TYPE_POSITION; |
|
545 neednum = 0; |
|
546 } // else if |
|
547 else if (check_token_segment(ctx, "oPos")) |
|
548 { |
|
549 regtype = REG_TYPE_RASTOUT; |
|
550 regnum = (int) RASTOUT_TYPE_POSITION; |
|
551 neednum = 0; |
|
552 } // else if |
|
553 else if (check_token_segment(ctx, "oFog")) |
|
554 { |
|
555 regtype = REG_TYPE_RASTOUT; |
|
556 regnum = (int) RASTOUT_TYPE_FOG; |
|
557 neednum = 0; |
|
558 } // else if |
|
559 else if (check_token_segment(ctx, "oPts")) |
|
560 { |
|
561 regtype = REG_TYPE_RASTOUT; |
|
562 regnum = (int) RASTOUT_TYPE_POINT_SIZE; |
|
563 neednum = 0; |
|
564 } // else if |
|
565 else if (check_token_segment(ctx, "aL")) |
|
566 { |
|
567 regtype = REG_TYPE_LOOP; |
|
568 neednum = 0; |
|
569 } // else if |
|
570 else if (check_token_segment(ctx, "oC")) |
|
571 regtype = REG_TYPE_COLOROUT; |
|
572 else if (check_token_segment(ctx, "oT")) |
|
573 regtype = REG_TYPE_OUTPUT; |
|
574 else if (check_token_segment(ctx, "oD")) |
|
575 regtype = REG_TYPE_ATTROUT; |
|
576 else if (check_token_segment(ctx, "r")) |
529 regtype = REG_TYPE_TEMP; |
577 regtype = REG_TYPE_TEMP; |
530 else if (check_token_segment(ctx, "v")) |
578 else if (check_token_segment(ctx, "v")) |
531 regtype = REG_TYPE_INPUT; |
579 regtype = REG_TYPE_INPUT; |
532 else if (check_token_segment(ctx, "c")) |
580 else if (check_token_segment(ctx, "c")) |
533 regtype = REG_TYPE_CONST; |
581 regtype = REG_TYPE_CONST; |
534 else if (check_token_segment(ctx, "i")) |
582 else if (check_token_segment(ctx, "i")) |
535 regtype = REG_TYPE_CONSTINT; |
583 regtype = REG_TYPE_CONSTINT; |
536 else if (check_token_segment(ctx, "b")) |
584 else if (check_token_segment(ctx, "b")) |
537 regtype = REG_TYPE_CONSTBOOL; |
585 regtype = REG_TYPE_CONSTBOOL; |
538 else if (check_token_segment(ctx, "oC")) |
|
539 regtype = REG_TYPE_COLOROUT; |
|
540 else if (check_token_segment(ctx, "s")) |
586 else if (check_token_segment(ctx, "s")) |
541 regtype = REG_TYPE_SAMPLER; |
587 regtype = REG_TYPE_SAMPLER; |
542 else if (check_token_segment(ctx, "oD")) |
|
543 regtype = REG_TYPE_ATTROUT; |
|
544 else if (check_token_segment(ctx, "l")) |
588 else if (check_token_segment(ctx, "l")) |
545 regtype = REG_TYPE_LABEL; |
589 regtype = REG_TYPE_LABEL; |
546 else if (check_token_segment(ctx, "p")) |
590 else if (check_token_segment(ctx, "p")) |
547 regtype = REG_TYPE_PREDICATE; |
591 regtype = REG_TYPE_PREDICATE; |
548 else if (check_token_segment(ctx, "o")) |
592 else if (check_token_segment(ctx, "o")) |
549 regtype = REG_TYPE_OUTPUT; |
593 regtype = REG_TYPE_OUTPUT; |
550 else if (check_token_segment(ctx, "oT")) |
|
551 regtype = REG_TYPE_OUTPUT; |
|
552 else if (check_token_segment(ctx, "a")) |
594 else if (check_token_segment(ctx, "a")) |
553 regtype = REG_TYPE_ADDRESS; |
595 regtype = REG_TYPE_ADDRESS; |
554 else if (check_token_segment(ctx, "t")) |
596 else if (check_token_segment(ctx, "t")) |
555 regtype = REG_TYPE_ADDRESS; |
597 regtype = REG_TYPE_ADDRESS; |
556 else if (check_token_segment(ctx, "oDepth")) |
|
557 { |
|
558 regtype = REG_TYPE_DEPTHOUT; |
|
559 neednum = 0; |
|
560 } // else if |
|
561 else if (check_token_segment(ctx, "aL")) |
|
562 { |
|
563 regtype = REG_TYPE_LOOP; |
|
564 neednum = 0; |
|
565 } // else if |
|
566 else if (check_token_segment(ctx, "vPos")) |
|
567 { |
|
568 regtype = REG_TYPE_MISCTYPE; |
|
569 regnum = (int) MISCTYPE_TYPE_POSITION; |
|
570 neednum = 0; |
|
571 } // else if |
|
572 else if (check_token_segment(ctx, "vFace")) |
|
573 { |
|
574 regtype = REG_TYPE_MISCTYPE; |
|
575 regnum = (int) MISCTYPE_TYPE_FACE; |
|
576 neednum = 0; |
|
577 } // else if |
|
578 else if (check_token_segment(ctx, "oPos")) |
|
579 { |
|
580 regtype = REG_TYPE_RASTOUT; |
|
581 regnum = (int) RASTOUT_TYPE_POSITION; |
|
582 neednum = 0; |
|
583 } // else if |
|
584 else if (check_token_segment(ctx, "oFog")) |
|
585 { |
|
586 regtype = REG_TYPE_RASTOUT; |
|
587 regnum = (int) RASTOUT_TYPE_FOG; |
|
588 neednum = 0; |
|
589 } // else if |
|
590 else if (check_token_segment(ctx, "oPts")) |
|
591 { |
|
592 regtype = REG_TYPE_RASTOUT; |
|
593 regnum = (int) RASTOUT_TYPE_POINT_SIZE; |
|
594 neednum = 0; |
|
595 } // else if |
|
596 |
598 |
597 //case REG_TYPE_TEMPFLOAT16: // !!! FIXME: don't know this asm string |
599 //case REG_TYPE_TEMPFLOAT16: // !!! FIXME: don't know this asm string |
598 |
600 |
599 else |
601 else |
600 { |
602 { |