OLD | NEW |
1 ;***************************************************************************** | 1 ;***************************************************************************** |
2 ;* x86inc.asm: x264asm abstraction layer | 2 ;* x86inc.asm: x264asm abstraction layer |
3 ;***************************************************************************** | 3 ;***************************************************************************** |
4 ;* Copyright (C) 2005-2015 x264 project | 4 ;* Copyright (C) 2005-2015 x264 project |
5 ;* | 5 ;* |
6 ;* Authors: Loren Merritt <lorenm@u.washington.edu> | 6 ;* Authors: Loren Merritt <lorenm@u.washington.edu> |
7 ;* Anton Mitrofanov <BugMaster@narod.ru> | 7 ;* Anton Mitrofanov <BugMaster@narod.ru> |
8 ;* Fiona Glaser <fiona@x264.com> | 8 ;* Fiona Glaser <fiona@x264.com> |
9 ;* Henrik Gramner <henrik@gramner.com> | 9 ;* Henrik Gramner <henrik@gramner.com> |
10 ;* | 10 ;* |
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 %assign cpuflags_slowctz (1<<18) | 869 %assign cpuflags_slowctz (1<<18) |
870 %assign cpuflags_lzcnt (1<<19) | 870 %assign cpuflags_lzcnt (1<<19) |
871 %assign cpuflags_aligned (1<<20) ; not a cpu feature, but a function variant | 871 %assign cpuflags_aligned (1<<20) ; not a cpu feature, but a function variant |
872 %assign cpuflags_atom (1<<21) | 872 %assign cpuflags_atom (1<<21) |
873 %assign cpuflags_bmi1 (1<<22)|cpuflags_lzcnt | 873 %assign cpuflags_bmi1 (1<<22)|cpuflags_lzcnt |
874 %assign cpuflags_bmi2 (1<<23)|cpuflags_bmi1 | 874 %assign cpuflags_bmi2 (1<<23)|cpuflags_bmi1 |
875 | 875 |
876 %define cpuflag(x) ((cpuflags & (cpuflags_ %+ x)) == (cpuflags_ %+ x)) | 876 %define cpuflag(x) ((cpuflags & (cpuflags_ %+ x)) == (cpuflags_ %+ x)) |
877 %define notcpuflag(x) ((cpuflags & (cpuflags_ %+ x)) != (cpuflags_ %+ x)) | 877 %define notcpuflag(x) ((cpuflags & (cpuflags_ %+ x)) != (cpuflags_ %+ x)) |
878 | 878 |
| 879 %ifdef __NASM_VER__ |
| 880 %use smartalign |
| 881 %endif |
| 882 |
879 ; Takes an arbitrary number of cpuflags from the above list. | 883 ; Takes an arbitrary number of cpuflags from the above list. |
880 ; All subsequent functions (up to the next INIT_CPUFLAGS) is built for the speci
fied cpu. | 884 ; All subsequent functions (up to the next INIT_CPUFLAGS) is built for the speci
fied cpu. |
881 ; You shouldn't need to invoke this macro directly, it's a subroutine for INIT_M
MX &co. | 885 ; You shouldn't need to invoke this macro directly, it's a subroutine for INIT_M
MX &co. |
882 %macro INIT_CPUFLAGS 0-* | 886 %macro INIT_CPUFLAGS 0-* |
883 %xdefine SUFFIX | 887 %xdefine SUFFIX |
884 %undef cpuname | 888 %undef cpuname |
885 %assign cpuflags 0 | 889 %assign cpuflags 0 |
886 | 890 |
887 %if %0 >= 1 | 891 %if %0 >= 1 |
888 %rep %0 | 892 %rep %0 |
(...skipping 16 matching lines...) Expand all Loading... |
905 %define movnta movntps | 909 %define movnta movntps |
906 %endif | 910 %endif |
907 %if cpuflag(aligned) | 911 %if cpuflag(aligned) |
908 %define movu mova | 912 %define movu mova |
909 %elif cpuflag(sse3) && notcpuflag(ssse3) | 913 %elif cpuflag(sse3) && notcpuflag(ssse3) |
910 %define movu lddqu | 914 %define movu lddqu |
911 %endif | 915 %endif |
912 %endif | 916 %endif |
913 | 917 |
914 %ifdef __NASM_VER__ | 918 %ifdef __NASM_VER__ |
915 %use smartalign | |
916 ALIGNMODE k7 | 919 ALIGNMODE k7 |
917 %elif ARCH_X86_64 || cpuflag(sse2) | 920 %elif ARCH_X86_64 || cpuflag(sse2) |
918 CPU amdnop | 921 CPU amdnop |
919 %else | 922 %else |
920 CPU basicnop | 923 CPU basicnop |
921 %endif | 924 %endif |
922 %endmacro | 925 %endmacro |
923 | 926 |
924 ; Merge mmx and sse* | 927 ; Merge mmx and sse* |
925 ; m# is a simd register of the currently selected size | 928 ; m# is a simd register of the currently selected size |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 ; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug | 1602 ; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug |
1600 %if ARCH_X86_64 == 0 | 1603 %if ARCH_X86_64 == 0 |
1601 %macro vpbroadcastq 2 | 1604 %macro vpbroadcastq 2 |
1602 %if sizeof%1 == 16 | 1605 %if sizeof%1 == 16 |
1603 movddup %1, %2 | 1606 movddup %1, %2 |
1604 %else | 1607 %else |
1605 vbroadcastsd %1, %2 | 1608 vbroadcastsd %1, %2 |
1606 %endif | 1609 %endif |
1607 %endmacro | 1610 %endmacro |
1608 %endif | 1611 %endif |
OLD | NEW |