Lines Matching refs:stack_ptr
120 static int altera_check_stack(int stack_ptr, int count, int *status) in altera_check_stack() argument
122 if (stack_ptr < count) { in altera_check_stack()
243 int stack_ptr = 0; in altera_execute() local
527 if (altera_check_stack(stack_ptr, 1, &status)) { in altera_execute()
528 stack[stack_ptr] = stack[stack_ptr - 1]; in altera_execute()
529 ++stack_ptr; in altera_execute()
533 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
534 long_tmp = stack[stack_ptr - 2]; in altera_execute()
535 stack[stack_ptr - 2] = stack[stack_ptr - 1]; in altera_execute()
536 stack[stack_ptr - 1] = long_tmp; in altera_execute()
540 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
541 --stack_ptr; in altera_execute()
542 stack[stack_ptr - 1] += stack[stack_ptr]; in altera_execute()
546 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
547 --stack_ptr; in altera_execute()
548 stack[stack_ptr - 1] -= stack[stack_ptr]; in altera_execute()
552 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
553 --stack_ptr; in altera_execute()
554 stack[stack_ptr - 1] *= stack[stack_ptr]; in altera_execute()
558 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
559 --stack_ptr; in altera_execute()
560 stack[stack_ptr - 1] /= stack[stack_ptr]; in altera_execute()
564 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
565 --stack_ptr; in altera_execute()
566 stack[stack_ptr - 1] %= stack[stack_ptr]; in altera_execute()
570 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
571 --stack_ptr; in altera_execute()
572 stack[stack_ptr - 1] <<= stack[stack_ptr]; in altera_execute()
576 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
577 --stack_ptr; in altera_execute()
578 stack[stack_ptr - 1] >>= stack[stack_ptr]; in altera_execute()
582 if (altera_check_stack(stack_ptr, 1, &status)) in altera_execute()
583 stack[stack_ptr - 1] ^= (-1L); in altera_execute()
587 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
588 --stack_ptr; in altera_execute()
589 stack[stack_ptr - 1] &= stack[stack_ptr]; in altera_execute()
593 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
594 --stack_ptr; in altera_execute()
595 stack[stack_ptr - 1] |= stack[stack_ptr]; in altera_execute()
599 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
600 --stack_ptr; in altera_execute()
601 stack[stack_ptr - 1] ^= stack[stack_ptr]; in altera_execute()
605 if (!altera_check_stack(stack_ptr, 1, &status)) in altera_execute()
607 stack[stack_ptr - 1] = stack[stack_ptr - 1] ? 0L : 1L; in altera_execute()
610 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
612 --stack_ptr; in altera_execute()
613 stack[stack_ptr - 1] = in altera_execute()
614 (stack[stack_ptr - 1] > stack[stack_ptr]) ? in altera_execute()
619 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
621 --stack_ptr; in altera_execute()
622 stack[stack_ptr - 1] = in altera_execute()
623 (stack[stack_ptr - 1] < stack[stack_ptr]) ? in altera_execute()
628 if ((version > 0) && (stack_ptr == 0)) { in altera_execute()
659 if (altera_check_stack(stack_ptr, 1, &status)) { in altera_execute()
660 pc = stack[--stack_ptr] + code_sect; in altera_execute()
676 if (altera_check_stack(stack_ptr, 4, &status)) { in altera_execute()
677 s32 a = stack[--stack_ptr]; in altera_execute()
678 s32 b = stack[--stack_ptr]; in altera_execute()
679 long_tmp = stack[--stack_ptr]; in altera_execute()
680 count = stack[stack_ptr - 1]; in altera_execute()
687 stack[stack_ptr - 1] = in altera_execute()
698 if (!altera_check_stack(stack_ptr, 1, &status)) in altera_execute()
701 "%ld", stack[--stack_ptr]); in altera_execute()
716 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
718 long_tmp = stack[--stack_ptr]; in altera_execute()
719 count = stack[--stack_ptr]; in altera_execute()
729 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
731 long_tmp = stack[--stack_ptr]; in altera_execute()
732 count = stack[stack_ptr - 1]; in altera_execute()
736 stack[stack_ptr - 1] = get_unaligned_le32(&charbuf[0]); in altera_execute()
744 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
746 long_tmp = stack[--stack_ptr]; in altera_execute()
747 count = stack[--stack_ptr]; in altera_execute()
757 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
759 long_tmp = stack[--stack_ptr]; in altera_execute()
760 count = stack[stack_ptr - 1]; in altera_execute()
764 stack[stack_ptr - 1] = get_unaligned_le32(&charbuf[0]); in altera_execute()
767 if (!altera_check_stack(stack_ptr, 1, &status)) in altera_execute()
769 count = stack[--stack_ptr]; in altera_execute()
778 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
780 count = stack[--stack_ptr]; in altera_execute()
781 long_tmp = stack[--stack_ptr]; in altera_execute()
791 if (altera_check_stack(stack_ptr, 1, &status)) { in altera_execute()
792 count = stack[--stack_ptr]; in altera_execute()
803 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
805 count = stack[--stack_ptr]; in altera_execute()
806 long_tmp = stack[--stack_ptr]; in altera_execute()
812 if (altera_check_stack(stack_ptr, 1, &status)) { in altera_execute()
813 count = stack[--stack_ptr]; in altera_execute()
824 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
825 count = stack[--stack_ptr]; in altera_execute()
826 long_tmp = stack[--stack_ptr]; in altera_execute()
837 if (altera_check_stack(stack_ptr, 1, &status)) { in altera_execute()
838 count = stack[--stack_ptr]; in altera_execute()
849 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
851 count = stack[--stack_ptr]; in altera_execute()
852 long_tmp = stack[--stack_ptr]; in altera_execute()
858 if (altera_check_stack(stack_ptr, 1, &status)) { in altera_execute()
861 ch = (char) stack[--stack_ptr]; in altera_execute()
875 if (altera_check_stack(stack_ptr, 1, &status)) in altera_execute()
876 *exit_code = stack[--stack_ptr]; in altera_execute()
881 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
883 --stack_ptr; in altera_execute()
884 stack[stack_ptr - 1] = in altera_execute()
885 (stack[stack_ptr - 1] == stack[stack_ptr]) ? in altera_execute()
889 if (altera_check_stack(stack_ptr, 1, &status)) in altera_execute()
890 --stack_ptr; in altera_execute()
894 if (!altera_check_stack(stack_ptr, 1, &status)) in altera_execute()
896 if (stack[stack_ptr - 1] < 0) in altera_execute()
897 stack[stack_ptr - 1] = 0 - stack[stack_ptr - 1]; in altera_execute()
915 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
916 long_tmp = stack[stack_ptr - 2]; in altera_execute()
917 stack[stack_ptr - 2] = stack[stack_ptr - 1]; in altera_execute()
918 stack[stack_ptr - 1] = long_tmp; in altera_execute()
923 if (altera_check_stack(stack_ptr, index, &status)) { in altera_execute()
924 long_tmp = stack[stack_ptr - index]; in altera_execute()
925 stack[stack_ptr - index] = stack[stack_ptr - 1]; in altera_execute()
926 stack[stack_ptr - 1] = long_tmp; in altera_execute()
930 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
931 long_tmp = stack[stack_ptr - 2]; in altera_execute()
932 stack[stack_ptr - 2] = stack[stack_ptr - 1]; in altera_execute()
933 stack[stack_ptr - 1] = long_tmp; in altera_execute()
938 if (altera_check_stack(stack_ptr, index, &status)) { in altera_execute()
939 long_tmp = stack[stack_ptr - index]; in altera_execute()
940 stack[stack_ptr - index] = stack[stack_ptr - 1]; in altera_execute()
941 stack[stack_ptr - 1] = long_tmp; in altera_execute()
946 if (altera_check_stack(stack_ptr, index, &status)) { in altera_execute()
947 stack[stack_ptr] = stack[stack_ptr - index]; in altera_execute()
948 ++stack_ptr; in altera_execute()
953 if (altera_check_stack(stack_ptr, index, &status)) { in altera_execute()
954 long_tmp = stack[stack_ptr - index]; in altera_execute()
955 stack[stack_ptr - index] = stack[stack_ptr - 1]; in altera_execute()
956 stack[stack_ptr - 1] = long_tmp; in altera_execute()
960 if (altera_check_stack(stack_ptr, 2, &status)) { in altera_execute()
961 long_tmp = stack[stack_ptr - 2]; in altera_execute()
962 stack[stack_ptr - 2] = stack[stack_ptr - 1]; in altera_execute()
963 stack[stack_ptr - 1] = long_tmp; in altera_execute()
968 if (altera_check_stack(stack_ptr, index, &status)) { in altera_execute()
969 stack[stack_ptr] = stack[stack_ptr - index]; in altera_execute()
970 ++stack_ptr; in altera_execute()
975 if (altera_check_stack(stack_ptr, index, &status)) { in altera_execute()
976 stack[stack_ptr] = stack[stack_ptr - index]; in altera_execute()
977 ++stack_ptr; in altera_execute()
981 stack[stack_ptr++] = 0; in altera_execute()
984 stack[stack_ptr++] = (s32) args[0]; in altera_execute()
987 stack[stack_ptr++] = vars[args[0]]; in altera_execute()
995 stack[stack_ptr++] = pc; in altera_execute()
1008 if (altera_check_stack(stack_ptr, 3, &status)) { in altera_execute()
1009 s32 step = stack[stack_ptr - 1]; in altera_execute()
1010 s32 end = stack[stack_ptr - 2]; in altera_execute()
1011 s32 top = stack[stack_ptr - 3]; in altera_execute()
1022 stack_ptr -= 3; in altera_execute()
1078 if (altera_check_stack(stack_ptr, index, &status)) { in altera_execute()
1079 long_tmp = stack[stack_ptr - index]; in altera_execute()
1080 stack[stack_ptr - index] = stack[stack_ptr - 1]; in altera_execute()
1081 stack[stack_ptr - 1] = long_tmp; in altera_execute()
1090 if (altera_check_stack(stack_ptr, index, &status)) { in altera_execute()
1091 stack[stack_ptr] = stack[stack_ptr - index]; in altera_execute()
1092 ++stack_ptr; in altera_execute()
1101 if (altera_check_stack(stack_ptr, 1, &status)) in altera_execute()
1102 vars[args[0]] = stack[--stack_ptr]; in altera_execute()
1112 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
1160 index = stack[--stack_ptr]; in altera_execute()
1163 longptr_tmp[index] = stack[--stack_ptr]; in altera_execute()
1175 if (!altera_check_stack(stack_ptr, 3, &status)) in altera_execute()
1242 long_count = stack[--stack_ptr]; in altera_execute()
1245 long_idx = stack[--stack_ptr]; in altera_execute()
1272 long_tmp = stack[--stack_ptr]; in altera_execute()
1297 if (altera_check_stack(stack_ptr, 1, &status)) { in altera_execute()
1298 if (stack[--stack_ptr] == 0) { in altera_execute()
1315 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
1317 long_idx = stack[--stack_ptr]; in altera_execute()
1318 long_count = stack[--stack_ptr]; in altera_execute()
1327 long_count = stack[--stack_ptr]; in altera_execute()
1384 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
1386 index = stack[--stack_ptr]; in altera_execute()
1387 count = stack[--stack_ptr]; in altera_execute()
1407 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
1409 index = stack[--stack_ptr]; in altera_execute()
1410 count = stack[--stack_ptr]; in altera_execute()
1430 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
1432 index = stack[--stack_ptr]; in altera_execute()
1433 count = stack[--stack_ptr]; in altera_execute()
1454 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
1456 index = stack[--stack_ptr]; in altera_execute()
1457 count = stack[--stack_ptr]; in altera_execute()
1477 if (altera_check_stack(stack_ptr, 1, &status)) { in altera_execute()
1479 long_tmp = stack[--stack_ptr]; in altera_execute()
1489 if (!altera_check_stack(stack_ptr, 1, &status)) in altera_execute()
1492 index = stack[stack_ptr - 1]; in altera_execute()
1498 stack[stack_ptr - 1] = longptr_tmp[index]; in altera_execute()
1503 stack[stack_ptr - 1] = in altera_execute()
1516 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
1529 count = stack[--stack_ptr]; in altera_execute()
1532 index = stack[stack_ptr - 1]; in altera_execute()
1553 stack[stack_ptr - 1] = long_tmp; in altera_execute()
1562 if (!altera_check_stack(stack_ptr, 1, &status)) in altera_execute()
1565 long_tmp = stack[--stack_ptr]; in altera_execute()
1623 if (!altera_check_stack(stack_ptr, 3, &status)) in altera_execute()
1631 variable_id = stack[--stack_ptr]; in altera_execute()
1632 long_idx = stack[--stack_ptr];/* right indx */ in altera_execute()
1633 long_idx2 = stack[--stack_ptr];/* left indx */ in altera_execute()
1698 if (!altera_check_stack(stack_ptr, 3, &status)) in altera_execute()
1701 copy_count = stack[--stack_ptr]; in altera_execute()
1702 copy_index = stack[--stack_ptr]; in altera_execute()
1703 copy_index2 = stack[--stack_ptr]; in altera_execute()
1713 destleft = stack[--stack_ptr]; in altera_execute()
1855 if (!altera_check_stack(stack_ptr, 3, &status)) in altera_execute()
1858 capture_index = stack[--stack_ptr]; in altera_execute()
1859 scan_index = stack[--stack_ptr]; in altera_execute()
1869 scan_right = stack[--stack_ptr]; in altera_execute()
1870 scan_left = stack[--stack_ptr]; in altera_execute()
1876 long_count = stack[--stack_ptr]; in altera_execute()
1974 if (!altera_check_stack(stack_ptr, 2, &status)) in altera_execute()
1976 long_tmp = stack[--stack_ptr]; in altera_execute()
1982 long_tmp = stack[--stack_ptr]; in altera_execute()
1994 --stack_ptr; /* throw away MAX cycles */ in altera_execute()
1995 --stack_ptr; /* throw away MAX microseconds */ in altera_execute()
2017 if (!altera_check_stack(stack_ptr, 4, &status)) in altera_execute()
2020 index1 = stack[--stack_ptr]; in altera_execute()
2021 index2 = stack[--stack_ptr]; in altera_execute()
2022 mask_index = stack[--stack_ptr]; in altera_execute()
2023 long_count = stack[--stack_ptr]; in altera_execute()
2034 s32 mask_right = stack[--stack_ptr]; in altera_execute()
2035 s32 mask_left = stack[--stack_ptr]; in altera_execute()
2077 stack[stack_ptr++] = long_tmp; in altera_execute()
2090 if ((stack_ptr < 0) || (stack_ptr >= ALTERA_STACK_SIZE)) in altera_execute()