Changeset 2f436b in git for Singular/p_MemCmp.h
- Timestamp:
- Dec 31, 2000, 4:14:47 PM (23 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- e609098c45a74ac91c002ffa7ece5eebe7f8c002
- Parents:
- 33ec1145a109507ad3e3cf4a69a847b703358e93
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/p_MemCmp.h
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_MemCmp.h,v 1. 1 2000-09-04 14:08:17 obachman Exp $9 * Version: $Id: p_MemCmp.h,v 1.2 2000-12-31 15:14:37 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef P_MEM_CMP_H … … 765 765 while (0) 766 766 767 /*************************************************************** 768 * 769 * Bitmask 770 * 771 *******************************************************************/ 772 #define _p_MemCmp_Bitmask_Declare(s1, s2, bitmask) \ 773 const unsigned long* _s1 = ((unsigned long*) s1); \ 774 const unsigned long* _s2 = ((unsigned long*) s2); \ 775 register const unsigned long _bitmask = bitmask; \ 776 register unsigned long _v1; \ 777 register unsigned long _v2; \ 778 register unsigned long _i \ 779 780 781 #define p_MemCmp_Bitmask_LengthGeneral(s1, s2, bitmask, length, actionG, actionS) \ 782 do \ 783 { \ 784 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 785 const unsigned long _l = (unsigned long) length; \ 786 \ 787 _i=0; \ 788 \ 789 while (_i < _l) \ 790 { \ 791 _v1 = _s1[_i]; \ 792 _v2 = _s2[_i]; \ 793 \ 794 if ((_v1 > _v2) || \ 795 (((_v1 & _bitmask) ^ (_v2 & _bitmask)) != ((_v2 - _v1) & _bitmask))) \ 796 actionS; \ 797 _i++; \ 798 } \ 799 actionG; \ 800 } \ 801 while (0) 802 803 804 #define _p_MemCmp_Bitmask(i, actionS) \ 805 do \ 806 { \ 807 _i = i; \ 808 _v1 = _s1[i]; \ 809 _v2 = _s2[i]; \ 810 if ((_v1 > _v2) || \ 811 (((_v1 & _bitmask) ^ (_v2 & _bitmask)) != ((_v2 - _v1) & _bitmask))) \ 812 actionS; \ 813 } \ 814 while (0) 815 816 #define _p_MemCmp_Bitmask_LengthTwo(actionS) \ 817 do \ 818 { \ 819 _p_MemCmp_Bitmask(0, actionS); \ 820 _p_MemCmp_Bitmask(1, actionS); \ 821 } \ 822 while (0) 823 824 #define _p_MemCmp_Bitmask_LengthThree(actionS) \ 825 do \ 826 { \ 827 _p_MemCmp_Bitmask_LengthTwo(actionS); \ 828 _p_MemCmp_Bitmask(2, actionS); \ 829 } \ 830 while (0) 831 832 #define _p_MemCmp_Bitmask_LengthFour(actionS) \ 833 do \ 834 { \ 835 _p_MemCmp_Bitmask_LengthThree(actionS); \ 836 _p_MemCmp_Bitmask(3, actionS); \ 837 } \ 838 while (0) 839 840 841 #define _p_MemCmp_Bitmask_LengthFive(actionS) \ 842 do \ 843 { \ 844 _p_MemCmp_Bitmask_LengthFour(actionS); \ 845 _p_MemCmp_Bitmask(4, actionS); \ 846 } \ 847 while (0) 848 849 850 #define _p_MemCmp_Bitmask_LengthSix(actionS) \ 851 do \ 852 { \ 853 _p_MemCmp_Bitmask_LengthFive(actionS); \ 854 _p_MemCmp_Bitmask(5, actionS); \ 855 } \ 856 while (0) 857 858 #define _p_MemCmp_Bitmask_LengthSeven(actionS) \ 859 do \ 860 { \ 861 _p_MemCmp_Bitmask_LengthSix(actionS); \ 862 _p_MemCmp_Bitmask(6, actionS); \ 863 } \ 864 while (0) 865 866 #define _p_MemCmp_Bitmask_LengthEight(actionS) \ 867 do \ 868 { \ 869 _p_MemCmp_Bitmask_LengthSeven(actionS); \ 870 _p_MemCmp_Bitmask(7, actionS); \ 871 } \ 872 while (0) 873 874 #define p_MemCmp_Bitmask_LengthZero(s1, s2, bitmask, length, actionG, actionS) actionG 875 876 #define p_MemCmp_Bitmask_LengthOne(s1, s2, bitmask, length, actionG, actionS) \ 877 do \ 878 { \ 879 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 880 _p_MemCmp_Bitmask(0, actionS); \ 881 actionG; \ 882 } \ 883 while (0) 884 885 #define p_MemCmp_Bitmask_LengthTwo(s1, s2, bitmask, length, actionG, actionS) \ 886 do \ 887 { \ 888 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 889 _p_MemCmp_Bitmask_LengthTwo(actionS); \ 890 actionG; \ 891 } \ 892 while (0) 893 894 #define p_MemCmp_Bitmask_LengthThree(s1, s2, bitmask, length, actionG, actionS) \ 895 do \ 896 { \ 897 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 898 _p_MemCmp_Bitmask_LengthThree(actionS); \ 899 actionG; \ 900 } \ 901 while (0) 902 903 #define p_MemCmp_Bitmask_LengthFour(s1, s2, bitmask, length, actionG, actionS) \ 904 do \ 905 { \ 906 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 907 _p_MemCmp_Bitmask_LengthFour(actionS); \ 908 actionG; \ 909 } \ 910 while (0) 911 912 #define p_MemCmp_Bitmask_LengthFive(s1, s2, bitmask, length, actionG, actionS) \ 913 do \ 914 { \ 915 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 916 _p_MemCmp_Bitmask_LengthFive(actionS); \ 917 actionG; \ 918 } \ 919 while (0) 920 921 #define p_MemCmp_Bitmask_LengthSix(s1, s2, bitmask, length, actionG, actionS) \ 922 do \ 923 { \ 924 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 925 _p_MemCmp_Bitmask_LengthSix(actionS); \ 926 actionG; \ 927 } \ 928 while (0) 929 930 #define p_MemCmp_Bitmask_LengthSeven(s1, s2, bitmask, length, actionG, actionS) \ 931 do \ 932 { \ 933 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 934 _p_MemCmp_Bitmask_LengthSeven(actionS); \ 935 actionG; \ 936 } \ 937 while (0) 938 939 #define p_MemCmp_Bitmask_LengthEigth(s1, s2, bitmask, length, actionG, actionS) \ 940 do \ 941 { \ 942 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 943 _p_MemCmp_Bitmask_LengthEigth(actionS); \ 944 actionG; \ 945 } \ 946 while (0) 947 948 767 949 #endif // P_MEM_CMP
Note: See TracChangeset
for help on using the changeset viewer.