Compare commits
2488
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86dbc8a437 | ||
|
|
4c93274a31 | ||
|
|
bd7ea15f50 | ||
|
|
1df9591a8c | ||
|
|
23753277fa | ||
|
|
95053e8c6e | ||
|
|
0ff0a6909b | ||
|
|
40e445ade8 | ||
|
|
8c08b5c5b5 | ||
|
|
a07e9b0c5c | ||
|
|
0f4f821f76 | ||
|
|
cf4d9e9f62 | ||
|
|
d25f7b0ac2 | ||
|
|
15caf3fd1b | ||
|
|
0eb47c2c6b | ||
|
|
9de546d581 | ||
|
|
33bd19d2a3 | ||
|
|
4e1a7741fb | ||
|
|
e2f4851405 | ||
|
|
7662e7b260 | ||
|
|
4a12bfed63 | ||
|
|
1bf492e704 | ||
|
|
8e3fc16de5 | ||
|
|
d110857224 | ||
|
|
09a6013b79 | ||
|
|
60254acc8a | ||
|
|
6c6aa92560 | ||
|
|
79c9f4a1b8 | ||
|
|
ae20787a43 | ||
|
|
a8fda51877 | ||
|
|
dac0fa9d4a | ||
|
|
140c5c5680 | ||
|
|
d5d7d5bbef | ||
|
|
4fd65fbf17 | ||
|
|
53c87a2ec8 | ||
|
|
fc7a76fa67 | ||
|
|
4630132503 | ||
|
|
81185adc9b | ||
|
|
3c7862a953 | ||
|
|
617100a4b9 | ||
|
|
4ab3b7c36a | ||
|
|
045c3b9099 | ||
|
|
0d56e0eb04 | ||
|
|
08757fe9cd | ||
|
|
38c347f9be | ||
|
|
7ac397ad35 | ||
|
|
bbc55cee7c | ||
|
|
e7325f6a54 | ||
|
|
ecf885023e | ||
|
|
e9328c5dfd | ||
|
|
4c54822dca | ||
|
|
b34d224a7c | ||
|
|
9dd6dc3b7c | ||
|
|
688a867a5a | ||
|
|
06c4274e0f | ||
|
|
c2275ce57e | ||
|
|
528b23a699 | ||
|
|
68feaa034e | ||
|
|
91809d98d7 | ||
|
|
dd857c798f | ||
|
|
8cfc1a3893 | ||
|
|
24b6002b09 | ||
|
|
049b08ca0f | ||
|
|
84b4242cdb | ||
|
|
890cb29e7b | ||
|
|
8d5b349e27 | ||
|
|
e04b3127bc | ||
|
|
cdb12a2877 | ||
|
|
c46a2b48fd | ||
|
|
c345dc3ad6 | ||
|
|
c9bac63dcd | ||
|
|
17a17f7e18 | ||
|
|
b27a31f572 | ||
|
|
f785496706 | ||
|
|
208297aa12 | ||
|
|
a2189c43e8 | ||
|
|
4ff7f4fab9 | ||
|
|
18c3557f70 | ||
|
|
0da9a187a0 | ||
|
|
a7772b05aa | ||
|
|
03f24bbba5 | ||
|
|
d2db02fa10 | ||
|
|
22efa65df6 | ||
|
|
a6e9fc994c | ||
|
|
14bd6d7002 | ||
|
|
6c25c3eb63 | ||
|
|
acb5038c8a | ||
|
|
19932d1b7f | ||
|
|
f95089bc85 | ||
|
|
a8783fe64a | ||
|
|
d4d9a6a936 | ||
|
|
7207342964 | ||
|
|
cef97d043c | ||
|
|
80c0fae902 | ||
|
|
fd6eca502f | ||
|
|
a1c750b5a2 | ||
|
|
226f9e1fb5 | ||
|
|
8507bf0945 | ||
|
|
6e73a383db | ||
|
|
a705ecb6d6 | ||
|
|
1456b1d428 | ||
|
|
f81d0ce3ac | ||
|
|
5a40ecfa7e | ||
|
|
867afa5b7b | ||
|
|
2b761f364e | ||
|
|
ef9dd1951d | ||
|
|
392e7d22f0 | ||
|
|
0aac46598b | ||
|
|
ff64407196 | ||
|
|
ab7694016a | ||
|
|
dac69beaa6 | ||
|
|
b4dda0eb79 | ||
|
|
1a37087138 | ||
|
|
a89b7b3c3b | ||
|
|
a6527de9c9 | ||
|
|
9805370657 | ||
|
|
ff669ab8f4 | ||
|
|
4efa364c7b | ||
|
|
ca932f7669 | ||
|
|
7297e6ffff | ||
|
|
b04f338936 | ||
|
|
bb4cd86ea4 | ||
|
|
ba404619cc | ||
|
|
a88881677e | ||
|
|
7b7c88337d | ||
|
|
a9b96ac13f | ||
|
|
0e27f93cb2 | ||
|
|
4e725e928b | ||
|
|
d9fd88e841 | ||
|
|
abf293aa0a | ||
|
|
b71f37e1f6 | ||
|
|
b13918bd79 | ||
|
|
d56cfe1c7f | ||
|
|
bdc547c7cc | ||
|
|
d880935a86 | ||
|
|
a0026910d9 | ||
|
|
ba78d28f59 | ||
|
|
8656ac20ec | ||
|
|
3a41c0af2c | ||
|
|
b5a2f1337d | ||
|
|
0eabcdddd3 | ||
|
|
7b8fa2e8a2 | ||
|
|
762af34bdd | ||
|
|
8cf50641ed | ||
|
|
18e8a2dfbd | ||
|
|
7634bf6e4b | ||
|
|
11e4d67237 | ||
|
|
687099d882 | ||
|
|
d09daacf60 | ||
|
|
a48d986269 | ||
|
|
a72873c854 | ||
|
|
d5e09d228d | ||
|
|
60b0c0154f | ||
|
|
5a7230da1f | ||
|
|
a8dc2540de | ||
|
|
03f654c62e | ||
|
|
7aeb056b32 | ||
|
|
4262431328 | ||
|
|
11d5e26d82 | ||
|
|
3ae221bf73 | ||
|
|
f3b787a0ea | ||
|
|
63b3971140 | ||
|
|
8d3863ed00 | ||
|
|
dc9fa0eed0 | ||
|
|
36c541a2a5 | ||
|
|
0ec8f6a299 | ||
|
|
4be6966f63 | ||
|
|
49fab5e8e0 | ||
|
|
a8ee444842 | ||
|
|
d710ab6245 | ||
|
|
95d3b09224 | ||
|
|
51f418e87d | ||
|
|
f67d01d82d | ||
|
|
b8c8e81bac | ||
|
|
c729538394 | ||
|
|
301fe63a39 | ||
|
|
bd9ebf578f | ||
|
|
114208ac37 | ||
|
|
8f2695cba2 | ||
|
|
bd9ac93df7 | ||
|
|
dbb9b8d86d | ||
|
|
03af3dbb4c | ||
|
|
e13cb9bad7 | ||
|
|
08029410a9 | ||
|
|
dbd2675126 | ||
|
|
dbc07cff99 | ||
|
|
afac2b9b40 | ||
|
|
ad930f89af | ||
|
|
e139788935 | ||
|
|
919b8b2c31 | ||
|
|
8393de5f67 | ||
|
|
a845da963f | ||
|
|
5b9b4ae06c | ||
|
|
3be061ab61 | ||
|
|
f8bfa6a13f | ||
|
|
22a7ef2b20 | ||
|
|
699962846a | ||
|
|
072dcedc4d | ||
|
|
5697bc9113 | ||
|
|
e08e41c5b8 | ||
|
|
c1a682fda4 | ||
|
|
d8bb8524d9 | ||
|
|
6b89ac1a8e | ||
|
|
ef480fd1c3 | ||
|
|
a8977c8eca | ||
|
|
05bf30e437 | ||
|
|
91616608d7 | ||
|
|
add04f30dd | ||
|
|
f9c6035768 | ||
|
|
2557abe139 | ||
|
|
a110de4719 | ||
|
|
b7557ac3ea | ||
|
|
c870146e64 | ||
|
|
c1c7276602 | ||
|
|
0e032a023d | ||
|
|
46e80802e6 | ||
|
|
5892116ff8 | ||
|
|
96a1da0d6e | ||
|
|
1427c0a0d2 | ||
|
|
d891400ac7 | ||
|
|
98af7cc9ce | ||
|
|
a439e386e8 | ||
|
|
6c9a8a73a2 | ||
|
|
af945a102d | ||
|
|
4c25034bcc | ||
|
|
9010d6acd5 | ||
|
|
050881ad18 | ||
|
|
5d71b0bd04 | ||
|
|
3c5854e976 | ||
|
|
68081e661a | ||
|
|
859ca9ab03 | ||
|
|
d64f5f5271 | ||
|
|
fb2f51ff97 | ||
|
|
656ef5de5a | ||
|
|
ad10ae64b5 | ||
|
|
6e26fc5e1f | ||
|
|
3205290a9e | ||
|
|
ace88c9cb2 | ||
|
|
8331538e46 | ||
|
|
0600afb2cb | ||
|
|
3c3b9f2904 | ||
|
|
81838b7ff8 | ||
|
|
930f1383c9 | ||
|
|
bea5024322 | ||
|
|
d0add46b12 | ||
|
|
a4df8fdcbd | ||
|
|
43dfe0c2fc | ||
|
|
e1c7700b51 | ||
|
|
b1bdaa246c | ||
|
|
d9c55182a4 | ||
|
|
e526e4063c | ||
|
|
f05b994974 | ||
|
|
67f67087e0 | ||
|
|
f8b5c6ee3a | ||
|
|
11f1309a25 | ||
|
|
b4d4b35969 | ||
|
|
9a9298d45e | ||
|
|
c8ea1cec9d | ||
|
|
0040d3d1c6 | ||
|
|
8e3815e8ef | ||
|
|
8e915c9119 | ||
|
|
c8ffcbc3c4 | ||
|
|
8b6685bafc | ||
|
|
bf2b852b98 | ||
|
|
82bcba1968 | ||
|
|
3f91ca52be | ||
|
|
9d45e669aa | ||
|
|
e43652cc23 | ||
|
|
5b4d34cb63 | ||
|
|
aa3b42065b | ||
|
|
35622c3488 | ||
|
|
ae3f2e040d | ||
|
|
4e4f416e58 | ||
|
|
35278fecae | ||
|
|
db1ee1bdf1 | ||
|
|
c1323190b9 | ||
|
|
b0bb318732 | ||
|
|
2c7f536185 | ||
|
|
10097b03ce | ||
|
|
c6f3587f2a | ||
|
|
a9aba84b5a | ||
|
|
4e9fcb2519 | ||
|
|
d51b2e3efd | ||
|
|
afe3b030c8 | ||
|
|
1265a0d673 | ||
|
|
7c049f400e | ||
|
|
d4cf6d016b | ||
|
|
38fd7571e4 | ||
|
|
25b9c8dfac | ||
|
|
426af2c84b | ||
|
|
600089c23f | ||
|
|
822765dda5 | ||
|
|
72494b0e68 | ||
|
|
936d4947c8 | ||
|
|
073a46732f | ||
|
|
36e0a52128 | ||
|
|
c86385b23c | ||
|
|
7ff38953eb | ||
|
|
d818dacd8b | ||
|
|
0e778644a4 | ||
|
|
7c80f577fb | ||
|
|
a9de062e74 | ||
|
|
6f5cb39217 | ||
|
|
7d8e05f455 | ||
|
|
0b1f33c7b8 | ||
|
|
aecb76c57a | ||
|
|
8d6579c23e | ||
|
|
f41487af23 | ||
|
|
a2d6302fe0 | ||
|
|
74470d1602 | ||
|
|
ce3562a47c | ||
|
|
3b78e09c3f | ||
|
|
25f847caa3 | ||
|
|
6dc1d01006 | ||
|
|
f3e462c3ff | ||
|
|
40771f9a24 | ||
|
|
1c0a2f8725 | ||
|
|
9d1a22aa68 | ||
|
|
b643df8dc7 | ||
|
|
120f13fa5f | ||
|
|
fe1ff55842 | ||
|
|
54d3343a3a | ||
|
|
8ea1cff2c7 | ||
|
|
66eb5a12b5 | ||
|
|
2319c82d27 | ||
|
|
d8b3bedc16 | ||
|
|
ef3147b936 | ||
|
|
8394e81e53 | ||
|
|
375cf9569d | ||
|
|
a6430f5737 | ||
|
|
8d218554b9 | ||
|
|
dcee04517f | ||
|
|
32b9731433 | ||
|
|
e0fe856b24 | ||
|
|
529ff8e79e | ||
|
|
79812d71c3 | ||
|
|
63bf0f1c57 | ||
|
|
770def83f2 | ||
|
|
d7f2fdc6a5 | ||
|
|
a609ed7b5a | ||
|
|
f8107b95d8 | ||
|
|
6b30be2ab3 | ||
|
|
8bdefe49cc | ||
|
|
4e97aad275 | ||
|
|
ba203512e1 | ||
|
|
649fb96c3e | ||
|
|
a3690782bd | ||
|
|
58a412f3ed | ||
|
|
4c0185a4c6 | ||
|
|
669d46b2ed | ||
|
|
f2894e8fae | ||
|
|
c81ebaebbf | ||
|
|
96bbdc0a3c | ||
|
|
5eff653a31 | ||
|
|
a7ef4a7357 | ||
|
|
c07e5832bd | ||
|
|
a680355e5d | ||
|
|
4c86edcc79 | ||
|
|
57454c5d06 | ||
|
|
332db1f3ec | ||
|
|
d3ece0a3ed | ||
|
|
3626fdc040 | ||
|
|
4bf4fee24c | ||
|
|
d1c3adffb8 | ||
|
|
1aaad7d8a3 | ||
|
|
c430e7b9b1 | ||
|
|
f3c6de5bcb | ||
|
|
99c00ca4c8 | ||
|
|
c43f9921a5 | ||
|
|
dfb896a778 | ||
|
|
1348f18d4c | ||
|
|
0877719ba2 | ||
|
|
6a1d7f6263 | ||
|
|
4ad4b85da9 | ||
|
|
bf2da7e69f | ||
|
|
0f538cbe2f | ||
|
|
283ace8d97 | ||
|
|
e5c768abd8 | ||
|
|
111cf21ff1 | ||
|
|
000ba58b99 | ||
|
|
d914110bfe | ||
|
|
20cd2b44e6 | ||
|
|
4747e78654 | ||
|
|
ffa340a39e | ||
|
|
2861a279e1 | ||
|
|
f750d1374f | ||
|
|
5d15ecd197 | ||
|
|
101682cb56 | ||
|
|
ce1622f13c | ||
|
|
042edb3781 | ||
|
|
e4616fc3cf | ||
|
|
4d7dcf9166 | ||
|
|
9fb6e088da | ||
|
|
d63e2056bd | ||
|
|
ef80ecd326 | ||
|
|
7fb6adf79a | ||
|
|
9cb8e10074 | ||
|
|
9686263d87 | ||
|
|
4101f6ade0 | ||
|
|
794c5c093a | ||
|
|
f45d35c62c | ||
|
|
d0e4f1518d | ||
|
|
b6bc9c9b70 | ||
|
|
179892cfb6 | ||
|
|
4a0383d971 | ||
|
|
b5ccb3230b | ||
|
|
fc006f71ec | ||
|
|
8725251c34 | ||
|
|
c2f5395618 | ||
|
|
9943d8fe00 | ||
|
|
a87a8b8baf | ||
|
|
725b054067 | ||
|
|
a27e0b5dea | ||
|
|
664ed3f6ce | ||
|
|
0b3f6cda76 | ||
|
|
6e09b4f791 | ||
|
|
d09918fab3 | ||
|
|
0443adfad1 | ||
|
|
e96986b506 | ||
|
|
279dd39acf | ||
|
|
478d0f60a7 | ||
|
|
3cea4e59e1 | ||
|
|
63fbdc73af | ||
|
|
e0c7242c0b | ||
|
|
28e491c89e | ||
|
|
3eefbeaaea | ||
|
|
2209af9a25 | ||
|
|
1b1998d670 | ||
|
|
f9f1ccd379 | ||
|
|
b3ca42c79e | ||
|
|
18be8638fb | ||
|
|
66ec9b743c | ||
|
|
3a67575b1e | ||
|
|
80dafcbf8c | ||
|
|
0fe7cbaa70 | ||
|
|
2fb3f2a5ac | ||
|
|
22b7150b65 | ||
|
|
f93255e95f | ||
|
|
88fb38aeeb | ||
|
|
7b972a8a76 | ||
|
|
df29cd20a9 | ||
|
|
df75c832f3 | ||
|
|
0e2d183a4e | ||
|
|
8b4636cb04 | ||
|
|
33be1a389e | ||
|
|
4a31004780 | ||
|
|
13971f5cd6 | ||
|
|
e36f2853bd | ||
|
|
6ef80730c2 | ||
|
|
8a51e15310 | ||
|
|
629ce6324f | ||
|
|
a0f73bc3ff | ||
|
|
76bc0e2993 | ||
|
|
8b13b59960 | ||
|
|
26445319d3 | ||
|
|
39203b7444 | ||
|
|
1d1200cad7 | ||
|
|
6427db0e3c | ||
|
|
f9cc5e98cc | ||
|
|
b612fbcb63 | ||
|
|
862ccc35bf | ||
|
|
e4476f3c1f | ||
|
|
d881f062bf | ||
|
|
f7fa12be9c | ||
|
|
9b03ab695e | ||
|
|
942db2c4a1 | ||
|
|
2ee0dda407 | ||
|
|
16604998d0 | ||
|
|
69874a8a3a | ||
|
|
6400a8c543 | ||
|
|
14a9fd4ed2 | ||
|
|
9e32fb9bfd | ||
|
|
4e0d05553d | ||
|
|
96a234e4ef | ||
|
|
18fdab6e68 | ||
|
|
82271f0e23 | ||
|
|
41030eb022 | ||
|
|
08eef19a76 | ||
|
|
216a2c78f8 | ||
|
|
692d20f6d8 | ||
|
|
3a9e59ebca | ||
|
|
4c5fabfd5c | ||
|
|
dbd110dd5a | ||
|
|
275c83f1c2 | ||
|
|
7fe346d39d | ||
|
|
f0e70886a4 | ||
|
|
59e19d7f12 | ||
|
|
b054e111e2 | ||
|
|
aa3bb2a948 | ||
|
|
203601eae1 | ||
|
|
12a488aa01 | ||
|
|
d2a13ae296 | ||
|
|
20b5bdfe63 | ||
|
|
b5f4244a5c | ||
|
|
58046a2862 | ||
|
|
2026a7e6af | ||
|
|
d18963169c | ||
|
|
e8d2a1b515 | ||
|
|
8af35f98e9 | ||
|
|
30fd046199 | ||
|
|
ce9879e62c | ||
|
|
14b31a792e | ||
|
|
465d1cd47c | ||
|
|
17956340d6 | ||
|
|
7262945a72 | ||
|
|
09c360278c | ||
|
|
1680d0fdc4 | ||
|
|
dd617dbf43 | ||
|
|
a662ce35fc | ||
|
|
041279610b | ||
|
|
8d20fa7e41 | ||
|
|
2564a3a199 | ||
|
|
80db42cd53 | ||
|
|
cda4694b42 | ||
|
|
e6db5ce071 | ||
|
|
a3afc6797b | ||
|
|
c10ba17b54 | ||
|
|
9a62db7429 | ||
|
|
df9fee100e | ||
|
|
48ca8917c6 | ||
|
|
af79490da7 | ||
|
|
f2b4cc1b82 | ||
|
|
a3112b4c03 | ||
|
|
7e8af8ddcf | ||
|
|
635ec24694 | ||
|
|
6228fc7802 | ||
|
|
01da5054b3 | ||
|
|
642278fa61 | ||
|
|
86e0070c3f | ||
|
|
84b5dc7d3e | ||
|
|
fa354f6ed3 | ||
|
|
bbf9945fbb | ||
|
|
cd134ed838 | ||
|
|
7aab7612a3 | ||
|
|
d5a8bd3666 | ||
|
|
0a1372e854 | ||
|
|
341240d6cf | ||
|
|
f5d2b1cab7 | ||
|
|
40bab9887c | ||
|
|
f06b73061a | ||
|
|
6f46352f62 | ||
|
|
999f95f6e0 | ||
|
|
0d69ecd4d7 | ||
|
|
5bdfc6c67f | ||
|
|
2df6fc9393 | ||
|
|
263938ff16 | ||
|
|
2023e73e85 | ||
|
|
590bddcdaa | ||
|
|
f2fc02b637 | ||
|
|
bce1b16bbf | ||
|
|
028d75a013 | ||
|
|
058592185c | ||
|
|
4364046ed3 | ||
|
|
e993595586 | ||
|
|
18fb671ae2 | ||
|
|
d8b3bf3998 | ||
|
|
4b5880ff55 | ||
|
|
95c5cb5063 | ||
|
|
bf7fee2e80 | ||
|
|
c90b753d68 | ||
|
|
40b9aca266 | ||
|
|
51f96a8267 | ||
|
|
25ce563837 | ||
|
|
2d910b268c | ||
|
|
ea2655a4cc | ||
|
|
210a8fa21c | ||
|
|
425bb10a8c | ||
|
|
fcf26bca69 | ||
|
|
70a8f0e4ec | ||
|
|
3b8d32e965 | ||
|
|
60e6eab02f | ||
|
|
6ee24ab770 | ||
|
|
92bf7a6cb8 | ||
|
|
4188ec1410 | ||
|
|
aece2902e7 | ||
|
|
331c3cd9cd | ||
|
|
a4d9a2601d | ||
|
|
399825ece1 | ||
|
|
34f58bb69d | ||
|
|
a10ed0de14 | ||
|
|
8c311bcacb | ||
|
|
3648854745 | ||
|
|
2b7c126b3e | ||
|
|
ed389c6198 | ||
|
|
96b580e4b1 | ||
|
|
c2aa7f84dd | ||
|
|
c8de04f584 | ||
|
|
ab315c8ce7 | ||
|
|
5a408d2652 | ||
|
|
9c2754fb72 | ||
|
|
4b384e7ca5 | ||
|
|
90f48f9b51 | ||
|
|
38cdc35011 | ||
|
|
22f6d1a6cb | ||
|
|
f10902f3a4 | ||
|
|
a57e1bce5c | ||
|
|
69ddc5f1b3 | ||
|
|
27d70b9324 | ||
|
|
a38163e873 | ||
|
|
28bbc82116 | ||
|
|
8dbfdbe23c | ||
|
|
dd31ecde27 | ||
|
|
058d336565 | ||
|
|
bd5c48e814 | ||
|
|
a3e2e9ebba | ||
|
|
8e3b0a4e04 | ||
|
|
6f47214a47 | ||
|
|
6b6babf595 | ||
|
|
0bfb3fccc1 | ||
|
|
48de439450 | ||
|
|
977cc31050 | ||
|
|
f03bbbeda5 | ||
|
|
a136372ddf | ||
|
|
fe4a310acd | ||
|
|
c8653aa894 | ||
|
|
922066b360 | ||
|
|
9990f766f4 | ||
|
|
04e9ee82c7 | ||
|
|
f364618c0f | ||
|
|
90ba4f6bf6 | ||
|
|
674f5f13d5 | ||
|
|
5cdcf16e1c | ||
|
|
c4dc08825d | ||
|
|
3108be60e7 | ||
|
|
edf4b495a3 | ||
|
|
0fbcbf5bbe | ||
|
|
0de000a44b | ||
|
|
b8e383edc8 | ||
|
|
d56ff38b05 | ||
|
|
c84be47e1e | ||
|
|
3704b58214 | ||
|
|
4e10b81696 | ||
|
|
123f71699e | ||
|
|
62d01f656d | ||
|
|
69cbd82b3b | ||
|
|
a08316c716 | ||
|
|
7c92d705cb | ||
|
|
9f2ce6dd33 | ||
|
|
ef7bb6e656 | ||
|
|
317ac99455 | ||
|
|
30d9e9723e | ||
|
|
9638b58cba | ||
|
|
33c5055b63 | ||
|
|
d93b9bf34c | ||
|
|
035ee5d345 | ||
|
|
17d8aefe7e | ||
|
|
ff36f706c8 | ||
|
|
dcde5e3fd1 | ||
|
|
e241414fa9 | ||
|
|
802164ade9 | ||
|
|
fe042fe7a0 | ||
|
|
6cca401b02 | ||
|
|
e0466328fb | ||
|
|
d8aec0e93b | ||
|
|
1dbea98dbb | ||
|
|
fb3b3a7fc9 | ||
|
|
5be525ff0b | ||
|
|
00b6f06861 | ||
|
|
c90bc36942 | ||
|
|
90942b01f1 | ||
|
|
10b39147e7 | ||
|
|
d0bc45094f | ||
|
|
47c7ed06fb | ||
|
|
cdf62f7a84 | ||
|
|
6f2b25fed6 | ||
|
|
6f4cf90254 | ||
|
|
eb936a9e08 | ||
|
|
8831da2271 | ||
|
|
8173460e59 | ||
|
|
85ff154227 | ||
|
|
1c0841442a | ||
|
|
c3208ae63e | ||
|
|
8fd041eac3 | ||
|
|
c33d3c01f0 | ||
|
|
5ad3315ee2 | ||
|
|
1ec8a0778e | ||
|
|
bfa010855c | ||
|
|
ca6a45c9f0 | ||
|
|
91fb545199 | ||
|
|
228b3e2e78 | ||
|
|
b7592b1fe0 | ||
|
|
ce81e876ee | ||
|
|
e82b5887ee | ||
|
|
0575235e19 | ||
|
|
5d21c19d95 | ||
|
|
7946fb8395 | ||
|
|
4c8f9a1b99 | ||
|
|
173b45365e | ||
|
|
650ad52c65 | ||
|
|
13e85e4b0d | ||
|
|
76257fe0c7 | ||
|
|
cfc1f03816 | ||
|
|
8e98880e56 | ||
|
|
c846042106 | ||
|
|
6a33c2f3c1 | ||
|
|
e9a0f5b9c8 | ||
|
|
8b6a464404 | ||
|
|
2c242473c9 | ||
|
|
e24f0f7b86 | ||
|
|
09e9e0d619 | ||
|
|
5ead7d6c5e | ||
|
|
8e2ca9a44c | ||
|
|
7126b751bc | ||
|
|
33e8ed33ce | ||
|
|
8e4c07fbbe | ||
|
|
bb5e8fb4b1 | ||
|
|
e1a1cd0f64 | ||
|
|
49f4bc3098 | ||
|
|
4fc2e70a91 | ||
|
|
8469e56c38 | ||
|
|
e2ad0fae88 | ||
|
|
e031fe7833 | ||
|
|
e2a2ce3261 | ||
|
|
e286da434e | ||
|
|
893ff86abf | ||
|
|
d5868c6e02 | ||
|
|
42d52c6031 | ||
|
|
3a01ebb71e | ||
|
|
97e4cfdc5a | ||
|
|
d5eafa64d8 | ||
|
|
2df80085d0 | ||
|
|
d20794017a | ||
|
|
d3d2043413 | ||
|
|
e97de67c49 | ||
|
|
9129960d9a | ||
|
|
21d59c0565 | ||
|
|
234f501b7e | ||
|
|
8a389a2ef3 | ||
|
|
2a8983f993 | ||
|
|
6beed06a64 | ||
|
|
b0b5a60e24 | ||
|
|
3ce28c9ca3 | ||
|
|
84ebf20f83 | ||
|
|
6b84776cf7 | ||
|
|
ff0c243269 | ||
|
|
da4b9e6271 | ||
|
|
a25b809afd | ||
|
|
da6cb5a755 | ||
|
|
d3943d1793 | ||
|
|
a46f6a20e4 | ||
|
|
7b4f9ebab0 | ||
|
|
95d5936f3b | ||
|
|
74b95c9b42 | ||
|
|
0e143a75d8 | ||
|
|
8afd3ee0f4 | ||
|
|
0a1a6f504a | ||
|
|
a8a2ae633b | ||
|
|
55fe496a3d | ||
|
|
47875f1794 | ||
|
|
891831d404 | ||
|
|
8616b25d64 | ||
|
|
04e570b7c2 | ||
|
|
eab2cbda56 | ||
|
|
653bc60724 | ||
|
|
b781f0af39 | ||
|
|
a72f4bae28 | ||
|
|
b3f4ad5c4c | ||
|
|
7a95a1e450 | ||
|
|
150c477393 | ||
|
|
fec038ed2b | ||
|
|
50b68ea9cb | ||
|
|
ae821334b4 | ||
|
|
169933b005 | ||
|
|
07e16f375b | ||
|
|
2234b4acdf | ||
|
|
3c41998a6e | ||
|
|
e27ae915b4 | ||
|
|
a51524d16f | ||
|
|
c18b94a464 | ||
|
|
2e0b77eddf | ||
|
|
a7433844f4 | ||
|
|
00fbdc294c | ||
|
|
65893fe4b5 | ||
|
|
7d3e501a9d | ||
|
|
68991a9676 | ||
|
|
2dc91a108c | ||
|
|
6e54d4e383 | ||
|
|
3d182f2985 | ||
|
|
20274cb34a | ||
|
|
424e99e364 | ||
|
|
1aa7f6b865 | ||
|
|
0d83692ce8 | ||
|
|
38c041dbe2 | ||
|
|
df69271330 | ||
|
|
54973667b5 | ||
|
|
7afa445081 | ||
|
|
94f7b2a435 | ||
|
|
f4be8614ec | ||
|
|
bd8c954ea9 | ||
|
|
984e1d507e | ||
|
|
e09963e039 | ||
|
|
b022615584 | ||
|
|
23547380d0 | ||
|
|
dd1380dc6b | ||
|
|
e5960ebafc | ||
|
|
488e9586c6 | ||
|
|
950e3e72f5 | ||
|
|
cb219303f1 | ||
|
|
09d57e1068 | ||
|
|
630afcbc5c | ||
|
|
899d57f49e | ||
|
|
7b3b9cae81 | ||
|
|
569fd5d138 | ||
|
|
13c60db485 | ||
|
|
d25c20a71e | ||
|
|
c0103bfd74 | ||
|
|
520aa7b97e | ||
|
|
7b58b8852a | ||
|
|
4ec72e6e4e | ||
|
|
1875cf35d0 | ||
|
|
d70a94fd46 | ||
|
|
5e2a54f3d9 | ||
|
|
2a418287e4 | ||
|
|
9d1d8eb455 | ||
|
|
03f8d5c802 | ||
|
|
7e8acc0e7e | ||
|
|
c2204767e1 | ||
|
|
08dd1c9284 | ||
|
|
415184c5a2 | ||
|
|
e24fc2345b | ||
|
|
98bb603b43 | ||
|
|
773c55ff1a | ||
|
|
f2624c2990 | ||
|
|
d486942295 | ||
|
|
aff573b895 | ||
|
|
f5edf03668 | ||
|
|
b5e09c9a80 | ||
|
|
fa3e9f5bc1 | ||
|
|
bc922b2124 | ||
|
|
d89b0c8917 | ||
|
|
8b6a4c7613 | ||
|
|
88df96af88 | ||
|
|
e11973b014 | ||
|
|
371dd0cc92 | ||
|
|
eaf216ad20 | ||
|
|
8f85f7b8da | ||
|
|
a503ca8b35 | ||
|
|
b6c59dc661 | ||
|
|
1e370177d7 | ||
|
|
6072d5f9f9 | ||
|
|
beeb483e5d | ||
|
|
029b6824c9 | ||
|
|
c703913fc1 | ||
|
|
ed507f6b0b | ||
|
|
c081e03c6b | ||
|
|
2aeb2a29a6 | ||
|
|
8f53a4a491 | ||
|
|
3c9d509b5c | ||
|
|
8819065573 | ||
|
|
ad154d4e95 | ||
|
|
198946b5a8 | ||
|
|
9c3960bfca | ||
|
|
7f54eb6b4a | ||
|
|
c98c83225b | ||
|
|
358004dfbe | ||
|
|
4fb748b8a4 | ||
|
|
a975ed5f77 | ||
|
|
461472aff4 | ||
|
|
a6436a9bb7 | ||
|
|
9474d34c6c | ||
|
|
2e1a7cd0ea | ||
|
|
59245ddb4e | ||
|
|
d3100cb976 | ||
|
|
84855f3a1e | ||
|
|
57ac4d5128 | ||
|
|
bb8b75c89f | ||
|
|
d422038808 | ||
|
|
33ff1a88ca | ||
|
|
23339329f1 | ||
|
|
e36227fbbd | ||
|
|
a9babda896 | ||
|
|
1d4465a3ed | ||
|
|
b3e22069a4 | ||
|
|
dff9fb52f1 | ||
|
|
ef0bb390ea | ||
|
|
a3e8ad8e3b | ||
|
|
f7f2ec72e4 | ||
|
|
d34aa8acc2 | ||
|
|
56812dd4fb | ||
|
|
f575d74131 | ||
|
|
57da948942 | ||
|
|
cfcf5aba6f | ||
|
|
be2d0ff2a2 | ||
|
|
50f8178f28 | ||
|
|
f3a79a4731 | ||
|
|
9a2cb07424 | ||
|
|
bc1a8e2253 | ||
|
|
3a813dc132 | ||
|
|
3c8395b728 | ||
|
|
c51c1ac000 | ||
|
|
d4c56f6c38 | ||
|
|
00f0d5c45b | ||
|
|
2c87d2618b | ||
|
|
dec7f8f98f | ||
|
|
bef62b484c | ||
|
|
32147b113b | ||
|
|
1d05f317a6 | ||
|
|
859de14aee | ||
|
|
5c675b53fc | ||
|
|
d8b68b5bce | ||
|
|
1cb6e830e9 | ||
|
|
574c6dfa50 | ||
|
|
0069384a8a | ||
|
|
7d9cb9c807 | ||
|
|
b9d9921c79 | ||
|
|
97f69a4ca0 | ||
|
|
0b1edca83d | ||
|
|
62cba18a6c | ||
|
|
dc509c22da | ||
|
|
885cc56bab | ||
|
|
31640b05c0 | ||
|
|
affa8eab9d | ||
|
|
3c12689a6d | ||
|
|
a6477a74e0 | ||
|
|
6c25448b55 | ||
|
|
864b245dbb | ||
|
|
52027b1397 | ||
|
|
836776eacc | ||
|
|
76b97a68f1 | ||
|
|
23cfb3d476 | ||
|
|
12554509fc | ||
|
|
0239e40f03 | ||
|
|
d78b275431 | ||
|
|
18426b6765 | ||
|
|
1639d3f1ad | ||
|
|
7f63254542 | ||
|
|
1fa2724987 | ||
|
|
fd17910b22 | ||
|
|
33a9b5ba79 | ||
|
|
efe2e646b1 | ||
|
|
818df77678 | ||
|
|
5206c3c244 | ||
|
|
124eb6a894 | ||
|
|
a47b31e5b6 | ||
|
|
2a2da2addf | ||
|
|
215605aacf | ||
|
|
9ab969d212 | ||
|
|
96b9cadb8b | ||
|
|
603af0f3ce | ||
|
|
59c8b64048 | ||
|
|
dce11d55a2 | ||
|
|
286995e5c7 | ||
|
|
ff8d77c0f4 | ||
|
|
5afcb40c17 | ||
|
|
28f4d754a9 | ||
|
|
5d834e7cb4 | ||
|
|
f59208b53a | ||
|
|
c03c60df95 | ||
|
|
b1eb512243 | ||
|
|
ef38b30968 | ||
|
|
a2e6add7b6 | ||
|
|
95d457d308 | ||
|
|
8adafc3e20 | ||
|
|
86cf5d1337 | ||
|
|
48eb104282 | ||
|
|
5c6f02c5fd | ||
|
|
e1aab7b4a8 | ||
|
|
a68148adf7 | ||
|
|
6a507a173b | ||
|
|
6c43248cb5 | ||
|
|
4f9ae34ebc | ||
|
|
ffc93c511a | ||
|
|
c4e85b9c7f | ||
|
|
2cd785e3a9 | ||
|
|
152af04898 | ||
|
|
ed98ba430f | ||
|
|
128a90ef65 | ||
|
|
6045ecd539 | ||
|
|
b9334f4cd3 | ||
|
|
34ee23ab1a | ||
|
|
4640a10d81 | ||
|
|
dd02d5edbc | ||
|
|
80542d2435 | ||
|
|
62f2e23a59 | ||
|
|
970f2bfdf5 | ||
|
|
a73096ed86 | ||
|
|
12456003d9 | ||
|
|
88ada8c7f2 | ||
|
|
fad52bea20 | ||
|
|
a3f7127daa | ||
|
|
5ee9d990d2 | ||
|
|
cf4ca51ff3 | ||
|
|
bbef3524b7 | ||
|
|
f0b8c2ae3c | ||
|
|
377bd43f62 | ||
|
|
3d978c2533 | ||
|
|
7e38763b9d | ||
|
|
52fcf0fb50 | ||
|
|
705cbbf1ea | ||
|
|
66cf27a194 | ||
|
|
34635bb93f | ||
|
|
3fb3956d36 | ||
|
|
dbcc322748 | ||
|
|
364e40d662 | ||
|
|
c12f244dd0 | ||
|
|
7ac7c072dd | ||
|
|
ae236f540a | ||
|
|
b2c6b87e1f | ||
|
|
e63e83f445 | ||
|
|
340334d437 | ||
|
|
1ce8793725 | ||
|
|
0d5ff3b6ad | ||
|
|
802900582b | ||
|
|
27067adc7e | ||
|
|
e6b534cf38 | ||
|
|
b38e4c9a39 | ||
|
|
a268ff35a2 | ||
|
|
896bc79f76 | ||
|
|
84c9378736 | ||
|
|
d20d27822a | ||
|
|
eb632f9024 | ||
|
|
a5cfcc51ed | ||
|
|
a975d98fce | ||
|
|
d13611aac0 | ||
|
|
7c4ca53e91 | ||
|
|
4624415cec | ||
|
|
139f16fb4c | ||
|
|
e352b1cfa3 | ||
|
|
fb99034bb0 | ||
|
|
7febca9db2 | ||
|
|
b8e95a78d7 | ||
|
|
314d353e20 | ||
|
|
cbdfc6a670 | ||
|
|
5861da9c86 | ||
|
|
fe19b2c9a5 | ||
|
|
2aef720354 | ||
|
|
874453ba20 | ||
|
|
6da6cb83dc | ||
|
|
c6c700bfcc | ||
|
|
7a7769c3f4 | ||
|
|
9b781924aa | ||
|
|
e3075b8667 | ||
|
|
2a1f478235 | ||
|
|
5ba0c8a6d6 | ||
|
|
593c39969b | ||
|
|
730e8fcf13 | ||
|
|
f0d1f978a7 | ||
|
|
89c7b1ff08 | ||
|
|
11c7304080 | ||
|
|
d9326a8f2b | ||
|
|
d544d3e619 | ||
|
|
7899aeb2d2 | ||
|
|
6b3e4c49a4 | ||
|
|
7a6cc4b5f5 | ||
|
|
2f7de7ad0b | ||
|
|
fb7618391b | ||
|
|
e318a493a4 | ||
|
|
b7b7e7cf50 | ||
|
|
03e5800c12 | ||
|
|
30d6a6abfe | ||
|
|
482ffd7c78 | ||
|
|
08af060f8a | ||
|
|
a967d4d605 | ||
|
|
53ef3c7cc7 | ||
|
|
4a6bfa9581 | ||
|
|
0b659aa023 | ||
|
|
d82c4ac9e6 | ||
|
|
df9f1fdd55 | ||
|
|
fe00bf6e86 | ||
|
|
9008f8c9fe | ||
|
|
96a189bb09 | ||
|
|
c80851b18e | ||
|
|
96ee37d752 | ||
|
|
db9a6c1f6d | ||
|
|
316de473a5 | ||
|
|
fe87e5e055 | ||
|
|
cdbfbd3ca4 | ||
|
|
19d13bfbf7 | ||
|
|
7fc029700a | ||
|
|
af3f34e9c5 | ||
|
|
964eab5cc1 | ||
|
|
d9f48578e2 | ||
|
|
3df2c05b92 | ||
|
|
99e6fa4229 | ||
|
|
0d8dc89ae5 | ||
|
|
cebff8cd91 | ||
|
|
ae0cec29f3 | ||
|
|
039cd65ff7 | ||
|
|
0559a4e77a | ||
|
|
dd217ebbe6 | ||
|
|
cd4a8bda84 | ||
|
|
ea6233c5ac | ||
|
|
06389bb231 | ||
|
|
e1c7b35b64 | ||
|
|
5dbd5a2cda | ||
|
|
350d25e339 | ||
|
|
fe461b76b6 | ||
|
|
a73e620f6d | ||
|
|
4ffdfeeb47 | ||
|
|
efe16daf64 | ||
|
|
6b40d73da9 | ||
|
|
a60b77f898 | ||
|
|
a1421977bf | ||
|
|
6bdf3d812a | ||
|
|
a4544ed736 | ||
|
|
dfa3025a1c | ||
|
|
63b01eae42 | ||
|
|
522603677d | ||
|
|
2a581780ce | ||
|
|
5739deccb4 | ||
|
|
2cb9ab860f | ||
|
|
014f4ca608 | ||
|
|
9dbe2f1176 | ||
|
|
33a5818523 | ||
|
|
ca872a5a68 | ||
|
|
863ad27d0f | ||
|
|
bfe6fbed41 | ||
|
|
30373f6a85 | ||
|
|
3e8b4ab9b8 | ||
|
|
4e7caa01e7 | ||
|
|
c9273cf95b | ||
|
|
0d23be8c66 | ||
|
|
77949c31c3 | ||
|
|
141c8151dc | ||
|
|
4755371c42 | ||
|
|
f3b956391e | ||
|
|
d59b0e1b80 | ||
|
|
0838a1e87c | ||
|
|
4c48aabc07 | ||
|
|
8bbd45596c | ||
|
|
d4917407db | ||
|
|
5018e869d4 | ||
|
|
57fa54b2d6 | ||
|
|
7dcee492fd | ||
|
|
9095ebe2dc | ||
|
|
7be07069ab | ||
|
|
59078e1a1d | ||
|
|
b90601d6d9 | ||
|
|
0dba2e8fce | ||
|
|
12d6ba4bac | ||
|
|
d4226e08dc | ||
|
|
4c99ef4b64 | ||
|
|
ecc611b035 | ||
|
|
a380490f7b | ||
|
|
64dc2511dc | ||
|
|
8bc2d19a67 | ||
|
|
de58be88cd | ||
|
|
7bce4bb49e | ||
|
|
3180d98a23 | ||
|
|
a15cbae149 | ||
|
|
7c99eedf22 | ||
|
|
7eea211e4c | ||
|
|
7b43a9c2e9 | ||
|
|
55bff1d137 | ||
|
|
0001c3774b | ||
|
|
0d6e5a6aa0 | ||
|
|
9f893e8e7b | ||
|
|
b78beb012e | ||
|
|
26d28c6b5f | ||
|
|
2f4940f6c5 | ||
|
|
32af9b706b | ||
|
|
a58ff96a17 | ||
|
|
8830c796cd | ||
|
|
84ac353972 | ||
|
|
e615a6135f | ||
|
|
fdc6708e6d | ||
|
|
107e74850d | ||
|
|
566093d00a | ||
|
|
7033779d80 | ||
|
|
cfbfe736b5 | ||
|
|
b651a2dbc1 | ||
|
|
85ab6f2633 | ||
|
|
ed5a087254 | ||
|
|
37275c61ae | ||
|
|
147938a109 | ||
|
|
dd0ed9604b | ||
|
|
a41882c570 | ||
|
|
3b7f31e6b3 | ||
|
|
d434fd4805 | ||
|
|
86b1f37874 | ||
|
|
7bb52f9599 | ||
|
|
69d5c11d84 | ||
|
|
6c53df3409 | ||
|
|
e8b6184377 | ||
|
|
679a5c7d33 | ||
|
|
674ed2ef63 | ||
|
|
ca059afb31 | ||
|
|
922fbcc300 | ||
|
|
bb38ebec05 | ||
|
|
84796020bf | ||
|
|
9c8fe1b445 | ||
|
|
63773130f9 | ||
|
|
18d06c5b4b | ||
|
|
ce2406572a | ||
|
|
5dfa235aa2 | ||
|
|
46ddea3c1f | ||
|
|
a5922f66ec | ||
|
|
225fa580b1 | ||
|
|
e3010ba7c8 | ||
|
|
1c5e8306a0 | ||
|
|
5f1e98d071 | ||
|
|
43d2419380 | ||
|
|
75d8dc54d3 | ||
|
|
cc54da1e27 | ||
|
|
a020a0c62d | ||
|
|
78e3c94220 | ||
|
|
24c53086ea | ||
|
|
8757dfdc80 | ||
|
|
bd66e40784 | ||
|
|
f73f275ee6 | ||
|
|
2eb4981a32 | ||
|
|
0ea1ecb882 | ||
|
|
38a7e1567d | ||
|
|
a6947454b6 | ||
|
|
dfd984a0e1 | ||
|
|
b4112c1bd5 | ||
|
|
4d240bda6a | ||
|
|
daaa81f24d | ||
|
|
8d42e8ca71 | ||
|
|
dc8ade44b7 | ||
|
|
a054ce9aae | ||
|
|
743766b0cf | ||
|
|
98726feae5 | ||
|
|
ee6cff4539 | ||
|
|
94f7c4b61a | ||
|
|
dbef78ccaf | ||
|
|
fb92ccb22b | ||
|
|
1b42b4dd73 | ||
|
|
10cdba077b | ||
|
|
f90e61d322 | ||
|
|
ca2f36c73a | ||
|
|
e3fc1604c5 | ||
|
|
c3e4319536 | ||
|
|
5de3fcf698 | ||
|
|
2ed6c496e2 | ||
|
|
686cb79232 | ||
|
|
34fd8a391a | ||
|
|
641e4db9aa | ||
|
|
6f7e24724a | ||
|
|
61f1a7edd5 | ||
|
|
73c9b3136f | ||
|
|
7b439d136c | ||
|
|
f303e85847 | ||
|
|
47f08e143b | ||
|
|
bb1a989705 | ||
|
|
add770d0bc | ||
|
|
6f4c6e1077 | ||
|
|
62dec7ade5 | ||
|
|
454d82b168 | ||
|
|
bed4c59047 | ||
|
|
eca7ed247a | ||
|
|
0ac09a61c7 | ||
|
|
a8b9f4b485 | ||
|
|
1b72852850 | ||
|
|
13d0bae95d | ||
|
|
73d88fc8c4 | ||
|
|
38b9bb3b4f | ||
|
|
088ae6f9b3 | ||
|
|
f3945b460c | ||
|
|
d76b4246c4 | ||
|
|
a69f5a75bb | ||
|
|
08c43aeeb2 | ||
|
|
f19da5ae0b | ||
|
|
374a8c8598 | ||
|
|
9a12ac05af | ||
|
|
6b54884ef0 | ||
|
|
b4ee736628 | ||
|
|
e159fd3c38 | ||
|
|
933b3db736 | ||
|
|
41fa14e78b | ||
|
|
a5ead912de | ||
|
|
1154fffc72 | ||
|
|
067a1bff40 | ||
|
|
078b741009 | ||
|
|
f04b6e7efd | ||
|
|
2b8b2cf1cc | ||
|
|
f1fddf2daa | ||
|
|
1d7930cbf0 | ||
|
|
1c4be29d4e | ||
|
|
ff2f72d5b0 | ||
|
|
8ddd646ba1 | ||
|
|
44c94796e3 | ||
|
|
cf36bc925c | ||
|
|
91d2a537a2 | ||
|
|
875aca1121 | ||
|
|
d2c0a493b2 | ||
|
|
9669bd9b71 | ||
|
|
c56b1c7b7b | ||
|
|
77ce96e18b | ||
|
|
f428cf8b5a | ||
|
|
9e64621779 | ||
|
|
b2fd7dc248 | ||
|
|
5a5e66235b | ||
|
|
11b0a30569 | ||
|
|
e620816198 | ||
|
|
2f4ae13ec3 | ||
|
|
9e4a0c1f67 | ||
|
|
33bda91c97 | ||
|
|
4c779708a6 | ||
|
|
c1e563f326 | ||
|
|
61794449bc | ||
|
|
2b137a9137 | ||
|
|
63ed1888dd | ||
|
|
f1cb1598ea | ||
|
|
20b5fe0787 | ||
|
|
eeb1bbb9f1 | ||
|
|
bbd17d5de4 | ||
|
|
412ae415ae | ||
|
|
40b7e9b00e | ||
|
|
ac883fdc28 | ||
|
|
08bd3e98b8 | ||
|
|
48575730e3 | ||
|
|
d191d02641 | ||
|
|
c69a18498f | ||
|
|
ff740d523b | ||
|
|
05c4b95cb0 | ||
|
|
adef36b214 | ||
|
|
07cf3a6b66 | ||
|
|
4af6019bef | ||
|
|
fecc012404 | ||
|
|
566a96bb8d | ||
|
|
a2a1675588 | ||
|
|
4abe43dc66 | ||
|
|
cc3bdc30be | ||
|
|
4294978f62 | ||
|
|
81b00eae85 | ||
|
|
e5b613026f | ||
|
|
b43300b673 | ||
|
|
2f0e0b13dc | ||
|
|
3b55721c4b | ||
|
|
2045e6aa19 | ||
|
|
b4df94bf85 | ||
|
|
6216754fda | ||
|
|
951605b942 | ||
|
|
84d60bb6eb | ||
|
|
595f83a1ce | ||
|
|
ff7a836a59 | ||
|
|
6abbe2a5a5 | ||
|
|
c617cf46a8 | ||
|
|
9006f5e494 | ||
|
|
01700e59e6 | ||
|
|
502cd34c01 | ||
|
|
95447d4c4b | ||
|
|
718ac02070 | ||
|
|
c538a4042b | ||
|
|
192c1dadd9 | ||
|
|
09379a2a86 | ||
|
|
78a657f055 | ||
|
|
9a53813b9f | ||
|
|
2af797f8f7 | ||
|
|
a4069c3932 | ||
|
|
65fbcb1253 | ||
|
|
e61d160489 | ||
|
|
cfa2464ce9 | ||
|
|
a03d5da4d4 | ||
|
|
6018715b06 | ||
|
|
921b338b25 | ||
|
|
40b57ab867 | ||
|
|
0341bbd6de | ||
|
|
7c5c12b5d1 | ||
|
|
0de4d645d8 | ||
|
|
7a6713caad | ||
|
|
b838f6f93d | ||
|
|
a89bb87dcc | ||
|
|
2d6cae8ecc | ||
|
|
3a6f04fbbf | ||
|
|
ac9a1e25f4 | ||
|
|
25a4df668b | ||
|
|
e8bed0decd | ||
|
|
e6c15c4caa | ||
|
|
cffe00183e | ||
|
|
eacd477343 | ||
|
|
67a9064a0b | ||
|
|
9a105d9b59 | ||
|
|
9f4d636df0 | ||
|
|
c6282fe972 | ||
|
|
760a128751 | ||
|
|
6fa4d53e66 | ||
|
|
466488b3ad | ||
|
|
bab6349a50 | ||
|
|
a4a9bb5831 | ||
|
|
e5685205ce | ||
|
|
4646a1feef | ||
|
|
d057c7734d | ||
|
|
cdfc68c324 | ||
|
|
304a9d238a | ||
|
|
6fd6e8a1ad | ||
|
|
bb434ca127 | ||
|
|
8fb8f755aa | ||
|
|
03b0dd03d6 | ||
|
|
4ae648cb0c | ||
|
|
74c90befc7 | ||
|
|
13fc5b205e | ||
|
|
f5f4a20b96 | ||
|
|
894723e396 | ||
|
|
e5fbce1c9f | ||
|
|
e8af64f397 | ||
|
|
1bbe894eee | ||
|
|
0e70446c06 | ||
|
|
461305e8a1 | ||
|
|
e5a5322272 | ||
|
|
d0d1cfe837 | ||
|
|
82caf8a153 | ||
|
|
081f10e725 | ||
|
|
68c0ef27b5 | ||
|
|
8c1cb0b938 | ||
|
|
7445283860 | ||
|
|
d0c5ac3624 | ||
|
|
48cb95580d | ||
|
|
b48eec44c5 | ||
|
|
268736e7e2 | ||
|
|
1a3b806499 | ||
|
|
d800222b32 | ||
|
|
7c33b77223 | ||
|
|
6ebb05de67 | ||
|
|
a1e4c0e5af | ||
|
|
79813e48d0 | ||
|
|
c2459cbd51 | ||
|
|
342ec38315 | ||
|
|
0d13b0b709 | ||
|
|
e7197fa880 | ||
|
|
03cc0519e1 | ||
|
|
33df3d7cdb | ||
|
|
74b9243984 | ||
|
|
317992a8ac | ||
|
|
5ed469048c | ||
|
|
6285427fa0 | ||
|
|
a6a28d701e | ||
|
|
eec88df77e | ||
|
|
bbceae03c6 | ||
|
|
089c8c53b8 | ||
|
|
1b4d6b8adf | ||
|
|
5d3cb4ba44 | ||
|
|
41180f92dd | ||
|
|
1006be76a2 | ||
|
|
485f61c785 | ||
|
|
ff8c019205 | ||
|
|
a4ede1c35c | ||
|
|
21f844f3ef | ||
|
|
e534759167 | ||
|
|
bd9498115c | ||
|
|
24f74b2042 | ||
|
|
f32f1c9ffd | ||
|
|
70478cb176 | ||
|
|
700c8e6822 | ||
|
|
245ff6d239 | ||
|
|
baf7bde6e5 | ||
|
|
1e2c8b6ec6 | ||
|
|
5011f13d4c | ||
|
|
772f9ecd24 | ||
|
|
b8911c5993 | ||
|
|
300ef89492 | ||
|
|
409294590b | ||
|
|
154d7d8945 | ||
|
|
2bbcd8594e | ||
|
|
ea3b5dda8b | ||
|
|
3e73baf708 | ||
|
|
4096c4b879 | ||
|
|
1eee73ab3d | ||
|
|
212d6d4566 | ||
|
|
5298a04b0e | ||
|
|
acf8462495 | ||
|
|
4014c9b747 | ||
|
|
a748d3b04e | ||
|
|
e2f855c6b3 | ||
|
|
dd2e225d6c | ||
|
|
a5c3ece437 | ||
|
|
6c90ef221e | ||
|
|
60d7e8a053 | ||
|
|
fc37fe1241 | ||
|
|
cad471a23b | ||
|
|
eefe466c58 | ||
|
|
27d8a78d6c | ||
|
|
9211327353 | ||
|
|
a64b136de5 | ||
|
|
1450344d5e | ||
|
|
f821c69cb9 | ||
|
|
2ceb52259b | ||
|
|
1d3d45b54c | ||
|
|
d1becebc98 | ||
|
|
d076f7569a | ||
|
|
678a702c46 | ||
|
|
2c4abb195b | ||
|
|
01074aee8d | ||
|
|
6b30a7f4c5 | ||
|
|
67a4cd9e65 | ||
|
|
3539bf0e02 | ||
|
|
c49bea76fa | ||
|
|
7b25f032ca | ||
|
|
d4834c7ffd | ||
|
|
2df7c762ef | ||
|
|
2d7bf27eb2 | ||
|
|
5db6faf9d0 | ||
|
|
f5cc973567 | ||
|
|
7b5f5ada33 | ||
|
|
a84bb0daee | ||
|
|
50855d366d | ||
|
|
0d1e066ca6 | ||
|
|
f77ad0e1a7 | ||
|
|
07b787cc06 | ||
|
|
888f207a34 | ||
|
|
b16304c8af | ||
|
|
fa9c7117f9 | ||
|
|
3b55b61da2 | ||
|
|
802ec56af5 | ||
|
|
cc83f32f0c | ||
|
|
4959146013 | ||
|
|
dc5ed6adf2 | ||
|
|
2f4b588348 | ||
|
|
0ccfa6fdd7 | ||
|
|
f3e0c76d77 | ||
|
|
6984e2d42f | ||
|
|
f7ca0548a4 | ||
|
|
b8a8b7111f | ||
|
|
3026e38b11 | ||
|
|
37c8a76cd3 | ||
|
|
1e92a656b4 | ||
|
|
61f6b3455d | ||
|
|
957566ae94 | ||
|
|
7597e59501 | ||
|
|
b4d4d59d64 | ||
|
|
372dfbfb59 | ||
|
|
debce58e63 | ||
|
|
c9f7c57dd1 | ||
|
|
327103fe16 | ||
|
|
9edc365420 | ||
|
|
0713f17838 | ||
|
|
14777ecdc4 | ||
|
|
e4d83b2447 | ||
|
|
13d44cb428 | ||
|
|
0e44af4ba0 | ||
|
|
96681954a0 | ||
|
|
669e48e22e | ||
|
|
e2b6d4b74d | ||
|
|
9ef01bcef9 | ||
|
|
860c8b8ef8 | ||
|
|
70d7d81c82 | ||
|
|
bbde549c6c | ||
|
|
afca09d728 | ||
|
|
1d70dd845b | ||
|
|
bbf0c301df | ||
|
|
0d64962488 | ||
|
|
86c2b3bbf5 | ||
|
|
60baccae69 | ||
|
|
89bf21c9ce | ||
|
|
e1d417d073 | ||
|
|
596baae146 | ||
|
|
9deac117f0 | ||
|
|
ac136d8240 | ||
|
|
0278153166 | ||
|
|
76c6f43f6c | ||
|
|
603aa1d05c | ||
|
|
bf5ddb0b1b | ||
|
|
74fb958f87 | ||
|
|
a55508fdca | ||
|
|
4239e414f8 | ||
|
|
f5ed2d69ea | ||
|
|
1394acc898 | ||
|
|
68b9409e26 | ||
|
|
0e6a59bd49 | ||
|
|
99957106e1 | ||
|
|
14c544f177 | ||
|
|
0b45d1878d | ||
|
|
80f373eeb2 | ||
|
|
6de6b70066 | ||
|
|
fb75b68a67 | ||
|
|
008025c3fc | ||
|
|
1a6bb4b159 | ||
|
|
8784460cef | ||
|
|
ed543ddc13 | ||
|
|
3990371b7e | ||
|
|
6a97f3510d | ||
|
|
4186d36112 | ||
|
|
2c60bd5a02 | ||
|
|
417a6dfd6a | ||
|
|
f7a60ef9ea | ||
|
|
6f0ba056de | ||
|
|
c5f9b8d641 | ||
|
|
60527ca659 | ||
|
|
e940551ae2 | ||
|
|
97db15c941 | ||
|
|
15b519682a | ||
|
|
88a37377f5 | ||
|
|
12e1407f61 | ||
|
|
9d4f025888 | ||
|
|
30b6fbbe52 | ||
|
|
46a5fc3c8c | ||
|
|
45e89e84a3 | ||
|
|
ed4ae27caf | ||
|
|
1bb052b67c | ||
|
|
088144415d | ||
|
|
c67758786f | ||
|
|
1d4af950a2 | ||
|
|
cab25ae9b3 | ||
|
|
7b87fc1acc | ||
|
|
5e95d8f930 | ||
|
|
af8452c5d1 | ||
|
|
482d382238 | ||
|
|
90e49f2437 | ||
|
|
b46a868251 | ||
|
|
48c50ed486 | ||
|
|
b715a63592 | ||
|
|
8f782a62ac | ||
|
|
e3295e5c5e | ||
|
|
f7a49734cd | ||
|
|
d45c7c0a1a | ||
|
|
03fb2c637c | ||
|
|
6d607d841a | ||
|
|
1febe3d6d9 | ||
|
|
e14dc78115 | ||
|
|
973e3befc7 | ||
|
|
37da45340a | ||
|
|
218865c6ae | ||
|
|
94893e2c93 | ||
|
|
97318b61a5 | ||
|
|
62970be32f | ||
|
|
8a8dfd3465 | ||
|
|
90db4e7de5 | ||
|
|
712ca24754 | ||
|
|
7689b0f6ad | ||
|
|
a76dd84b1d | ||
|
|
8a10c92e27 | ||
|
|
bf9cc4c8d9 | ||
|
|
892c825175 | ||
|
|
997417ac5d | ||
|
|
74d3ac77f9 | ||
|
|
25a1625697 | ||
|
|
ddb65ba1af | ||
|
|
059f0be2c9 | ||
|
|
7cd6905e07 | ||
|
|
1706f95d44 | ||
|
|
93e2a33227 | ||
|
|
9d39f047ae | ||
|
|
417ed67ee1 | ||
|
|
ff52bc7673 | ||
|
|
c57aca0921 | ||
|
|
db016cab3f | ||
|
|
051b784e6e | ||
|
|
33765d388c | ||
|
|
70047b7cfb | ||
|
|
e0be4e93f7 | ||
|
|
bad7a9d89e | ||
|
|
f04ba2c73e | ||
|
|
2db4bbdb01 | ||
|
|
c9c83923ca | ||
|
|
9717ea5366 | ||
|
|
769b7bd469 | ||
|
|
313ba6370a | ||
|
|
80b9eae647 | ||
|
|
3cd56c2240 | ||
|
|
144a79f49a | ||
|
|
b045bd9178 | ||
|
|
9d9697c55f | ||
|
|
7b0164ecb2 | ||
|
|
01455cfdd1 | ||
|
|
08a6c03431 | ||
|
|
b3c6831e48 | ||
|
|
0e5e6c79cc | ||
|
|
4ae2234bce | ||
|
|
12828d3b49 | ||
|
|
3421560cd3 | ||
|
|
a4cebb5510 | ||
|
|
24ebddee3a | ||
|
|
0fc33ecc9e | ||
|
|
ef7ac487c8 | ||
|
|
d5c98f0fe8 | ||
|
|
6d00556992 | ||
|
|
62fb02da85 | ||
|
|
d54b39e41c | ||
|
|
660a68c9bc | ||
|
|
d55b897fa6 | ||
|
|
4c1231c644 | ||
|
|
1c94626dc4 | ||
|
|
0499f5b111 | ||
|
|
ec09ea72c4 | ||
|
|
e95f689dc4 | ||
|
|
65caa81a8b | ||
|
|
8a41e330e7 | ||
|
|
89665b41b7 | ||
|
|
da3c703686 | ||
|
|
bcef855a73 | ||
|
|
f407d75cd5 | ||
|
|
afee8cec19 | ||
|
|
eefeffcfbf | ||
|
|
5c86499015 | ||
|
|
8fcbc8d432 | ||
|
|
8f0ffb7688 | ||
|
|
b6a14ce20f | ||
|
|
f916c36a8a | ||
|
|
0a11ea9a80 | ||
|
|
90ca5a77ed | ||
|
|
ac371cd7cb | ||
|
|
7a77e1ebf0 | ||
|
|
753830fd33 | ||
|
|
021811e695 | ||
|
|
5159bfb1d4 | ||
|
|
59eff5c6d6 | ||
|
|
5da87e659b | ||
|
|
cf2854b91e | ||
|
|
9d4630256d | ||
|
|
e6d05fc2e3 | ||
|
|
c9d6f89103 | ||
|
|
4f1492e1c7 | ||
|
|
c4fa141f94 | ||
|
|
1bdca0e3e1 | ||
|
|
1db6e13d79 | ||
|
|
af96d40327 | ||
|
|
7ce114d4ff | ||
|
|
05b8b48943 | ||
|
|
555c2cfe05 | ||
|
|
5bab51c45b | ||
|
|
cc6287b8a4 | ||
|
|
0c13ffffe9 | ||
|
|
01601729c2 | ||
|
|
c0cf5a43ea | ||
|
|
3e10d7011c | ||
|
|
4912c58a3c | ||
|
|
17c4a02cfd | ||
|
|
b2fc19fccb | ||
|
|
7a336a1814 | ||
|
|
bd742bd72b | ||
|
|
8e3c531aeb | ||
|
|
0cbd38eaf1 | ||
|
|
e9531aab9f | ||
|
|
ed24f9b05b | ||
|
|
fab7c7ee20 | ||
|
|
282d368288 | ||
|
|
412742094f | ||
|
|
85aef4afc9 | ||
|
|
d6213110e6 | ||
|
|
8d46fa6d3a | ||
|
|
6a9da150d6 | ||
|
|
8d444137c0 | ||
|
|
74edd51aec | ||
|
|
d16ea286ce | ||
|
|
d227c720c8 | ||
|
|
92802a382e | ||
|
|
4ee3479ff4 | ||
|
|
b3ce0274fb | ||
|
|
dd603b1da2 | ||
|
|
2b7186282a | ||
|
|
37a094b424 | ||
|
|
2015ab6774 | ||
|
|
0d4c063641 | ||
|
|
ba8c6fbc8c | ||
|
|
21482d2914 | ||
|
|
27b9ead0ac | ||
|
|
c507b39a15 | ||
|
|
554bbd89f6 | ||
|
|
d1f9d744a7 | ||
|
|
23054cb7a0 | ||
|
|
a7a3bde31c | ||
|
|
b27ebe24d7 | ||
|
|
07ca26ccde | ||
|
|
17702b834f | ||
|
|
99da7c502d | ||
|
|
5b96102fbc | ||
|
|
ddd9b40ee7 | ||
|
|
0ad2634c2f | ||
|
|
346b3c9b0e | ||
|
|
6c06311ea6 | ||
|
|
b35e115de3 | ||
|
|
dd14472261 | ||
|
|
d5acaca6c7 | ||
|
|
868da4617f | ||
|
|
e63bcfc682 | ||
|
|
4731adf427 | ||
|
|
c8c324730a | ||
|
|
4ab08b603e | ||
|
|
5ac5293593 | ||
|
|
2a1101af94 | ||
|
|
10033ecc2d | ||
|
|
d8b64665f9 | ||
|
|
c9a4ac4d7a | ||
|
|
e150849c62 | ||
|
|
841f428594 | ||
|
|
e0ad376f85 | ||
|
|
91e4e63714 | ||
|
|
54811ef5e1 | ||
|
|
ffb74d6f4a | ||
|
|
9b039d77d9 | ||
|
|
68a329285f | ||
|
|
8b192d70ec | ||
|
|
8efcbd5add | ||
|
|
631fd40435 | ||
|
|
e12ab1dd31 | ||
|
|
38f84be109 | ||
|
|
443f44af1f | ||
|
|
8e198185f6 | ||
|
|
2ac277d8f7 | ||
|
|
60b65a8297 | ||
|
|
4e05357c5a | ||
|
|
ba03892ee4 | ||
|
|
9facacc075 | ||
|
|
c11bba9979 | ||
|
|
c25d459359 | ||
|
|
fa464e0627 | ||
|
|
51e98e8872 | ||
|
|
5653c781f4 | ||
|
|
0d1c22ad59 | ||
|
|
4f4bd10055 | ||
|
|
c0a7d56823 | ||
|
|
def348af97 | ||
|
|
e5ae9934e7 | ||
|
|
8e736d26cf | ||
|
|
1e4824e453 | ||
|
|
69ef6a1cd0 | ||
|
|
3d08acc9eb | ||
|
|
fa7c1a12ec | ||
|
|
5a83661a68 | ||
|
|
6895cff694 | ||
|
|
ace01048f7 | ||
|
|
5778310200 | ||
|
|
d7776d91fd | ||
|
|
add473fb8f | ||
|
|
fd55a45672 | ||
|
|
27026b5184 | ||
|
|
882b0ad54f | ||
|
|
8c1f57f797 | ||
|
|
9317c8d3e2 | ||
|
|
32eba73b8c | ||
|
|
db2c0a2ba3 | ||
|
|
d6a0359b00 | ||
|
|
7e1dd5e32c | ||
|
|
4392d147a7 | ||
|
|
7816d4ce7b | ||
|
|
a65f070c3b | ||
|
|
6ebd0d4074 | ||
|
|
6eb96a9ec1 | ||
|
|
24e7d54827 | ||
|
|
0ce4a696ed | ||
|
|
07486d7a7a | ||
|
|
6501479e74 | ||
|
|
d7bccd1bad | ||
|
|
83166d37d8 | ||
|
|
aa64d94ffe | ||
|
|
50e9e66954 | ||
|
|
f1eabe2b82 | ||
|
|
7fc05db316 | ||
|
|
bc7296e128 | ||
|
|
a95a523255 | ||
|
|
703db81ae0 | ||
|
|
3d94159db8 | ||
|
|
23c41e9a16 | ||
|
|
7158614071 | ||
|
|
0ba7f9c37a | ||
|
|
51adb1b981 | ||
|
|
c1e3794807 | ||
|
|
465c87dcd8 | ||
|
|
b5098db771 | ||
|
|
e3f63bce82 | ||
|
|
32cac1efb1 | ||
|
|
3573480351 | ||
|
|
9ca429aeae | ||
|
|
da5339089e | ||
|
|
e1f9e585e6 | ||
|
|
c7b1fd47bb | ||
|
|
cbc5fcaa66 | ||
|
|
27d6b7b83d | ||
|
|
063f2e638a | ||
|
|
27eb99c55d | ||
|
|
9113ed09db | ||
|
|
ee09125573 | ||
|
|
e2a757a562 | ||
|
|
5176e2f9b2 | ||
|
|
ebbf4c48f5 | ||
|
|
abc751a5d5 | ||
|
|
36fd411e45 | ||
|
|
0acacf383a | ||
|
|
e68bc0504f | ||
|
|
951e66c3c2 | ||
|
|
45872fef9e | ||
|
|
ad2934406d | ||
|
|
0c20de4564 | ||
|
|
21622b2d1d | ||
|
|
0e4a87cea6 | ||
|
|
e558ac7a91 | ||
|
|
1393105a6e | ||
|
|
f4d6d661b6 | ||
|
|
a3b3abc22e | ||
|
|
1c47d7593c | ||
|
|
e67a6f07c1 | ||
|
|
5803218992 | ||
|
|
ddc2ee8765 | ||
|
|
2c46238f97 | ||
|
|
0b2290d31b | ||
|
|
c997c4b349 | ||
|
|
fc36364e46 | ||
|
|
6a1d8dafa9 | ||
|
|
b0faabe164 | ||
|
|
26530243dc | ||
|
|
3e56e59dbe | ||
|
|
390db3d4bc | ||
|
|
ee322bebfd | ||
|
|
7d781307ba | ||
|
|
8d7ae5392c | ||
|
|
003cf7e127 | ||
|
|
24684f2863 | ||
|
|
91944b1628 | ||
|
|
b7d4611379 | ||
|
|
d7f61b619c | ||
|
|
2b8b750d4a | ||
|
|
786cf56f8b | ||
|
|
9fa7490bf0 | ||
|
|
2261c29e18 | ||
|
|
e0947e6318 | ||
|
|
6a77811ba9 | ||
|
|
bde87b1dd9 | ||
|
|
f35bfe49f2 | ||
|
|
04074d25ee | ||
|
|
266dcaad87 | ||
|
|
41d1d557ee | ||
|
|
12d12bc991 | ||
|
|
73313bd167 | ||
|
|
7210ffabbe | ||
|
|
98be30f9da | ||
|
|
c9d3bae315 | ||
|
|
19714e038d | ||
|
|
aeab922980 | ||
|
|
27ed78adc6 | ||
|
|
1add14cf82 | ||
|
|
2ede4e24fa | ||
|
|
363fdf625c | ||
|
|
79c9ce44d3 | ||
|
|
fbdc2f1b46 | ||
|
|
535de2714a | ||
|
|
47a498c314 | ||
|
|
9fd360ddf3 | ||
|
|
bd6a1b9e14 | ||
|
|
29a6c63a05 | ||
|
|
2d44c1c340 | ||
|
|
7b5569e4ae | ||
|
|
27b8903017 | ||
|
|
87bda666b4 | ||
|
|
e874f916c5 | ||
|
|
edb57de000 | ||
|
|
715d78e06b | ||
|
|
5abcd41a4b | ||
|
|
2b86282db0 | ||
|
|
443ba4a51a | ||
|
|
7153d24f91 | ||
|
|
4378a9b14d | ||
|
|
4549d3fb9a | ||
|
|
13a8adf2dc | ||
|
|
7257d369b3 | ||
|
|
a2caad2543 | ||
|
|
e7ea4b0caa | ||
|
|
d0c105ec22 | ||
|
|
d7457f0e4f | ||
|
|
84038a96e2 | ||
|
|
731772fac0 | ||
|
|
eaaa3e8a7a | ||
|
|
3373df95a6 | ||
|
|
ff195702e4 | ||
|
|
e7f8ad3690 | ||
|
|
64afa7aa05 | ||
|
|
4cbfe4226d | ||
|
|
5e47d4c951 | ||
|
|
22fd208f43 | ||
|
|
49736bf8f8 | ||
|
|
999fac4c6b | ||
|
|
e38af807ae | ||
|
|
1c276740a1 | ||
|
|
29e4a7f6cc | ||
|
|
0209e71406 | ||
|
|
6bca9cece0 | ||
|
|
44b16a4d29 | ||
|
|
42d73703d9 | ||
|
|
353e3cc164 | ||
|
|
54f287207a | ||
|
|
f12f81de51 | ||
|
|
18826fba08 | ||
|
|
8fd4235bd9 | ||
|
|
5370aaa4bf | ||
|
|
22706dd7ca | ||
|
|
243a04fd38 | ||
|
|
fc028927f6 | ||
|
|
63b7ee111c | ||
|
|
ebd67ebf57 | ||
|
|
41d9a48c57 | ||
|
|
c91d0492c8 | ||
|
|
9c63948322 | ||
|
|
db046182f0 | ||
|
|
c0d6aba30a | ||
|
|
efab7d00b2 | ||
|
|
c7163a5967 | ||
|
|
5c17fd4833 | ||
|
|
73665c5247 | ||
|
|
cb559dbe90 | ||
|
|
dc961964ee | ||
|
|
cb1fb07edf | ||
|
|
d7ce521c89 | ||
|
|
3bf2e5d694 | ||
|
|
f3aa55fa73 | ||
|
|
d93226eedf | ||
|
|
2d780d85fb | ||
|
|
e8aa112afa | ||
|
|
49872fd775 | ||
|
|
8824fc3c62 | ||
|
|
82e6788c84 | ||
|
|
621529b985 | ||
|
|
b4c3cfcf70 | ||
|
|
76f13df892 | ||
|
|
bec36b25fd | ||
|
|
55edf7e92b | ||
|
|
54f3ede6c6 | ||
|
|
4d34dd3cb4 | ||
|
|
97937c1776 | ||
|
|
d867f80c21 | ||
|
|
958cedba81 | ||
|
|
a6a3aa581d | ||
|
|
fd2649ab63 | ||
|
|
249a6beaa6 | ||
|
|
faade958a0 | ||
|
|
9ccd2d9c03 | ||
|
|
86d96005ed | ||
|
|
f4280a1238 | ||
|
|
9402f63211 | ||
|
|
dac24bbba1 | ||
|
|
b131ea3c8c | ||
|
|
f34b975536 | ||
|
|
2adb825771 | ||
|
|
0241c0e911 | ||
|
|
d664621960 | ||
|
|
2825ea771f | ||
|
|
946b22b6e0 | ||
|
|
4934a9a369 | ||
|
|
7434b15721 | ||
|
|
67757ee34e | ||
|
|
b79a185616 | ||
|
|
30a9cbead1 | ||
|
|
60f1926864 | ||
|
|
1a33ecb2f9 | ||
|
|
124ff6912d | ||
|
|
0cdce1fe23 | ||
|
|
457483a01f | ||
|
|
969da177c1 | ||
|
|
feb8498dbb | ||
|
|
9868338028 | ||
|
|
c41f85d36f | ||
|
|
48b37a7b70 | ||
|
|
0515f3fea6 | ||
|
|
a357bd1207 | ||
|
|
abab4d1c33 | ||
|
|
cc6d33f5c9 | ||
|
|
2703fb283b | ||
|
|
3951e2b64e | ||
|
|
6858715dec | ||
|
|
a58494cd0e | ||
|
|
1b85509883 | ||
|
|
16f659e409 | ||
|
|
b80940be56 | ||
|
|
98ec03dc7b | ||
|
|
57d95a7c41 | ||
|
|
64e29136eb | ||
|
|
3c5fdd3ed0 | ||
|
|
793eb66559 | ||
|
|
e46ee94ef4 | ||
|
|
6644f30f39 | ||
|
|
54c665efe2 | ||
|
|
c8e4110884 | ||
|
|
28a8377d7d | ||
|
|
1b4d5354bc | ||
|
|
bd6087f58f | ||
|
|
e993c13043 | ||
|
|
5352d50374 | ||
|
|
c5d0619fdd | ||
|
|
c8bc10f825 | ||
|
|
76fc190fec | ||
|
|
b0351b8177 | ||
|
|
1e1b82d346 | ||
|
|
f01ee267d4 | ||
|
|
77e5789fd5 | ||
|
|
482a0f558d | ||
|
|
a95f9550b0 | ||
|
|
fe28120cfe | ||
|
|
a96292cfa9 | ||
|
|
64595c1cf6 | ||
|
|
60a54bc184 | ||
|
|
68970980db | ||
|
|
26ed014dd4 | ||
|
|
2509639c90 | ||
|
|
441f29fb16 | ||
|
|
1744ead51f | ||
|
|
e7bbcc39f2 | ||
|
|
3ce3a8024b | ||
|
|
ba07077b7e | ||
|
|
a0f99f6471 | ||
|
|
19abcfc972 | ||
|
|
3a3d2c30ac | ||
|
|
790cb8a237 | ||
|
|
c62e5d6c4e | ||
|
|
3b14164e58 | ||
|
|
83f5487221 | ||
|
|
e95f89eafd | ||
|
|
b03713d1c5 | ||
|
|
da2ea49985 | ||
|
|
791e517dc4 | ||
|
|
f2425cf81a | ||
|
|
3165f5ace6 | ||
|
|
3df6f333ad | ||
|
|
03b76ff02f | ||
|
|
0741f61825 | ||
|
|
642b76c07a | ||
|
|
55afef15c9 | ||
|
|
441de40bb4 | ||
|
|
f2ae3ba435 | ||
|
|
0f991e8259 | ||
|
|
5740bc2c72 | ||
|
|
5c09beda8d | ||
|
|
4d3757c7f5 | ||
|
|
af5f6b2da9 | ||
|
|
22a4ba8791 | ||
|
|
deec581efd | ||
|
|
5e83c5623e | ||
|
|
6b6e10d779 | ||
|
|
e484ec03cf | ||
|
|
68d3571687 | ||
|
|
73288463a2 | ||
|
|
e723d69fd6 | ||
|
|
ad47a25a95 | ||
|
|
e830368237 | ||
|
|
c479917dbe | ||
|
|
54bd46dfa7 | ||
|
|
e30d95408e | ||
|
|
d91c94ba4f | ||
|
|
a50afb4ba4 | ||
|
|
c288f2b22e | ||
|
|
72822e253d | ||
|
|
8e06e3f253 | ||
|
|
6ae0919548 | ||
|
|
63e8b73853 | ||
|
|
1383e8316b | ||
|
|
6b5bcf93d2 | ||
|
|
434e8aefbb | ||
|
|
4ecc229938 | ||
|
|
cdd5ca02ed | ||
|
|
2177d44af9 | ||
|
|
c952070bd0 | ||
|
|
d065ab22f7 | ||
|
|
4993b046e8 | ||
|
|
280c2a22d4 | ||
|
|
04e306f51d | ||
|
|
48f29b5f4e | ||
|
|
eab26b1f79 | ||
|
|
bb017f1533 | ||
|
|
9f3ae4ef77 | ||
|
|
a677fa4d78 | ||
|
|
fd1252baf9 | ||
|
|
58d792c4f2 | ||
|
|
528dfd03a5 | ||
|
|
a74711e3ca | ||
|
|
1f626bfb33 | ||
|
|
987907579c | ||
|
|
973d084570 | ||
|
|
e52248f568 | ||
|
|
0015fb9c6c | ||
|
|
600bf861d0 | ||
|
|
93c4a001ad | ||
|
|
b8c30540ba | ||
|
|
78b0d65860 | ||
|
|
c144a17824 | ||
|
|
83c2060a1c | ||
|
|
551c06668a | ||
|
|
d344a7ac4c | ||
|
|
a9404238f0 | ||
|
|
cdb86d76d6 | ||
|
|
4cbde0882c | ||
|
|
786b131e9f | ||
|
|
42979151c2 | ||
|
|
94c7c31771 | ||
|
|
7294976e82 | ||
|
|
171b440941 | ||
|
|
e8610e6886 | ||
|
|
6bafe12b19 | ||
|
|
eddd6117c8 | ||
|
|
a23f998e77 | ||
|
|
33bd380a08 | ||
|
|
ff76dea7db | ||
|
|
5a893e0556 | ||
|
|
b3e3c62ddc | ||
|
|
e3c59bb56f | ||
|
|
c5a9e7248e | ||
|
|
a5d3ca562c | ||
|
|
aa2f6fec01 | ||
|
|
7bef688a95 | ||
|
|
fc15e5d184 | ||
|
|
379bbb42c8 | ||
|
|
7af24625ae | ||
|
|
32e723e2da | ||
|
|
faaab25816 | ||
|
|
3b921c1944 | ||
|
|
4b078bb1bc | ||
|
|
66f21608e0 | ||
|
|
c41d484595 | ||
|
|
88b23dd622 | ||
|
|
c48d21814c | ||
|
|
a7d313ad41 | ||
|
|
fe52f5d6b7 | ||
|
|
729ece7292 | ||
|
|
9722b4c30d | ||
|
|
ed8ee37967 | ||
|
|
7a50a2d692 | ||
|
|
357c6f24c5 | ||
|
|
83fcf53b95 | ||
|
|
2c724c529f | ||
|
|
11b243931c | ||
|
|
28e11c9857 | ||
|
|
4c9c026a1b | ||
|
|
1fb988cd6b | ||
|
|
d5ece51a4d | ||
|
|
c6498a29d0 | ||
|
|
fcd747217b | ||
|
|
b0768fdd0d | ||
|
|
6bf725ba7c | ||
|
|
e9a402ecd1 | ||
|
|
23b6ff263f | ||
|
|
b41d26f50c | ||
|
|
f5427f1d17 | ||
|
|
37e582c257 | ||
|
|
d3b47d7c1a | ||
|
|
a7dd991418 | ||
|
|
2f6af2832d | ||
|
|
640c6daa85 | ||
|
|
512811023f | ||
|
|
f4e26c2e3c | ||
|
|
b2f4a130bd | ||
|
|
ed0509b132 | ||
|
|
2ef779c547 | ||
|
|
cf84c93fc7 | ||
|
|
c638488667 | ||
|
|
2441823d7a | ||
|
|
c0a1dbb5d8 | ||
|
|
045c418031 | ||
|
|
8956aee21c | ||
|
|
0d9bc8df72 | ||
|
|
ca96c96cb3 | ||
|
|
4c50caa6b1 | ||
|
|
9edba0f4ea | ||
|
|
f4626bb22e | ||
|
|
7d66ef477b | ||
|
|
1b3b7ecb38 | ||
|
|
d8b019b304 | ||
|
|
d532e721de | ||
|
|
32ebce2f5f | ||
|
|
b98b464ab1 | ||
|
|
c6c1525ae8 | ||
|
|
1cafe84b0b | ||
|
|
46185dae68 | ||
|
|
2e89ce818d | ||
|
|
d85cf668db | ||
|
|
d8dcf755d8 | ||
|
|
fb01923ae7 | ||
|
|
97435abef5 | ||
|
|
e8cc22f78c | ||
|
|
96b32159cf | ||
|
|
c26978094f | ||
|
|
d0ec5ff970 | ||
|
|
e082712373 | ||
|
|
185ffc39d3 | ||
|
|
3f4c6ac6e3 | ||
|
|
5e3b4cf0e2 | ||
|
|
dec21a5f65 | ||
|
|
2b0c400355 | ||
|
|
058e820efb | ||
|
|
d633a5541d | ||
|
|
563fa8b32c | ||
|
|
0894d751f1 | ||
|
|
23e8a0389d | ||
|
|
54f29c991b | ||
|
|
fd3af84024 | ||
|
|
a9a868f252 | ||
|
|
870e7adc71 | ||
|
|
bec88b6568 | ||
|
|
85a6d9c54c | ||
|
|
63919c188c | ||
|
|
76892f8577 | ||
|
|
44e783d59d | ||
|
|
0a642420af | ||
|
|
d208cbb4d9 | ||
|
|
0419f1d8cc | ||
|
|
c2309bbf79 | ||
|
|
e9149e8e9a | ||
|
|
c15bb92593 | ||
|
|
a1b56e8adc | ||
|
|
d85aea4c1a | ||
|
|
4498acd035 | ||
|
|
152073d7ac | ||
|
|
a90002157c | ||
|
|
f8c8d55c44 | ||
|
|
97600fb260 | ||
|
|
b6d6cba2a2 | ||
|
|
ead4835d35 | ||
|
|
eb4906c79c | ||
|
|
85b65574bb | ||
|
|
363c005f8e | ||
|
|
4422ca608c | ||
|
|
d38ac50b2b | ||
|
|
4d05b49867 | ||
|
|
a22e54cc49 | ||
|
|
46d131e056 | ||
|
|
f1d23c57ed | ||
|
|
265044e73f | ||
|
|
ca84d3425e | ||
|
|
418ec0bdfb | ||
|
|
2d1f8a6a97 | ||
|
|
9813d6a6ee | ||
|
|
255ab75c5f | ||
|
|
ece6b8345c | ||
|
|
59ec5d0fcd | ||
|
|
2cd05a8b2b | ||
|
|
08e54eb4c1 | ||
|
|
fb13a85505 | ||
|
|
fb81cb34de | ||
|
|
3ceca55050 | ||
|
|
87d45e6096 | ||
|
|
872ced9934 | ||
|
|
f987d717ef | ||
|
|
9b40fcb862 | ||
|
|
19605e0738 | ||
|
|
fe56a4dc3c | ||
|
|
4994f64729 | ||
|
|
7b4af861f4 | ||
|
|
82ef698bcf | ||
|
|
ca70fc388b | ||
|
|
ae06ac06a9 | ||
|
|
e2656563b1 | ||
|
|
752e905ecc | ||
|
|
d9e046d0c3 | ||
|
|
5945b87db9 | ||
|
|
0c92fff315 | ||
|
|
360ad9d0c3 | ||
|
|
6c34e0d090 | ||
|
|
794d90069c | ||
|
|
fb8e4405c7 | ||
|
|
36d53847c7 | ||
|
|
e45aabfb8a | ||
|
|
d66fbeb235 | ||
|
|
af13b7704f | ||
|
|
649d39f3a8 | ||
|
|
9b3362a394 | ||
|
|
fdb80242af | ||
|
|
fa7d1b4f89 | ||
|
|
f6cdaeb732 | ||
|
|
a9d59ed6c8 | ||
|
|
5633e5233d | ||
|
|
2b681c5f27 | ||
|
|
8a8f7c78aa | ||
|
|
159e440014 | ||
|
|
04d8b88026 | ||
|
|
1f8e43141c | ||
|
|
07c35e2ed2 | ||
|
|
a44f900b20 | ||
|
|
141aa737c6 | ||
|
|
f154b5f160 | ||
|
|
7f82ff96ce | ||
|
|
1112474494 | ||
|
|
b486e32e7c | ||
|
|
8375fa6ddc | ||
|
|
1c618498f1 | ||
|
|
412f96bd78 | ||
|
|
d29f6463fc | ||
|
|
83cf25ff11 | ||
|
|
7502c34550 | ||
|
|
e70e719de9 | ||
|
|
da88c40c5a | ||
|
|
97d9c48aea | ||
|
|
ff0adca3d2 | ||
|
|
386aca9c02 | ||
|
|
9f19cc077b | ||
|
|
9631f41e77 | ||
|
|
9f034802bb | ||
|
|
437e87a931 | ||
|
|
081a301f20 | ||
|
|
71495578a4 | ||
|
|
d2960b7b5c | ||
|
|
78a9ad27c3 | ||
|
|
ecda1d8a44 | ||
|
|
9da3d17093 | ||
|
|
8d0a5962a9 | ||
|
|
e9a41e05e1 | ||
|
|
24e7f7e369 | ||
|
|
28737d9ee9 | ||
|
|
6dafd1d4d3 | ||
|
|
6353759cce | ||
|
|
fb0def1684 | ||
|
|
caea79c997 | ||
|
|
c775d0de2e | ||
|
|
843d6dd4c8 | ||
|
|
c935e0da39 | ||
|
|
d87d7df513 | ||
|
|
77dc26ef4f | ||
|
|
8963303344 | ||
|
|
746cadf4e4 | ||
|
|
417eb0d7b8 | ||
|
|
5d19c5bb68 | ||
|
|
b479fb5d9f | ||
|
|
6901238ba7 | ||
|
|
0e296bba08 | ||
|
|
01adb67d9f | ||
|
|
305a169b01 | ||
|
|
6c598c3c35 | ||
|
|
24b98e170e | ||
|
|
b2bd8f62b2 | ||
|
|
1d143a08dd | ||
|
|
23908e9c71 | ||
|
|
9fc5e527e9 | ||
|
|
5f13249d40 | ||
|
|
1a745a5d1d | ||
|
|
6cbc00fb19 | ||
|
|
ee3387e59d | ||
|
|
fb7f022fc3 | ||
|
|
fbeaa1002f | ||
|
|
9328d403ee | ||
|
|
3e927e6874 | ||
|
|
15a5d109c7 | ||
|
|
96f8c8f414 | ||
|
|
6e888ebdbf | ||
|
|
ba945af43a | ||
|
|
c62e54d720 | ||
|
|
d9763d57bf | ||
|
|
299b53370d | ||
|
|
61a0b1f35f | ||
|
|
a8604e6a68 | ||
|
|
5f1bc27167 | ||
|
|
620d45feb4 | ||
|
|
cb81b83199 | ||
|
|
14813caba9 | ||
|
|
7bbd847b33 | ||
|
|
32aa21e991 | ||
|
|
dea80f4954 | ||
|
|
e1415c4474 | ||
|
|
fbbb077fb7 | ||
|
|
7d604fc519 | ||
|
|
e23b856425 | ||
|
|
16872d6323 | ||
|
|
1b82440464 | ||
|
|
5ac4f24a6c | ||
|
|
2d87a836dd | ||
|
|
eea2e26f27 | ||
|
|
34a5076448 | ||
|
|
8dcb052322 | ||
|
|
d3b5b12a5a | ||
|
|
c44b69807d | ||
|
|
5248d162d7 | ||
|
|
d3db45d710 | ||
|
|
70a24218cf | ||
|
|
b2bc8807b5 | ||
|
|
db90caa563 | ||
|
|
4837531a00 | ||
|
|
4586f0bbb4 | ||
|
|
6db9a37056 | ||
|
|
360ece9e98 | ||
|
|
a6dea3e220 | ||
|
|
10e494b220 | ||
|
|
b57c862896 | ||
|
|
2fb5038a4e | ||
|
|
7cc0ed4dcb | ||
|
|
12e0435035 | ||
|
|
e5ccab49c2 | ||
|
|
c954c616a8 | ||
|
|
fd9674c6c0 | ||
|
|
71a828ebfd | ||
|
|
8ac982ad08 | ||
|
|
bf5af56f19 | ||
|
|
9a4aedeecb | ||
|
|
26df12ba62 | ||
|
|
20221e0fcd | ||
|
|
17f16c7f13 | ||
|
|
c5c2493a80 | ||
|
|
3e2a13182b | ||
|
|
34568ddfec | ||
|
|
60838a7555 | ||
|
|
d07c1c4e57 | ||
|
|
601da2a282 | ||
|
|
188388ce2f | ||
|
|
6615050cf2 | ||
|
|
ef5aeb5065 | ||
|
|
9fcfb997e5 | ||
|
|
06f7784f31 | ||
|
|
7b4979c100 | ||
|
|
90b83aea4b | ||
|
|
821c0d4d7c | ||
|
|
2929c4d4a9 | ||
|
|
199cbdba2f | ||
|
|
da71a4116a | ||
|
|
2a0ae0225a | ||
|
|
dc191dabcf | ||
|
|
ccc00a7cc0 | ||
|
|
2908742a66 | ||
|
|
d228ba1027 | ||
|
|
8ec7a998c9 | ||
|
|
51c709a7da | ||
|
|
12f3fe074e | ||
|
|
d0ae78e8c2 | ||
|
|
c624afc9af | ||
|
|
a62a51eb8a | ||
|
|
72e0ebb1ca |
No files matched your search
@@ -5,3 +5,10 @@ x64
|
||||
*.ncb
|
||||
.*sw?
|
||||
.DS_Store
|
||||
kernels/config.h
|
||||
kernels/hash.h
|
||||
build
|
||||
models
|
||||
tbb
|
||||
doc/intelstyle
|
||||
|
||||
+538
@@ -0,0 +1,538 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
## You may obtain a copy of the License at ##
|
||||
## ##
|
||||
## http://www.apache.org/licenses/LICENSE-2.0 ##
|
||||
## ##
|
||||
## Unless required by applicable law or agreed to in writing, software ##
|
||||
## distributed under the License is distributed on an "AS IS" BASIS, ##
|
||||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ##
|
||||
## See the License for the specific language governing permissions and ##
|
||||
## limitations under the License. ##
|
||||
## ======================================================================== ##
|
||||
|
||||
#####################################################################
|
||||
# Continuous Test
|
||||
####################################################################
|
||||
|
||||
continuous-windows-x64-RelWithDebInfo-V120-ISPC1.9.2-AVX2-TBB2017:
|
||||
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:V120 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:3"
|
||||
tags: [win7, v120]
|
||||
only: [pushes]
|
||||
|
||||
#continuous-windows-Win32-RelWithDebInfo-V140-ISPC1.9.2-AVX2-TBB2017:
|
||||
# script: "python scripts\\test.py platform:Win32 build:RelWithDebInfo compiler:V140 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:2"
|
||||
# tags: [win7, v140]
|
||||
# only: [pushes]
|
||||
|
||||
continuous-windows-x64-RelWithDebInfo-V141-ISPC1.9.2-AVX2-TBB2017:
|
||||
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:V141 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:3"
|
||||
tags: [win7, v141]
|
||||
only: [pushes]
|
||||
|
||||
continuous-macosx-x64-RelWithDebInfo-CLANG-ISPC1.9.2-AVX2-TBB2017:
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:3"
|
||||
tags: [mac, clang]
|
||||
only: [pushes]
|
||||
|
||||
continuous-linux-skx-x64-RelWithDebInfo-ICC17-ISPC1.9.2-AVX512SKX-TBB2017:
|
||||
image: embreedocker/centos:6.0
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC17 ispc:ispc1.9.2 isa:AVX512SKX tasking:TBB2017 intensity:3"
|
||||
tags: [docker, skx]
|
||||
only: [pushes]
|
||||
|
||||
continuous-linux-skx-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX512SKX-TBB2017:
|
||||
image: embreedocker/fedora:26
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX512SKX tasking:TBB2017 intensity:3"
|
||||
tags: [docker, skx]
|
||||
only: [pushes]
|
||||
|
||||
#continuous-linux-knl-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX512KNL-TBB2017:
|
||||
# image: embreedocker/fedora:26
|
||||
# script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX512KNL tasking:TBB2017 intensity:3"
|
||||
# tags: [docker-knl]
|
||||
# only: [pushes]
|
||||
|
||||
continuous-linux-x64-RelWithDebInfo-CLANG5-ISPC1.9.2-AVX2-INT-ADDRSANITIZER:
|
||||
image: embreedocker/fedora:26
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG5 ispc:ispc1.9.2 isa:AVX2 tasking:INT intensity:1 addrsanitizer:ON"
|
||||
tags: [docker]
|
||||
only: [pushes]
|
||||
|
||||
continuous-ubuntu17.10-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB:
|
||||
image: embreedocker/ubuntu:17.10
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
|
||||
tags: [docker]
|
||||
only: [pushes]
|
||||
|
||||
continuous-centos7.4-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB:
|
||||
image: embreedocker/centos:7.4
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
|
||||
tags: [docker]
|
||||
only: [pushes]
|
||||
|
||||
continuous-fedora27-x64-RelWithDebInfo-GCC-ISPC-AVX512SKX-TBB:
|
||||
image: embreedocker/fedora:27
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc isa:AVX512SKX tasking:TBB intensity:3"
|
||||
tags: [docker, skx]
|
||||
only: [pushes]
|
||||
|
||||
continuous-linux-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB-KLOCKWORK:
|
||||
image: embree-kw-centos7
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB klocwork:ON intensity:0"
|
||||
tags: [kw-scan-docker]
|
||||
only: [pushes]
|
||||
|
||||
#####################################################################
|
||||
# Intensive Nightly Tests
|
||||
####################################################################
|
||||
|
||||
nightly-windows-x64-RelWithDebInfo-V120-ISPC1.9.2-SSE2-INT:
|
||||
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:V120 ispc:ispc1.9.2 isa:SSE2 tasking:INT intensity:4"
|
||||
tags: [win7, v120]
|
||||
only: [schedules]
|
||||
|
||||
nightly-windows-x64-RelWithDebInfo-V120-ISPC1.9.2-AVX-TBB2017:
|
||||
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:V120 ispc:ispc1.9.2 isa:AVX tasking:TBB2017 intensity:4"
|
||||
tags: [win7, v120] # avx
|
||||
only: [schedules]
|
||||
|
||||
nightly-windows-Win32-RelWithDebInfo-V140-ISPC1.9.2-AVX2-TBB2017:
|
||||
script: "python scripts\\test.py platform:Win32 build:RelWithDebInfo compiler:V140 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:2"
|
||||
tags: [win7, v140]
|
||||
only: [schedules]
|
||||
|
||||
nightly-windows-x64-RelWithDebInfo-V140-ISPC1.9.2-AVX2-PPL:
|
||||
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:V140 ispc:ispc1.9.2 isa:AVX2 tasking:PPL intensity:4"
|
||||
tags: [win7, v140] # avx2
|
||||
only: [schedules]
|
||||
|
||||
nightly-windows-x64-RelWithDebInfo-V141-ISPC1.9.2-AVX2-TBB2017-STATIC:
|
||||
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:V140 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4 STATIC_LIB:ON"
|
||||
tags: [win7, v141]
|
||||
only: [schedules]
|
||||
|
||||
nightly-windows-x64-RelWithDebInfo-CLANG-ISPC1.9.2-AVX2-TBB2017:
|
||||
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:CLANG ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
|
||||
tags: [win7, clang]
|
||||
only: [schedules]
|
||||
|
||||
nightly-windows-x64-RelWithDebInfo-ICC16-ISPC1.9.2-AVX2-TBB2017:
|
||||
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:ICC16 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
|
||||
tags: [win7, icc16]
|
||||
only: [schedules]
|
||||
|
||||
nightly-windows-x64-RelWithDebInfo-ICC17-ISPC1.9.2-AVX2-TBB2017:
|
||||
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:ICC17 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
|
||||
tags: [win7, icc17]
|
||||
only: [schedules]
|
||||
|
||||
nightly-windows-x64-RelWithDebInfo-ICC18-ISPC1.9.2-AVX2-TBB2017:
|
||||
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:ICC18 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:3"
|
||||
tags: [win7, icc18]
|
||||
only: [schedules]
|
||||
|
||||
nightly-windows-x64-RelWithDebInfo-ICC18-ISPC1.9.2-AVX512SKX-TBB2017:
|
||||
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:ICC18 ispc:ispc1.9.2 isa:AVX512SKX tasking:TBB2017 intensity:1 sde:skx"
|
||||
tags: [win7, icc18]
|
||||
only: [schedules]
|
||||
|
||||
|
||||
# CLANG compilation and testing of different ISAs
|
||||
|
||||
nightly-macosx-x64-RelWithDebInfo-CLANG-ISPC1.9.2-SSE2-TBB2017:
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG ispc:ispc1.9.2 isa:SSE2 tasking:TBB2017 intensity:4"
|
||||
tags: [mac, clang]
|
||||
only: [schedules]
|
||||
|
||||
nightly-macosx-x64-RelWithDebInfo-CLANG-ISPC1.9.2-AVX-INT:
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG ispc:ispc1.9.2 isa:AVX tasking:INT intensity:4"
|
||||
tags: [mac, clang] # avx
|
||||
only: [schedules]
|
||||
|
||||
nightly-macosx-x64-RelWithDebInfo-CLANG-ISPC1.9.2-AVX2-TBB2017-STATIC:
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4 STATIC_LIB:ON"
|
||||
tags: [mac, clang] # avx2
|
||||
only: [schedules]
|
||||
|
||||
# ICC compilation and testing of different ISAs
|
||||
|
||||
nightly-macosx-x64-RelWithDebInfo-ICC15-ISPC1.9.2-AVX-INT:
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC15 ispc:ispc1.9.2 isa:AVX tasking:INT intensity:4"
|
||||
tags: [mac, icc15]
|
||||
only: [schedules]
|
||||
|
||||
nightly-macosx-x64-RelWithDebInfo-ICC16-ISPC1.9.2-AVX2-TBB2017:
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC16 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
|
||||
tags: [mac, icc16]
|
||||
only: [schedules]
|
||||
|
||||
|
||||
# CLANG compilation and testing of different ISAs
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-SSE2-TBB:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:SSE2 tasking:TBB2017 intensity:4"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX-TBB2017-VALGRIND:
|
||||
image: embreedocker/fedora:26
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX tasking:TBB2017 intensity:4 memcheck:ON"
|
||||
tags: [docker] # avx
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG5-ISPC1.9.2-AVX2-INT-ADDRSANITIZER:
|
||||
image: embreedocker/fedora:26
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG5 ispc:ispc1.9.2 isa:AVX2 tasking:INT intensity:2 addrsanitizer:ON"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-STATIC:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4 STATIC_LIB:ON"
|
||||
tags: [docker] # avx2
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-knl-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX512KNL-TBB2017:
|
||||
image: embreedocker/fedora:26
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX512KNL tasking:TBB2017 intensity:3"
|
||||
tags: [docker-knl]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-skx-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX512SKX-TBB2017:
|
||||
image: embreedocker/fedora:26
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX512SKX tasking:TBB2017 intensity:3"
|
||||
tags: [docker, skx]
|
||||
only: [schedules]
|
||||
|
||||
|
||||
# GCC compilation and testing of different ISAs
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-GCC-ISPC1.9.2-SSE2-TBB2017:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:SSE2 tasking:TBB2017 intensity:4"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX-TBB2017:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX tasking:TBB2017 intensity:4"
|
||||
tags: [docker] # avx
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB2017:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
|
||||
tags: [docker] # avx2
|
||||
only: [schedules]
|
||||
|
||||
|
||||
# ICC compilation and testing of different ISAs
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-ICC15-ISPC1.9.2-SSE2-TBB2017:
|
||||
image: embreedocker/centos:6.0
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC15 ispc:ispc1.9.2 isa:SSE2 tasking:TBB2017 intensity:4"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-ICC16-ISPC1.9.2-AVX-TBB2017:
|
||||
image: embreedocker/centos:6.0
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC16 ispc:ispc1.9.2 isa:AVX tasking:TBB2017 intensity:4"
|
||||
tags: [docker] # avx
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-ICC17-ISPC1.9.2-AVX2-TBB2017:
|
||||
image: embreedocker/centos:6.0
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC17 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
|
||||
tags: [docker] # avx2
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-knl-x64-RelWithDebInfo-ICC17-ISPC1.9.2-AVX512KNL-TBB2017:
|
||||
image: embreedocker/centos:6.0
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC17 ispc:ispc1.9.2 isa:AVX512KNL tasking:TBB2017 intensity:3"
|
||||
tags: [docker-knl]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-skx-x64-RelWithDebInfo-ICC17-ISPC1.9.2-AVX512SKX-TBB2017:
|
||||
image: embreedocker/centos:6.0
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC17 ispc:ispc1.9.2 isa:AVX512SKX tasking:TBB2017 intensity:4"
|
||||
tags: [docker, skx]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-skx-x64-RelWithDebInfo-ICC18-ISPC1.9.2-AVX512SKX-TBB2017:
|
||||
image: embreedocker/centos:6.0
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC18 ispc:ispc1.9.2 isa:AVX512SKX tasking:TBB2017 intensity:4"
|
||||
tags: [docker, skx]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-ICC19-ISPC1.9.2-AVX2-TBB2017:
|
||||
image: embreedocker/centos:6.0
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC19 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
|
||||
tags: [docker] # avx2
|
||||
only: [schedules]
|
||||
|
||||
# Testing on different Linux distributions
|
||||
|
||||
nightly-ubuntu17.10-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB:
|
||||
image: embreedocker/ubuntu:17.10
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-ubuntu16.04-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB:
|
||||
image: embreedocker/ubuntu:16.04
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-centos7.4-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB:
|
||||
image: embreedocker/centos:7.4
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-centos7.0-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB:
|
||||
image: embreedocker/centos:7.0
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-centos6.0-x64-RelWithDebInfo-GCC4.8.2-ISPC1.9.2-AVX2-TBB:
|
||||
image: embreedocker/centos:6.0
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-fedora28-x64-RelWithDebInfo-GCC-ISPC-AVX512SKX-TBB:
|
||||
image: embreedocker/fedora:28
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc isas:SSE2-SSE42-AVX-AVX2-AVX512SKX tasking:TBB intensity:3" # AVX512KNL triggers internal compiler bug in GCC 8.0.1
|
||||
tags: [docker, skx]
|
||||
only: [schedules]
|
||||
|
||||
nightly-fedora27-x64-RelWithDebInfo-GCC-ISPC-AVX512SKX-TBB:
|
||||
image: embreedocker/fedora:27
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc isa:AVX512SKX tasking:TBB intensity:3"
|
||||
tags: [docker, skx]
|
||||
only: [schedules]
|
||||
|
||||
nightly-fedora26-x64-RelWithDebInfo-GCC-ISPC-AVX2-TBB:
|
||||
image: embreedocker/fedora:26
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc isa:AVX2 tasking:TBB intensity:3"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-fedora25-x64-RelWithDebInfo-GCC-ISPC-AVX2-TBB:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc isa:AVX2 tasking:TBB intensity:3"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
|
||||
# Compilation test of disabled features
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-AVX2-TBB2017-NO-ISPC:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 ISPC_SUPPORT:OFF intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-NO-TUTORIALS:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TUTORIALS:OFF intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-BACKFACECULLING:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 BACKFACE_CULLING:ON intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-IGNORE-INVALID-RAYS:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 IGNORE_INVALID_RAYS:ON intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-NO-FILTER-FUNCTION:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 FILTER_FUNCTION:OFF intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-RAYMASKS:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 RAY_MASK:ON intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-NO-PACKETS:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 RAY_PACKETS:OFF intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-STATCOUNTER:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 STAT_COUNTER:ON intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
|
||||
# Compilation test of individual ISAs
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-ISAS-SSE2-TBB2017:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isas:SSE2 tasking:TBB2017 intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-ISAS-SSE42-TBB2017:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isas:SSE42 tasking:TBB2017 intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-ISAS-AVX-TBB2017:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isas:AVX tasking:TBB2017 intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-ISAS-AVX2-TBB2017:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isas:AVX2 tasking:TBB2017 intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-ISAS-AVX512SKX-TBB2017:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isas:AVX512SKX tasking:TBB2017 intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
|
||||
# Compilation test of individual primitive types enabled
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-TRI:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:ON QUAD:OFF GRID:OFF CURVE:OFF SUBDIV:OFF USERGEOM:OFF INSTANCE:OFF intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-QUAD:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:OFF QUAD:ON GRID:OFF CURVE:OFF SUBDIV:OFF USERGEOM:OFF INSTANCE:OFF intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-GRID:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:OFF QUAD:OFF GRID:ON CURVE:OFF SUBDIV:OFF USERGEOM:OFF INSTANCE:OFF intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-CURVE:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:ON QUAD:OFF GRID:OFF CURVE:ON SUBDIV:OFF USERGEOM:OFF INSTANCE:OFF intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-SUBDIV:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:ON QUAD:OFF GRID:OFF CURVE:OFF SUBDIV:ON USERGEOM:OFF INSTANCE:OFF intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-USERGEOM:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:ON QUAD:OFF GRID:OFF CURVE:OFF SUBDIV:OFF USERGEOM:ON INSTANCE:OFF intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-INSTANCE:
|
||||
image: embreedocker/fedora:25
|
||||
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:ON QUAD:OFF GRID:OFF CURVE:OFF SUBDIV:OFF USERGEOM:OFF INSTANCE:ON intensity:0"
|
||||
tags: [docker]
|
||||
only: [schedules]
|
||||
|
||||
|
||||
#####################################################################
|
||||
# Release Builds
|
||||
####################################################################
|
||||
|
||||
release-windows-x64-Release-ICC17-VC12-ISPC1.9.2-TBB2017-PACKAGE-ZIP:
|
||||
script: "python scripts\\test.py platform:x64 build:Release compiler:ICC17-VC12 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2-AVX512SKX tasking:TBB2017 intensity:4 package:ZIP"
|
||||
tags: [win7, icc17]
|
||||
only: [web]
|
||||
artifacts:
|
||||
name: "$env:CI_JOB_NAME"
|
||||
paths: [build/*.zip]
|
||||
when: always
|
||||
expire_in: 2 mos
|
||||
|
||||
release-windows-x64-Release-ICC17-VC14-ISPC1.9.2-TBB2017-PACKAGE-ZIP:
|
||||
script: "python scripts\\test.py platform:x64 build:Release compiler:ICC17-VC14 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2-AVX512SKX tasking:TBB2017 intensity:4 package:ZIP"
|
||||
tags: [win7, icc17]
|
||||
only: [web]
|
||||
artifacts:
|
||||
name: "$env:CI_JOB_NAME"
|
||||
paths: [build/*.zip]
|
||||
when: always
|
||||
expire_in: 2 mos
|
||||
|
||||
release-windows-x64-Release-ICC17-ISPC1.9.2-TBB2017-PACKAGE-MSI:
|
||||
script: "python scripts\\test.py platform:x64 build:Release compiler:ICC17 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2-AVX512SKX tasking:TBB2017 intensity:4 package:MSI"
|
||||
tags: [win7, icc17]
|
||||
only: [web]
|
||||
artifacts:
|
||||
name: "$env:CI_JOB_NAME"
|
||||
paths: [build/*.msi]
|
||||
when: always
|
||||
expire_in: 2 mos
|
||||
|
||||
release-macosx-x64-Release-ICC16-ISPC1.9.2-TBB2017-PACKAGE-ZIP:
|
||||
script: "scripts/test.py platform:x64 build:Release compiler:ICC16 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2 tasking:TBB2017 intensity:4 package:ZIP"
|
||||
tags: [mac, icc16]
|
||||
only: [web]
|
||||
artifacts:
|
||||
name: "$CI_JOB_NAME"
|
||||
paths: [build/*.tar.gz]
|
||||
when: always
|
||||
expire_in: 2 mos
|
||||
|
||||
release-macosx-x64-Release-ICC16-ISPC1.9.2-TBB-PACKAGE-PKG:
|
||||
script: "scripts/test.py platform:x64 build:Release compiler:ICC16 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2 tasking:TBB intensity:4 package:PKG"
|
||||
tags: [mac, icc16]
|
||||
only: [web]
|
||||
artifacts:
|
||||
name: "$CI_JOB_NAME"
|
||||
paths: [build/*.pkg]
|
||||
when: always
|
||||
expire_in: 2 mos
|
||||
|
||||
release-linux-x64-Release-ICC17-ISPC1.9.2-TBB2017-PACKAGE-ZIP:
|
||||
image: embreedocker/centos:6.0
|
||||
script: "scripts/test.py platform:x64 build:Release compiler:ICC17 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2-AVX512KNL-AVX512SKX tasking:TBB2017 intensity:4 package:ZIP"
|
||||
tags: [docker]
|
||||
only: [web]
|
||||
artifacts:
|
||||
name: "$CI_JOB_NAME"
|
||||
paths: [build/*.tar.gz]
|
||||
when: always
|
||||
expire_in: 2 mos
|
||||
|
||||
release-linux-x64-Release-ICC17-ISPC1.9.2-TBB-PACKAGE-RPM:
|
||||
image: embreedocker/centos:6.0
|
||||
script: "scripts/test.py platform:x64 build:Release compiler:ICC17 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2-AVX512KNL-AVX512SKX tasking:TBB intensity:4 package:RPM"
|
||||
tags: [docker]
|
||||
only: [web]
|
||||
artifacts:
|
||||
name: "$CI_JOB_NAME"
|
||||
paths: [build/*.tar.gz]
|
||||
when: always
|
||||
expire_in: 2 mos
|
||||
+173
-2
@@ -1,6 +1,176 @@
|
||||
Version History
|
||||
---------------
|
||||
|
||||
### New Features in Embree 3.3.0
|
||||
- Added support for motion blur time range per geometry. This way geometries
|
||||
can appear and disappear during the camera shutter and time steps do not have
|
||||
to start and end at camera shutter interval boundaries.
|
||||
- Fixed crash with pathtracer when using --triangle-sphere command line.
|
||||
- Fixed crash with pathtracer when using --shader ao command line.
|
||||
- Fixed tutorials showing a black window on macOS 10.14 until moved.
|
||||
|
||||
### New Features in Embree 3.2.4
|
||||
- Fixed compile issues with ICC 2019.
|
||||
- Released ZIP files for Windows are now provided in a
|
||||
version linked against Visual Studio 2013 and Visual Studio 2015.
|
||||
|
||||
### New Features in Embree 3.2.3
|
||||
- Fixed crash when using curves with RTC_SCENE_FLAG_DYNAMIC
|
||||
combined with RTC_BUILD_QUALITY_MEDIUM.
|
||||
|
||||
### New Features in Embree 3.2.2
|
||||
- Fixed intersection distance for unnormalized rays with line segments.
|
||||
- Removed libmmd.dll dependency in release builds for Windows.
|
||||
- Fixed detection of AppleClang compiler under MacOSX.
|
||||
|
||||
### New Features in Embree 3.2.1
|
||||
- Bugfix in flat mode for hermite curves.
|
||||
- Added EMBREE_CURVE_SELF_INTERSECTION_AVOIDANCE_FACTOR cmake option to
|
||||
control self intersection avoidance for flat curves.
|
||||
- Performance fix when instantiating motion blurred scenes. The application
|
||||
should best use two (or more) time steps for an instance that instantiates
|
||||
a motion blurred scene.
|
||||
- Fixed AVX512 compile issue with GCC 6.1.1.
|
||||
- Fixed performance issue with rtcGetGeometryUserData when used
|
||||
during rendering.
|
||||
- Bugfix in length of derivatives for grid geometry.
|
||||
- Added BVH8 support for motion blurred curves and lines. For some workloads
|
||||
this increases performance by up to 7%.
|
||||
- Fixed rtcGetGeometryTransform to return the local to world transform.
|
||||
- Fixed bug in multi segment motion blur that caused missing of perfectly
|
||||
axis aligned geometry.
|
||||
- Reduced memory consumption of small scenes by 4x.
|
||||
- Reduced temporal storage of grid builder.
|
||||
|
||||
### New Features in Embree 3.2.0
|
||||
- Improved watertightness of robust mode.
|
||||
- Line segments, and other curves are now all contained in a single
|
||||
BVH which improves performance when these are both used in a scene.
|
||||
- Performance improvement of up to 20% for line segments.
|
||||
- Bugfix to Embree2 to Embree3 conversion script.
|
||||
- Added support for Hermite curve basis.
|
||||
- Semantics of normal buffer for normal oriented curves has
|
||||
changed to simplify usage. Please see documentation for details.
|
||||
- Using GLFW and imgui in tutorials.
|
||||
- Fixed floating point exception in static variable initialization.
|
||||
- Fixed invalid memory access in rtcGetGeometryTransform for non-motion
|
||||
blur instances.
|
||||
- Improved self intersection avoidance for flat curves. Transparency rays
|
||||
with tnear set to previous hit distance do not need curve radius
|
||||
based self intersection avoidance as same hit is calculated again. For this
|
||||
reason self intersection avoidance is now only applied to ray origin.
|
||||
|
||||
### New Features in Embree 3.1.0
|
||||
- Added new normal-oriented curve primitive for ray tracing of grass-like
|
||||
structures.
|
||||
- Added new grid primitive for ray tracing tessellated and displaced surfaces
|
||||
in very memory efficient manner.
|
||||
- Fixed bug of ribbon curve intersector when derivative was zero.
|
||||
- Installing all static libraries when EMBREE_STATIC_LIB is enabled.
|
||||
- Added API functions to access topology of subdivision mesh.
|
||||
- Reduced memory consumption of instances.
|
||||
- Improved performance of instances by 8%.
|
||||
- Reduced memory consumption of curves by up to 2x.
|
||||
- Up to 5% higher performance on AVX-512 architectures.
|
||||
- Added native support for multiple curve basis functions. Internal
|
||||
basis conversions are no longer performed, which saves additional
|
||||
memory when multiple bases are used.
|
||||
- Fixed issue with non thread safe local static variable initialization
|
||||
in VS2013.
|
||||
- Bugfix in rtcSetNewGeometry. Vertex buffers did not get properly
|
||||
overallocated.
|
||||
- Replaced ImageMagick with OpenImageIO in the tutorials.
|
||||
|
||||
### New Features in Embree 3.0.0
|
||||
- Switched to a new version of the API which provides improved
|
||||
flexibility but is not backward compatible. Please see "Upgrading
|
||||
from Embree 2 to Embree 3" section of the documentation for upgrade
|
||||
instructions. In particular, we provide a Python script that performs
|
||||
most of the transition work.
|
||||
- User geometries inside an instanced scene and a top-level scene no
|
||||
longer need to handle the instID field of the ray differently. They
|
||||
both just need to copy the context.instID into the ray.instID field.
|
||||
- Support for context filter functions that can be assigned to a ray
|
||||
query.
|
||||
- User geometries can now invoke filter functions using the
|
||||
rtcFilterIntersection and rtcFilterOcclusion calls.
|
||||
- Higher flexibility through specifying build quality per scene and
|
||||
geometry.
|
||||
- Geometry normal uses commonly used right-hand rule from now on.
|
||||
- Added self-intersection avoidance to ribbon curves and lines.
|
||||
Applications do not have to implement self-intersection workarounds
|
||||
for these primitive types anymore.
|
||||
- Added support for 4 billion primitives in a single scene.
|
||||
- Removed the RTC_MAX_USER_VERTEX_BUFFERS and RTC_MAX_INDEX_BUFFERS
|
||||
limitations.
|
||||
- Reduced memory consumption by 192 bytes per instance.
|
||||
- Fixed some performance issues on AVX-512 architectures.
|
||||
- Individual Contributor License Agreement (ICLA) and Corporate
|
||||
Contributor License Agreement (CCLA) no longer required to
|
||||
contribute to the project.
|
||||
|
||||
### New Features in Embree 2.17.5
|
||||
- Improved watertightness of robust mode.
|
||||
- Fixed floating point exception in static variable initialization.
|
||||
- Fixed AVX512 compile issue with GCC 6.1.1.
|
||||
|
||||
### New Features in Embree 2.17.4
|
||||
- Fixed AVX512 compile issue with GCC 7.
|
||||
- Fixed issue with not thread safe local static variable
|
||||
initialization in VS2013.
|
||||
- Fixed bug in the 4 and 8-wide packet intersection of instances with
|
||||
multi-segment motion blur on AVX-512 architectures.
|
||||
- Fixed bug in rtcOccluded4/8/16 when only AVX-512 ISA was enabled.
|
||||
|
||||
### New Features in Embree 2.17.3
|
||||
- Fixed GCC compile warning in debug mode.
|
||||
- Fixed bug of ribbon curve intersector when derivative was zero.
|
||||
- Installing all static libraries when EMBREE_STATIC_LIB is enabled.
|
||||
|
||||
### New Features in Embree 2.17.2
|
||||
- Made BVH build of curve geometry deterministic.
|
||||
|
||||
### New Features in Embree 2.17.1
|
||||
- Improved performance of occlusion ray packets by up to 50%.
|
||||
- Fixed detection of Clang for CMake 3 under MacOSX
|
||||
- Fixed AVX code compilation issue with GCC 7 compiler caused by
|
||||
explicit use of vzeroupper intrinsics.
|
||||
- Fixed an issue where Clang address sanitizer reported an error in
|
||||
the internal tasking system.
|
||||
- Added fix to compile on 32 bit Linux distribution.
|
||||
- Fixed some wrong relative include paths in Embree.
|
||||
- Improved performance of robust single ray mode by 5%.
|
||||
- Added EMBREE_INSTALL_DEPENDENCIES option (default OFF) to enable
|
||||
installing of Embree dependencies.
|
||||
- Fixed performance regression for occlusion ray streams.
|
||||
- Reduced temporary memory requirements of BVH builder for curves and
|
||||
line segments.
|
||||
- Fixed performance regression for user geometries and packet ray tracing.
|
||||
- Fixed bug where wrong closest hit was reported for very curvy hair segment.
|
||||
|
||||
### New Features in Embree 2.17.0
|
||||
- Improved packet ray tracing performance for coherent rays by 10-60%
|
||||
(requires RTC_INTERSECT_COHERENT flag).
|
||||
- Improved ray tracing performance for incoherent rays on
|
||||
AVX-512 architectures by 5%.
|
||||
- Improved ray tracing performance for streams of incoherent rays
|
||||
by 5-15%.
|
||||
- Fixed tbb_debug.lib linking error under Windows.
|
||||
- Fast coherent ray stream and packet code paths now also work in robust mode.
|
||||
- Using less agressive prefetching for large BVH nodes which
|
||||
results in 1-2% higher ray tracing performance.
|
||||
- Precompiled binaries have stack-protector enabled, except for
|
||||
traversal kernels. BVH builders can be slightly slower due to this
|
||||
change. If you want stack-protectors disabled please turn off
|
||||
EMBREE_STACK_PROTECTOR in cmake and build the binaries yourself.
|
||||
- When enabling ISAs individually, the 8-wide BVH was previously only
|
||||
available when the AVX ISA was also selected. This issue is now
|
||||
fixed, and one can enable only AVX2 and still get best
|
||||
performance by using an 8-wide BVH.
|
||||
- Fixed rtcOccluded1 and rtcOccluded1Ex API functions which were
|
||||
broken in ISPC.
|
||||
- Providing MSI installer for Windows.
|
||||
|
||||
### New Features in Embree 2.16.5
|
||||
- Bugfix in the robust triangle intersector that rarely caused NaNs.
|
||||
- Fixed bug in hybrid traversal kernel when BVH leaf was entered with no
|
||||
@@ -84,7 +254,7 @@ Version History
|
||||
- Removed support for Visual Studio 2012.
|
||||
- Precompiled binaries now require a CPU supporting at least the
|
||||
SSE4.2 ISA.
|
||||
- We no longer provide precompiled binaries for 32 bit on Windows.
|
||||
- We no longer provide precompiled binaries for 32-bit on Windows.
|
||||
- Under Windows one now has to use the platform toolset option in
|
||||
CMake to switch to Clang or the Intel® Compiler.
|
||||
- Fixed a bug for subdivision meshes when using the incoherent scene
|
||||
@@ -394,7 +564,7 @@ Version History
|
||||
|
||||
- Improved mixed AABB/OBB-BVH for hair geometry (Xeon Phi)
|
||||
- Reduced amount of pre-allocated memory for BVH builders (Xeon Phi)
|
||||
- New 64 bit Morton code-based BVH builder (Xeon Phi)
|
||||
- New 64-bit Morton code-based BVH builder (Xeon Phi)
|
||||
- (Enhanced) Morton code-based BVH builders use now tree rotations to
|
||||
improve BVH quality (Xeon Phi)
|
||||
- Bug fixes (Xeon and Xeon Phi)
|
||||
@@ -458,3 +628,4 @@ Version History
|
||||
- Integration with the Intel® SPMD Program Compiler (ISPC)
|
||||
- Instantiation and fast BVH reconstruction
|
||||
- Example photo-realistic rendering engine for both C++ and ISPC
|
||||
|
||||
+130
-92
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -14,10 +14,11 @@
|
||||
## limitations under the License. ##
|
||||
## ======================================================================== ##
|
||||
|
||||
SET(EMBREE_VERSION_MAJOR 2)
|
||||
SET(EMBREE_VERSION_MINOR 17)
|
||||
SET(EMBREE_VERSION_MAJOR 3)
|
||||
SET(EMBREE_VERSION_MINOR 3)
|
||||
SET(EMBREE_VERSION_PATCH 0)
|
||||
SET(EMBREE_VERSION_NOTE "-alpha.0")
|
||||
SET(EMBREE_VERSION_NOTE "")
|
||||
|
||||
SET(EMBREE_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}.${EMBREE_VERSION_PATCH})
|
||||
MATH(EXPR EMBREE_VERSION_NUMBER "10000*${EMBREE_VERSION_MAJOR} + 100*${EMBREE_VERSION_MINOR} + ${EMBREE_VERSION_PATCH}")
|
||||
SET(CPACK_RPM_PACKAGE_RELEASE 1)
|
||||
@@ -26,6 +27,25 @@ PROJECT(embree${EMBREE_VERSION_MAJOR})
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
|
||||
|
||||
MACRO (SIGN_TARGET target)
|
||||
IF (EMBREE_SIGN_FILE)
|
||||
IF (WIN32)
|
||||
# on Windows we only strip as debug symbols not included in binary
|
||||
ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
|
||||
COMMAND ${EMBREE_SIGN_FILE} -vv -c embree $<TARGET_FILE:${target}>)
|
||||
ELSEIF (APPLE)
|
||||
# on MacOSX we strip and sign
|
||||
ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_STRIP} -x $<TARGET_FILE:${target}>
|
||||
COMMAND ${EMBREE_SIGN_FILE} -vv -c embree $<TARGET_FILE:${target}>)
|
||||
ELSE()
|
||||
# on Linux just strip as signing not supported
|
||||
ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_STRIP} -x $<TARGET_FILE:${target}>)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
# find git version
|
||||
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||
FIND_PACKAGE(Git)
|
||||
@@ -43,20 +63,19 @@ ENDIF()
|
||||
|
||||
CONFIGURE_FILE(
|
||||
"${PROJECT_SOURCE_DIR}/kernels/rtcore_version.h.in"
|
||||
"${PROJECT_SOURCE_DIR}/include/embree2/rtcore_version.h"
|
||||
"${PROJECT_SOURCE_DIR}/include/embree3/rtcore_version.h"
|
||||
)
|
||||
CONFIGURE_FILE(
|
||||
"${PROJECT_SOURCE_DIR}/kernels/hash.h.in"
|
||||
"${PROJECT_BINARY_DIR}/hash.h"
|
||||
"${PROJECT_SOURCE_DIR}/kernels/hash.h"
|
||||
)
|
||||
FILE(WRITE "${PROJECT_BINARY_DIR}/hash" "${EMBREE_HASH}")
|
||||
|
||||
IF(COMMAND cmake_policy)
|
||||
if (POLICY CMP0003)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
endif()
|
||||
if (POLICY CMP0042)
|
||||
cmake_policy(SET CMP0042 OLD)
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
endif()
|
||||
ENDIF(COMMAND cmake_policy)
|
||||
|
||||
@@ -68,7 +87,6 @@ MARK_AS_ADVANCED(CMAKE_OSX_ARCHITECTURES)
|
||||
MARK_AS_ADVANCED(CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
MARK_AS_ADVANCED(CMAKE_OSX_SYSROOT)
|
||||
MARK_AS_ADVANCED(CLEAR CMAKE_CXX_COMPILER)
|
||||
MARK_AS_ADVANCED(GLUT_cocoa_LIBRARY)
|
||||
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/common/cmake ${CMAKE_MODULE_PATH})
|
||||
|
||||
@@ -99,30 +117,27 @@ OPTION(EMBREE_TUTORIALS "Enable to build Embree tutorials" ON)
|
||||
##############################################################################
|
||||
# Configurations (add configurations also to common/cmake/embree-config-default.cmake)
|
||||
|
||||
OPTION(EMBREE_INSTALL_DEPENDENCIES "Install Embree dependencies in binary packages and install" OFF)
|
||||
MARK_AS_ADVANCED(EMBREE_INSTALL_DEPENDENCIES)
|
||||
|
||||
OPTION(EMBREE_STAT_COUNTERS "Enables statistic counters.")
|
||||
OPTION(EMBREE_STACK_PROTECTOR "When enabled Embree compiles with stack protection against return address overrides." OFF)
|
||||
|
||||
OPTION(EMBREE_RAY_MASK "Enables ray mask support.")
|
||||
OPTION(EMBREE_BACKFACE_CULLING "Enables backface culling.")
|
||||
OPTION(EMBREE_INTERSECTION_FILTER "Enables intersection filter callback." ON)
|
||||
OPTION(EMBREE_INTERSECTION_FILTER_RESTORE "Restores previous hit when hit is filtered out." ON)
|
||||
OPTION(EMBREE_FILTER_FUNCTION "Enables filter functions." ON)
|
||||
OPTION(EMBREE_IGNORE_INVALID_RAYS "Ignores invalid rays." OFF) # FIXME: enable by default?
|
||||
|
||||
OPTION(EMBREE_GEOMETRY_TRIANGLES "Enables support for triangle geometries." ON)
|
||||
OPTION(EMBREE_GEOMETRY_QUADS "Enables support for quad geometries." ON)
|
||||
OPTION(EMBREE_GEOMETRY_LINES "Enables support for line geometries." ON)
|
||||
OPTION(EMBREE_GEOMETRY_HAIR "Enables support for hair geometries." ON)
|
||||
OPTION(EMBREE_GEOMETRY_SUBDIV "Enables support for subdiv geometries." ON)
|
||||
OPTION(EMBREE_GEOMETRY_TRIANGLE "Enables support for triangle geometries." ON)
|
||||
OPTION(EMBREE_GEOMETRY_QUAD "Enables support for quad geometries." ON)
|
||||
OPTION(EMBREE_GEOMETRY_CURVE "Enables support for curve geometries." ON)
|
||||
OPTION(EMBREE_GEOMETRY_SUBDIVISION "Enables support for subdiv geometries." ON)
|
||||
OPTION(EMBREE_GEOMETRY_USER "Enables support for user geometries." ON)
|
||||
OPTION(EMBREE_GEOMETRY_INSTANCE "Enables support for instances." ON)
|
||||
OPTION(EMBREE_GEOMETRY_GRID "Enables support for grid geometries." ON)
|
||||
OPTION(EMBREE_RAY_PACKETS "Enabled support for ray packets." ON)
|
||||
|
||||
SET(EMBREE_NATIVE_SPLINE_BASIS BEZIER CACHE STRING "Sets the basis for curves which Embree uses internally. Other types are converted and need more memory.")
|
||||
SET_PROPERTY(CACHE EMBREE_NATIVE_SPLINE_BASIS PROPERTY STRINGS BSPLINE BEZIER)
|
||||
IF (EMBREE_NATIVE_SPLINE_BASIS STREQUAL "BSPLINE")
|
||||
SET(EMBREE_NATIVE_CURVE_BSPLINE ON)
|
||||
ELSE()
|
||||
SET(EMBREE_NATIVE_CURVE_BSPLINE OFF)
|
||||
ENDIF()
|
||||
SET(EMBREE_CURVE_SELF_INTERSECTION_AVOIDANCE_FACTOR 2.0 CACHE STRING "Self intersection avoidance factor for flat curves. Specify floating point value in range 0 to inf.")
|
||||
|
||||
SET(EMBREE_TASKING_SYSTEM "TBB" CACHE STRING "Selects tasking system")
|
||||
IF (WIN32)
|
||||
@@ -153,35 +168,103 @@ ENDIF()
|
||||
|
||||
CONFIGURE_FILE(
|
||||
"${PROJECT_SOURCE_DIR}/kernels/config.h.in"
|
||||
"${PROJECT_BINARY_DIR}/config.h"
|
||||
"${PROJECT_SOURCE_DIR}/kernels/config.h"
|
||||
)
|
||||
|
||||
##############################################################
|
||||
# Compiler
|
||||
##############################################################
|
||||
|
||||
SET(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
|
||||
|
||||
IF (WIN32)
|
||||
IF (NOT DEFAULT_CMAKE_CONFIGURATION_TYPES_SET)
|
||||
SET(CMAKE_CONFIGURATION_TYPES "${CONFIGURATION_TYPES}" CACHE STRING "List of generated configurations." FORCE)
|
||||
SET(DEFAULT_CMAKE_CONFIGURATION_TYPES_SET ON CACHE INTERNAL "Default CMake configuration types set.")
|
||||
ENDIF()
|
||||
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
IF (${CMAKE_GENERATOR_TOOLSET} MATCHES "^LLVM" )
|
||||
MESSAGE("CLANG detected")
|
||||
INCLUDE(clang)
|
||||
ELSEIF(${CMAKE_GENERATOR_TOOLSET} MATCHES "^Intel")
|
||||
MESSAGE("Intel Compiler detected")
|
||||
INCLUDE (intel)
|
||||
ELSE()
|
||||
IF (EMBREE_ISA_AVX512KNL OR EMBREE_ISA_AVX512SKX)
|
||||
MESSAGE(FATAL_ERROR "Microsoft Visual C++ Compiler does not support AVX512. Please use Intel Compiler or Clang.")
|
||||
ENDIF()
|
||||
INCLUDE (msvc)
|
||||
ENDIF()
|
||||
|
||||
ELSE (WIN32)
|
||||
IF(CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
|
||||
INCLUDE (crayprgenv)
|
||||
ELSE()
|
||||
STRING(TOLOWER "${CMAKE_CXX_COMPILER_ID}" _LOWER_CXX_COMPILER_ID)
|
||||
STRING(REPLACE "appleclang" "clang" _LOWER_CXX_COMPILER_ID ${_LOWER_CXX_COMPILER_ID})
|
||||
INCLUDE(${_LOWER_CXX_COMPILER_ID} OPTIONAL RESULT_VARIABLE COMPILER_FOUND)
|
||||
IF (NOT COMPILER_FOUND)
|
||||
MESSAGE(FATAL_ERROR "Unsupported compiler: " ${CMAKE_CXX_COMPILER_ID})
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Specifies the build type." FORCE)
|
||||
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CONFIGURATION_TYPES})
|
||||
ENDIF(NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
OPTION(CMAKE_VERBOSE_MAKEFILE "Enables verbose mode.")
|
||||
MARK_AS_ADVANCED(CLEAR CMAKE_VERBOSE_MAKEFILE)
|
||||
|
||||
ENDIF (WIN32)
|
||||
|
||||
##############################################################
|
||||
# ISA configuration
|
||||
##############################################################
|
||||
|
||||
IF(CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
|
||||
SET(EMBREE_MAX_ISA "NONE" CACHE STRING "Selects highest ISA to support.")
|
||||
SET(EMBREE_MAX_ISA "DEFAULT" CACHE STRING "Selects highest ISA to support.")
|
||||
ELSE()
|
||||
SET(EMBREE_MAX_ISA "AVX2" CACHE STRING "Selects highest ISA to support.")
|
||||
SET(EMBREE_MAX_ISA "NONE" CACHE STRING "Selects highest ISA to support.")
|
||||
ENDIF()
|
||||
SET_PROPERTY(CACHE EMBREE_MAX_ISA PROPERTY STRINGS NONE SSE2 SSE4.2 AVX AVX2 AVX512KNL AVX512SKX)
|
||||
SET_PROPERTY(CACHE EMBREE_MAX_ISA PROPERTY STRINGS NONE SSE2 SSE4.2 AVX AVX2 AVX512KNL AVX512SKX DEFAULT)
|
||||
|
||||
IF (EMBREE_MAX_ISA STREQUAL "NONE")
|
||||
OPTION(EMBREE_ISA_SSE2 "Enables SSE2 ISA.")
|
||||
OPTION(EMBREE_ISA_SSE42 "Enables SSE4.2 ISA.")
|
||||
OPTION(EMBREE_ISA_AVX "Enables AVX ISA.")
|
||||
OPTION(EMBREE_ISA_AVX2 "Enables AVX2 ISA.")
|
||||
OPTION(EMBREE_ISA_AVX512KNL "Enables AVX512 ISA for Knights Landing.")
|
||||
OPTION(EMBREE_ISA_AVX512SKX "Enables AVX512 ISA for Skylake.")
|
||||
IF(NOT (EMBREE_ISA_SSE2 OR EMBREE_ISA_SSE42 OR EMBREE_ISA_AVX OR
|
||||
EMBREE_ISA_AVX2 OR EMBREE_ISA_AVX512KNL OR EMBREE_ISA_AVX512SKX))
|
||||
MESSAGE(STATUS "Detecting default ISA:")
|
||||
INCLUDE(check_isa_default)
|
||||
CHECK_ISA_DEFAULT(EMBREE_ISA_DEFAULT)
|
||||
MESSAGE(STATUS "Detecting default ISA: ${EMBREE_ISA_DEFAULT}")
|
||||
SET(EMBREE_ISA_${EMBREE_ISA_DEFAULT} ON)
|
||||
TRY_COMPILE(COMPILER_SUPPORTS_AVX ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp COMPILE_DEFINITIONS ${FLAGS_AVX})
|
||||
TRY_COMPILE(COMPILER_SUPPORTS_AVX2 ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp COMPILE_DEFINITIONS ${FLAGS_AVX2})
|
||||
TRY_COMPILE(COMPILER_SUPPORTS_AVX512KNL ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp COMPILE_DEFINITIONS ${FLAGS_AVX512KNL})
|
||||
TRY_COMPILE(COMPILER_SUPPORTS_AVX512SKX ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp COMPILE_DEFINITIONS ${FLAGS_AVX512SKX})
|
||||
|
||||
OPTION(EMBREE_ISA_SSE2 "Enables SSE2 ISA." ON)
|
||||
OPTION(EMBREE_ISA_SSE42 "Enables SSE4.2 ISA." ON)
|
||||
OPTION(EMBREE_ISA_AVX "Enables AVX ISA." ${COMPILER_SUPPORTS_AVX})
|
||||
OPTION(EMBREE_ISA_AVX2 "Enables AVX2 ISA." ${COMPILER_SUPPORTS_AVX2})
|
||||
IF (WIN32 OR APPLE)
|
||||
OPTION(EMBREE_ISA_AVX512KNL "Enables AVX512 ISA for Knights Landing." OFF)
|
||||
OPTION(EMBREE_ISA_AVX512SKX "Enables AVX512 ISA for Skylake." OFF)
|
||||
ELSE()
|
||||
OPTION(EMBREE_ISA_AVX512KNL "Enables AVX512 ISA for Knights Landing." OFF) # compilation on GCC 8 broken
|
||||
OPTION(EMBREE_ISA_AVX512SKX "Enables AVX512 ISA for Skylake." ${COMPILER_SUPPORTS_AVX512SKX})
|
||||
ENDIF()
|
||||
ELSEIF (EMBREE_MAX_ISA STREQUAL "DEFAULT")
|
||||
UNSET(EMBREE_ISA_SSE2 CACHE)
|
||||
UNSET(EMBREE_ISA_SSE42 CACHE)
|
||||
UNSET(EMBREE_ISA_AVX CACHE)
|
||||
UNSET(EMBREE_ISA_AVX2 CACHE)
|
||||
UNSET(EMBREE_ISA_AVX512KNL CACHE)
|
||||
UNSET(EMBREE_ISA_AVX512SKX CACHE)
|
||||
SET(EMBREE_ISA_SSE2 OFF)
|
||||
SET(EMBREE_ISA_SSE42 OFF)
|
||||
SET(EMBREE_ISA_AVX OFF)
|
||||
SET(EMBREE_ISA_AVX2 OFF)
|
||||
SET(EMBREE_ISA_AVX512KNL OFF)
|
||||
SET(EMBREE_ISA_AVX512SKX OFF)
|
||||
MESSAGE(STATUS "Detecting default ISA...")
|
||||
INCLUDE(check_isa_default)
|
||||
CHECK_ISA_DEFAULT(EMBREE_ISA_DEFAULT)
|
||||
MESSAGE(STATUS "Detected default ISA: ${EMBREE_ISA_DEFAULT}")
|
||||
SET(EMBREE_ISA_${EMBREE_ISA_DEFAULT} ON)
|
||||
ELSE()
|
||||
UNSET(EMBREE_ISA_SSE2 CACHE)
|
||||
UNSET(EMBREE_ISA_SSE42 CACHE)
|
||||
@@ -233,54 +316,9 @@ ELSE()
|
||||
ENDIF ()
|
||||
ENDIF()
|
||||
|
||||
##############################################################
|
||||
# Compiler
|
||||
##############################################################
|
||||
|
||||
SET(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
|
||||
|
||||
IF (WIN32)
|
||||
IF (NOT DEFAULT_CMAKE_CONFIGURATION_TYPES_SET)
|
||||
SET(CMAKE_CONFIGURATION_TYPES "${CONFIGURATION_TYPES}" CACHE STRING "List of generated configurations." FORCE)
|
||||
SET(DEFAULT_CMAKE_CONFIGURATION_TYPES_SET ON CACHE INTERNAL "Default CMake configuration types set.")
|
||||
ENDIF()
|
||||
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
IF (${CMAKE_GENERATOR_TOOLSET} MATCHES "^LLVM" )
|
||||
MESSAGE("CLANG detected")
|
||||
INCLUDE(clang)
|
||||
ELSEIF(${CMAKE_GENERATOR_TOOLSET} MATCHES "^Intel")
|
||||
MESSAGE("Intel Compiler detected")
|
||||
INCLUDE (icc)
|
||||
ELSE()
|
||||
IF (EMBREE_ISA_AVX512KNL OR EMBREE_ISA_AVX512SKX)
|
||||
MESSAGE(FATAL_ERROR "Microsoft Visual C++ Compiler does not support AVX512. Please use Intel Compiler or Clang.")
|
||||
ENDIF()
|
||||
INCLUDE (msvc)
|
||||
ENDIF()
|
||||
|
||||
ELSE (WIN32)
|
||||
IF(CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
|
||||
INCLUDE(crayprgenv)
|
||||
ELSEIF (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
INCLUDE (gcc)
|
||||
ELSEIF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||
INCLUDE (clang)
|
||||
ELSEIF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
|
||||
INCLUDE (icc)
|
||||
ELSE ()
|
||||
MESSAGE(FATAL_ERROR "Unsupported compiler: " ${CMAKE_CXX_COMPILER_ID})
|
||||
ENDIF ()
|
||||
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Specifies the build type." FORCE)
|
||||
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CONFIGURATION_TYPES})
|
||||
ENDIF(NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
OPTION(CMAKE_VERBOSE_MAKEFILE "Enables verbose mode.")
|
||||
MARK_AS_ADVANCED(CLEAR CMAKE_VERBOSE_MAKEFILE)
|
||||
|
||||
ENDIF (WIN32)
|
||||
IF(CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
|
||||
SET(EMBREE_ISA_SSE42 OFF)
|
||||
ENDIF()
|
||||
|
||||
##############################################################
|
||||
# ISA configuration continued
|
||||
@@ -294,6 +332,7 @@ SET(AVX512KNL 4)
|
||||
SET(AVX512SKX 5)
|
||||
|
||||
UNSET(FLAGS_LOWEST)
|
||||
SET(ISA_LOWEST_AVX 2)
|
||||
|
||||
IF (EMBREE_ISA_SSE2)
|
||||
ADD_DEFINITIONS(-DEMBREE_TARGET_SSE2)
|
||||
@@ -318,6 +357,7 @@ IF (EMBREE_ISA_AVX)
|
||||
LIST(APPEND ISPC_TARGETS "avx")
|
||||
IF(NOT FLAGS_LOWEST)
|
||||
SET(ISA_LOWEST ${AVX})
|
||||
SET(ISA_LOWEST_AVX ${AVX})
|
||||
SET(FLAGS_LOWEST ${FLAGS_AVX})
|
||||
ENDIF()
|
||||
ENDIF ()
|
||||
@@ -327,6 +367,7 @@ IF (EMBREE_ISA_AVX2)
|
||||
LIST(APPEND ISPC_TARGETS "avx2")
|
||||
IF(NOT FLAGS_LOWEST)
|
||||
SET(ISA_LOWEST ${AVX2})
|
||||
SET(ISA_LOWEST_AVX ${AVX2})
|
||||
SET(FLAGS_LOWEST ${FLAGS_AVX2})
|
||||
ENDIF()
|
||||
ENDIF ()
|
||||
@@ -345,6 +386,7 @@ IF (EMBREE_ISA_AVX512SKX)
|
||||
LIST(APPEND ISPC_TARGETS "avx512skx-i32x16")
|
||||
IF(NOT FLAGS_LOWEST)
|
||||
SET(ISA_LOWEST ${AVX512SKX})
|
||||
SET(ISA_LOWEST_AVX ${AVX512SKX})
|
||||
SET(FLAGS_LOWEST ${FLAGS_AVX512SKX})
|
||||
ENDIF()
|
||||
ENDIF ()
|
||||
@@ -359,9 +401,6 @@ include(package)
|
||||
##############################################################
|
||||
# Search paths
|
||||
##############################################################
|
||||
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
|
||||
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
|
||||
INCLUDE_DIRECTORIES_ISPC("${PROJECT_BINARY_DIR}")
|
||||
IF (TASKING_TBB)
|
||||
FIND_PACKAGE(TBB REQUIRED)
|
||||
INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIRS})
|
||||
@@ -380,7 +419,6 @@ SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
ADD_SUBDIRECTORY(common)
|
||||
ADD_SUBDIRECTORY(kernels)
|
||||
|
||||
IF (EMBREE_TUTORIALS)
|
||||
ADD_SUBDIRECTORY(tutorials)
|
||||
ENDIF()
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
set(CTEST_PROJECT_NAME "Embree")
|
||||
set(CTEST_NIGHTLY_START_TIME "22:00:00 UTC")
|
||||
set(TEST_MODELS_HASH 01ada7ec1ace15ddba73aaab3f53ac6aac6a0309)
|
||||
set(TEST_MODELS_HASH ba1bd24186ccdf939d2e749a514f81718f3a2b20)
|
||||
|
||||
IF (NOT CTEST_DROP_SITE)
|
||||
set(CTEST_DROP_METHOD "http")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -28,5 +28,4 @@ ADD_LIBRARY(algorithms OBJECT
|
||||
)
|
||||
|
||||
SET_PROPERTY(TARGET algorithms PROPERTY FOLDER common)
|
||||
|
||||
|
||||
SET_PROPERTY(TARGET algorithms APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -33,29 +33,31 @@ namespace embree
|
||||
|
||||
for (size_t N=10; N<1000000; N=size_t(2.1*N))
|
||||
{
|
||||
size_t N0 = rand() % N;
|
||||
|
||||
/* initialize array with random numbers */
|
||||
std::vector<uint32_t> src(N);
|
||||
std::map<uint32_t,int> m;
|
||||
for (size_t i=0; i<N; i++) src[i] = rand();
|
||||
|
||||
/* count elements up */
|
||||
for (size_t i=0; i<N; i++)
|
||||
for (size_t i=N0; i<N; i++)
|
||||
if (pred(src[i]))
|
||||
m[src[i]] = 0;
|
||||
for (size_t i=0; i<N; i++)
|
||||
for (size_t i=N0; i<N; i++)
|
||||
if (pred(src[i]))
|
||||
m[src[i]]++;
|
||||
|
||||
/* filter array */
|
||||
//size_t_t M = sequential_filter(src.data(),size_t(0),N,pred);
|
||||
size_t M = parallel_filter(src.data(),size_t(0),N,size_t(1024),pred);
|
||||
//size_t M = sequential_filter(src.data(),N0,N,pred);
|
||||
size_t M = parallel_filter(src.data(),N0,N,size_t(1024),pred);
|
||||
|
||||
/* check if filtered data is correct */
|
||||
for (size_t i=0; i<M; i++) {
|
||||
for (size_t i=N0; i<M; i++) {
|
||||
passed &= pred(src[i]);
|
||||
m[src[i]]--;
|
||||
}
|
||||
for (size_t i=0; i<M; i++)
|
||||
for (size_t i=N0; i<M; i++)
|
||||
passed &= (m[src[i]] == 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -39,7 +39,7 @@ namespace embree
|
||||
return sequential_filter(data,begin,end,predicate);
|
||||
|
||||
/* calculate number of tasks to use */
|
||||
enum { MAX_TASKS = 512 };
|
||||
enum { MAX_TASKS = 64 };
|
||||
const Index numThreads = TaskScheduler::threadCount();
|
||||
const Index numBlocks = (end-begin+minStepSize-1)/minStepSize;
|
||||
const Index taskCount = min(numThreads,numBlocks,(Index)MAX_TASKS);
|
||||
@@ -76,8 +76,8 @@ namespace embree
|
||||
parallel_for(taskCount, [&](const Index taskIndex)
|
||||
{
|
||||
/* destination to write elements to */
|
||||
Index dst = (taskIndex+0)*(end-begin)/taskCount+nused[taskIndex];
|
||||
Index dst_end = min(dst+nfree[taskIndex],sused);
|
||||
Index dst = begin+(taskIndex+0)*(end-begin)/taskCount+nused[taskIndex];
|
||||
Index dst_end = min(dst+nfree[taskIndex],begin+sused);
|
||||
if (dst_end <= dst) return;
|
||||
|
||||
/* range of misplaced elements to copy to destination */
|
||||
@@ -92,7 +92,10 @@ namespace embree
|
||||
Index k1 = k0+nused[i];
|
||||
Index src = begin+(i+0)*(end-begin)/taskCount+nused[i];
|
||||
for (Index i=max(r0,k0); i<min(r1,k1); i++) {
|
||||
data[dst++] = data[src-i+k0-1];
|
||||
Index isrc = src-i+k0-1;
|
||||
assert(dst >= begin && dst < end);
|
||||
assert(isrc >= begin && isrc < end);
|
||||
data[dst++] = data[isrc];
|
||||
}
|
||||
k0 = k1;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../common/tasking/taskscheduler.h"
|
||||
#include "../tasking/taskscheduler.h"
|
||||
#include "../sys/array.h"
|
||||
#include "../math/math.h"
|
||||
#include "../common/math/range.h"
|
||||
#include "../math/range.h"
|
||||
|
||||
namespace embree
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -35,7 +35,7 @@ namespace embree
|
||||
{
|
||||
public:
|
||||
|
||||
enum { MAX_TASKS = 512 };
|
||||
enum { MAX_TASKS = 64 };
|
||||
|
||||
__forceinline ParallelForForState ()
|
||||
: taskCount(0) {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -17,7 +17,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "parallel_for.h"
|
||||
#include "../common/math/range.h"
|
||||
#include "../math/range.h"
|
||||
|
||||
namespace embree
|
||||
{
|
||||
@@ -64,10 +64,10 @@ namespace embree
|
||||
template<typename T, typename V, typename Vi, typename IsLeft, typename Reduction_T, typename Reduction_V>
|
||||
class __aligned(64) parallel_partition_task
|
||||
{
|
||||
ALIGNED_CLASS;
|
||||
ALIGNED_CLASS_(64);
|
||||
private:
|
||||
|
||||
static const size_t MAX_TASKS = 512;
|
||||
static const size_t MAX_TASKS = 64;
|
||||
|
||||
T* array;
|
||||
size_t N;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -23,7 +23,7 @@ namespace embree
|
||||
template<typename Value>
|
||||
struct ParallelPrefixSumState
|
||||
{
|
||||
enum { MAX_TASKS = 512 };
|
||||
enum { MAX_TASKS = 64 };
|
||||
Value counts[MAX_TASKS];
|
||||
Value sums [MAX_TASKS];
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -266,7 +266,7 @@ namespace embree
|
||||
template<typename Ty, typename Key>
|
||||
class ParallelRadixSort
|
||||
{
|
||||
static const size_t MAX_TASKS = 512;
|
||||
static const size_t MAX_TASKS = 64;
|
||||
static const size_t BITS = 8;
|
||||
static const size_t BUCKETS = (1 << BITS);
|
||||
typedef unsigned int TyRadixCount[BUCKETS];
|
||||
@@ -275,10 +275,17 @@ namespace embree
|
||||
static bool compare(const T& v0, const T& v1) {
|
||||
return (Key)v0 < (Key)v1;
|
||||
}
|
||||
|
||||
private:
|
||||
ParallelRadixSort (const ParallelRadixSort& other) DELETED; // do not implement
|
||||
ParallelRadixSort& operator= (const ParallelRadixSort& other) DELETED; // do not implement
|
||||
|
||||
|
||||
public:
|
||||
ParallelRadixSort (Ty* const src, Ty* const tmp, const size_t N, const size_t blockSize)
|
||||
: radixCount(nullptr), src(src), tmp(tmp), N(N)
|
||||
ParallelRadixSort (Ty* const src, Ty* const tmp, const size_t N)
|
||||
: radixCount(nullptr), src(src), tmp(tmp), N(N) {}
|
||||
|
||||
void sort(const size_t blockSize)
|
||||
{
|
||||
assert(blockSize > 0);
|
||||
|
||||
@@ -296,6 +303,12 @@ namespace embree
|
||||
tbbRadixSort(numThreads);
|
||||
}
|
||||
}
|
||||
|
||||
~ParallelRadixSort()
|
||||
{
|
||||
alignedFree(radixCount);
|
||||
radixCount = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -402,7 +415,7 @@ namespace embree
|
||||
|
||||
void tbbRadixSort(const size_t numTasks)
|
||||
{
|
||||
radixCount = (TyRadixCount*) alignedMalloc(MAX_TASKS*sizeof(TyRadixCount));
|
||||
radixCount = (TyRadixCount*) alignedMalloc(MAX_TASKS*sizeof(TyRadixCount),64);
|
||||
|
||||
if (sizeof(Key) == sizeof(uint32_t)) {
|
||||
tbbRadixIteration(0*BITS,0,src,tmp,numTasks);
|
||||
@@ -421,8 +434,6 @@ namespace embree
|
||||
tbbRadixIteration(6*BITS,0,src,tmp,numTasks);
|
||||
tbbRadixIteration(7*BITS,1,tmp,src,numTasks);
|
||||
}
|
||||
alignedFree(radixCount);
|
||||
radixCount = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -435,13 +446,13 @@ namespace embree
|
||||
template<typename Ty>
|
||||
void radix_sort(Ty* const src, Ty* const tmp, const size_t N, const size_t blockSize = 8192)
|
||||
{
|
||||
ParallelRadixSort<Ty,Ty>(src,tmp,N,blockSize);
|
||||
ParallelRadixSort<Ty,Ty>(src,tmp,N).sort(blockSize);
|
||||
}
|
||||
|
||||
template<typename Ty, typename Key>
|
||||
void radix_sort(Ty* const src, Ty* const tmp, const size_t N, const size_t blockSize = 8192)
|
||||
{
|
||||
ParallelRadixSort<Ty,Key>(src,tmp,N,blockSize);
|
||||
ParallelRadixSort<Ty,Key>(src,tmp,N).sort(blockSize);
|
||||
}
|
||||
|
||||
template<typename Ty>
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
## You may obtain a copy of the License at ##
|
||||
## ##
|
||||
## http://www.apache.org/licenses/LICENSE-2.0 ##
|
||||
## ##
|
||||
## Unless required by applicable law or agreed to in writing, software ##
|
||||
## distributed under the License is distributed on an "AS IS" BASIS, ##
|
||||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ##
|
||||
## See the License for the specific language governing permissions and ##
|
||||
## limitations under the License. ##
|
||||
## ======================================================================== ##
|
||||
|
||||
IF (NOT OPENIMAGEIO_ROOT)
|
||||
SET(OPENIMAGEIO_ROOT $ENV{OPENIMAGEIO_ROOT})
|
||||
ENDIF()
|
||||
IF (NOT OPENIMAGEIO_ROOT)
|
||||
SET(OPENIMAGEIO_ROOT $ENV{OPENIMAGEIOROOT})
|
||||
ENDIF()
|
||||
|
||||
# detect changed OPENIMAGEIO_ROOT
|
||||
IF (NOT OPENIMAGEIO_ROOT STREQUAL OPENIMAGEIO_ROOT_LAST)
|
||||
UNSET(OPENIMAGEIO_INCLUDE_DIR CACHE)
|
||||
UNSET(OPENIMAGEIO_LIBRARY CACHE)
|
||||
ENDIF()
|
||||
|
||||
set(OPENIMAGEIO_LIB_SUFFIX "")
|
||||
IF (WIN32)
|
||||
IF (MSVC14)
|
||||
SET(OPENIMAGEIO_LIB_SUFFIX "vc2015")
|
||||
ELSEIF (MSVC12)
|
||||
SET(OPENIMAGEIO_LIB_SUFFIX "vc2013")
|
||||
ELSEIF (MSVC11)
|
||||
SET(OPENIMAGEIO_LIB_SUFFIX "vc2012")
|
||||
ELSEIF (MINGW)
|
||||
IF (X64)
|
||||
SET(OPENIMAGEIO_LIB_SUFFIX "mingw-w64")
|
||||
# Who's ever going to build for 32bit??
|
||||
ELSE ()
|
||||
SET(OPENIMAGEIO_LIB_SUFFIX "mingw-w64")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF ()
|
||||
|
||||
FIND_PATH(OPENIMAGEIO_ROOT include/OpenImageIO/imageio.h
|
||||
DOC "Root of OpenImageIO installation"
|
||||
HINTS ${OPENIMAGEIO_ROOT}
|
||||
PATHS
|
||||
${PROJECT_SOURCE_DIR}/oiio
|
||||
/usr/local
|
||||
/usr
|
||||
/
|
||||
)
|
||||
|
||||
FIND_PATH(OPENIMAGEIO_INCLUDE_DIR OpenImageIO/imageio.h PATHS ${OPENIMAGEIO_ROOT}/include NO_DEFAULT_PATH)
|
||||
SET(OPENIMAGEIO_HINTS
|
||||
HINTS
|
||||
${OPENIMAGEIO_ROOT}
|
||||
PATH_SUFFIXES
|
||||
/lib
|
||||
/lib64
|
||||
/lib-${OPENIMAGEIO_LIB_SUFFIX}
|
||||
)
|
||||
SET(OPENIMAGEIO_PATHS PATHS /usr/lib /usr/lib64 /lib /lib64)
|
||||
FIND_LIBRARY(OPENIMAGEIO_LIBRARY OpenImageIO ${OPENIMAGEIO_HINTS} ${OPENIMAGEIO_PATHS})
|
||||
|
||||
SET(OPENIMAGEIO_ROOT_LAST ${OPENIMAGEIO_ROOT} CACHE INTERNAL "Last value of OPENIMAGEIO_ROOT to detect changes")
|
||||
|
||||
SET(OPENIMAGEIO_ERROR_MESSAGE "OpenImageIO not found in your environment. You can 1) install
|
||||
via your OS package manager, or 2) install it
|
||||
somewhere on your machine and point OPENIMAGEIO_ROOT to it.")
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenImageIO
|
||||
${OPENIMAGEIO_ERROR_MESSAGE}
|
||||
OPENIMAGEIO_INCLUDE_DIR OPENIMAGEIO_LIBRARY
|
||||
)
|
||||
|
||||
IF (OPENIMAGEIO_FOUND)
|
||||
SET(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR})
|
||||
SET(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY})
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(OPENIMAGEIO_INCLUDE_DIR)
|
||||
MARK_AS_ADVANCED(OPENIMAGEIO_LIBRARY)
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
|
||||
+52
-21
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -14,13 +14,36 @@
|
||||
## limitations under the License. ##
|
||||
## ======================================================================== ##
|
||||
|
||||
IF (NOT TBB_ROOT)
|
||||
SET(TBB_ROOT $ENV{TBB_ROOT})
|
||||
ENDIF()
|
||||
IF (NOT TBB_ROOT)
|
||||
SET(TBB_ROOT $ENV{TBBROOT})
|
||||
ENDIF()
|
||||
|
||||
IF (WIN32)
|
||||
# workaround for parentheses in variable name / CMP0053
|
||||
SET(PROGRAMFILESx86 "PROGRAMFILES(x86)")
|
||||
SET(PROGRAMFILES32 "$ENV{${PROGRAMFILESx86}}")
|
||||
IF (NOT PROGRAMFILES32)
|
||||
SET(PROGRAMFILES32 "$ENV{PROGRAMFILES}")
|
||||
ENDIF()
|
||||
IF (NOT PROGRAMFILES32)
|
||||
SET(PROGRAMFILES32 "C:/Program Files (x86)")
|
||||
ENDIF()
|
||||
FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h
|
||||
DOC "Root of TBB installation"
|
||||
PATHS ${PROJECT_SOURCE_DIR}/tbb "C:/Program Files (x86)/Intel/Composer XE/tbb"
|
||||
PATHS ${PROJECT_SOURCE_DIR}/tbb
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h)
|
||||
FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h
|
||||
HINTS ${TBB_ROOT}
|
||||
PATHS
|
||||
${PROJECT_SOURCE_DIR}/../tbb
|
||||
"${PROGRAMFILES32}/IntelSWTools/compilers_and_libraries/windows/tbb"
|
||||
"${PROGRAMFILES32}/Intel/Composer XE/tbb"
|
||||
"${PROGRAMFILES32}/Intel/compilers_and_libraries/windows/tbb"
|
||||
)
|
||||
|
||||
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
SET(TBB_ARCH intel64)
|
||||
@@ -28,12 +51,11 @@ IF (WIN32)
|
||||
SET(TBB_ARCH ia32)
|
||||
ENDIF()
|
||||
|
||||
IF (MSVC10)
|
||||
SET(TBB_VCVER vc10)
|
||||
ELSEIF (MSVC11)
|
||||
SET(TBB_VCVER vc11)
|
||||
ELSE()
|
||||
# precompiled TBB packages currently only support VC12 and VC14
|
||||
IF (MSVC12)
|
||||
SET(TBB_VCVER vc12)
|
||||
ELSEIF(MSVC14)
|
||||
SET(TBB_VCVER vc14)
|
||||
ENDIF()
|
||||
|
||||
SET(TBB_LIBDIR ${EMBREE_TBB_ROOT}/lib/${TBB_ARCH}/${TBB_VCVER})
|
||||
@@ -48,25 +70,33 @@ IF (WIN32)
|
||||
SET(TBB_LIBRARY TBB_LIBRARY-NOTFOUND)
|
||||
SET(TBB_LIBRARY_MALLOC TBB_LIBRARY_MALLOC-NOTFOUND)
|
||||
FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${EMBREE_TBB_ROOT}/include NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_LIBDIR} NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_LIBDIR} NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_LIBDIR} ${EMBREE_TBB_ROOT}/lib NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_LIBDIR} ${EMBREE_TBB_ROOT}/lib NO_DEFAULT_PATH)
|
||||
ENDIF()
|
||||
|
||||
ELSE ()
|
||||
|
||||
FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h
|
||||
DOC "Root of TBB installation"
|
||||
PATHS ${PROJECT_SOURCE_DIR}/tbb /opt/intel/tbb
|
||||
PATHS ${PROJECT_SOURCE_DIR}/tbb
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h)
|
||||
FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h
|
||||
DOC "Root of TBB installation"
|
||||
HINTS ${TBB_ROOT}
|
||||
PATHS
|
||||
${PROJECT_SOURCE_DIR}/tbb
|
||||
/opt/intel/composerxe/tbb
|
||||
/opt/intel/compilers_and_libraries/tbb
|
||||
/opt/intel/tbb
|
||||
)
|
||||
|
||||
IF (EMBREE_TBB_ROOT STREQUAL "")
|
||||
FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h)
|
||||
FIND_LIBRARY(TBB_LIBRARY tbb)
|
||||
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc)
|
||||
|
||||
ELSEIF (EXISTS ${EMBREE_TBB_ROOT}/src)
|
||||
ELSEIF (EXISTS ${EMBREE_TBB_ROOT}/cmake/TBBBuild.cmake AND EXISTS ${EMBREE_TBB_ROOT}/src/tbb/tbb_version.h)
|
||||
OPTION(EMBREE_TBB_STATIC_LIB "Build TBB as a static library (building TBB as a static library is NOT recommended)")
|
||||
if (EMBREE_TBB_STATIC_LIB)
|
||||
include(${EMBREE_TBB_ROOT}/cmake/TBBBuild.cmake)
|
||||
@@ -92,8 +122,9 @@ ELSE ()
|
||||
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${EMBREE_TBB_ROOT}/lib NO_DEFAULT_PATH)
|
||||
ELSE()
|
||||
FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${EMBREE_TBB_ROOT}/include NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4 ${EMBREE_TBB_ROOT}/lib ${EMBREE_TBB_ROOT}/lib64 /usr/libx86_64-linux-gnu/ NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4 ${EMBREE_TBB_ROOT}/lib ${EMBREE_TBB_ROOT}/lib64 /usr/libx86_64-linux-gnu/ NO_DEFAULT_PATH)
|
||||
SET(TBB_HINTS HINTS ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4 ${EMBREE_TBB_ROOT}/lib ${EMBREE_TBB_ROOT}/lib64 PATHS /usr/libx86_64-linux-gnu/)
|
||||
FIND_LIBRARY(TBB_LIBRARY tbb ${TBB_HINTS})
|
||||
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc ${TBB_HINTS})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
@@ -115,14 +146,14 @@ MARK_AS_ADVANCED(TBB_LIBRARY_MALLOC)
|
||||
# Install TBB
|
||||
##############################################################
|
||||
|
||||
IF (WIN32)
|
||||
INSTALL(PROGRAMS ${TBB_BINDIR}/tbb.dll ${TBB_BINDIR}/tbbmalloc.dll DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
|
||||
INSTALL(PROGRAMS ${TBB_BINDIR}/tbb.dll ${TBB_BINDIR}/tbbmalloc.dll DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
|
||||
INSTALL(PROGRAMS ${TBB_LIBDIR}/tbb.lib ${TBB_LIBDIR}/tbbmalloc.lib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
|
||||
ELSEIF (EMBREE_ZIP_MODE)
|
||||
IF (APPLE)
|
||||
IF (EMBREE_INSTALL_DEPENDENCIES)
|
||||
IF (WIN32)
|
||||
INSTALL(PROGRAMS ${TBB_BINDIR}/tbb.dll ${TBB_BINDIR}/tbbmalloc.dll DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
|
||||
INSTALL(PROGRAMS ${TBB_LIBDIR}/tbb.lib ${TBB_LIBDIR}/tbbmalloc.lib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
|
||||
ELSEIF (APPLE)
|
||||
INSTALL(PROGRAMS ${EMBREE_TBB_ROOT}/lib/libtbb.dylib ${EMBREE_TBB_ROOT}/lib/libtbbmalloc.dylib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
|
||||
ELSE()
|
||||
INSTALL(PROGRAMS ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4/libtbb.so.2 ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4/libtbbmalloc.so.2 DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -23,8 +23,10 @@ string(REPLACE "\n" ";" output ${output})
|
||||
|
||||
foreach (line ${output})
|
||||
if ("${line}" MATCHES "O .bss")
|
||||
if (NOT "${line}" MATCHES "std::__ioinit" AND # this is caused by iostream initialization and is likely also ok
|
||||
NOT "${line}" MATCHES "\\(\\)::") # this matches a static inside a function which is fine
|
||||
if (NOT "${line}" MATCHES "std::__ioinit" AND # this is caused by iostream initialization and is likely also ok
|
||||
NOT "${line}" MATCHES "\\(\\)::" AND # this matches a static inside a function which is fine
|
||||
NOT "${line}" MATCHES "function_local_static_" AND # static variable inside a function (explicitely named)
|
||||
NOT "${line}" MATCHES "__\\$U") # ICC generated locks for static variable inside a function
|
||||
message(WARNING "\nProblematic global variable in non-SSE code:\n" ${line})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
|
||||
+45
-18
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -14,15 +14,18 @@
|
||||
## limitations under the License. ##
|
||||
## ======================================================================== ##
|
||||
|
||||
SET(FLAGS_SSE2 "-msse2")
|
||||
SET(FLAGS_SSE3 "-msse3")
|
||||
SET(FLAGS_SSSE3 "-mssse3")
|
||||
SET(FLAGS_SSE41 "-msse4.1")
|
||||
SET(FLAGS_SSE42 "-msse4.2")
|
||||
SET(FLAGS_AVX "-mavx")
|
||||
SET(FLAGS_AVX2 "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
|
||||
SET(FLAGS_AVX512KNL "-march=knl")
|
||||
SET(FLAGS_AVX512SKX "-march=skx")
|
||||
MACRO(_SET_IF_EMPTY VAR VALUE)
|
||||
IF(NOT ${VAR})
|
||||
SET(${VAR} "${VALUE}")
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
_SET_IF_EMPTY(FLAGS_SSE2 "-msse2")
|
||||
_SET_IF_EMPTY(FLAGS_SSE42 "-msse4.2")
|
||||
_SET_IF_EMPTY(FLAGS_AVX "-mavx")
|
||||
_SET_IF_EMPTY(FLAGS_AVX2 "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
|
||||
_SET_IF_EMPTY(FLAGS_AVX512KNL "-march=knl")
|
||||
_SET_IF_EMPTY(FLAGS_AVX512SKX "-march=skx")
|
||||
|
||||
IF (WIN32)
|
||||
|
||||
@@ -36,8 +39,16 @@ IF (WIN32)
|
||||
ELSE()
|
||||
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /GS-") # do not protect against return address overrides
|
||||
ENDIF()
|
||||
MACRO(DISABLE_STACK_PROTECTOR_FOR_FILE file)
|
||||
IF (EMBREE_STACK_PROTECTOR)
|
||||
SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES COMPILE_FLAGS "/GS-")
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DDEBUG") # enables assertions
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DTBB_USE_DEBUG") # configures TBB in debug mode
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Oi") # inline intrinsic functions
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /DEBUG") # generate debug information
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /DEBUG") # generate debug information
|
||||
|
||||
@@ -48,6 +59,7 @@ IF (WIN32)
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-vectorize") # disable auto vectorization
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMMON_CXX_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /DTBB_USE_DEBUG") # configures TBB in debug mode
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Ox") # enable full optimizations
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Oi") # inline intrinsic functions
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Gy") # package individual functions
|
||||
@@ -69,52 +81,67 @@ IF (WIN32)
|
||||
ELSE()
|
||||
|
||||
OPTION(EMBREE_IGNORE_CMAKE_CXX_FLAGS "When enabled Embree ignores default CMAKE_CXX_FLAGS." ON)
|
||||
OPTION(EMBREE_ADDRESS_SANITIZER "Enabled CLANG address sanitizer." OFF)
|
||||
IF (EMBREE_IGNORE_CMAKE_CXX_FLAGS)
|
||||
SET(CMAKE_CXX_FLAGS "")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") # enables most warnings
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Wformat-security") # enables string format vulnerability warnings
|
||||
IF (NOT APPLE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE") # enables support for more secure position independent execution
|
||||
ENDIF()
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # generate position independent code suitable for shared libraries
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") # generate position independent code suitable for shared libraries
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") # enables C++11 features
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") # makes all symbols hidden by default
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden") # makes all inline symbols hidden by default
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") # disables strict aliasing rules
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize") # disable auto vectorizer
|
||||
IF (EMBREE_STACK_PROTECTOR)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector") # protects against return address overrides
|
||||
ENDIF()
|
||||
MACRO(DISABLE_STACK_PROTECTOR_FOR_FILE file)
|
||||
IF (EMBREE_STACK_PROTECTOR)
|
||||
SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES COMPILE_FLAGS "-fno-stack-protector")
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
IF (EMBREE_ADDRESS_SANITIZER)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer -fno-optimize-sibling-calls")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") # enable assertions
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DTBB_USE_DEBUG") # configure TBB in debug mode
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") # generate debug information
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0") # disable optimizations
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2") # allow inlining of intrinsics
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") # disable assertions
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") # enable full optimizations
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDEBUG") # enable assertions
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DTBB_USE_DEBUG") # configure TBB in debug mode
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g") # generate debug information
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3") # enable full optimizations
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
|
||||
|
||||
IF (APPLE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7") # makes sure code runs on older MacOSX versions
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") # link against libc++ which supports C++11 features
|
||||
ELSE(APPLE)
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") # issues link error for undefined symbols in shared library
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") # enables position independent execution for executable
|
||||
IF (NOT EMBREE_ADDRESS_SANITIZER) # for address sanitizer this causes link errors
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") # issues link error for undefined symbols in shared library
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") # enables position independent execution for executable
|
||||
ENDIF()
|
||||
ENDIF(APPLE)
|
||||
|
||||
ENDIF()
|
||||
@@ -13,10 +13,12 @@
|
||||
## See the License for the specific language governing permissions and ##
|
||||
## limitations under the License. ##
|
||||
## ======================================================================== ##
|
||||
|
||||
SET(FLAGS_SSE2 "-target-cpu=xeon")
|
||||
SET(FLAGS_SSE42 "-target-cpu=interlagos")
|
||||
SET(FLAGS_SSE2 "-target-cpu=x86_64")
|
||||
SET(FLAGS_SSE42 "NOT_SUPPORTED")
|
||||
SET(FLAGS_AVX "-target-cpu=sandybridge")
|
||||
SET(FLAGS_AVX2 "-target-cpu=haswell")
|
||||
SET(FLAGS_AVX512KNL "-target-cpu=mic-knl")
|
||||
SET(FLAGS_AVX512SKX "-target-cpu=x86-skylake")
|
||||
|
||||
STRING(TOLOWER "${CMAKE_CXX_COMPILER_ID}" _lower_compiler_id)
|
||||
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/${_lower_compiler_id}.cmake" OPTIONAL)
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -45,15 +45,13 @@ SET(EMBREE_TUTORIALS @EMBREE_TUTORIALS@)
|
||||
SET(EMBREE_RAY_MASK @EMBREE_RAY_MASK@)
|
||||
SET(EMBREE_STAT_COUNTERS @EMBREE_STAT_COUNTERS@)
|
||||
SET(EMBREE_BACKFACE_CULLING @EMBREE_BACKFACE_CULLING@)
|
||||
SET(EMBREE_INTERSECTION_FILTER @EMBREE_INTERSECTION_FILTER@)
|
||||
SET(EMBREE_INTERSECTION_FILTER_RESTORE @EMBREE_INTERSECTION_FILTER_RESTORE@)
|
||||
SET(EMBREE_FILTER_FUNCTION @EMBREE_FILTER_FUNCTION@)
|
||||
SET(EMBREE_IGNORE_INVALID_RAYS @EMBREE_IGNORE_INVALID_RAYS@)
|
||||
SET(EMBREE_TASKING_SYSTEM @EMBREE_TASKING_SYSTEM@)
|
||||
|
||||
SET(EMBREE_GEOMETRY_TRIANGLES @EMBREE_GEOMETRY_TRIANGLES@)
|
||||
SET(EMBREE_GEOMETRY_QUADS @EMBREE_GEOMETRY_QUADS@)
|
||||
SET(EMBREE_GEOMETRY_LINES @EMBREE_GEOMETRY_LINES@)
|
||||
SET(EMBREE_GEOMETRY_HAIR @EMBREE_GEOMETRY_HAIR@)
|
||||
SET(EMBREE_GEOMETRY_SUBDIV @EMBREE_GEOMETRY_SUBDIV@)
|
||||
SET(EMBREE_GEOMETRY_TRIANGLE @EMBREE_GEOMETRY_TRIANGLE@)
|
||||
SET(EMBREE_GEOMETRY_QUAD @EMBREE_GEOMETRY_QUAD@)
|
||||
SET(EMBREE_GEOMETRY_CURVE @EMBREE_GEOMETRY_CURVE@)
|
||||
SET(EMBREE_GEOMETRY_SUBDIVISION @EMBREE_GEOMETRY_SUBDIVISION@)
|
||||
SET(EMBREE_GEOMETRY_USER @EMBREE_GEOMETRY_USER@)
|
||||
SET(EMBREE_RAY_PACKETS @EMBREE_RAY_PACKETS@)
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -14,49 +14,63 @@
|
||||
## limitations under the License. ##
|
||||
## ======================================================================== ##
|
||||
|
||||
SET(FLAGS_SSE2 "-msse2")
|
||||
SET(FLAGS_SSE42 "-msse4.2")
|
||||
SET(FLAGS_AVX "-mavx")
|
||||
SET(FLAGS_AVX2 "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
|
||||
SET(FLAGS_AVX512KNL "-mavx512f -mavx512pf -mavx512er -mavx512cd -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
|
||||
SET(FLAGS_AVX512SKX "-mavx512f -mavx512dq -mavx512cd -mavx512bw -mavx512vl -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
|
||||
MACRO(_SET_IF_EMPTY VAR VALUE)
|
||||
IF(NOT ${VAR})
|
||||
SET(${VAR} "${VALUE}")
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
_SET_IF_EMPTY(FLAGS_SSE2 "-msse2")
|
||||
_SET_IF_EMPTY(FLAGS_SSE42 "-msse4.2")
|
||||
_SET_IF_EMPTY(FLAGS_AVX "-mavx")
|
||||
_SET_IF_EMPTY(FLAGS_AVX2 "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
|
||||
_SET_IF_EMPTY(FLAGS_AVX512KNL "-mavx512f -mavx512pf -mavx512er -mavx512cd -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
|
||||
_SET_IF_EMPTY(FLAGS_AVX512SKX "-mavx512f -mavx512dq -mavx512cd -mavx512bw -mavx512vl -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
|
||||
|
||||
OPTION(EMBREE_IGNORE_CMAKE_CXX_FLAGS "When enabled Embree ignores default CMAKE_CXX_FLAGS." ON)
|
||||
IF (EMBREE_IGNORE_CMAKE_CXX_FLAGS)
|
||||
SET(CMAKE_CXX_FLAGS "")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") # enables most warnings
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Wformat-security") # enables string format vulnerability warnings
|
||||
IF (NOT APPLE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE") # enables support for more secure position independent execution
|
||||
ENDIF()
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # generate position independent code suitable for shared libraries
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") # generate position independent code suitable for shared libraries
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") # enables C++11 features
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") # makes all symbols hidden by default
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden") # makes all inline symbols hidden by default
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") # disables strict aliasing rules
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize") # disable auto vectorizer
|
||||
IF (EMBREE_STACK_PROTECTOR)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector") # protects against return address overrides
|
||||
ENDIF()
|
||||
MACRO(DISABLE_STACK_PROTECTOR_FOR_FILE file)
|
||||
IF (EMBREE_STACK_PROTECTOR)
|
||||
SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES COMPILE_FLAGS "-fno-stack-protector")
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") # enable assertions
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DTBB_USE_DEBUG") # configure TBB in debug mode
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") # generate debug information
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0") # disable optimizations
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2") # allow inlining of intrinsics
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") # disable assertions
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") # enable full optimizations
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDEBUG") # enable assertions
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DTBB_USE_DEBUG") # configure TBB in debug mode
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g") # generate debug information
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3") # enable full optimizations
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
|
||||
|
||||
IF (APPLE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7") # makes sure code runs on older MacOSX versions
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -14,30 +14,45 @@
|
||||
## limitations under the License. ##
|
||||
## ======================================================================== ##
|
||||
|
||||
MACRO(_SET_IF_EMPTY VAR VALUE)
|
||||
IF(NOT ${VAR})
|
||||
SET(${VAR} "${VALUE}")
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
IF (WIN32)
|
||||
|
||||
SET(FLAGS_SSE2 "/QxSSE2")
|
||||
SET(FLAGS_SSE42 "/QxSSE4.2")
|
||||
SET(FLAGS_AVX "/arch:AVX")
|
||||
SET(FLAGS_AVX2 "/QxCORE-AVX2")
|
||||
SET(FLAGS_AVX512KNL "/QxMIC-AVX512")
|
||||
SET(FLAGS_AVX512SKX "/QxCORE-AVX512")
|
||||
_SET_IF_EMPTY(FLAGS_SSE2 "/QxSSE2")
|
||||
_SET_IF_EMPTY(FLAGS_SSE42 "/QxSSE4.2")
|
||||
_SET_IF_EMPTY(FLAGS_AVX "/arch:AVX")
|
||||
_SET_IF_EMPTY(FLAGS_AVX2 "/QxCORE-AVX2")
|
||||
_SET_IF_EMPTY(FLAGS_AVX512KNL "/QxMIC-AVX512")
|
||||
_SET_IF_EMPTY(FLAGS_AVX512SKX "/QxCORE-AVX512")
|
||||
|
||||
SET(COMMON_CXX_FLAGS "")
|
||||
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /EHsc") # catch C++ exceptions only and extern "C" functions never throw a C++ exception
|
||||
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /MP") # compile source files in parallel
|
||||
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /GR") # enable runtime type information (on by default)
|
||||
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qvec-") # disable auto vectorizer
|
||||
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qfast-transcendentals-") # disable fast transcendentals, prevents sin(x),cos(x) -> sincos(x) optimization
|
||||
IF (EMBREE_STACK_PROTECTOR)
|
||||
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /GS") # protects against return address overrides
|
||||
ELSE()
|
||||
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /GS-") # do not protect against return address overrides
|
||||
ENDIF()
|
||||
MACRO(DISABLE_STACK_PROTECTOR_FOR_FILE file)
|
||||
IF (EMBREE_STACK_PROTECTOR)
|
||||
SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES COMPILE_FLAGS "/GS-")
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qdiag-disable:11074 ") # remark #11074: Inlining inhibited by limit max-size
|
||||
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qdiag-disable:11075 ") # remark #11075: To get full report use -Qopt-report:4 -Qopt-report-phase ipo
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DDEBUG") # enables assertions
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DTBB_USE_DEBUG") # configures TBB in debug mode
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Oi") # inline intrinsic functions
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /DEBUG") # generate debug information
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /DEBUG") # generate debug information
|
||||
|
||||
@@ -46,14 +61,15 @@ IF (WIN32)
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi") # inline intrinsic functions
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Gy") # package individual functions
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Qinline-max-total-size-") # no size limit when performing inlining
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Qinline-factor=200") # increase default inline factors by 2x
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Qinline-factor=150") # increase default inline factors by 2x
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMMON_CXX_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /DTBB_USE_DEBUG") # configures TBB in debug mode
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Ox") # enable full optimizations
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Oi") # inline intrinsic functions
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Gy") # package individual functions
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Qinline-max-total-size-") # no size limit when performing inlining
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Qinline-factor=200") # increase default inline factors by 2x
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Qinline-factor=150") # increase default inline factors by 2x
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG") # generate debug information
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG") # generate debug information
|
||||
|
||||
@@ -71,40 +87,58 @@ IF (WIN32)
|
||||
|
||||
INCLUDE(msvc_post)
|
||||
|
||||
# remove libmmd dependency
|
||||
IF (NOT EMBREE_STATIC_RUNTIME)
|
||||
STRING(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " /nodefaultlib:libmmdd.lib")
|
||||
STRING(APPEND CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO " /nodefaultlib:libmmd.lib")
|
||||
STRING(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE " /nodefaultlib:libmmd.lib")
|
||||
STRING(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG " /nodefaultlib:libmmdd.lib")
|
||||
STRING(APPEND CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO " /nodefaultlib:libmmd.lib")
|
||||
STRING(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE " /nodefaultlib:libmmd.lib")
|
||||
ENDIF()
|
||||
|
||||
ELSE()
|
||||
|
||||
IF (APPLE)
|
||||
SET(FLAGS_SSE2 "-xssse3") # on MacOSX ICC does not support SSE2
|
||||
_SET_IF_EMPTY(FLAGS_SSE2 "-xssse3") # on MacOSX ICC does not support SSE2
|
||||
ELSE()
|
||||
SET(FLAGS_SSE2 "-xsse2")
|
||||
_SET_IF_EMPTY(FLAGS_SSE2 "-xsse2")
|
||||
ENDIF()
|
||||
SET(FLAGS_SSE42 "-xsse4.2")
|
||||
SET(FLAGS_AVX "-xAVX")
|
||||
SET(FLAGS_AVX2 "-xCORE-AVX2")
|
||||
SET(FLAGS_AVX512KNL "-xMIC-AVX512")
|
||||
SET(FLAGS_AVX512SKX "-xCORE-AVX512")
|
||||
_SET_IF_EMPTY(FLAGS_SSE42 "-xsse4.2")
|
||||
_SET_IF_EMPTY(FLAGS_AVX "-xAVX")
|
||||
_SET_IF_EMPTY(FLAGS_AVX2 "-xCORE-AVX2")
|
||||
_SET_IF_EMPTY(FLAGS_AVX512KNL "-xMIC-AVX512")
|
||||
_SET_IF_EMPTY(FLAGS_AVX512SKX "-xCORE-AVX512")
|
||||
|
||||
OPTION(EMBREE_IGNORE_CMAKE_CXX_FLAGS "When enabled Embree ignores default CMAKE_CXX_FLAGS." ON)
|
||||
IF (EMBREE_IGNORE_CMAKE_CXX_FLAGS)
|
||||
SET(CMAKE_CXX_FLAGS "")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") # enables most warnings
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Wformat-security") # enables string format vulnerability warnings
|
||||
IF (NOT APPLE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE") # enables support for more secure position independent execution
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftls-model=local-dynamic") # otherwise ICC2019 cannot compile code with -fPIE enabled
|
||||
ENDIF()
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # generate position independent code suitable for shared libraries
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") # generate position independent code suitable for shared libraries
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") # enables C++11 features
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") # makes all symbols hidden by default
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden") # makes all inline symbols hidden by default
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-ansi-alias") # disables strict aliasing rules
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-vec") # disable auto vectorizer
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fasm-blocks") # enable assembly blocks
|
||||
IF (EMBREE_STACK_PROTECTOR)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector") # protects against return address overrides
|
||||
ENDIF()
|
||||
MACRO(DISABLE_STACK_PROTECTOR_FOR_FILE file)
|
||||
IF (EMBREE_STACK_PROTECTOR)
|
||||
SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES COMPILE_FLAGS "-fno-stack-protector")
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
IF(NOT CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel") # links intel runtime statically
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-intel-extensions") # disables some intel extensions which cause symbols to be exported
|
||||
@@ -114,7 +148,7 @@ ELSE()
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") # enables assertions
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DTBB_USE_DEBUG") # configures TBB in debug mode
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") # generate debug information
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0") # disable all optimizations
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2") # allow inlining of intrinsics
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") # disable assertions
|
||||
@@ -122,8 +156,9 @@ ELSE()
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -restrict") # enable restrict keyword
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -no-inline-max-total-size") # no size limit when performing inlining
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -no-inline-max-per-compile") # no maximal number of inlinings per compilation unit
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -inline-factor=200") # increase default inline factors limits by 2x
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -inline-factor=150") # increase default inline factors limits by 2x
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDEBUG") # enables assertions
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DTBB_USE_DEBUG") # configures TBB in debug mode
|
||||
@@ -132,8 +167,9 @@ ELSE()
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -restrict") # enable restrict keyword
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -no-inline-max-total-size") # no size limit when performing inlining
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -no-inline-max-per-compile") # no maximal number of inlinings per compilation unit
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -inline-factor=200") # increase default inline factors by 2x
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -inline-factor=150") # increase default inline factors by 2x
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
|
||||
|
||||
#SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -debug inline-debug-info")
|
||||
#SET(CMAKE_EXE_LINKER_FLAGS "-g")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -59,11 +59,11 @@ ENDIF()
|
||||
|
||||
# check ISPC version
|
||||
EXECUTE_PROCESS(COMMAND ${EMBREE_ISPC_EXECUTABLE} --version OUTPUT_VARIABLE ISPC_OUTPUT)
|
||||
STRING(REGEX MATCH " ([0-9]+[.][0-9]+[.][0-9]+)(dev|knl)? " DUMMY "${ISPC_OUTPUT}")
|
||||
STRING(REGEX MATCH "([0-9]+[.][0-9]+[.][0-9]+)" DUMMY "${ISPC_OUTPUT}")
|
||||
SET(ISPC_VERSION ${CMAKE_MATCH_1})
|
||||
|
||||
IF (ISPC_VERSION VERSION_LESS ISPC_VERSION_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Need at least version ${ISPC_VERSION_REQUIRED} of Intel SPMD Compiler (ISPC).")
|
||||
MESSAGE(FATAL_ERROR "ISPC ${ISPC_VERSION} is too old. You need at least ISPC ${ISPC_VERSION_REQUIRED}.")
|
||||
ENDIF()
|
||||
|
||||
GET_FILENAME_COMPONENT(ISPC_DIR ${EMBREE_ISPC_EXECUTABLE} PATH)
|
||||
@@ -93,7 +93,7 @@ MACRO (ISPC_COMPILE)
|
||||
IF (WIN32 OR "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||
SET(ISPC_OPT_FLAGS -O3)
|
||||
ELSE()
|
||||
SET(ISPC_OPT_FLAGS -O2 -g)
|
||||
SET(ISPC_OPT_FLAGS -O2)
|
||||
ENDIF()
|
||||
|
||||
IF (WIN32)
|
||||
|
||||
+11
-3
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -28,9 +28,16 @@ IF (EMBREE_STACK_PROTECTOR)
|
||||
ELSE()
|
||||
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /GS-") # do not protect against return address overrides
|
||||
ENDIF()
|
||||
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} ${FLAGS_SSE2}")
|
||||
MACRO(DISABLE_STACK_PROTECTOR_FOR_FILE file)
|
||||
IF (EMBREE_STACK_PROTECTOR)
|
||||
SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES COMPILE_FLAGS "/GS-")
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DDEBUG") # enables assertions
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DTBB_USE_DEBUG") # configures TBB in debug mode
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Oi") # inline intrinsic functions
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /DEBUG") # generate debug information
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /DEBUG") # generate debug information
|
||||
|
||||
@@ -40,12 +47,13 @@ SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Gy") # package individual functions
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMMON_CXX_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /DTBB_USE_DEBUG") # configures TBB in debug mode
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Ox") # enable full optimizations
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Oi") # inline intrinsic functions
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Gy") # package individual functions
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG") # generate debug information
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG") # generate debug information
|
||||
|
||||
|
||||
SET(SECURE_LINKER_FLAGS "")
|
||||
SET(SECURE_LINKER_FLAGS "${SECURE_LINKER_FLAGS} /NXCompat") # compatible with data execution prevention (on by default)
|
||||
SET(SECURE_LINKER_FLAGS "${SECURE_LINKER_FLAGS} /DynamicBase") # random rebase of executable at load time
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -15,7 +15,7 @@
|
||||
## ======================================================================== ##
|
||||
|
||||
# optionally use static runtime library
|
||||
OPTION(EMBREE_STATIC_RUNTIME "Use the static version of the C/C++ runtime library." ON)
|
||||
OPTION(EMBREE_STATIC_RUNTIME "Use the static version of the C/C++ runtime library." OFF)
|
||||
IF (EMBREE_STATIC_RUNTIME)
|
||||
STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
|
||||
STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
|
||||
|
||||
+45
-51
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -39,7 +39,10 @@ ENDIF()
|
||||
##############################################################
|
||||
# Install Headers
|
||||
##############################################################
|
||||
INSTALL(DIRECTORY include/embree2 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel)
|
||||
INSTALL(DIRECTORY include/embree3 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel)
|
||||
IF (NOT WIN32)
|
||||
INSTALL(DIRECTORY man/man3 DESTINATION ${CMAKE_INSTALL_MANDIR} COMPONENT devel)
|
||||
ENDIF()
|
||||
|
||||
##############################################################
|
||||
# Install Models
|
||||
@@ -55,11 +58,6 @@ INSTALL(FILES ${PROJECT_SOURCE_DIR}/CHANGELOG.md DESTINATION ${CMAKE_INSTALL_DOC
|
||||
INSTALL(FILES ${PROJECT_SOURCE_DIR}/README.md DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib)
|
||||
INSTALL(FILES ${PROJECT_SOURCE_DIR}/readme.pdf DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib)
|
||||
|
||||
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_DOCDIR}/LICENSE.txt" "LICENSE")
|
||||
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_DOCDIR}/CHANGELOG.txt" "CHANGELOG")
|
||||
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_DOCDIR}/README.md" "README.md")
|
||||
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_DOCDIR}/readme.pdf" "readme.pdf")
|
||||
|
||||
##############################################################
|
||||
# Install scripts to set embree paths
|
||||
##############################################################
|
||||
@@ -96,11 +94,11 @@ ENDIF()
|
||||
|
||||
# why does this have to be so complicated...
|
||||
IF (WIN32)
|
||||
SET(EMBREE_LIBRARY_NAME ${CMAKE_IMPORT_LIBRARY_PREFIX}embree${CMAKE_IMPORT_LIBRARY_SUFFIX})
|
||||
SET(EMBREE_LIBRARY_NAME ${CMAKE_IMPORT_LIBRARY_PREFIX}embree${EMBREE_VERSION_MAJOR}${CMAKE_IMPORT_LIBRARY_SUFFIX})
|
||||
ELSEIF (APPLE)
|
||||
SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree.${EMBREE_CONFIG_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree${EMBREE_VERSION_MAJOR}.${EMBREE_CONFIG_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
ELSE()
|
||||
SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree${CMAKE_SHARED_LIBRARY_SUFFIX}.${EMBREE_CONFIG_VERSION})
|
||||
SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree${EMBREE_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}.${EMBREE_CONFIG_VERSION})
|
||||
ENDIF()
|
||||
|
||||
IF (WIN32 OR EMBREE_ZIP_MODE)
|
||||
@@ -111,7 +109,7 @@ IF (WIN32 OR EMBREE_ZIP_MODE)
|
||||
SET(EMBREE_RELATIV_ROOT_DIR ".")
|
||||
ELSE()
|
||||
SET(EMBREE_CMAKECONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}")
|
||||
SET(EMBREE_RELATIV_ROOT_DIR "../../..")
|
||||
FILE(RELATIVE_PATH EMBREE_RELATIV_ROOT_DIR "/${EMBREE_CMAKECONFIG_DIR}" "/")
|
||||
ENDIF()
|
||||
CONFIGURE_FILE(common/cmake/embree-config.cmake embree-config-install.cmake @ONLY)
|
||||
CONFIGURE_FILE(common/cmake/embree-config-version.cmake embree-config-version.cmake @ONLY)
|
||||
@@ -125,11 +123,11 @@ INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION ${
|
||||
# CPack specific stuff
|
||||
##############################################################
|
||||
|
||||
SET(CPACK_PACKAGE_NAME "Embree")
|
||||
SET(CPACK_PACKAGE_NAME "Embree Ray Tracing Kernels")
|
||||
SET(CPACK_PACKAGE_FILE_NAME "embree-${EMBREE_VERSION}")
|
||||
#SET(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/embree-doc/images/icon.png)
|
||||
#SET(CPACK_PACKAGE_RELOCATABLE TRUE)
|
||||
SET(CPACK_STRIP_FILES TRUE)
|
||||
SET(CPACK_STRIP_FILES FALSE) # we strip already as a post_build step
|
||||
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${EMBREE_VERSION_MAJOR})
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR ${EMBREE_VERSION_MINOR})
|
||||
@@ -148,9 +146,9 @@ SET(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples")
|
||||
SET(CPACK_COMPONENT_EXAMPLES_DESCRIPTION "Tutorials demonstrating how to use Embree.")
|
||||
|
||||
# dependencies between components
|
||||
SET(CPACK_COMPONENT_DEVEL_DEPENDS lib)
|
||||
SET(CPACK_COMPONENT_EXAMPLES_DEPENDS lib)
|
||||
SET(CPACK_COMPONENT_LIB_REQUIRED ON) # always install the libs
|
||||
#SET(CPACK_COMPONENT_DEVEL_DEPENDS lib)
|
||||
#SET(CPACK_COMPONENT_EXAMPLES_DEPENDS lib)
|
||||
#SET(CPACK_COMPONENT_LIB_REQUIRED ON) # always install the libs
|
||||
|
||||
# point to readme and license files
|
||||
SET(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)
|
||||
@@ -161,42 +159,34 @@ IF(WIN32)
|
||||
|
||||
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
SET(ARCH x64)
|
||||
SET(PROGRAMFILES "\$PROGRAMFILES64")
|
||||
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME} x64")
|
||||
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME} x64")
|
||||
ELSE()
|
||||
SET(ARCH win32)
|
||||
SET(PROGRAMFILES "\$PROGRAMFILES")
|
||||
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME} Win32")
|
||||
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME} Win32")
|
||||
ENDIF()
|
||||
|
||||
IF (MSVC12)
|
||||
SET(VCVER vc12)
|
||||
ELSEIF(MSVC14) # also for VC15, which is toolset v141
|
||||
SET(VCVER vc14)
|
||||
ENDIF()
|
||||
|
||||
# NSIS specific settings
|
||||
IF (NOT EMBREE_ZIP_MODE)
|
||||
SET(CPACK_GENERATOR NSIS)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}")
|
||||
SET(CPACK_COMPONENTS_ALL lib devel examples)
|
||||
SET(CPACK_NSIS_INSTALL_ROOT "${PROGRAMFILES}\\\\Intel")
|
||||
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Embree v${EMBREE_VERSION} ${ARCH}")
|
||||
SET(CPACK_NSIS_DISPLAY_NAME "Embree v${EMBREE_VERSION} ${ARCH}")
|
||||
SET(CPACK_NSIS_PACKAGE_NAME "Embree v${EMBREE_VERSION} ${ARCH}")
|
||||
SET(CPACK_NSIS_URL_INFO_ABOUT http://embree.github.io/)
|
||||
#SET(CPACK_NSIS_HELP_LINK http://embree.github.io/downloads.html#windows)
|
||||
SET(CPACK_NSIS_MUI_ICON ${PROJECT_SOURCE_DIR}/scripts/install_windows/icon32.ico)
|
||||
SET(CPACK_NSIS_CONTACT ${CPACK_PACKAGE_CONTACT})
|
||||
#SET(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS} "\n CreateDirectory \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\"")
|
||||
#SET(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS} "\n CreateDirectory \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\documentation\\\"")
|
||||
#SET(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS} "\n CreateDirectory \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\tutorials\\\" \n")
|
||||
#SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} "\n ${UNINSTALL_LIST}\n RMDir \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\documentation\\\"")
|
||||
#SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} "\n ${UNINSTALL_LIST}\n RMDir \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\tutorials\\\"")
|
||||
#SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} "\n ${UNINSTALL_LIST}\n RMDir \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\"\n")
|
||||
SET(CPACK_GENERATOR WIX)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}.${VCVER}")
|
||||
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Intel\\\\Embree${EMBREE_VERSION_MAJOR} ${ARCH}")
|
||||
SET(CPACK_WIX_PRODUCT_GUID "331BD5A9-DAD6-486B-A435-18AAB80${EMBREE_VERSION_NUMBER}")
|
||||
SET(CPACK_WIX_UPGRADE_GUID "331BD5A9-DAD6-486B-A435-18AAB80${EMBREE_VERSION_MAJOR}0000") # upgrade as long as major version is the same
|
||||
SET(CPACK_WIX_CMAKE_PACKAGE_REGISTRY TRUE)
|
||||
IF (EMBREE_TESTING_PACKAGE)
|
||||
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_win.bat ${CPACK_PACKAGE_FILE_NAME}.exe ${CMAKE_BUILD_TYPE})
|
||||
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_win.bat ${CMAKE_BUILD_TYPE} ${CPACK_PACKAGE_FILE_NAME}.msi ${EMBREE_SIGN_FILE})
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(CPACK_GENERATOR ZIP)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}.windows")
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}.${VCVER}.windows")
|
||||
SET(CPACK_MONOLITHIC_INSTALL 1)
|
||||
IF (EMBREE_TESTING_PACKAGE)
|
||||
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_win.bat ${CPACK_PACKAGE_FILE_NAME}.zip ${CMAKE_BUILD_TYPE})
|
||||
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_win.bat ${CMAKE_BUILD_TYPE} ${CPACK_PACKAGE_FILE_NAME}.zip)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
@@ -208,32 +198,32 @@ ELSEIF(APPLE)
|
||||
|
||||
IF (NOT EMBREE_ZIP_MODE)
|
||||
SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
SET(CPACK_GENERATOR PackageMaker)
|
||||
SET(CPACK_GENERATOR productbuild)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64")
|
||||
#SET(CPACK_COMPONENTS_ALL lib devel examples)
|
||||
SET(CPACK_MONOLITHIC_INSTALL 1)
|
||||
SET(CPACK_COMPONENTS_ALL lib devel examples)
|
||||
#SET(CPACK_MONOLITHIC_INSTALL 1)
|
||||
SET(CPACK_PACKAGE_NAME embree-${EMBREE_VERSION})
|
||||
SET(CPACK_PACKAGE_VENDOR "intel") # creates short name com.intel.embree2.xxx in pkgutil
|
||||
SET(CPACK_PACKAGE_VENDOR "intel") # creates short name com.intel.embree3.xxx in pkgutil
|
||||
SET(CPACK_OSX_PACKAGE_VERSION 10.7)
|
||||
IF (EMBREE_TESTING_PACKAGE)
|
||||
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_macosx.sh ${CMAKE_BUILD_TYPE} ${CPACK_PACKAGE_FILE_NAME}.dmg)
|
||||
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_macosx.sh ${CMAKE_BUILD_TYPE} ${CPACK_PACKAGE_FILE_NAME}.pkg ${EMBREE_SIGN_FILE})
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(CPACK_GENERATOR TGZ)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.macosx")
|
||||
SET(CPACK_MONOLITHIC_INSTALL 1)
|
||||
IF (EMBREE_TESTING_PACKAGE)
|
||||
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_macosx.sh ${CMAKE_BUILD_TYPE} ${CPACK_PACKAGE_FILE_NAME}.tgz)
|
||||
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_macosx.sh ${CMAKE_BUILD_TYPE} ${CPACK_PACKAGE_FILE_NAME}.tgz ${EMBREE_SIGN_FILE})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Linux specific settings
|
||||
ELSE()
|
||||
|
||||
|
||||
IF (NOT EMBREE_ZIP_MODE)
|
||||
|
||||
SET(CPACK_GENERATOR RPM)
|
||||
SET(CPACK_RPM_PACKAGE_NAME "embree${EMBREE_VERSION_MAJOR}")
|
||||
SET(CPACK_COMPONENTS_ALL devel lib examples)
|
||||
SET(CPACK_RPM_COMPONENT_INSTALL ON)
|
||||
SET(CPACK_RPM_FILE_NAME RPM-DEFAULT)
|
||||
@@ -241,7 +231,11 @@ ELSE()
|
||||
SET(CPACK_RPM_PACKAGE_LICENSE "ASL 2.0") # Apache Software License, Version 2.0
|
||||
SET(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
|
||||
SET(CPACK_RPM_CHANGELOG_FILE ${CMAKE_BINARY_DIR}/rpm_changelog.txt) # ChangeLog of the RPM
|
||||
STRING(TIMESTAMP CHANGELOG_DATE "%a %b %d %Y")
|
||||
IF (CMAKE_VERSION VERSION_LESS "3.7.0")
|
||||
EXECUTE_PROCESS(COMMAND date "+%a %b %d %Y" OUTPUT_VARIABLE CHANGELOG_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
ELSE()
|
||||
STRING(TIMESTAMP CHANGELOG_DATE "%a %b %d %Y")
|
||||
ENDIF()
|
||||
SET(RPM_CHANGELOG "* ${CHANGELOG_DATE} Johannes Günther <johannes.guenther@intel.com> - ${EMBREE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}\n- First package")
|
||||
FILE(WRITE ${CPACK_RPM_CHANGELOG_FILE} ${RPM_CHANGELOG})
|
||||
SET(CPACK_RPM_PACKAGE_URL http://embree.github.io/)
|
||||
@@ -251,7 +245,7 @@ ELSE()
|
||||
SET(CPACK_RPM_lib_POST_INSTALL_SCRIPT_FILE ${PROJECT_SOURCE_DIR}/common/cmake/rpm_ldconfig.sh)
|
||||
SET(CPACK_RPM_lib_POST_UNINSTALL_SCRIPT_FILE ${PROJECT_SOURCE_DIR}/common/cmake/rpm_ldconfig.sh)
|
||||
IF (EMBREE_TESTING_PACKAGE)
|
||||
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_linux.sh ${EMBREE_ZIP_MODE} ${EMBREE_VERSION})
|
||||
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_linux.sh ${EMBREE_ZIP_MODE} ${EMBREE_VERSION} ${EMBREE_VERSION_MAJOR} ${EMBREE_SIGN_FILE})
|
||||
ENDIF()
|
||||
ELSE()
|
||||
|
||||
@@ -259,7 +253,7 @@ ELSE()
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.linux")
|
||||
SET(CPACK_MONOLITHIC_INSTALL 1)
|
||||
IF (EMBREE_TESTING_PACKAGE)
|
||||
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_linux.sh ${EMBREE_ZIP_MODE} ${EMBREE_VERSION})
|
||||
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_linux.sh ${EMBREE_ZIP_MODE} ${EMBREE_VERSION} ${EMBREE_SIGN_FILE})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
||||
+115
-73
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -14,86 +14,132 @@
|
||||
## limitations under the License. ##
|
||||
## ======================================================================== ##
|
||||
|
||||
IF(NOT BUILD_TESTING)
|
||||
SET(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(CTest)
|
||||
|
||||
IF (BUILD_TESTING)
|
||||
|
||||
CMAKE_HOST_SYSTEM_INFORMATION(RESULT memory QUERY TOTAL_PHYSICAL_MEMORY)
|
||||
|
||||
SET(EMBREE_TESTING_MODEL_DIR "${PROJECT_SOURCE_DIR}/models" CACHE PATH "Path to the folder containing the Embree models for regression testing.")
|
||||
SET(EMBREE_TESTING_INTENSIVE OFF CACHE BOOL "Turns intensive testing on.")
|
||||
SET(EMBREE_TESTING_MEMCHECK OFF CACHE BOOL "Turns on memory checking for some tests.")
|
||||
SET(EMBREE_TESTING_BENCHMARK OFF CACHE BOOL "Turns benchmarking on.")
|
||||
SET(EMBREE_TESTING_BENCHMARK_DATABASE "${PROJECT_BINARY_DIR}" CACHE PATH "Path to database for benchmarking.")
|
||||
SET(EMBREE_TESTING_PACKAGE OFF CACHE BOOL "Packages release as test.")
|
||||
SET(EMBREE_TESTING_KLOCWORK OFF CACHE BOOL "Runs Kocwork as test.")
|
||||
|
||||
SET(EMBREE_TESTING_SDE OFF CACHE STRING "Uses SDE to run tests for specified CPU.")
|
||||
SET_PROPERTY(CACHE EMBREE_TESTING_SDE PROPERTY STRINGS OFF pnr nhm wsm snb ivb hsw bdw knl skl skx cnl)
|
||||
|
||||
IF( NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-subdiv.txt"
|
||||
OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-win32.txt"
|
||||
OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-x64.txt"
|
||||
OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-large.txt")
|
||||
MESSAGE(FATAL_ERROR "Invalid Embree testing model repository. Either disable BUILD_TESTING or properly set EMBREE_TESTING_MODEL_DIR.")
|
||||
ENDIF()
|
||||
|
||||
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-subdiv.txt" models_subdiv)
|
||||
STRING(REGEX REPLACE "\n" ";" models_subdiv "${models_subdiv}")
|
||||
|
||||
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-win32.txt" models_small_win32)
|
||||
STRING(REGEX REPLACE "\n" ";" models_small_win32 "${models_small_win32}")
|
||||
|
||||
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-x64.txt" models_small_x64)
|
||||
STRING(REGEX REPLACE "\n" ";" models_small_x64 "${models_small_x64}")
|
||||
|
||||
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-large.txt" models_large)
|
||||
STRING(REGEX REPLACE "\n" ";" models_large "${models_large}")
|
||||
|
||||
IF (EMBREE_TESTING_INTENSIVE)
|
||||
SET(models ${models_small_x64})
|
||||
IF (${memory} GREATER 10000)
|
||||
SET(models ${models} ${models_large})
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(models ${models_small_win32})
|
||||
ENDIF()
|
||||
|
||||
IF (WIN32)
|
||||
IF (WIN32)
|
||||
SET(MY_PROJECT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
|
||||
ELSE()
|
||||
ELSE()
|
||||
SET(MY_PROJECT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
ENDIF()
|
||||
|
||||
MACRO (ADD_EMBREE_MODEL_TEST name reference executable args model)
|
||||
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(EMBREE_TESTING_MODEL_DIR
|
||||
NAMES test-models-intensity2.txt
|
||||
PATHS "${PROJECT_SOURCE_DIR}/models"
|
||||
DOC "Path to the folder containing the Embree models for regression testing."
|
||||
NO_DEFAULT_PATHS)
|
||||
|
||||
SET(EMBREE_TESTING_INTENSITY 1 CACHE INT "Intensity of testing (0 = no testing, 1 = verify and tutorials, 2 = light testing, 3 = intensive testing.")
|
||||
SET(EMBREE_TESTING_MEMCHECK OFF CACHE BOOL "Turns on memory checking for some tests.")
|
||||
SET(EMBREE_TESTING_BENCHMARK OFF CACHE BOOL "Turns benchmarking on.")
|
||||
SET(EMBREE_TESTING_BENCHMARK_DATABASE "${PROJECT_BINARY_DIR}" CACHE PATH "Path to database for benchmarking.")
|
||||
SET(EMBREE_TESTING_PACKAGE OFF CACHE BOOL "Packages release as test.")
|
||||
SET(EMBREE_TESTING_KLOCWORK OFF CACHE BOOL "Runs Kocwork as test.")
|
||||
SET(EMBREE_TESTING_SDE OFF CACHE STRING "Uses SDE to run tests for specified CPU.")
|
||||
SET_PROPERTY(CACHE EMBREE_TESTING_SDE PROPERTY STRINGS OFF pnr nhm wsm snb ivb hsw bdw knl skl skx cnl)
|
||||
|
||||
SET(EMBREE_MODEL_DIR "none")
|
||||
IF (EMBREE_TESTING_MODEL_DIR)
|
||||
SET(EMBREE_MODEL_DIR ${EMBREE_TESTING_MODEL_DIR})
|
||||
ENDIF()
|
||||
|
||||
MACRO (ADD_EMBREE_NORMAL_TEST name reference executable args)
|
||||
IF (BUILD_TESTING)
|
||||
ADD_TEST(NAME ${name}
|
||||
WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
|
||||
COMMAND python ${PROJECT_SOURCE_DIR}/scripts/invoke_test.py
|
||||
--name ${name}
|
||||
--modeldir ${EMBREE_TESTING_MODEL_DIR}
|
||||
--reference ${reference}
|
||||
--model ${model}
|
||||
--modeldir ${EMBREE_MODEL_DIR}
|
||||
--model default
|
||||
--sde ${EMBREE_TESTING_SDE}
|
||||
--execute ${MY_PROJECT_BINARY_DIR}/${executable} ${args})
|
||||
|
||||
IF (EMBREE_ISPC_SUPPORT AND EMBREE_RAY_PACKETS)
|
||||
ENDIF()
|
||||
|
||||
IF (EMBREE_ISPC_SUPPORT AND NOT DISABLE_ISPC_TEST)
|
||||
IF (BUILD_TESTING)
|
||||
ADD_TEST(NAME ${name}_ispc
|
||||
WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
|
||||
COMMAND python ${PROJECT_SOURCE_DIR}/scripts/invoke_test.py
|
||||
--name ${name}_ispc
|
||||
--modeldir ${EMBREE_TESTING_MODEL_DIR}
|
||||
--reference ${reference}
|
||||
--modeldir ${EMBREE_MODEL_DIR}
|
||||
--model default
|
||||
--sde ${EMBREE_TESTING_SDE}
|
||||
--execute ${MY_PROJECT_BINARY_DIR}/${executable}_ispc ${args})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
MACRO (ADD_EMBREE_TEST name)
|
||||
ADD_EMBREE_NORMAL_TEST(${name} ${name} ${name} "")
|
||||
ENDMACRO()
|
||||
|
||||
MACRO (ADD_EMBREE_TEST2 name exe args)
|
||||
ADD_EMBREE_MODEL_TEST(${name} ${exe} ${exe} "${args}" "default")
|
||||
ENDMACRO()
|
||||
|
||||
MACRO (ADD_EMBREE_MODEL_TEST name reference executable args model)
|
||||
IF (BUILD_TESTING)
|
||||
ADD_TEST(NAME ${name}
|
||||
WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
|
||||
COMMAND python ${PROJECT_SOURCE_DIR}/scripts/invoke_test.py
|
||||
--name ${name}
|
||||
--reference ${reference}
|
||||
--modeldir ${EMBREE_MODEL_DIR}
|
||||
--model ${model}
|
||||
--sde ${EMBREE_TESTING_SDE}
|
||||
--execute ${MY_PROJECT_BINARY_DIR}/${executable} ${args})
|
||||
ENDIF()
|
||||
|
||||
IF (EMBREE_ISPC_SUPPORT AND NOT DISABLE_ISPC_TEST)
|
||||
IF (BUILD_TESTING)
|
||||
ADD_TEST(NAME ${name}_ispc
|
||||
WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
|
||||
COMMAND python ${PROJECT_SOURCE_DIR}/scripts/invoke_test.py
|
||||
--name ${name}_ispc
|
||||
--reference ${reference}
|
||||
--modeldir ${EMBREE_MODEL_DIR}
|
||||
--model ${model}
|
||||
--sde ${EMBREE_TESTING_SDE}
|
||||
--execute ${MY_PROJECT_BINARY_DIR}/${executable}_ispc ${args})
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
IF (EMBREE_TESTING_MODEL_DIR AND EMBREE_TESTING_INTENSITY GREATER 0)
|
||||
|
||||
IF( NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/test-models-subdiv.txt"
|
||||
OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/test-models-intensity2.txt"
|
||||
OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/test-models-intensity3.txt"
|
||||
OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/test-models-intensity4.txt")
|
||||
MESSAGE(FATAL_ERROR "Invalid Embree testing model repository.")
|
||||
ENDIF()
|
||||
|
||||
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/test-models-subdiv.txt" models_subdiv)
|
||||
STRING(REGEX REPLACE "\n" ";" models_subdiv "${models_subdiv}")
|
||||
|
||||
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/test-models-intensity2.txt" models_intensity2)
|
||||
STRING(REGEX REPLACE "\n" ";" models_intensity2 "${models_intensity2}")
|
||||
|
||||
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/test-models-intensity3.txt" models_intensity3)
|
||||
STRING(REGEX REPLACE "\n" ";" models_intensity3 "${models_intensity3}")
|
||||
|
||||
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/test-models-intensity4.txt" models_intensity4)
|
||||
STRING(REGEX REPLACE "\n" ";" models_intensity4 "${models_intensity4}")
|
||||
|
||||
IF (EMBREE_TESTING_INTENSITY GREATER 1)
|
||||
LIST(APPEND models ${models_intensity2})
|
||||
ENDIF()
|
||||
|
||||
IF (EMBREE_TESTING_INTENSITY GREATER 2)
|
||||
LIST(APPEND models ${models_intensity3})
|
||||
ENDIF()
|
||||
|
||||
CMAKE_HOST_SYSTEM_INFORMATION(RESULT memory QUERY TOTAL_PHYSICAL_MEMORY)
|
||||
IF (EMBREE_TESTING_INTENSITY GREATER 3 AND ${memory} GREATER 10000)
|
||||
LIST(APPEND models ${models_intensity4})
|
||||
ENDIF()
|
||||
|
||||
MACRO (ADD_EMBREE_MODELS_TEST name reference executable)
|
||||
FOREACH (model ${models})
|
||||
STRING(REGEX REPLACE "/" "_" modelname "${model}")
|
||||
@@ -110,11 +156,6 @@ IF (BUILD_TESTING)
|
||||
ENDFOREACH()
|
||||
ENDMACRO()
|
||||
|
||||
IF (EMBREE_TESTING_KLOCWORK)
|
||||
ADD_TEST(NAME Klocwork WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/klocwork.sh)
|
||||
SET_TESTS_PROPERTIES(Klocwork PROPERTIES TIMEOUT 2400)
|
||||
ENDIF()
|
||||
|
||||
ELSE()
|
||||
|
||||
MACRO (ADD_EMBREE_MODEL_TEST name reference executable args model)
|
||||
@@ -128,18 +169,19 @@ ELSE()
|
||||
|
||||
ENDIF()
|
||||
|
||||
MACRO (ADD_EMBREE_TEST name)
|
||||
ADD_EMBREE_MODEL_TEST(${name} ${name} ${name} "" "default")
|
||||
ENDMACRO()
|
||||
|
||||
MACRO (ADD_EMBREE_TEST2 name exe args)
|
||||
ADD_EMBREE_MODEL_TEST(${name} ${exe} ${exe} "${args}" "default")
|
||||
ENDMACRO()
|
||||
# add klocwork test
|
||||
IF (EMBREE_TESTING_KLOCWORK)
|
||||
ADD_TEST(NAME Klocwork WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/klocwork.sh)
|
||||
SET_TESTS_PROPERTIES(Klocwork PROPERTIES TIMEOUT 2400)
|
||||
ENDIF()
|
||||
|
||||
# add valgrind test
|
||||
IF (EMBREE_TESTING_MEMCHECK)
|
||||
find_program( EMBREE_MEMORYCHECK_COMMAND valgrind )
|
||||
set( EMBREE_MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --show-leak-kinds=definite --errors-for-leak-kinds=definite --error-exitcode=1" )
|
||||
|
||||
IF (NOT EMBREE_MEMORYCHECK_COMMAND)
|
||||
MESSAGE(FATAL_ERROR "valgrind not found")
|
||||
ENDIF()
|
||||
FUNCTION(ADD_MEMCHECK_TEST name binary)
|
||||
set(memcheck_command "${EMBREE_MEMORYCHECK_COMMAND} ${EMBREE_MEMORYCHECK_COMMAND_OPTIONS}")
|
||||
separate_arguments(memcheck_command)
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -18,21 +18,21 @@
|
||||
# if ADDITIONAL_LIBRARIES is set these will be included during linking
|
||||
|
||||
MACRO (ADD_TUTORIAL TUTORIAL_NAME)
|
||||
|
||||
ADD_EXECUTABLE(${TUTORIAL_NAME} ${TUTORIAL_NAME}.cpp ${TUTORIAL_NAME}_device.cpp ${ARGN})
|
||||
TARGET_LINK_LIBRARIES(${TUTORIAL_NAME} embree tutorial image tutorial_device noise ${ADDITIONAL_LIBRARIES})
|
||||
TARGET_LINK_LIBRARIES(${TUTORIAL_NAME} embree image tutorial noise ${ADDITIONAL_LIBRARIES})
|
||||
SET_PROPERTY(TARGET ${TUTORIAL_NAME} PROPERTY FOLDER tutorials/single)
|
||||
SET_PROPERTY(TARGET ${TUTORIAL_NAME} APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
|
||||
INSTALL(TARGETS ${TUTORIAL_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
|
||||
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_BINDIR}/${TUTORIAL_NAME}" "${TUTORIAL_NAME}")
|
||||
SIGN_TARGET(${TUTORIAL_NAME})
|
||||
ENDMACRO ()
|
||||
|
||||
IF (EMBREE_ISPC_SUPPORT AND EMBREE_RAY_PACKETS)
|
||||
MACRO (ADD_TUTORIAL_ISPC TUTORIAL_NAME)
|
||||
IF (EMBREE_ISPC_SUPPORT)
|
||||
ADD_EMBREE_ISPC_EXECUTABLE(${TUTORIAL_NAME}_ispc ${TUTORIAL_NAME}.cpp ${TUTORIAL_NAME}_device.ispc)
|
||||
TARGET_LINK_LIBRARIES(${TUTORIAL_NAME}_ispc embree tutorial image tutorial_device_ispc noise noise_ispc)
|
||||
TARGET_LINK_LIBRARIES(${TUTORIAL_NAME}_ispc embree image tutorial_ispc noise noise_ispc)
|
||||
SET_PROPERTY(TARGET ${TUTORIAL_NAME}_ispc PROPERTY FOLDER tutorials/ispc)
|
||||
SET_PROPERTY(TARGET ${TUTORIAL_NAME}_ispc APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
|
||||
INSTALL(TARGETS ${TUTORIAL_NAME}_ispc DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
|
||||
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_BINDIR}/${TUTORIAL_NAME}_ispc" "${TUTORIAL_NAME}_ispc")
|
||||
SIGN_TARGET(${TUTORIAL_NAME}_ispc)
|
||||
ENDIF()
|
||||
|
||||
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} PARENT_SCOPE)
|
||||
|
||||
ENDMACRO ()
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -20,3 +20,9 @@ ADD_LIBRARY(lexers STATIC
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(lexers sys math)
|
||||
SET_PROPERTY(TARGET lexers PROPERTY FOLDER common)
|
||||
SET_PROPERTY(TARGET lexers APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
|
||||
|
||||
IF (EMBREE_STATIC_LIB)
|
||||
INSTALL(TARGETS lexers ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel)
|
||||
SIGN_TARGET(lexers)
|
||||
ENDIF()
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -32,9 +32,9 @@ namespace embree
|
||||
class ParseLocation
|
||||
{
|
||||
public:
|
||||
ParseLocation () : lineNumber(-1), colNumber(-1), charNumber(-1) {}
|
||||
ParseLocation (std::shared_ptr<std::string> fileName, ssize_t lineNumber, ssize_t colNumber, ssize_t charNumber)
|
||||
: fileName(fileName), lineNumber(lineNumber), colNumber(colNumber), charNumber(charNumber) {}
|
||||
ParseLocation () : lineNumber(-1), colNumber(-1) {}
|
||||
ParseLocation (std::shared_ptr<std::string> fileName, ssize_t lineNumber, ssize_t colNumber, ssize_t /*charNumber*/)
|
||||
: fileName(fileName), lineNumber(lineNumber), colNumber(colNumber) {}
|
||||
|
||||
std::string str() const
|
||||
{
|
||||
@@ -49,7 +49,6 @@ namespace embree
|
||||
std::shared_ptr<std::string> fileName; /// name of the file (or stream) the token is from
|
||||
ssize_t lineNumber; /// the line number the token is from
|
||||
ssize_t colNumber; /// the character number in the current line
|
||||
ssize_t charNumber; /// the character in the file
|
||||
};
|
||||
|
||||
/*! a stream class templated over the stream elements */
|
||||
@@ -67,7 +66,7 @@ namespace embree
|
||||
}
|
||||
__forceinline void push_back(const std::pair<T,ParseLocation>& v) {
|
||||
if (past+future == BUF_SIZE) pop_front();
|
||||
int end = (start+past+future++)%BUF_SIZE;
|
||||
size_t end = (start+past+future++)%BUF_SIZE;
|
||||
buffer[end] = v;
|
||||
}
|
||||
__forceinline void pop_front() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -30,7 +30,7 @@ namespace embree
|
||||
ParseLocation location() { return cin->loc(); }
|
||||
std::string next();
|
||||
private:
|
||||
__forceinline bool isSeparator(int c) const { return isSepMap[c]; }
|
||||
__forceinline bool isSeparator(int c) const { return c<256 && isSepMap[c]; }
|
||||
private:
|
||||
Ref<Stream<int> > cin; /*! source character stream */
|
||||
bool isSepMap[256]; /*! map for fast classification of separators */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -160,13 +160,13 @@ namespace embree
|
||||
std::vector<std::string> symbols;
|
||||
|
||||
/*! checks if a character is a separator */
|
||||
__forceinline bool isSeparator(int c) const { return isSepMap[c]; }
|
||||
__forceinline bool isSeparator(int c) const { return c<256 && isSepMap[c]; }
|
||||
|
||||
/*! checks if a character is a number */
|
||||
__forceinline bool isDigit(int c) const { return c >= '0' && c <= '9';}
|
||||
|
||||
/*! checks if a character is legal for an identifier */
|
||||
__forceinline bool isAlpha(int c) const { return isAlphaMap[c]; }
|
||||
__forceinline bool isAlpha(int c) const { return c<256 && isAlphaMap[c]; }
|
||||
__forceinline bool isAlphaNum(int c) const { return isAlpha(c) || isDigit(c); }
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -16,3 +16,10 @@
|
||||
|
||||
ADD_LIBRARY(math STATIC constants.cpp)
|
||||
SET_PROPERTY(TARGET math PROPERTY FOLDER common)
|
||||
SET_PROPERTY(TARGET math APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
|
||||
|
||||
IF (EMBREE_STATIC_LIB)
|
||||
INSTALL(TARGETS math ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel)
|
||||
SIGN_TARGET(math)
|
||||
ENDIF()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -107,9 +107,9 @@ namespace embree
|
||||
template<typename L> __forceinline AffineSpaceT<L>& operator /=( AffineSpaceT<L>& a, const AffineSpaceT<L>& b ) { return a = a / b; }
|
||||
template<typename L> __forceinline AffineSpaceT<L>& operator /=( AffineSpaceT<L>& a, const ScalarT & b ) { return a = a / b; }
|
||||
|
||||
template<typename L> __forceinline const VectorT xfmPoint (const AffineSpaceT<L>& m, const VectorT& p) { return madd(VectorT(p.x),m.l.vx,madd(VectorT(p.y),m.l.vy,madd(VectorT(p.z),m.l.vz,m.p))); }
|
||||
template<typename L> __forceinline const VectorT xfmVector(const AffineSpaceT<L>& m, const VectorT& v) { return xfmVector(m.l,v); }
|
||||
template<typename L> __forceinline const VectorT xfmNormal(const AffineSpaceT<L>& m, const VectorT& n) { return xfmNormal(m.l,n); }
|
||||
template<typename L> __forceinline VectorT xfmPoint (const AffineSpaceT<L>& m, const VectorT& p) { return madd(VectorT(p.x),m.l.vx,madd(VectorT(p.y),m.l.vy,madd(VectorT(p.z),m.l.vz,m.p))); }
|
||||
template<typename L> __forceinline VectorT xfmVector(const AffineSpaceT<L>& m, const VectorT& v) { return xfmVector(m.l,v); }
|
||||
template<typename L> __forceinline VectorT xfmNormal(const AffineSpaceT<L>& m, const VectorT& n) { return xfmNormal(m.l,n); }
|
||||
|
||||
__forceinline const BBox<Vec3fa> xfmBounds(const AffineSpaceT<LinearSpace3<Vec3fa> >& m, const BBox<Vec3fa>& b)
|
||||
{
|
||||
|
||||
+11
-1
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -60,6 +60,11 @@ namespace embree
|
||||
__forceinline static const BBox merge (const BBox& a, const BBox& b) {
|
||||
return BBox(min(a.lower, b.lower), max(a.upper, b.upper));
|
||||
}
|
||||
|
||||
/*! enlarge box by some scaling factor */
|
||||
__forceinline BBox enlarge_by(const float a) {
|
||||
return BBox(lower - T(a)*abs(lower), upper + T(a)*abs(upper));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constants
|
||||
@@ -184,6 +189,10 @@ namespace embree
|
||||
return true;
|
||||
}
|
||||
|
||||
template<> __inline bool subset( const BBox<Vec3fa>& a, const BBox<Vec3fa>& b ) {
|
||||
return all(ge_mask(a.lower,b.lower)) & all(le_mask(a.upper,b.upper));
|
||||
}
|
||||
|
||||
/*! blending */
|
||||
template<typename T>
|
||||
__forceinline BBox<T> lerp(const BBox<T>& b0, const BBox<T>& b1, const float t) {
|
||||
@@ -198,6 +207,7 @@ namespace embree
|
||||
/*! default template instantiations */
|
||||
typedef BBox<float> BBox1f;
|
||||
typedef BBox<Vec2f> BBox2f;
|
||||
typedef BBox<Vec2fa> BBox2fa;
|
||||
typedef BBox<Vec3f> BBox3f;
|
||||
typedef BBox<Vec3fa> BBox3fa;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -53,8 +53,8 @@ namespace embree
|
||||
__forceinline Color4 ( const Color4& other ) : m128(other.m128) {}
|
||||
__forceinline Color4& operator=( const Color4& other ) { m128 = other.m128; return *this; }
|
||||
|
||||
__forceinline operator const __m128&( void ) const { return m128; }
|
||||
__forceinline operator __m128&( void ) { return m128; }
|
||||
__forceinline operator const __m128&() const { return m128; }
|
||||
__forceinline operator __m128&() { return m128; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Set
|
||||
@@ -115,8 +115,8 @@ namespace embree
|
||||
__forceinline Color ( const Color4& other ) : m128(other.m128) {}
|
||||
__forceinline Color& operator=( const Color4& other ) { m128 = other.m128; return *this; }
|
||||
|
||||
__forceinline operator const __m128&( void ) const { return m128; }
|
||||
__forceinline operator __m128&( void ) { return m128; }
|
||||
__forceinline operator const __m128&() const { return m128; }
|
||||
__forceinline operator __m128&() { return m128; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Set
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -36,4 +36,5 @@ namespace embree
|
||||
StepTy step;
|
||||
ReverseStepTy reverse_step;
|
||||
EmptyTy empty;
|
||||
UndefinedTy undefined;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -26,11 +26,11 @@
|
||||
|
||||
namespace embree
|
||||
{
|
||||
static const float one_over_255 = 1.0f/255.0f;
|
||||
static const float min_rcp_input = 1E-18f; // for abs(x) >= min_rcp_input the newton raphson rcp calculation does not fail
|
||||
static MAYBE_UNUSED const float one_over_255 = 1.0f/255.0f;
|
||||
static MAYBE_UNUSED const float min_rcp_input = 1E-18f; // for abs(x) >= min_rcp_input the newton raphson rcp calculation does not fail
|
||||
|
||||
/* we consider floating point numbers in that range as valid input numbers */
|
||||
static float FLT_LARGE = 1.844E18f;
|
||||
static MAYBE_UNUSED float FLT_LARGE = 1.844E18f;
|
||||
|
||||
struct TrueTy {
|
||||
__forceinline operator bool( ) const { return true; }
|
||||
@@ -201,4 +201,9 @@ namespace embree
|
||||
};
|
||||
|
||||
extern MAYBE_UNUSED FullTy full;
|
||||
|
||||
struct UndefinedTy {
|
||||
};
|
||||
|
||||
extern MAYBE_UNUSED UndefinedTy undefined;
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
// You may obtain a copy of the License at //
|
||||
// //
|
||||
// http://www.apache.org/licenses/LICENSE-2.0 //
|
||||
// //
|
||||
// Unless required by applicable law or agreed to in writing, software //
|
||||
// distributed under the License is distributed on an "AS IS" BASIS, //
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
|
||||
// See the License for the specific language governing permissions and //
|
||||
// limitations under the License. //
|
||||
// ======================================================================== //
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "vec2.h"
|
||||
#include "vec3.h"
|
||||
#include "bbox.h"
|
||||
|
||||
namespace embree
|
||||
{
|
||||
template<typename V>
|
||||
struct Interval
|
||||
{
|
||||
V lower, upper;
|
||||
|
||||
__forceinline Interval() {}
|
||||
__forceinline Interval ( const Interval& other ) { lower = other.lower; upper = other.upper; }
|
||||
__forceinline Interval& operator=( const Interval& other ) { lower = other.lower; upper = other.upper; return *this; }
|
||||
|
||||
__forceinline Interval(const V& a) : lower(a), upper(a) {}
|
||||
__forceinline Interval(const V& lower, const V& upper) : lower(lower), upper(upper) {}
|
||||
__forceinline Interval(const BBox<V>& a) : lower(a.lower), upper(a.upper) {}
|
||||
|
||||
/*! tests if box is empty */
|
||||
//__forceinline bool empty() const { return lower > upper; }
|
||||
|
||||
/*! computes the size of the interval */
|
||||
__forceinline V size() const { return upper - lower; }
|
||||
|
||||
__forceinline V center() const { return 0.5f*(lower+upper); }
|
||||
|
||||
__forceinline const Interval& extend(const Interval& other) { lower = min(lower,other.lower); upper = max(upper,other.upper); return *this; }
|
||||
__forceinline const Interval& extend(const V & other) { lower = min(lower,other ); upper = max(upper,other ); return *this; }
|
||||
|
||||
__forceinline friend Interval operator +( const Interval& a, const Interval& b ) {
|
||||
return Interval(a.lower+b.lower,a.upper+b.upper);
|
||||
}
|
||||
|
||||
__forceinline friend Interval operator -( const Interval& a, const Interval& b ) {
|
||||
return Interval(a.lower-b.upper,a.upper-b.lower);
|
||||
}
|
||||
|
||||
__forceinline friend Interval operator -( const Interval& a, const V& b ) {
|
||||
return Interval(a.lower-b,a.upper-b);
|
||||
}
|
||||
|
||||
__forceinline friend Interval operator *( const Interval& a, const Interval& b )
|
||||
{
|
||||
const V ll = a.lower*b.lower;
|
||||
const V lu = a.lower*b.upper;
|
||||
const V ul = a.upper*b.lower;
|
||||
const V uu = a.upper*b.upper;
|
||||
return Interval(min(ll,lu,ul,uu),max(ll,lu,ul,uu));
|
||||
}
|
||||
|
||||
__forceinline friend Interval merge( const Interval& a, const Interval& b) {
|
||||
return Interval(min(a.lower,b.lower),max(a.upper,b.upper));
|
||||
}
|
||||
|
||||
__forceinline friend Interval merge( const Interval& a, const Interval& b, const Interval& c) {
|
||||
return merge(merge(a,b),c);
|
||||
}
|
||||
|
||||
__forceinline friend Interval merge( const Interval& a, const Interval& b, const Interval& c, const Interval& d) {
|
||||
return merge(merge(a,b),merge(c,d));
|
||||
}
|
||||
|
||||
/*! intersect bounding boxes */
|
||||
__forceinline friend const Interval intersect( const Interval& a, const Interval& b ) { return Interval(max(a.lower, b.lower), min(a.upper, b.upper)); }
|
||||
__forceinline friend const Interval intersect( const Interval& a, const Interval& b, const Interval& c ) { return intersect(a,intersect(b,c)); }
|
||||
__forceinline friend const Interval intersect( const Interval& a, const Interval& b, const Interval& c, const Interval& d ) { return intersect(intersect(a,b),intersect(c,d)); }
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& cout, const Interval& a) {
|
||||
return cout << "[" << a.lower << ", " << a.upper << "]";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline Interval( EmptyTy ) : lower(pos_inf), upper(neg_inf) {}
|
||||
__forceinline Interval( FullTy ) : lower(neg_inf), upper(pos_inf) {}
|
||||
};
|
||||
|
||||
__forceinline bool isEmpty(const Interval<float>& v) {
|
||||
return v.lower > v.upper;
|
||||
}
|
||||
|
||||
__forceinline vboolx isEmpty(const Interval<vfloatx>& v) {
|
||||
return v.lower > v.upper;
|
||||
}
|
||||
|
||||
/*! subset relation */
|
||||
template<typename T> __forceinline bool subset( const Interval<T>& a, const Interval<T>& b ) {
|
||||
return (a.lower > b.lower) && (a.upper < b.upper);
|
||||
}
|
||||
|
||||
template<typename T> __forceinline bool subset( const Vec2<Interval<T>>& a, const Vec2<Interval<T>>& b ) {
|
||||
return subset(a.x,b.x) && subset(a.y,b.y);
|
||||
}
|
||||
|
||||
template<typename T> __forceinline const Vec2<Interval<T>> intersect( const Vec2<Interval<T>>& a, const Vec2<Interval<T>>& b ) {
|
||||
return Vec2<Interval<T>>(intersect(a.x,b.x),intersect(a.y,b.y));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<typename T> __forceinline Interval<T> select ( bool s, const Interval<T>& t, const Interval<T>& f ) {
|
||||
return Interval<T>(select(s,t.lower,f.lower),select(s,t.upper,f.upper));
|
||||
}
|
||||
|
||||
template<typename T> __forceinline Interval<T> select ( const typename T::Bool& s, const Interval<T>& t, const Interval<T>& f ) {
|
||||
return Interval<T>(select(s,t.lower,f.lower),select(s,t.upper,f.upper));
|
||||
}
|
||||
|
||||
__forceinline int numRoots(const Interval<float>& p0, const Interval<float>& p1)
|
||||
{
|
||||
float eps = 1E-4f;
|
||||
bool neg0 = p0.lower < eps; bool pos0 = p0.upper > -eps;
|
||||
bool neg1 = p1.lower < eps; bool pos1 = p1.upper > -eps;
|
||||
return (neg0 && pos1) || (pos0 && neg1) || (neg0 && pos0) || (neg1 && pos1);
|
||||
}
|
||||
|
||||
typedef Interval<float> Interval1f;
|
||||
typedef Vec2<Interval<float>> Interval2f;
|
||||
typedef Vec3<Interval<float>> Interval3f;
|
||||
}
|
||||
+64
-2
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -109,6 +109,56 @@ namespace embree
|
||||
bounds1 = b1;
|
||||
}
|
||||
|
||||
/*! calculates the linear bounds of a primitive for the specified time range */
|
||||
template<typename BoundsFunc>
|
||||
__forceinline LBBox(const BoundsFunc& bounds, const BBox1f& time_range_in, const BBox1f& geom_time_range, float geom_time_segments)
|
||||
{
|
||||
/* normalize global time_range_in to local geom_time_range */
|
||||
const BBox1f time_range((time_range_in.lower-geom_time_range.lower)/geom_time_range.size(),
|
||||
(time_range_in.upper-geom_time_range.lower)/geom_time_range.size());
|
||||
|
||||
const float lower = time_range.lower*geom_time_segments;
|
||||
const float upper = time_range.upper*geom_time_segments;
|
||||
const float ilowerf = floor(lower);
|
||||
const float iupperf = ceil(upper);
|
||||
const float ilowerfc = max(0.0f,ilowerf);
|
||||
const float iupperfc = min(iupperf,geom_time_segments);
|
||||
const int ilowerc = (int)ilowerfc;
|
||||
const int iupperc = (int)iupperfc;
|
||||
assert(iupperc-ilowerc > 0);
|
||||
|
||||
/* this larger iteration range guarantees that we process borders of geom_time_range is (partially) inside time_range_in */
|
||||
const int ilower_iter = max(-1,(int)ilowerf);
|
||||
const int iupper_iter = min((int)iupperf,(int)geom_time_segments+1);
|
||||
|
||||
const BBox<T> blower0 = bounds(ilowerc);
|
||||
const BBox<T> bupper1 = bounds(iupperc);
|
||||
if (iupper_iter-ilower_iter == 1) {
|
||||
bounds0 = lerp(blower0, bupper1, max(0.0f,lower-ilowerfc));
|
||||
bounds1 = lerp(bupper1, blower0, max(0.0f,iupperfc-upper));
|
||||
return;
|
||||
}
|
||||
|
||||
const BBox<T> blower1 = bounds(ilowerc+1);
|
||||
const BBox<T> bupper0 = bounds(iupperc-1);
|
||||
BBox<T> b0 = lerp(blower0, blower1, max(0.0f,lower-ilowerfc));
|
||||
BBox<T> b1 = lerp(bupper1, bupper0, max(0.0f,iupperfc-upper));
|
||||
|
||||
for (int i = ilower_iter+1; i < iupper_iter; i++)
|
||||
{
|
||||
const float f = (float(i)/geom_time_segments - time_range.lower) / time_range.size();
|
||||
const BBox<T> bt = lerp(b0, b1, f);
|
||||
const BBox<T> bi = bounds(i);
|
||||
const T dlower = min(bi.lower-bt.lower, T(zero));
|
||||
const T dupper = max(bi.upper-bt.upper, T(zero));
|
||||
b0.lower += dlower; b1.lower += dlower;
|
||||
b0.upper += dupper; b1.upper += dupper;
|
||||
}
|
||||
|
||||
bounds0 = b0;
|
||||
bounds1 = b1;
|
||||
}
|
||||
|
||||
/*! calculates the linear bounds of a primitive for the specified time range */
|
||||
template<typename BoundsFunc>
|
||||
__forceinline LBBox(const BoundsFunc& bounds, const range<int>& time_range, int numTimeSegments)
|
||||
@@ -119,7 +169,8 @@ namespace embree
|
||||
BBox<T> b0 = bounds(ilower);
|
||||
BBox<T> b1 = bounds(iupper);
|
||||
|
||||
if (iupper-ilower == 1) {
|
||||
if (iupper-ilower == 1)
|
||||
{
|
||||
bounds0 = b0;
|
||||
bounds1 = b1;
|
||||
return;
|
||||
@@ -195,6 +246,12 @@ namespace embree
|
||||
BBox<T> bounds0, bounds1;
|
||||
};
|
||||
|
||||
/*! tests if box is finite */
|
||||
template<typename T>
|
||||
__forceinline bool isvalid( const LBBox<T>& v ) {
|
||||
return isvalid(v.bounds0) && isvalid(v.bounds1);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
__forceinline T expectedArea(const T& a0, const T& a1, const T& b0, const T& b1)
|
||||
{
|
||||
@@ -223,6 +280,11 @@ namespace embree
|
||||
return LBBox<T>(merge(a.bounds0, b.bounds0), merge(a.bounds1, b.bounds1));
|
||||
}
|
||||
|
||||
/*! subset relation */
|
||||
template<typename T> __inline bool subset( const LBBox<T>& a, const LBBox<T>& b ) {
|
||||
return subset(a.bounds0,b.bounds0) && subset(a.bounds1,b.bounds1);
|
||||
}
|
||||
|
||||
/*! default template instantiations */
|
||||
typedef LBBox<float> LBBox1f;
|
||||
typedef LBBox<Vec2f> LBBox2f;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -58,10 +58,10 @@ namespace embree
|
||||
__forceinline const LinearSpace2 transposed() const { return LinearSpace2(vx.x,vx.y,vy.x,vy.y); }
|
||||
|
||||
/*! returns first row of matrix */
|
||||
__forceinline const Vector row0() const { return Vector(vx.x,vy.x); }
|
||||
__forceinline Vector row0() const { return Vector(vx.x,vy.x); }
|
||||
|
||||
/*! returns second row of matrix */
|
||||
__forceinline const Vector row1() const { return Vector(vx.y,vy.y); }
|
||||
__forceinline Vector row1() const { return Vector(vx.y,vy.y); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constants
|
||||
@@ -157,4 +157,5 @@ namespace embree
|
||||
|
||||
/*! Shortcuts for common linear spaces. */
|
||||
typedef LinearSpace2<Vec2f> LinearSpace2f;
|
||||
typedef LinearSpace2<Vec2fa> LinearSpace2fa;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -66,13 +66,13 @@ namespace embree
|
||||
__forceinline const LinearSpace3 transposed() const { return LinearSpace3(vx.x,vx.y,vx.z,vy.x,vy.y,vy.z,vz.x,vz.y,vz.z); }
|
||||
|
||||
/*! returns first row of matrix */
|
||||
__forceinline const Vector row0() const { return Vector(vx.x,vy.x,vz.x); }
|
||||
__forceinline Vector row0() const { return Vector(vx.x,vy.x,vz.x); }
|
||||
|
||||
/*! returns second row of matrix */
|
||||
__forceinline const Vector row1() const { return Vector(vx.y,vy.y,vz.y); }
|
||||
__forceinline Vector row1() const { return Vector(vx.y,vy.y,vz.y); }
|
||||
|
||||
/*! returns third row of matrix */
|
||||
__forceinline const Vector row2() const { return Vector(vx.z,vy.z,vz.z); }
|
||||
__forceinline Vector row2() const { return Vector(vx.z,vy.z,vz.z); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constants
|
||||
|
||||
+3
-4
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -270,9 +270,8 @@ namespace embree
|
||||
__forceinline float select(bool s, float t, float f) { return s ? t : f; }
|
||||
|
||||
|
||||
template<typename V>
|
||||
__forceinline V lerp(const V& v0, const V& v1, const float t) {
|
||||
return madd(V(1.0f-t),v0,t*v1);
|
||||
__forceinline float lerp(const float v0, const float v1, const float t) {
|
||||
return madd(1.0f-t,v0,t*v1);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -33,7 +33,7 @@ namespace embree
|
||||
/// Construction
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline QuaternionT ( void ) { }
|
||||
__forceinline QuaternionT () { }
|
||||
__forceinline QuaternionT ( const QuaternionT& other ) { r = other.r; i = other.i; j = other.j; k = other.k; }
|
||||
__forceinline QuaternionT& operator=( const QuaternionT& other ) { r = other.r; i = other.i; j = other.j; k = other.k; return *this; }
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace embree
|
||||
}
|
||||
|
||||
/*! returns the rotation axis of the quaternion as a vector */
|
||||
__forceinline const Vec3<T> v( ) const { return Vec3<T>(i, j, k); }
|
||||
__forceinline Vec3<T> v( ) const { return Vec3<T>(i, j, k); }
|
||||
|
||||
public:
|
||||
T r, i, j, k;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
|
||||
+58
-10
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
namespace embree
|
||||
{
|
||||
struct Vec2fa;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Generic 2D vector Class
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -40,6 +42,8 @@ namespace embree
|
||||
__forceinline Vec2( const T& x, const T& y ) : x(x), y(y) {}
|
||||
|
||||
__forceinline Vec2( const Vec2& other ) { x = other.x; y = other.y; }
|
||||
__forceinline Vec2( const Vec2fa& other );
|
||||
|
||||
template<typename T1> __forceinline Vec2( const Vec2<T1>& a ) : x(T(a.x)), y(T(a.y)) {}
|
||||
template<typename T1> __forceinline Vec2& operator =( const Vec2<T1>& other ) { x = other.x; y = other.y; return *this; }
|
||||
|
||||
@@ -92,15 +96,15 @@ namespace embree
|
||||
/// Ternary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<typename T> __forceinline const Vec2<T> madd ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( madd(a.x,b.x,c.x), madd(a.y,b.y,c.y) ); }
|
||||
template<typename T> __forceinline const Vec2<T> msub ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( msub(a.x,b.x,c.x), msub(a.y,b.y,c.y) ); }
|
||||
template<typename T> __forceinline const Vec2<T> nmadd ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmadd(a.x,b.x,c.x),nmadd(a.y,b.y,c.y) ); }
|
||||
template<typename T> __forceinline const Vec2<T> nmsub ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmsub(a.x,b.x,c.x),nmsub(a.y,b.y,c.y) ); }
|
||||
template<typename T> __forceinline Vec2<T> madd ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( madd(a.x,b.x,c.x), madd(a.y,b.y,c.y) ); }
|
||||
template<typename T> __forceinline Vec2<T> msub ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( msub(a.x,b.x,c.x), msub(a.y,b.y,c.y) ); }
|
||||
template<typename T> __forceinline Vec2<T> nmadd ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmadd(a.x,b.x,c.x),nmadd(a.y,b.y,c.y) ); }
|
||||
template<typename T> __forceinline Vec2<T> nmsub ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmsub(a.x,b.x,c.x),nmsub(a.y,b.y,c.y) ); }
|
||||
|
||||
template<typename T> __forceinline const Vec2<T> madd ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( madd(a,b.x,c.x), madd(a,b.y,c.y) ); }
|
||||
template<typename T> __forceinline const Vec2<T> msub ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( msub(a,b.x,c.x), msub(a,b.y,c.y) ); }
|
||||
template<typename T> __forceinline const Vec2<T> nmadd ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmadd(a,b.x,c.x),nmadd(a,b.y,c.y) ); }
|
||||
template<typename T> __forceinline const Vec2<T> nmsub ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmsub(a,b.x,c.x),nmsub(a,b.y,c.y) ); }
|
||||
template<typename T> __forceinline Vec2<T> madd ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( madd(a,b.x,c.x), madd(a,b.y,c.y) ); }
|
||||
template<typename T> __forceinline Vec2<T> msub ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( msub(a,b.x,c.x), msub(a,b.y,c.y) ); }
|
||||
template<typename T> __forceinline Vec2<T> nmadd ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmadd(a,b.x,c.x),nmadd(a,b.y,c.y) ); }
|
||||
template<typename T> __forceinline Vec2<T> nmsub ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmsub(a,b.x,c.x),nmsub(a,b.y,c.y) ); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
@@ -132,12 +136,20 @@ namespace embree
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Shift Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<typename T> __forceinline Vec2<T> shift_right_1( const Vec2<T>& a ) {
|
||||
return Vec2<T>(shift_right_1(a.x),shift_right_1(a.y));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Euclidian Space Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<typename T> __forceinline T dot ( const Vec2<T>& a, const Vec2<T>& b ) { return madd(a.x,b.x,a.y*b.y); }
|
||||
|
||||
template<typename T> __forceinline Vec2<T> cross ( const Vec2<T>& a ) { return Vec2<T>(-a.y,a.x); }
|
||||
template<typename T> __forceinline T length ( const Vec2<T>& a ) { return sqrt(dot(a,a)); }
|
||||
template<typename T> __forceinline Vec2<T> normalize( const Vec2<T>& a ) { return a*rsqrt(dot(a,a)); }
|
||||
template<typename T> __forceinline T distance ( const Vec2<T>& a, const Vec2<T>& b ) { return length(a-b); }
|
||||
@@ -163,6 +175,11 @@ namespace embree
|
||||
return Vec2<T>(select(s,t.x,f.x),select(s,t.y,f.y));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
__forceinline Vec2<T> lerp(const Vec2<T>& v0, const Vec2<T>& v1, const T& t) {
|
||||
return madd(Vec2<T>(T(1.0f)-t),v0,t*v1);
|
||||
}
|
||||
|
||||
template<typename T> __forceinline int maxDim ( const Vec2<T>& a )
|
||||
{
|
||||
const Vec2<T> b = abs(a);
|
||||
@@ -186,3 +203,34 @@ namespace embree
|
||||
typedef Vec2<int > Vec2i;
|
||||
typedef Vec2<float> Vec2f;
|
||||
}
|
||||
|
||||
#include "vec2fa.h"
|
||||
|
||||
#if defined __SSE__
|
||||
#include "../simd/sse.h"
|
||||
#endif
|
||||
|
||||
#if defined __AVX__
|
||||
#include "../simd/avx.h"
|
||||
#endif
|
||||
|
||||
#if defined(__AVX512F__)
|
||||
#include "../simd/avx512.h"
|
||||
#endif
|
||||
|
||||
namespace embree
|
||||
{
|
||||
template<> __forceinline Vec2<float>::Vec2(const Vec2fa& a) : x(a.x), y(a.y) {}
|
||||
|
||||
#if defined(__SSE__)
|
||||
template<> __forceinline Vec2<vfloat4>::Vec2(const Vec2fa& a) : x(a.x), y(a.y) {}
|
||||
#endif
|
||||
|
||||
#if defined(__AVX__)
|
||||
template<> __forceinline Vec2<vfloat8>::Vec2(const Vec2fa& a) : x(a.x), y(a.y) {}
|
||||
#endif
|
||||
|
||||
#if defined(__AVX512F__)
|
||||
template<> __forceinline Vec2<vfloat16>::Vec2(const Vec2fa& a) : x(a.x), y(a.y) {}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,310 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
// You may obtain a copy of the License at //
|
||||
// //
|
||||
// http://www.apache.org/licenses/LICENSE-2.0 //
|
||||
// //
|
||||
// Unless required by applicable law or agreed to in writing, software //
|
||||
// distributed under the License is distributed on an "AS IS" BASIS, //
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
|
||||
// See the License for the specific language governing permissions and //
|
||||
// limitations under the License. //
|
||||
// ======================================================================== //
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../sys/alloc.h"
|
||||
#include "math.h"
|
||||
#include "../simd/sse.h"
|
||||
|
||||
namespace embree
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// SSE Vec2fa Type
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct __aligned(16) Vec2fa
|
||||
{
|
||||
ALIGNED_STRUCT_(16);
|
||||
|
||||
typedef float Scalar;
|
||||
enum { N = 2 };
|
||||
union {
|
||||
__m128 m128;
|
||||
struct { float x,y,az,aw; };
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constructors, Assignment & Cast Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline Vec2fa( ) {}
|
||||
__forceinline Vec2fa( const __m128 a ) : m128(a) {}
|
||||
|
||||
__forceinline Vec2fa ( const Vec2<float>& other ) { x = other.x; y = other.y; }
|
||||
__forceinline Vec2fa& operator =( const Vec2<float>& other ) { x = other.x; y = other.y; return *this; }
|
||||
|
||||
__forceinline Vec2fa ( const Vec2fa& other ) { m128 = other.m128; }
|
||||
__forceinline Vec2fa& operator =( const Vec2fa& other ) { m128 = other.m128; return *this; }
|
||||
|
||||
__forceinline explicit Vec2fa( const float a ) : m128(_mm_set1_ps(a)) {}
|
||||
__forceinline Vec2fa( const float x, const float y) : m128(_mm_set_ps(y, y, y, x)) {}
|
||||
|
||||
__forceinline explicit Vec2fa( const __m128i a ) : m128(_mm_cvtepi32_ps(a)) {}
|
||||
|
||||
__forceinline operator const __m128&() const { return m128; }
|
||||
__forceinline operator __m128&() { return m128; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Loads and Stores
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static __forceinline Vec2fa load( const void* const a ) {
|
||||
return Vec2fa(_mm_and_ps(_mm_load_ps((float*)a),_mm_castsi128_ps(_mm_set_epi32(0, 0, -1, -1))));
|
||||
}
|
||||
|
||||
static __forceinline Vec2fa loadu( const void* const a ) {
|
||||
return Vec2fa(_mm_and_ps(_mm_loadu_ps((float*)a),_mm_castsi128_ps(_mm_set_epi32(0, 0, -1, -1))));
|
||||
}
|
||||
|
||||
static __forceinline void storeu ( void* ptr, const Vec2fa& v ) {
|
||||
_mm_storeu_ps((float*)ptr,v);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline Vec2fa( ZeroTy ) : m128(_mm_setzero_ps()) {}
|
||||
__forceinline Vec2fa( OneTy ) : m128(_mm_set1_ps(1.0f)) {}
|
||||
__forceinline Vec2fa( PosInfTy ) : m128(_mm_set1_ps(pos_inf)) {}
|
||||
__forceinline Vec2fa( NegInfTy ) : m128(_mm_set1_ps(neg_inf)) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const float& operator []( const size_t index ) const { assert(index < 2); return (&x)[index]; }
|
||||
__forceinline float& operator []( const size_t index ) { assert(index < 2); return (&x)[index]; }
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline Vec2fa operator +( const Vec2fa& a ) { return a; }
|
||||
__forceinline Vec2fa operator -( const Vec2fa& a ) {
|
||||
const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x80000000));
|
||||
return _mm_xor_ps(a.m128, mask);
|
||||
}
|
||||
__forceinline Vec2fa abs ( const Vec2fa& a ) {
|
||||
const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff));
|
||||
return _mm_and_ps(a.m128, mask);
|
||||
}
|
||||
__forceinline Vec2fa sign ( const Vec2fa& a ) {
|
||||
return blendv_ps(Vec2fa(one), -Vec2fa(one), _mm_cmplt_ps (a,Vec2fa(zero)));
|
||||
}
|
||||
|
||||
__forceinline Vec2fa rcp ( const Vec2fa& a )
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
const Vec2fa r = _mm_rcp14_ps(a.m128);
|
||||
#else
|
||||
const Vec2fa r = _mm_rcp_ps(a.m128);
|
||||
#endif
|
||||
|
||||
#if defined(__AVX2__)
|
||||
const Vec2fa res = _mm_mul_ps(r,_mm_fnmadd_ps(r, a, vfloat4(2.0f)));
|
||||
#else
|
||||
const Vec2fa res = _mm_mul_ps(r,_mm_sub_ps(vfloat4(2.0f), _mm_mul_ps(r, a)));
|
||||
//return _mm_sub_ps(_mm_add_ps(r, r), _mm_mul_ps(_mm_mul_ps(r, r), a));
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
__forceinline Vec2fa sqrt ( const Vec2fa& a ) { return _mm_sqrt_ps(a.m128); }
|
||||
__forceinline Vec2fa sqr ( const Vec2fa& a ) { return _mm_mul_ps(a,a); }
|
||||
|
||||
__forceinline Vec2fa rsqrt( const Vec2fa& a )
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
__m128 r = _mm_rsqrt14_ps(a.m128);
|
||||
#else
|
||||
__m128 r = _mm_rsqrt_ps(a.m128);
|
||||
#endif
|
||||
return _mm_add_ps(_mm_mul_ps(_mm_set1_ps(1.5f),r), _mm_mul_ps(_mm_mul_ps(_mm_mul_ps(a, _mm_set1_ps(-0.5f)), r), _mm_mul_ps(r, r)));
|
||||
}
|
||||
|
||||
__forceinline Vec2fa zero_fix(const Vec2fa& a) {
|
||||
return blendv_ps(a, _mm_set1_ps(min_rcp_input), _mm_cmplt_ps (abs(a).m128, _mm_set1_ps(min_rcp_input)));
|
||||
}
|
||||
__forceinline Vec2fa rcp_safe(const Vec2fa& a) {
|
||||
return rcp(zero_fix(a));
|
||||
}
|
||||
__forceinline Vec2fa log ( const Vec2fa& a ) {
|
||||
return Vec2fa(logf(a.x),logf(a.y));
|
||||
}
|
||||
|
||||
__forceinline Vec2fa exp ( const Vec2fa& a ) {
|
||||
return Vec2fa(expf(a.x),expf(a.y));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline Vec2fa operator +( const Vec2fa& a, const Vec2fa& b ) { return _mm_add_ps(a.m128, b.m128); }
|
||||
__forceinline Vec2fa operator -( const Vec2fa& a, const Vec2fa& b ) { return _mm_sub_ps(a.m128, b.m128); }
|
||||
__forceinline Vec2fa operator *( const Vec2fa& a, const Vec2fa& b ) { return _mm_mul_ps(a.m128, b.m128); }
|
||||
__forceinline Vec2fa operator *( const Vec2fa& a, const float b ) { return a * Vec2fa(b); }
|
||||
__forceinline Vec2fa operator *( const float a, const Vec2fa& b ) { return Vec2fa(a) * b; }
|
||||
__forceinline Vec2fa operator /( const Vec2fa& a, const Vec2fa& b ) { return _mm_div_ps(a.m128,b.m128); }
|
||||
__forceinline Vec2fa operator /( const Vec2fa& a, const float b ) { return _mm_div_ps(a.m128,_mm_set1_ps(b)); }
|
||||
__forceinline Vec2fa operator /( const float a, const Vec2fa& b ) { return _mm_div_ps(_mm_set1_ps(a),b.m128); }
|
||||
|
||||
__forceinline Vec2fa min( const Vec2fa& a, const Vec2fa& b ) { return _mm_min_ps(a.m128,b.m128); }
|
||||
__forceinline Vec2fa max( const Vec2fa& a, const Vec2fa& b ) { return _mm_max_ps(a.m128,b.m128); }
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
__forceinline Vec2fa mini(const Vec2fa& a, const Vec2fa& b) {
|
||||
const vint4 ai = _mm_castps_si128(a);
|
||||
const vint4 bi = _mm_castps_si128(b);
|
||||
const vint4 ci = _mm_min_epi32(ai,bi);
|
||||
return _mm_castsi128_ps(ci);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
__forceinline Vec2fa maxi(const Vec2fa& a, const Vec2fa& b) {
|
||||
const vint4 ai = _mm_castps_si128(a);
|
||||
const vint4 bi = _mm_castps_si128(b);
|
||||
const vint4 ci = _mm_max_epi32(ai,bi);
|
||||
return _mm_castsi128_ps(ci);
|
||||
}
|
||||
#endif
|
||||
|
||||
__forceinline Vec2fa pow ( const Vec2fa& a, const float& b ) {
|
||||
return Vec2fa(powf(a.x,b),powf(a.y,b));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Ternary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__AVX2__)
|
||||
__forceinline Vec2fa madd ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return _mm_fmadd_ps(a,b,c); }
|
||||
__forceinline Vec2fa msub ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return _mm_fmsub_ps(a,b,c); }
|
||||
__forceinline Vec2fa nmadd ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return _mm_fnmadd_ps(a,b,c); }
|
||||
__forceinline Vec2fa nmsub ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return _mm_fnmsub_ps(a,b,c); }
|
||||
#else
|
||||
__forceinline Vec2fa madd ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return a*b+c; }
|
||||
__forceinline Vec2fa msub ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return a*b-c; }
|
||||
__forceinline Vec2fa nmadd ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return -a*b+c;}
|
||||
__forceinline Vec2fa nmsub ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return -a*b-c; }
|
||||
#endif
|
||||
|
||||
__forceinline Vec2fa madd ( const float a, const Vec2fa& b, const Vec2fa& c) { return madd(Vec2fa(a),b,c); }
|
||||
__forceinline Vec2fa msub ( const float a, const Vec2fa& b, const Vec2fa& c) { return msub(Vec2fa(a),b,c); }
|
||||
__forceinline Vec2fa nmadd ( const float a, const Vec2fa& b, const Vec2fa& c) { return nmadd(Vec2fa(a),b,c); }
|
||||
__forceinline Vec2fa nmsub ( const float a, const Vec2fa& b, const Vec2fa& c) { return nmsub(Vec2fa(a),b,c); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline Vec2fa& operator +=( Vec2fa& a, const Vec2fa& b ) { return a = a + b; }
|
||||
__forceinline Vec2fa& operator -=( Vec2fa& a, const Vec2fa& b ) { return a = a - b; }
|
||||
__forceinline Vec2fa& operator *=( Vec2fa& a, const Vec2fa& b ) { return a = a * b; }
|
||||
__forceinline Vec2fa& operator *=( Vec2fa& a, const float b ) { return a = a * b; }
|
||||
__forceinline Vec2fa& operator /=( Vec2fa& a, const Vec2fa& b ) { return a = a / b; }
|
||||
__forceinline Vec2fa& operator /=( Vec2fa& a, const float b ) { return a = a / b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Reductions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline float reduce_add(const Vec2fa& v) { return v.x+v.y; }
|
||||
__forceinline float reduce_mul(const Vec2fa& v) { return v.x*v.y; }
|
||||
__forceinline float reduce_min(const Vec2fa& v) { return min(v.x,v.y); }
|
||||
__forceinline float reduce_max(const Vec2fa& v) { return max(v.x,v.y); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline bool operator ==( const Vec2fa& a, const Vec2fa& b ) { return (_mm_movemask_ps(_mm_cmpeq_ps (a.m128, b.m128)) & 3) == 3; }
|
||||
__forceinline bool operator !=( const Vec2fa& a, const Vec2fa& b ) { return (_mm_movemask_ps(_mm_cmpneq_ps(a.m128, b.m128)) & 3) != 0; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Euclidian Space Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
__forceinline float dot ( const Vec2fa& a, const Vec2fa& b ) {
|
||||
return _mm_cvtss_f32(_mm_dp_ps(a,b,0x3F));
|
||||
}
|
||||
#else
|
||||
__forceinline float dot ( const Vec2fa& a, const Vec2fa& b ) {
|
||||
return reduce_add(a*b);
|
||||
}
|
||||
#endif
|
||||
|
||||
__forceinline Vec2fa cross ( const Vec2fa& a ) {
|
||||
return Vec2fa(-a.y,a.x);
|
||||
}
|
||||
|
||||
__forceinline float sqr_length ( const Vec2fa& a ) { return dot(a,a); }
|
||||
__forceinline float rcp_length ( const Vec2fa& a ) { return rsqrt(dot(a,a)); }
|
||||
__forceinline float rcp_length2( const Vec2fa& a ) { return rcp(dot(a,a)); }
|
||||
__forceinline float length ( const Vec2fa& a ) { return sqrt(dot(a,a)); }
|
||||
__forceinline Vec2fa normalize( const Vec2fa& a ) { return a*rsqrt(dot(a,a)); }
|
||||
__forceinline float distance ( const Vec2fa& a, const Vec2fa& b ) { return length(a-b); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline Vec2fa select( bool s, const Vec2fa& t, const Vec2fa& f ) {
|
||||
__m128 mask = s ? _mm_castsi128_ps(_mm_cmpeq_epi32(_mm_setzero_si128(), _mm_setzero_si128())) : _mm_setzero_ps();
|
||||
return blendv_ps(f, t, mask);
|
||||
}
|
||||
|
||||
__forceinline Vec2fa lerp(const Vec2fa& v0, const Vec2fa& v1, const float t) {
|
||||
return madd(1.0f-t,v0,t*v1);
|
||||
}
|
||||
|
||||
__forceinline int maxDim ( const Vec2fa& a )
|
||||
{
|
||||
const Vec2fa b = abs(a);
|
||||
if (b.x > b.y) return 0;
|
||||
else return 1;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Rounding Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined (__SSE4_1__)
|
||||
//__forceinline Vec2fa trunc( const Vec2fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEAREST_INT); }
|
||||
__forceinline Vec2fa floor( const Vec2fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
|
||||
__forceinline Vec2fa ceil ( const Vec2fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_POS_INF ); }
|
||||
#else
|
||||
//__forceinline Vec2fa trunc( const Vec2fa& a ) { return Vec2fa(truncf(a.x),truncf(a.y),truncf(a.z)); }
|
||||
__forceinline Vec2fa floor( const Vec2fa& a ) { return Vec2fa(floorf(a.x),floorf(a.y)); }
|
||||
__forceinline Vec2fa ceil ( const Vec2fa& a ) { return Vec2fa(ceilf (a.x),ceilf (a.y)); }
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& cout, const Vec2fa& a) {
|
||||
return cout << "(" << a.x << ", " << a.y << ")";
|
||||
}
|
||||
|
||||
typedef Vec2fa Vec2fa_t;
|
||||
}
|
||||
+45
-33
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -77,7 +77,7 @@ namespace embree
|
||||
select(abs(a.y)<min_rcp_input,T(min_rcp_input),a.y),
|
||||
select(abs(a.z)<min_rcp_input,T(min_rcp_input),a.z));
|
||||
}
|
||||
template<typename T> __forceinline const Vec3<T> rcp_safe(const Vec3<T>& a) { return rcp(zero_fix(a)); }
|
||||
template<typename T> __forceinline Vec3<T> rcp_safe(const Vec3<T>& a) { return rcp(zero_fix(a)); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
@@ -102,25 +102,25 @@ namespace embree
|
||||
/// Ternary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<typename T> __forceinline const Vec3<T> madd ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( madd(a.x,b.x,c.x), madd(a.y,b.y,c.y), madd(a.z,b.z,c.z)); }
|
||||
template<typename T> __forceinline const Vec3<T> msub ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( msub(a.x,b.x,c.x), msub(a.y,b.y,c.y), msub(a.z,b.z,c.z)); }
|
||||
template<typename T> __forceinline const Vec3<T> nmadd ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmadd(a.x,b.x,c.x),nmadd(a.y,b.y,c.y),nmadd(a.z,b.z,c.z));}
|
||||
template<typename T> __forceinline const Vec3<T> nmsub ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmsub(a.x,b.x,c.x),nmsub(a.y,b.y,c.y),nmsub(a.z,b.z,c.z)); }
|
||||
template<typename T> __forceinline Vec3<T> madd ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( madd(a.x,b.x,c.x), madd(a.y,b.y,c.y), madd(a.z,b.z,c.z)); }
|
||||
template<typename T> __forceinline Vec3<T> msub ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( msub(a.x,b.x,c.x), msub(a.y,b.y,c.y), msub(a.z,b.z,c.z)); }
|
||||
template<typename T> __forceinline Vec3<T> nmadd ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmadd(a.x,b.x,c.x),nmadd(a.y,b.y,c.y),nmadd(a.z,b.z,c.z));}
|
||||
template<typename T> __forceinline Vec3<T> nmsub ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmsub(a.x,b.x,c.x),nmsub(a.y,b.y,c.y),nmsub(a.z,b.z,c.z)); }
|
||||
|
||||
template<typename T> __forceinline const Vec3<T> madd ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( madd(a,b.x,c.x), madd(a,b.y,c.y), madd(a,b.z,c.z)); }
|
||||
template<typename T> __forceinline const Vec3<T> msub ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( msub(a,b.x,c.x), msub(a,b.y,c.y), msub(a,b.z,c.z)); }
|
||||
template<typename T> __forceinline const Vec3<T> nmadd ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmadd(a,b.x,c.x),nmadd(a,b.y,c.y),nmadd(a,b.z,c.z));}
|
||||
template<typename T> __forceinline const Vec3<T> nmsub ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmsub(a,b.x,c.x),nmsub(a,b.y,c.y),nmsub(a,b.z,c.z)); }
|
||||
template<typename T> __forceinline Vec3<T> madd ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( madd(a,b.x,c.x), madd(a,b.y,c.y), madd(a,b.z,c.z)); }
|
||||
template<typename T> __forceinline Vec3<T> msub ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( msub(a,b.x,c.x), msub(a,b.y,c.y), msub(a,b.z,c.z)); }
|
||||
template<typename T> __forceinline Vec3<T> nmadd ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmadd(a,b.x,c.x),nmadd(a,b.y,c.y),nmadd(a,b.z,c.z));}
|
||||
template<typename T> __forceinline Vec3<T> nmsub ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmsub(a,b.x,c.x),nmsub(a,b.y,c.y),nmsub(a,b.z,c.z)); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<typename T> __forceinline const Vec3<T>& operator +=( Vec3<T>& a, const T b ) { a.x += b; a.y += b; a.z += b; return a; }
|
||||
template<typename T> __forceinline const Vec3<T>& operator +=( Vec3<T>& a, const Vec3<T>& b ) { a.x += b.x; a.y += b.y; a.z += b.z; return a; }
|
||||
template<typename T> __forceinline const Vec3<T>& operator -=( Vec3<T>& a, const Vec3<T>& b ) { a.x -= b.x; a.y -= b.y; a.z -= b.z; return a; }
|
||||
template<typename T> __forceinline const Vec3<T>& operator *=( Vec3<T>& a, const T& b ) { a.x *= b ; a.y *= b ; a.z *= b ; return a; }
|
||||
template<typename T> __forceinline const Vec3<T>& operator /=( Vec3<T>& a, const T& b ) { a.x /= b ; a.y /= b ; a.z /= b ; return a; }
|
||||
template<typename T> __forceinline Vec3<T>& operator +=( Vec3<T>& a, const T b ) { a.x += b; a.y += b; a.z += b; return a; }
|
||||
template<typename T> __forceinline Vec3<T>& operator +=( Vec3<T>& a, const Vec3<T>& b ) { a.x += b.x; a.y += b.y; a.z += b.z; return a; }
|
||||
template<typename T> __forceinline Vec3<T>& operator -=( Vec3<T>& a, const Vec3<T>& b ) { a.x -= b.x; a.y -= b.y; a.z -= b.z; return a; }
|
||||
template<typename T> __forceinline Vec3<T>& operator *=( Vec3<T>& a, const T& b ) { a.x *= b ; a.y *= b ; a.z *= b ; return a; }
|
||||
template<typename T> __forceinline Vec3<T>& operator /=( Vec3<T>& a, const T& b ) { a.x /= b ; a.y /= b ; a.z /= b ; return a; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Reduction Operators
|
||||
@@ -144,6 +144,14 @@ namespace embree
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Shift Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<typename T> __forceinline Vec3<T> shift_right_1( const Vec3<T>& a ) {
|
||||
return Vec3<T>(shift_right_1(a.x),shift_right_1(a.y),shift_right_1(a.z));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -270,66 +278,70 @@ namespace embree
|
||||
namespace embree
|
||||
{
|
||||
template<typename Out, typename In>
|
||||
__forceinline Vec3<Out> broadcast(const Vec3<In>& a, const size_t k) {
|
||||
return Vec3<Out>(Out(a.x[k]),Out(a.y[k]),Out(a.z[k]));
|
||||
__forceinline Vec3<Out> broadcast(const Vec3<In>& a, const size_t k) {
|
||||
return Vec3<Out>(Out(a.x[k]), Out(a.y[k]), Out(a.z[k]));
|
||||
}
|
||||
|
||||
template<> __forceinline Vec3<float>::Vec3( const Vec3fa& a ) { x = a.x; y = a.y; z = a.z; }
|
||||
template<> __forceinline Vec3<float>::Vec3(const Vec3fa& a) { x = a.x; y = a.y; z = a.z; }
|
||||
|
||||
#if defined(__AVX__)
|
||||
template<> __forceinline Vec3<vfloat4>::Vec3( const Vec3fa& a ) {
|
||||
template<> __forceinline Vec3<vfloat4>::Vec3(const Vec3fa& a) {
|
||||
x = a.x; y = a.y; z = a.z;
|
||||
}
|
||||
#elif defined(__SSE__)
|
||||
template<> __forceinline Vec3<vfloat4>::Vec3( const Vec3fa& a ) {
|
||||
template<>
|
||||
__forceinline Vec3<vfloat4>::Vec3(const Vec3fa& a) {
|
||||
const vfloat4 v = vfloat4(a); x = shuffle<0,0,0,0>(v); y = shuffle<1,1,1,1>(v); z = shuffle<2,2,2,2>(v);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__SSE__)
|
||||
__forceinline Vec3<vfloat4> broadcast4f( const Vec3<vfloat4>& a, const size_t k ) {
|
||||
__forceinline Vec3<vfloat4> broadcast4f(const Vec3<vfloat4>& a, const size_t k) {
|
||||
return Vec3<vfloat4>(vfloat4::broadcast(&a.x[k]), vfloat4::broadcast(&a.y[k]), vfloat4::broadcast(&a.z[k]));
|
||||
}
|
||||
|
||||
template<>
|
||||
__forceinline Vec3<vfloat4> broadcast<vfloat4,vfloat4>( const Vec3<vfloat4>& a, const size_t k ) {
|
||||
__forceinline Vec3<vfloat4> broadcast<vfloat4,vfloat4>(const Vec3<vfloat4>& a, const size_t k) {
|
||||
return Vec3<vfloat4>(vfloat4::broadcast(&a.x[k]), vfloat4::broadcast(&a.y[k]), vfloat4::broadcast(&a.z[k]));
|
||||
}
|
||||
|
||||
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const Vec3<vfloat4> shuffle( const Vec3<vfloat4>& b ) {
|
||||
return Vec3<vfloat4>(shuffle<i0,i1,i2,i3>(b.x),shuffle<i0,i1,i2,i3>(b.y),shuffle<i0,i1,i2,i3>(b.z));
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline Vec3<vfloat4> shuffle(const Vec3<vfloat4>& b) {
|
||||
return Vec3<vfloat4>(shuffle<i0,i1,i2,i3>(b.x), shuffle<i0,i1,i2,i3>(b.y), shuffle<i0,i1,i2,i3>(b.z));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__AVX__)
|
||||
template<> __forceinline Vec3<vfloat8>::Vec3( const Vec3fa& a ) {
|
||||
template<>
|
||||
__forceinline Vec3<vfloat8>::Vec3(const Vec3fa& a) {
|
||||
x = a.x; y = a.y; z = a.z;
|
||||
}
|
||||
__forceinline Vec3<vfloat4> broadcast4f( const Vec3<vfloat8>& a, const size_t k ) {
|
||||
__forceinline Vec3<vfloat4> broadcast4f(const Vec3<vfloat8>& a, const size_t k) {
|
||||
return Vec3<vfloat4>(vfloat4::broadcast(&a.x[k]), vfloat4::broadcast(&a.y[k]), vfloat4::broadcast(&a.z[k]));
|
||||
}
|
||||
__forceinline Vec3<vfloat8> broadcast8f( const Vec3<vfloat4>& a, const size_t k ) {
|
||||
__forceinline Vec3<vfloat8> broadcast8f(const Vec3<vfloat4>& a, const size_t k) {
|
||||
return Vec3<vfloat8>(vfloat8::broadcast(&a.x[k]), vfloat8::broadcast(&a.y[k]), vfloat8::broadcast(&a.z[k]));
|
||||
}
|
||||
__forceinline Vec3<vfloat8> broadcast8f( const Vec3<vfloat8>& a, const size_t k ) {
|
||||
__forceinline Vec3<vfloat8> broadcast8f(const Vec3<vfloat8>& a, const size_t k) {
|
||||
return Vec3<vfloat8>(vfloat8::broadcast(&a.x[k]), vfloat8::broadcast(&a.y[k]), vfloat8::broadcast(&a.z[k]));
|
||||
}
|
||||
|
||||
template<>
|
||||
__forceinline Vec3<vfloat8> broadcast<vfloat8,vfloat4>( const Vec3<vfloat4>& a, const size_t k ) {
|
||||
__forceinline Vec3<vfloat8> broadcast<vfloat8,vfloat4>(const Vec3<vfloat4>& a, const size_t k) {
|
||||
return Vec3<vfloat8>(vfloat8::broadcast(&a.x[k]), vfloat8::broadcast(&a.y[k]), vfloat8::broadcast(&a.z[k]));
|
||||
}
|
||||
template<>
|
||||
__forceinline Vec3<vfloat8> broadcast<vfloat8,vfloat8>( const Vec3<vfloat8>& a, const size_t k ) {
|
||||
__forceinline Vec3<vfloat8> broadcast<vfloat8,vfloat8>(const Vec3<vfloat8>& a, const size_t k) {
|
||||
return Vec3<vfloat8>(vfloat8::broadcast(&a.x[k]), vfloat8::broadcast(&a.y[k]), vfloat8::broadcast(&a.z[k]));
|
||||
}
|
||||
|
||||
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const Vec3<vfloat8> shuffle( const Vec3<vfloat8>& b ) {
|
||||
return Vec3<vfloat8>(shuffle<i0,i1,i2,i3>(b.x),shuffle<i0,i1,i2,i3>(b.y),shuffle<i0,i1,i2,i3>(b.z));
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline Vec3<vfloat8> shuffle(const Vec3<vfloat8>& b) {
|
||||
return Vec3<vfloat8>(shuffle<i0,i1,i2,i3>(b.x), shuffle<i0,i1,i2,i3>(b.y), shuffle<i0,i1,i2,i3>(b.z));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__AVX512F__)
|
||||
template<> __forceinline Vec3<vfloat16>::Vec3( const Vec3fa& a ) : x(a.x), y(a.y), z(a.z) {}
|
||||
template<> __forceinline Vec3<vfloat16>::Vec3(const Vec3fa& a) : x(a.x), y(a.y), z(a.z) {}
|
||||
#endif
|
||||
}
|
||||
+13
-13
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -28,7 +28,7 @@ namespace embree
|
||||
|
||||
struct __aligned(16) Vec3ba
|
||||
{
|
||||
ALIGNED_STRUCT;
|
||||
ALIGNED_STRUCT_(16);
|
||||
|
||||
union {
|
||||
__m128 m128;
|
||||
@@ -48,12 +48,12 @@ namespace embree
|
||||
__forceinline Vec3ba& operator =(const Vec3ba& other) { m128 = other.m128; return *this; }
|
||||
|
||||
__forceinline explicit Vec3ba( bool a )
|
||||
: m128(_mm_lookupmask_ps[(size_t(a) << 3) | (size_t(a) << 2) | (size_t(a) << 1) | size_t(a)]) {}
|
||||
: m128(mm_lookupmask_ps[(size_t(a) << 3) | (size_t(a) << 2) | (size_t(a) << 1) | size_t(a)]) {}
|
||||
__forceinline Vec3ba( bool a, bool b, bool c)
|
||||
: m128(_mm_lookupmask_ps[(size_t(c) << 2) | (size_t(b) << 1) | size_t(a)]) {}
|
||||
: m128(mm_lookupmask_ps[(size_t(c) << 2) | (size_t(b) << 1) | size_t(a)]) {}
|
||||
|
||||
__forceinline operator const __m128&( void ) const { return m128; }
|
||||
__forceinline operator __m128&( void ) { return m128; }
|
||||
__forceinline operator const __m128&() const { return m128; }
|
||||
__forceinline operator __m128&() { return m128; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constants
|
||||
@@ -75,23 +75,23 @@ namespace embree
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const Vec3ba operator !( const Vec3ba& a ) { return _mm_xor_ps(a.m128, Vec3ba(embree::True)); }
|
||||
__forceinline Vec3ba operator !( const Vec3ba& a ) { return _mm_xor_ps(a.m128, Vec3ba(embree::True)); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const Vec3ba operator &( const Vec3ba& a, const Vec3ba& b ) { return _mm_and_ps(a.m128, b.m128); }
|
||||
__forceinline const Vec3ba operator |( const Vec3ba& a, const Vec3ba& b ) { return _mm_or_ps (a.m128, b.m128); }
|
||||
__forceinline const Vec3ba operator ^( const Vec3ba& a, const Vec3ba& b ) { return _mm_xor_ps(a.m128, b.m128); }
|
||||
__forceinline Vec3ba operator &( const Vec3ba& a, const Vec3ba& b ) { return _mm_and_ps(a.m128, b.m128); }
|
||||
__forceinline Vec3ba operator |( const Vec3ba& a, const Vec3ba& b ) { return _mm_or_ps (a.m128, b.m128); }
|
||||
__forceinline Vec3ba operator ^( const Vec3ba& a, const Vec3ba& b ) { return _mm_xor_ps(a.m128, b.m128); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const Vec3ba operator &=( Vec3ba& a, const Vec3ba& b ) { return a = a & b; }
|
||||
__forceinline const Vec3ba operator |=( Vec3ba& a, const Vec3ba& b ) { return a = a | b; }
|
||||
__forceinline const Vec3ba operator ^=( Vec3ba& a, const Vec3ba& b ) { return a = a ^ b; }
|
||||
__forceinline Vec3ba& operator &=( Vec3ba& a, const Vec3ba& b ) { return a = a & b; }
|
||||
__forceinline Vec3ba& operator |=( Vec3ba& a, const Vec3ba& b ) { return a = a | b; }
|
||||
__forceinline Vec3ba& operator ^=( Vec3ba& a, const Vec3ba& b ) { return a = a ^ b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
|
||||
+54
-37
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -28,7 +28,7 @@ namespace embree
|
||||
|
||||
struct __aligned(16) Vec3fa
|
||||
{
|
||||
ALIGNED_STRUCT;
|
||||
ALIGNED_STRUCT_(16);
|
||||
|
||||
typedef float Scalar;
|
||||
enum { N = 3 };
|
||||
@@ -56,20 +56,27 @@ namespace embree
|
||||
|
||||
__forceinline Vec3fa( const Vec3fa& other, const int a1) { m128 = other.m128; a = a1; }
|
||||
__forceinline Vec3fa( const Vec3fa& other, const unsigned a1) { m128 = other.m128; u = a1; }
|
||||
__forceinline Vec3fa( const Vec3fa& other, const float w1) { m128 = other.m128; w = w1; }
|
||||
__forceinline Vec3fa( const Vec3fa& other, const float w1) {
|
||||
#if defined (__SSE4_1__)
|
||||
m128 = _mm_insert_ps(other.m128, _mm_set_ss(w1),3 << 4);
|
||||
#else
|
||||
const vint4 mask(-1,-1,-1,0);
|
||||
m128 = select(vboolf4(_mm_castsi128_ps(mask)),vfloat4(other.m128),vfloat4(w1));
|
||||
#endif
|
||||
}
|
||||
//__forceinline Vec3fa( const float x, const float y, const float z, const int a) : x(x), y(y), z(z), a(a) {} // not working properly!
|
||||
//__forceinline Vec3fa( const float x, const float y, const float z, const unsigned a) : x(x), y(y), z(z), u(a) {} // not working properly!
|
||||
__forceinline Vec3fa( const float x, const float y, const float z, const float w) : m128(_mm_set_ps(w, z, y, x)) {}
|
||||
|
||||
__forceinline explicit Vec3fa( const __m128i a ) : m128(_mm_cvtepi32_ps(a)) {}
|
||||
|
||||
__forceinline operator const __m128&( void ) const { return m128; }
|
||||
__forceinline operator __m128&( void ) { return m128; }
|
||||
__forceinline operator const __m128&() const { return m128; }
|
||||
__forceinline operator __m128&() { return m128; }
|
||||
|
||||
#if defined (__SSE4_1__)
|
||||
friend __forceinline const Vec3fa copy_a( const Vec3fa& a, const Vec3fa& b ) { return _mm_insert_ps(a, b, (3 << 4) | (3 << 6)); }
|
||||
friend __forceinline Vec3fa copy_a( const Vec3fa& a, const Vec3fa& b ) { return _mm_insert_ps(a, b, (3 << 4) | (3 << 6)); }
|
||||
#else
|
||||
friend __forceinline const Vec3fa copy_a( const Vec3fa& a, const Vec3fa& b ) { Vec3fa c = a; c.a = b.a; return c; }
|
||||
friend __forceinline Vec3fa copy_a( const Vec3fa& a, const Vec3fa& b ) { Vec3fa c = a; c.a = b.a; return c; }
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -81,7 +88,7 @@ namespace embree
|
||||
}
|
||||
|
||||
static __forceinline Vec3fa loadu( const void* const a ) {
|
||||
return Vec3fa(_mm_and_ps(_mm_loadu_ps((float*)a),_mm_castsi128_ps(_mm_set_epi32(0, -1, -1, -1))));
|
||||
return Vec3fa(_mm_loadu_ps((float*)a));
|
||||
}
|
||||
|
||||
static __forceinline void storeu ( void* ptr, const Vec3fa& v ) {
|
||||
@@ -109,20 +116,20 @@ namespace embree
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const Vec3fa operator +( const Vec3fa& a ) { return a; }
|
||||
__forceinline const Vec3fa operator -( const Vec3fa& a ) {
|
||||
__forceinline Vec3fa operator +( const Vec3fa& a ) { return a; }
|
||||
__forceinline Vec3fa operator -( const Vec3fa& a ) {
|
||||
const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x80000000));
|
||||
return _mm_xor_ps(a.m128, mask);
|
||||
}
|
||||
__forceinline const Vec3fa abs ( const Vec3fa& a ) {
|
||||
__forceinline Vec3fa abs ( const Vec3fa& a ) {
|
||||
const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff));
|
||||
return _mm_and_ps(a.m128, mask);
|
||||
}
|
||||
__forceinline const Vec3fa sign ( const Vec3fa& a ) {
|
||||
__forceinline Vec3fa sign ( const Vec3fa& a ) {
|
||||
return blendv_ps(Vec3fa(one), -Vec3fa(one), _mm_cmplt_ps (a,Vec3fa(zero)));
|
||||
}
|
||||
|
||||
__forceinline const Vec3fa rcp ( const Vec3fa& a )
|
||||
__forceinline Vec3fa rcp ( const Vec3fa& a )
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
const Vec3fa r = _mm_rcp14_ps(a.m128);
|
||||
@@ -140,10 +147,10 @@ namespace embree
|
||||
return res;
|
||||
}
|
||||
|
||||
__forceinline const Vec3fa sqrt ( const Vec3fa& a ) { return _mm_sqrt_ps(a.m128); }
|
||||
__forceinline const Vec3fa sqr ( const Vec3fa& a ) { return _mm_mul_ps(a,a); }
|
||||
__forceinline Vec3fa sqrt ( const Vec3fa& a ) { return _mm_sqrt_ps(a.m128); }
|
||||
__forceinline Vec3fa sqr ( const Vec3fa& a ) { return _mm_mul_ps(a,a); }
|
||||
|
||||
__forceinline const Vec3fa rsqrt( const Vec3fa& a )
|
||||
__forceinline Vec3fa rsqrt( const Vec3fa& a )
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
__m128 r = _mm_rsqrt14_ps(a.m128);
|
||||
@@ -153,10 +160,10 @@ namespace embree
|
||||
return _mm_add_ps(_mm_mul_ps(_mm_set1_ps(1.5f),r), _mm_mul_ps(_mm_mul_ps(_mm_mul_ps(a, _mm_set1_ps(-0.5f)), r), _mm_mul_ps(r, r)));
|
||||
}
|
||||
|
||||
__forceinline const Vec3fa zero_fix(const Vec3fa& a) {
|
||||
__forceinline Vec3fa zero_fix(const Vec3fa& a) {
|
||||
return blendv_ps(a, _mm_set1_ps(min_rcp_input), _mm_cmplt_ps (abs(a).m128, _mm_set1_ps(min_rcp_input)));
|
||||
}
|
||||
__forceinline const Vec3fa rcp_safe(const Vec3fa& a) {
|
||||
__forceinline Vec3fa rcp_safe(const Vec3fa& a) {
|
||||
return rcp(zero_fix(a));
|
||||
}
|
||||
__forceinline Vec3fa log ( const Vec3fa& a ) {
|
||||
@@ -171,17 +178,17 @@ namespace embree
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const Vec3fa operator +( const Vec3fa& a, const Vec3fa& b ) { return _mm_add_ps(a.m128, b.m128); }
|
||||
__forceinline const Vec3fa operator -( const Vec3fa& a, const Vec3fa& b ) { return _mm_sub_ps(a.m128, b.m128); }
|
||||
__forceinline const Vec3fa operator *( const Vec3fa& a, const Vec3fa& b ) { return _mm_mul_ps(a.m128, b.m128); }
|
||||
__forceinline const Vec3fa operator *( const Vec3fa& a, const float b ) { return a * Vec3fa(b); }
|
||||
__forceinline const Vec3fa operator *( const float a, const Vec3fa& b ) { return Vec3fa(a) * b; }
|
||||
__forceinline const Vec3fa operator /( const Vec3fa& a, const Vec3fa& b ) { return _mm_div_ps(a.m128,b.m128); }
|
||||
__forceinline const Vec3fa operator /( const Vec3fa& a, const float b ) { return _mm_div_ps(a.m128,_mm_set1_ps(b)); }
|
||||
__forceinline const Vec3fa operator /( const float a, const Vec3fa& b ) { return _mm_div_ps(_mm_set1_ps(a),b.m128); }
|
||||
__forceinline Vec3fa operator +( const Vec3fa& a, const Vec3fa& b ) { return _mm_add_ps(a.m128, b.m128); }
|
||||
__forceinline Vec3fa operator -( const Vec3fa& a, const Vec3fa& b ) { return _mm_sub_ps(a.m128, b.m128); }
|
||||
__forceinline Vec3fa operator *( const Vec3fa& a, const Vec3fa& b ) { return _mm_mul_ps(a.m128, b.m128); }
|
||||
__forceinline Vec3fa operator *( const Vec3fa& a, const float b ) { return a * Vec3fa(b); }
|
||||
__forceinline Vec3fa operator *( const float a, const Vec3fa& b ) { return Vec3fa(a) * b; }
|
||||
__forceinline Vec3fa operator /( const Vec3fa& a, const Vec3fa& b ) { return _mm_div_ps(a.m128,b.m128); }
|
||||
__forceinline Vec3fa operator /( const Vec3fa& a, const float b ) { return _mm_div_ps(a.m128,_mm_set1_ps(b)); }
|
||||
__forceinline Vec3fa operator /( const float a, const Vec3fa& b ) { return _mm_div_ps(_mm_set1_ps(a),b.m128); }
|
||||
|
||||
__forceinline const Vec3fa min( const Vec3fa& a, const Vec3fa& b ) { return _mm_min_ps(a.m128,b.m128); }
|
||||
__forceinline const Vec3fa max( const Vec3fa& a, const Vec3fa& b ) { return _mm_max_ps(a.m128,b.m128); }
|
||||
__forceinline Vec3fa min( const Vec3fa& a, const Vec3fa& b ) { return _mm_min_ps(a.m128,b.m128); }
|
||||
__forceinline Vec3fa max( const Vec3fa& a, const Vec3fa& b ) { return _mm_max_ps(a.m128,b.m128); }
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
__forceinline Vec3fa mini(const Vec3fa& a, const Vec3fa& b) {
|
||||
@@ -241,7 +248,13 @@ namespace embree
|
||||
/// Reductions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline float reduce_add(const Vec3fa& v) { return v.x+v.y+v.z; }
|
||||
__forceinline float reduce_add(const Vec3fa& v) {
|
||||
const vfloat4 a(v);
|
||||
const vfloat4 b = shuffle<1>(a);
|
||||
const vfloat4 c = shuffle<2>(a);
|
||||
return _mm_cvtss_f32(a+b+c);
|
||||
}
|
||||
|
||||
__forceinline float reduce_mul(const Vec3fa& v) { return v.x*v.y*v.z; }
|
||||
__forceinline float reduce_min(const Vec3fa& v) { return min(v.x,v.y,v.z); }
|
||||
__forceinline float reduce_max(const Vec3fa& v) { return max(v.x,v.y,v.z); }
|
||||
@@ -316,15 +329,19 @@ namespace embree
|
||||
/// Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const Vec3fa select( bool s, const Vec3fa& t, const Vec3fa& f ) {
|
||||
__forceinline Vec3fa select( bool s, const Vec3fa& t, const Vec3fa& f ) {
|
||||
__m128 mask = s ? _mm_castsi128_ps(_mm_cmpeq_epi32(_mm_setzero_si128(), _mm_setzero_si128())) : _mm_setzero_ps();
|
||||
return blendv_ps(f, t, mask);
|
||||
}
|
||||
|
||||
__forceinline const Vec3fa select( const Vec3ba& s, const Vec3fa& t, const Vec3fa& f ) {
|
||||
__forceinline Vec3fa select( const Vec3ba& s, const Vec3fa& t, const Vec3fa& f ) {
|
||||
return blendv_ps(f, t, s);
|
||||
}
|
||||
|
||||
__forceinline Vec3fa lerp(const Vec3fa& v0, const Vec3fa& v1, const float t) {
|
||||
return madd(1.0f-t,v0,t*v1);
|
||||
}
|
||||
|
||||
__forceinline int maxDim ( const Vec3fa& a )
|
||||
{
|
||||
const Vec3fa b = abs(a);
|
||||
@@ -340,13 +357,13 @@ namespace embree
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined (__SSE4_1__)
|
||||
//__forceinline const Vec3fa trunc( const Vec3fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEAREST_INT); }
|
||||
__forceinline const Vec3fa floor( const Vec3fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
|
||||
__forceinline const Vec3fa ceil ( const Vec3fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_POS_INF ); }
|
||||
__forceinline Vec3fa trunc( const Vec3fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEAREST_INT); }
|
||||
__forceinline Vec3fa floor( const Vec3fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
|
||||
__forceinline Vec3fa ceil ( const Vec3fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_POS_INF ); }
|
||||
#else
|
||||
//__forceinline const Vec3fa trunc( const Vec3fa& a ) { return Vec3fa(truncf(a.x),truncf(a.y),truncf(a.z)); }
|
||||
__forceinline const Vec3fa floor( const Vec3fa& a ) { return Vec3fa(floorf(a.x),floorf(a.y),floorf(a.z)); }
|
||||
__forceinline const Vec3fa ceil ( const Vec3fa& a ) { return Vec3fa(ceilf (a.x),ceilf (a.y),ceilf (a.z)); }
|
||||
__forceinline Vec3fa trunc( const Vec3fa& a ) { return Vec3fa(truncf(a.x),truncf(a.y),truncf(a.z)); }
|
||||
__forceinline Vec3fa floor( const Vec3fa& a ) { return Vec3fa(floorf(a.x),floorf(a.y),floorf(a.z)); }
|
||||
__forceinline Vec3fa ceil ( const Vec3fa& a ) { return Vec3fa(ceilf (a.x),ceilf (a.y),ceilf (a.z)); }
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+35
-35
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -28,7 +28,7 @@ namespace embree
|
||||
|
||||
struct __aligned(16) Vec3ia
|
||||
{
|
||||
ALIGNED_STRUCT;
|
||||
ALIGNED_STRUCT_(16);
|
||||
|
||||
union {
|
||||
__m128i m128;
|
||||
@@ -51,8 +51,8 @@ namespace embree
|
||||
__forceinline Vec3ia( const int x, const int y, const int z) : m128(_mm_set_epi32(z, z, y, x)) {}
|
||||
__forceinline explicit Vec3ia( const __m128 a ) : m128(_mm_cvtps_epi32(a)) {}
|
||||
|
||||
__forceinline operator const __m128i&( void ) const { return m128; }
|
||||
__forceinline operator __m128i&( void ) { return m128; }
|
||||
__forceinline operator const __m128i&() const { return m128; }
|
||||
__forceinline operator __m128i&() { return m128; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constants
|
||||
@@ -76,48 +76,48 @@ namespace embree
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const Vec3ia operator +( const Vec3ia& a ) { return a; }
|
||||
__forceinline const Vec3ia operator -( const Vec3ia& a ) { return _mm_sub_epi32(_mm_setzero_si128(), a.m128); }
|
||||
__forceinline Vec3ia operator +( const Vec3ia& a ) { return a; }
|
||||
__forceinline Vec3ia operator -( const Vec3ia& a ) { return _mm_sub_epi32(_mm_setzero_si128(), a.m128); }
|
||||
#if defined(__SSSE3__)
|
||||
__forceinline const Vec3ia abs ( const Vec3ia& a ) { return _mm_abs_epi32(a.m128); }
|
||||
__forceinline Vec3ia abs ( const Vec3ia& a ) { return _mm_abs_epi32(a.m128); }
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const Vec3ia operator +( const Vec3ia& a, const Vec3ia& b ) { return _mm_add_epi32(a.m128, b.m128); }
|
||||
__forceinline const Vec3ia operator +( const Vec3ia& a, const int b ) { return a+Vec3ia(b); }
|
||||
__forceinline const Vec3ia operator +( const int a, const Vec3ia& b ) { return Vec3ia(a)+b; }
|
||||
__forceinline Vec3ia operator +( const Vec3ia& a, const Vec3ia& b ) { return _mm_add_epi32(a.m128, b.m128); }
|
||||
__forceinline Vec3ia operator +( const Vec3ia& a, const int b ) { return a+Vec3ia(b); }
|
||||
__forceinline Vec3ia operator +( const int a, const Vec3ia& b ) { return Vec3ia(a)+b; }
|
||||
|
||||
__forceinline const Vec3ia operator -( const Vec3ia& a, const Vec3ia& b ) { return _mm_sub_epi32(a.m128, b.m128); }
|
||||
__forceinline const Vec3ia operator -( const Vec3ia& a, const int b ) { return a-Vec3ia(b); }
|
||||
__forceinline const Vec3ia operator -( const int a, const Vec3ia& b ) { return Vec3ia(a)-b; }
|
||||
__forceinline Vec3ia operator -( const Vec3ia& a, const Vec3ia& b ) { return _mm_sub_epi32(a.m128, b.m128); }
|
||||
__forceinline Vec3ia operator -( const Vec3ia& a, const int b ) { return a-Vec3ia(b); }
|
||||
__forceinline Vec3ia operator -( const int a, const Vec3ia& b ) { return Vec3ia(a)-b; }
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
__forceinline const Vec3ia operator *( const Vec3ia& a, const Vec3ia& b ) { return _mm_mullo_epi32(a.m128, b.m128); }
|
||||
__forceinline const Vec3ia operator *( const Vec3ia& a, const int b ) { return a * Vec3ia(b); }
|
||||
__forceinline const Vec3ia operator *( const int a, const Vec3ia& b ) { return Vec3ia(a) * b; }
|
||||
__forceinline Vec3ia operator *( const Vec3ia& a, const Vec3ia& b ) { return _mm_mullo_epi32(a.m128, b.m128); }
|
||||
__forceinline Vec3ia operator *( const Vec3ia& a, const int b ) { return a * Vec3ia(b); }
|
||||
__forceinline Vec3ia operator *( const int a, const Vec3ia& b ) { return Vec3ia(a) * b; }
|
||||
#endif
|
||||
|
||||
__forceinline const Vec3ia operator &( const Vec3ia& a, const Vec3ia& b ) { return _mm_and_si128(a.m128, b.m128); }
|
||||
__forceinline const Vec3ia operator &( const Vec3ia& a, const int b ) { return a & Vec3ia(b); }
|
||||
__forceinline const Vec3ia operator &( const int a, const Vec3ia& b ) { return Vec3ia(a) & b; }
|
||||
__forceinline Vec3ia operator &( const Vec3ia& a, const Vec3ia& b ) { return _mm_and_si128(a.m128, b.m128); }
|
||||
__forceinline Vec3ia operator &( const Vec3ia& a, const int b ) { return a & Vec3ia(b); }
|
||||
__forceinline Vec3ia operator &( const int a, const Vec3ia& b ) { return Vec3ia(a) & b; }
|
||||
|
||||
__forceinline const Vec3ia operator |( const Vec3ia& a, const Vec3ia& b ) { return _mm_or_si128(a.m128, b.m128); }
|
||||
__forceinline const Vec3ia operator |( const Vec3ia& a, const int b ) { return a | Vec3ia(b); }
|
||||
__forceinline const Vec3ia operator |( const int a, const Vec3ia& b ) { return Vec3ia(a) | b; }
|
||||
__forceinline Vec3ia operator |( const Vec3ia& a, const Vec3ia& b ) { return _mm_or_si128(a.m128, b.m128); }
|
||||
__forceinline Vec3ia operator |( const Vec3ia& a, const int b ) { return a | Vec3ia(b); }
|
||||
__forceinline Vec3ia operator |( const int a, const Vec3ia& b ) { return Vec3ia(a) | b; }
|
||||
|
||||
__forceinline const Vec3ia operator ^( const Vec3ia& a, const Vec3ia& b ) { return _mm_xor_si128(a.m128, b.m128); }
|
||||
__forceinline const Vec3ia operator ^( const Vec3ia& a, const int b ) { return a ^ Vec3ia(b); }
|
||||
__forceinline const Vec3ia operator ^( const int a, const Vec3ia& b ) { return Vec3ia(a) ^ b; }
|
||||
__forceinline Vec3ia operator ^( const Vec3ia& a, const Vec3ia& b ) { return _mm_xor_si128(a.m128, b.m128); }
|
||||
__forceinline Vec3ia operator ^( const Vec3ia& a, const int b ) { return a ^ Vec3ia(b); }
|
||||
__forceinline Vec3ia operator ^( const int a, const Vec3ia& b ) { return Vec3ia(a) ^ b; }
|
||||
|
||||
__forceinline const Vec3ia operator <<( const Vec3ia& a, const int n ) { return _mm_slli_epi32(a.m128, n); }
|
||||
__forceinline const Vec3ia operator >>( const Vec3ia& a, const int n ) { return _mm_srai_epi32(a.m128, n); }
|
||||
__forceinline Vec3ia operator <<( const Vec3ia& a, const int n ) { return _mm_slli_epi32(a.m128, n); }
|
||||
__forceinline Vec3ia operator >>( const Vec3ia& a, const int n ) { return _mm_srai_epi32(a.m128, n); }
|
||||
|
||||
__forceinline const Vec3ia sll ( const Vec3ia& a, const int b ) { return _mm_slli_epi32(a.m128, b); }
|
||||
__forceinline const Vec3ia sra ( const Vec3ia& a, const int b ) { return _mm_srai_epi32(a.m128, b); }
|
||||
__forceinline const Vec3ia srl ( const Vec3ia& a, const int b ) { return _mm_srli_epi32(a.m128, b); }
|
||||
__forceinline Vec3ia sll ( const Vec3ia& a, const int b ) { return _mm_slli_epi32(a.m128, b); }
|
||||
__forceinline Vec3ia sra ( const Vec3ia& a, const int b ) { return _mm_srai_epi32(a.m128, b); }
|
||||
__forceinline Vec3ia srl ( const Vec3ia& a, const int b ) { return _mm_srli_epi32(a.m128, b); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
@@ -173,7 +173,7 @@ namespace embree
|
||||
/// Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const Vec3ia select( const Vec3ba& m, const Vec3ia& t, const Vec3ia& f ) {
|
||||
__forceinline Vec3ia select( const Vec3ba& m, const Vec3ia& t, const Vec3ia& f ) {
|
||||
#if defined(__SSE4_1__)
|
||||
return _mm_castps_si128(_mm_blendv_ps(_mm_castsi128_ps(f), _mm_castsi128_ps(t), m));
|
||||
#else
|
||||
@@ -182,11 +182,11 @@ namespace embree
|
||||
}
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
__forceinline const Vec3ia min( const Vec3ia& a, const Vec3ia& b ) { return _mm_min_epi32(a.m128,b.m128); }
|
||||
__forceinline const Vec3ia max( const Vec3ia& a, const Vec3ia& b ) { return _mm_max_epi32(a.m128,b.m128); }
|
||||
__forceinline Vec3ia min( const Vec3ia& a, const Vec3ia& b ) { return _mm_min_epi32(a.m128,b.m128); }
|
||||
__forceinline Vec3ia max( const Vec3ia& a, const Vec3ia& b ) { return _mm_max_epi32(a.m128,b.m128); }
|
||||
#else
|
||||
__forceinline const Vec3ia min( const Vec3ia& a, const Vec3ia& b ) { return select(lt_mask(a,b),a,b); }
|
||||
__forceinline const Vec3ia max( const Vec3ia& a, const Vec3ia& b ) { return select(gt_mask(a,b),a,b); }
|
||||
__forceinline Vec3ia min( const Vec3ia& a, const Vec3ia& b ) { return select(lt_mask(a,b),a,b); }
|
||||
__forceinline Vec3ia max( const Vec3ia& a, const Vec3ia& b ) { return select(gt_mask(a,b),a,b); }
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+9
-9
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -99,15 +99,15 @@ namespace embree
|
||||
/// Ternary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<typename T> __forceinline const Vec4<T> madd ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( madd(a.x,b.x,c.x), madd(a.y,b.y,c.y), madd(a.z,b.z,c.z), madd(a.w,b.w,c.w)); }
|
||||
template<typename T> __forceinline const Vec4<T> msub ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( msub(a.x,b.x,c.x), msub(a.y,b.y,c.y), msub(a.z,b.z,c.z), msub(a.w,b.w,c.w)); }
|
||||
template<typename T> __forceinline const Vec4<T> nmadd ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmadd(a.x,b.x,c.x),nmadd(a.y,b.y,c.y),nmadd(a.z,b.z,c.z),nmadd(a.w,b.w,c.w)); }
|
||||
template<typename T> __forceinline const Vec4<T> nmsub ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmsub(a.x,b.x,c.x),nmsub(a.y,b.y,c.y),nmsub(a.z,b.z,c.z),nmsub(a.w,b.w,c.w)); }
|
||||
template<typename T> __forceinline Vec4<T> madd ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( madd(a.x,b.x,c.x), madd(a.y,b.y,c.y), madd(a.z,b.z,c.z), madd(a.w,b.w,c.w)); }
|
||||
template<typename T> __forceinline Vec4<T> msub ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( msub(a.x,b.x,c.x), msub(a.y,b.y,c.y), msub(a.z,b.z,c.z), msub(a.w,b.w,c.w)); }
|
||||
template<typename T> __forceinline Vec4<T> nmadd ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmadd(a.x,b.x,c.x),nmadd(a.y,b.y,c.y),nmadd(a.z,b.z,c.z),nmadd(a.w,b.w,c.w)); }
|
||||
template<typename T> __forceinline Vec4<T> nmsub ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmsub(a.x,b.x,c.x),nmsub(a.y,b.y,c.y),nmsub(a.z,b.z,c.z),nmsub(a.w,b.w,c.w)); }
|
||||
|
||||
template<typename T> __forceinline const Vec4<T> madd ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( madd(a,b.x,c.x), madd(a,b.y,c.y), madd(a,b.z,c.z), madd(a,b.w,c.w)); }
|
||||
template<typename T> __forceinline const Vec4<T> msub ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( msub(a,b.x,c.x), msub(a,b.y,c.y), msub(a,b.z,c.z), msub(a,b.w,c.w)); }
|
||||
template<typename T> __forceinline const Vec4<T> nmadd ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmadd(a,b.x,c.x),nmadd(a,b.y,c.y),nmadd(a,b.z,c.z),nmadd(a,b.w,c.w)); }
|
||||
template<typename T> __forceinline const Vec4<T> nmsub ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmsub(a,b.x,c.x),nmsub(a,b.y,c.y),nmsub(a,b.z,c.z),nmsub(a,b.w,c.w)); }
|
||||
template<typename T> __forceinline Vec4<T> madd ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( madd(a,b.x,c.x), madd(a,b.y,c.y), madd(a,b.z,c.z), madd(a,b.w,c.w)); }
|
||||
template<typename T> __forceinline Vec4<T> msub ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( msub(a,b.x,c.x), msub(a,b.y,c.y), msub(a,b.z,c.z), msub(a,b.w,c.w)); }
|
||||
template<typename T> __forceinline Vec4<T> nmadd ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmadd(a,b.x,c.x),nmadd(a,b.y,c.y),nmadd(a,b.z,c.z),nmadd(a,b.w,c.w)); }
|
||||
template<typename T> __forceinline Vec4<T> nmsub ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmsub(a,b.x,c.x),nmsub(a,b.y,c.y),nmsub(a,b.z,c.z),nmsub(a,b.w,c.w)); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## ======================================================================== ##
|
||||
## Copyright 2009-2017 Intel Corporation ##
|
||||
## Copyright 2009-2018 Intel Corporation ##
|
||||
## ##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
||||
## you may not use this file except in compliance with the License. ##
|
||||
@@ -16,4 +16,9 @@
|
||||
|
||||
ADD_LIBRARY(simd STATIC sse.cpp)
|
||||
SET_PROPERTY(TARGET simd PROPERTY FOLDER common)
|
||||
SET_PROPERTY(TARGET simd APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
|
||||
|
||||
IF (EMBREE_STATIC_LIB)
|
||||
INSTALL(TARGETS simd ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel)
|
||||
SIGN_TARGET(simd)
|
||||
ENDIF()
|
||||
+3
-1
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -28,11 +28,13 @@
|
||||
|
||||
#if defined(__AVX2__)
|
||||
#include "vint8_avx2.h"
|
||||
#include "vuint8_avx2.h"
|
||||
#if defined(__X86_64__)
|
||||
#include "vllong4_avx2.h"
|
||||
#endif
|
||||
#else
|
||||
#include "vint8_avx.h"
|
||||
#include "vuint8_avx.h"
|
||||
#endif
|
||||
#include "vfloat8_avx.h"
|
||||
#if defined(__X86_64__)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -23,9 +23,9 @@
|
||||
|
||||
#include "vboolf16_avx512.h"
|
||||
#include "vint16_avx512.h"
|
||||
#include "vuint16_avx512.h"
|
||||
#include "vfloat16_avx512.h"
|
||||
|
||||
#include "vuint16_avx512.h"
|
||||
#include "vboold8_avx512.h"
|
||||
#include "vllong8_avx512.h"
|
||||
#include "vdouble8_avx512.h"
|
||||
|
||||
+41
-25
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -33,49 +33,65 @@
|
||||
# include "avx512.h"
|
||||
#endif
|
||||
|
||||
#if defined(__AVX512F__)
|
||||
# define AVX_ZERO_UPPER()
|
||||
#elif defined (__AVX__)
|
||||
# define AVX_ZERO_UPPER() _mm256_zeroupper()
|
||||
#else
|
||||
# define AVX_ZERO_UPPER()
|
||||
#endif
|
||||
|
||||
namespace embree
|
||||
{
|
||||
/* foreach unique */
|
||||
template<typename vbool, typename vint, typename Closure>
|
||||
__forceinline void foreach_unique(const vbool& valid0, const vint& vi, const Closure& closure)
|
||||
__forceinline void foreach_unique(const vbool& valid0, const vint& vi, const Closure& closure)
|
||||
{
|
||||
vbool valid1 = valid0;
|
||||
while (any(valid1)) {
|
||||
const int j = int(__bsf(movemask(valid1)));
|
||||
const int j = int(bsf(movemask(valid1)));
|
||||
const int i = vi[j];
|
||||
const vbool valid2 = valid1 & (i == vi);
|
||||
valid1 = valid1 & !valid2;
|
||||
closure(valid2,i);
|
||||
valid1 = andn(valid1, valid2);
|
||||
closure(valid2, i);
|
||||
}
|
||||
}
|
||||
|
||||
/* foreach unique */
|
||||
/* returns the next unique value i in vi and the corresponding valid_i mask */
|
||||
template<typename vbool, typename vint>
|
||||
__forceinline int next_unique(vbool& valid, const vint& vi, /*out*/ vbool& valid_i)
|
||||
{
|
||||
assert(any(valid));
|
||||
const int j = int(bsf(movemask(valid)));
|
||||
const int i = vi[j];
|
||||
valid_i = valid & (i == vi);
|
||||
valid = andn(valid, valid_i);
|
||||
return i;
|
||||
}
|
||||
|
||||
/* foreach unique index */
|
||||
template<typename vbool, typename vint, typename Closure>
|
||||
__forceinline void foreach_unique_index(const vbool& valid0, const vint& vi, const Closure& closure)
|
||||
__forceinline void foreach_unique_index(const vbool& valid0, const vint& vi, const Closure& closure)
|
||||
{
|
||||
vbool valid1 = valid0;
|
||||
while (any(valid1)) {
|
||||
const int j = (int) __bsf(movemask(valid1));
|
||||
const int j = int(bsf(movemask(valid1)));
|
||||
const int i = vi[j];
|
||||
const vbool valid2 = valid1 & (i == vi);
|
||||
valid1 = valid1 & !valid2;
|
||||
closure(valid2,i,j);
|
||||
valid1 = andn(valid1, valid2);
|
||||
closure(valid2, i, j);
|
||||
}
|
||||
}
|
||||
|
||||
/* returns the index of the next unique value i in vi and the corresponding valid_i mask */
|
||||
template<typename vbool, typename vint>
|
||||
__forceinline int next_unique_index(vbool& valid, const vint& vi, /*out*/ vbool& valid_i)
|
||||
{
|
||||
assert(any(valid));
|
||||
const int j = int(bsf(movemask(valid)));
|
||||
const int i = vi[j];
|
||||
valid_i = valid & (i == vi);
|
||||
valid = andn(valid, valid_i);
|
||||
return j;
|
||||
}
|
||||
|
||||
template<typename Closure>
|
||||
__forceinline void foreach2(int x0, int x1, int y0, int y1, const Closure& closure)
|
||||
__forceinline void foreach2(int x0, int x1, int y0, int y1, const Closure& closure)
|
||||
{
|
||||
__aligned(64) int U[128];
|
||||
__aligned(64) int V[128];
|
||||
__aligned(64) int U[2*VSIZEX];
|
||||
__aligned(64) int V[2*VSIZEX];
|
||||
int index = 0;
|
||||
for (int y=y0; y<y1; y++) {
|
||||
const bool lasty = y+1>=y1;
|
||||
@@ -83,15 +99,15 @@ namespace embree
|
||||
for (int x=x0; x<x1; ) { //x+=VSIZEX) {
|
||||
const bool lastx = x+VSIZEX >= x1;
|
||||
vintx vx = x+vintx(step);
|
||||
vintx::storeu(&U[index],vx);
|
||||
vintx::storeu(&V[index],vy);
|
||||
vintx::storeu(&U[index], vx);
|
||||
vintx::storeu(&V[index], vy);
|
||||
const int dx = min(x1-x,VSIZEX);
|
||||
index += dx;
|
||||
x += dx;
|
||||
if (index >= VSIZEX || (lastx && lasty)) {
|
||||
const vboolx valid = vintx(step) < vintx(index);
|
||||
closure(valid,vintx::load(U),vintx::load(V));
|
||||
x-= max(0,index-VSIZEX);
|
||||
closure(valid, vintx::load(U), vintx::load(V));
|
||||
x-= max(0, index-VSIZEX);
|
||||
index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
namespace embree
|
||||
{
|
||||
const __m128 _mm_lookupmask_ps[16] = {
|
||||
const __m128 mm_lookupmask_ps[16] = {
|
||||
_mm_castsi128_ps(_mm_set_epi32( 0, 0, 0, 0)),
|
||||
_mm_castsi128_ps(_mm_set_epi32( 0, 0, 0,-1)),
|
||||
_mm_castsi128_ps(_mm_set_epi32( 0, 0,-1, 0)),
|
||||
@@ -37,7 +37,7 @@ namespace embree
|
||||
_mm_castsi128_ps(_mm_set_epi32(-1,-1,-1,-1))
|
||||
};
|
||||
|
||||
const __m128d _mm_lookupmask_pd[4] = {
|
||||
const __m128d mm_lookupmask_pd[4] = {
|
||||
_mm_castsi128_pd(_mm_set_epi32( 0, 0, 0, 0)),
|
||||
_mm_castsi128_pd(_mm_set_epi32( 0, 0,-1,-1)),
|
||||
_mm_castsi128_pd(_mm_set_epi32(-1,-1, 0, 0)),
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -24,17 +24,17 @@
|
||||
namespace embree
|
||||
{
|
||||
#if defined(__SSE4_1__)
|
||||
__forceinline __m128 blendv_ps( __m128 f, __m128 t, __m128 mask ) {
|
||||
__forceinline __m128 blendv_ps(__m128 f, __m128 t, __m128 mask) {
|
||||
return _mm_blendv_ps(f,t,mask);
|
||||
}
|
||||
#else
|
||||
__forceinline __m128 blendv_ps( __m128 f, __m128 t, __m128 mask ) {
|
||||
__forceinline __m128 blendv_ps(__m128 f, __m128 t, __m128 mask) {
|
||||
return _mm_or_ps(_mm_and_ps(mask, t), _mm_andnot_ps(mask, f));
|
||||
}
|
||||
#endif
|
||||
|
||||
extern const __m128 _mm_lookupmask_ps[16];
|
||||
extern const __m128d _mm_lookupmask_pd[4];
|
||||
extern const __m128 mm_lookupmask_ps[16];
|
||||
extern const __m128d mm_lookupmask_pd[4];
|
||||
}
|
||||
|
||||
#if defined(__AVX512VL__)
|
||||
|
||||
+12
-4
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -69,13 +69,19 @@ namespace embree
|
||||
template<int N> using vreal = vfloat<N>;
|
||||
template<int N> using vbool = vboolf<N>;
|
||||
|
||||
/* Maximum supported varying size */
|
||||
#if defined(__AVX512F__)
|
||||
/* Varying size constants */
|
||||
#if defined(__AVX512VL__) // SKX
|
||||
const int VSIZEX = 8; // default size
|
||||
const int VSIZEL = 16; // large size
|
||||
#elif defined(__AVX512F__) // KNL
|
||||
const int VSIZEX = 16;
|
||||
const int VSIZEL = 16;
|
||||
#elif defined(__AVX__)
|
||||
const int VSIZEX = 8;
|
||||
const int VSIZEL = 8;
|
||||
#else
|
||||
const int VSIZEX = 4;
|
||||
const int VSIZEL = 4;
|
||||
#endif
|
||||
|
||||
/* Extends varying size N to optimal or up to max(N, N2) */
|
||||
@@ -109,6 +115,7 @@ namespace embree
|
||||
typedef vdouble<8> vdouble8;
|
||||
typedef vreal<8> vreal8;
|
||||
typedef vint<8> vint8;
|
||||
typedef vuint<8> vuint8;
|
||||
typedef vllong<8> vllong8;
|
||||
typedef vbool<8> vbool8;
|
||||
typedef vboolf<8> vboolf8;
|
||||
@@ -125,11 +132,12 @@ namespace embree
|
||||
typedef vboolf<16> vboolf16;
|
||||
typedef vboold<16> vboold16;
|
||||
|
||||
/* Maximum shortcuts */
|
||||
/* Default shortcuts */
|
||||
typedef vfloat<VSIZEX> vfloatx;
|
||||
typedef vdouble<VSIZEX> vdoublex;
|
||||
typedef vreal<VSIZEX> vrealx;
|
||||
typedef vint<VSIZEX> vintx;
|
||||
typedef vuint<VSIZEX> vuintx;
|
||||
typedef vllong<VSIZEX> vllongx;
|
||||
typedef vbool<VSIZEX> vboolx;
|
||||
typedef vboolf<VSIZEX> vboolfx;
|
||||
|
||||
+49
-45
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -35,18 +35,18 @@ namespace embree
|
||||
/// Constructors, Assignment & Cast Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboold () {}
|
||||
__forceinline vboold ( const vboold4& a ) { v = a.v; }
|
||||
__forceinline vboold4& operator=( const vboold4& a ) { v = a.v; return *this; }
|
||||
__forceinline vboold() {}
|
||||
__forceinline vboold(const vboold4& a) { v = a.v; }
|
||||
__forceinline vboold4& operator =(const vboold4& a) { v = a.v; return *this; }
|
||||
|
||||
__forceinline vboold( const __m256d a ) : v(a) {}
|
||||
__forceinline vboold( const __m256i a ) : v(_mm256_castsi256_pd(a)) {}
|
||||
__forceinline vboold(__m256d a) : v(a) {}
|
||||
__forceinline vboold(__m256i a) : v(_mm256_castsi256_pd(a)) {}
|
||||
|
||||
__forceinline operator const __m256( void ) const { return _mm256_castpd_ps(v); }
|
||||
__forceinline operator const __m256i( void ) const { return _mm256_castpd_si256(v); }
|
||||
__forceinline operator const __m256d( void ) const { return v; }
|
||||
__forceinline operator const __m256() const { return _mm256_castpd_ps(v); }
|
||||
__forceinline operator const __m256i() const { return _mm256_castpd_si256(v); }
|
||||
__forceinline operator const __m256d() const { return v; }
|
||||
|
||||
__forceinline vboold ( const int a )
|
||||
__forceinline vboold(int a)
|
||||
{
|
||||
assert(a >= 0 && a <= 255);
|
||||
#if defined (__AVX2__)
|
||||
@@ -55,54 +55,56 @@ namespace embree
|
||||
const __m256i c = _mm256_and_si256(b,mask);
|
||||
v = _mm256_castsi256_pd(_mm256_cmpeq_epi64(c,mask));
|
||||
#else
|
||||
vl = _mm_lookupmask_pd[a & 0x3];
|
||||
vh = _mm_lookupmask_pd[a >> 2];
|
||||
vl = mm_lookupmask_pd[a & 0x3];
|
||||
vh = mm_lookupmask_pd[a >> 2];
|
||||
#endif
|
||||
}
|
||||
|
||||
__forceinline vboold ( const __m128d a, const __m128d b) : vl(a), vh(b) {}
|
||||
__forceinline vboold(__m128d a, __m128d b) : vl(a), vh(b) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboold( FalseTy ) : v(_mm256_setzero_pd()) {}
|
||||
__forceinline vboold( TrueTy ) : v(_mm256_cmp_pd(_mm256_setzero_pd(), _mm256_setzero_pd(), _CMP_EQ_OQ)) {}
|
||||
__forceinline vboold(FalseTy) : v(_mm256_setzero_pd()) {}
|
||||
__forceinline vboold(TrueTy) : v(_mm256_cmp_pd(_mm256_setzero_pd(), _mm256_setzero_pd(), _CMP_EQ_OQ)) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline bool operator []( const size_t index ) const { assert(index < 4); return (_mm256_movemask_pd(v) >> index) & 1; }
|
||||
__forceinline long long& operator []( const size_t index ) { assert(index < 4); return i[index]; }
|
||||
__forceinline bool operator [](size_t index) const { assert(index < 4); return (_mm256_movemask_pd(v) >> index) & 1; }
|
||||
__forceinline long long& operator [](size_t index) { assert(index < 4); return i[index]; }
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboold4 operator !( const vboold4& a ) { return _mm256_xor_pd(a, vboold4(embree::True)); }
|
||||
__forceinline vboold4 operator !(const vboold4& a) { return _mm256_xor_pd(a, vboold4(embree::True)); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboold4 operator &( const vboold4& a, const vboold4& b ) { return _mm256_and_pd(a, b); }
|
||||
__forceinline const vboold4 operator |( const vboold4& a, const vboold4& b ) { return _mm256_or_pd (a, b); }
|
||||
__forceinline const vboold4 operator ^( const vboold4& a, const vboold4& b ) { return _mm256_xor_pd(a, b); }
|
||||
__forceinline vboold4 operator &(const vboold4& a, const vboold4& b) { return _mm256_and_pd(a, b); }
|
||||
__forceinline vboold4 operator |(const vboold4& a, const vboold4& b) { return _mm256_or_pd (a, b); }
|
||||
__forceinline vboold4 operator ^(const vboold4& a, const vboold4& b) { return _mm256_xor_pd(a, b); }
|
||||
|
||||
__forceinline vboold4 operator &=( vboold4& a, const vboold4& b ) { return a = a & b; }
|
||||
__forceinline vboold4 operator |=( vboold4& a, const vboold4& b ) { return a = a | b; }
|
||||
__forceinline vboold4 operator ^=( vboold4& a, const vboold4& b ) { return a = a ^ b; }
|
||||
__forceinline vboold4 andn(const vboold4& a, const vboold4& b) { return _mm256_andnot_pd(b, a); }
|
||||
|
||||
__forceinline vboold4& operator &=(vboold4& a, const vboold4& b) { return a = a & b; }
|
||||
__forceinline vboold4& operator |=(vboold4& a, const vboold4& b) { return a = a | b; }
|
||||
__forceinline vboold4& operator ^=(vboold4& a, const vboold4& b) { return a = a ^ b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboold4 operator !=( const vboold4& a, const vboold4& b ) { return _mm256_xor_pd(a, b); }
|
||||
__forceinline const vboold4 operator ==( const vboold4& a, const vboold4& b ) { return _mm256_xor_pd(_mm256_xor_pd(a,b),vboold4(embree::True)); }
|
||||
__forceinline vboold4 operator !=(const vboold4& a, const vboold4& b) { return _mm256_xor_pd(a, b); }
|
||||
__forceinline vboold4 operator ==(const vboold4& a, const vboold4& b) { return _mm256_xor_pd(_mm256_xor_pd(a,b),vboold4(embree::True)); }
|
||||
|
||||
__forceinline const vboold4 select( const vboold4& mask, const vboold4& t, const vboold4& f ) {
|
||||
__forceinline vboold4 select(const vboold4& mask, const vboold4& t, const vboold4& f) {
|
||||
return _mm256_blendv_pd(f, t, mask);
|
||||
}
|
||||
|
||||
@@ -110,17 +112,19 @@ namespace embree
|
||||
/// Movement/Shifting/Shuffling Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboold4 unpacklo( const vboold4& a, const vboold4& b ) { return _mm256_unpacklo_pd(a.v, b.v); }
|
||||
__forceinline vboold4 unpackhi( const vboold4& a, const vboold4& b ) { return _mm256_unpackhi_pd(a.v, b.v); }
|
||||
__forceinline vboold4 unpacklo(const vboold4& a, const vboold4& b) { return _mm256_unpacklo_pd(a, b); }
|
||||
__forceinline vboold4 unpackhi(const vboold4& a, const vboold4& b) { return _mm256_unpackhi_pd(a, b); }
|
||||
|
||||
|
||||
#if defined(__AVX2__)
|
||||
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vboold4 shuffle( const vboold4& a ) {
|
||||
return _mm256_permute4x64_pd(a, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vboold4 shuffle(const vboold4& v) {
|
||||
return _mm256_permute4x64_pd(v, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
}
|
||||
|
||||
template<size_t i> __forceinline const vboold4 shuffle( const vboold4& a ) {
|
||||
return _mm256_permute4x64_pd(a, _MM_SHUFFLE(i, i, i, i));
|
||||
template<int i>
|
||||
__forceinline vboold4 shuffle(const vboold4& v) {
|
||||
return _mm256_permute4x64_pd(v, _MM_SHUFFLE(i, i, i, i));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -129,33 +133,33 @@ namespace embree
|
||||
/// Reduction Operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline bool reduce_and( const vboold4& a ) { return _mm256_movemask_pd(a) == (unsigned int)0xf; }
|
||||
__forceinline bool reduce_or ( const vboold4& a ) { return !_mm256_testz_pd(a,a); }
|
||||
__forceinline bool reduce_and(const vboold4& a) { return _mm256_movemask_pd(a) == (unsigned int)0xf; }
|
||||
__forceinline bool reduce_or (const vboold4& a) { return !_mm256_testz_pd(a,a); }
|
||||
|
||||
__forceinline bool all ( const vboold4& a ) { return _mm256_movemask_pd(a) == (unsigned int)0xf; }
|
||||
__forceinline bool any ( const vboold4& a ) { return !_mm256_testz_pd(a,a); }
|
||||
__forceinline bool none ( const vboold4& a ) { return _mm256_testz_pd(a,a) != 0; }
|
||||
__forceinline bool all (const vboold4& a) { return _mm256_movemask_pd(a) == (unsigned int)0xf; }
|
||||
__forceinline bool any (const vboold4& a) { return !_mm256_testz_pd(a,a); }
|
||||
__forceinline bool none(const vboold4& a) { return _mm256_testz_pd(a,a) != 0; }
|
||||
|
||||
__forceinline bool all ( const vboold4& valid, const vboold4& b ) { return all((!valid) | b); }
|
||||
__forceinline bool any ( const vboold4& valid, const vboold4& b ) { return any( valid & b); }
|
||||
__forceinline bool none ( const vboold4& valid, const vboold4& b ) { return none(valid & b); }
|
||||
__forceinline bool all (const vboold4& valid, const vboold4& b) { return all((!valid) | b); }
|
||||
__forceinline bool any (const vboold4& valid, const vboold4& b) { return any(valid & b); }
|
||||
__forceinline bool none(const vboold4& valid, const vboold4& b) { return none(valid & b); }
|
||||
|
||||
__forceinline unsigned int movemask( const vboold4& a ) { return _mm256_movemask_pd(a); }
|
||||
__forceinline size_t popcnt ( const vboold4& a ) { return __popcnt((size_t)_mm256_movemask_pd(a)); }
|
||||
__forceinline unsigned int movemask(const vboold4& a) { return _mm256_movemask_pd(a); }
|
||||
__forceinline size_t popcnt (const vboold4& a) { return popcnt((size_t)_mm256_movemask_pd(a)); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Get/Set Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline bool get(const vboold4& a, size_t index) { return a[index]; }
|
||||
__forceinline void set (vboold4& a, size_t index) { a[index] = -1; }
|
||||
__forceinline void set (vboold4& a, size_t index) { a[index] = -1; }
|
||||
__forceinline void clear(vboold4& a, size_t index) { a[index] = 0; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& cout, const vboold4& a) {
|
||||
inline std::ostream& operator <<(std::ostream& cout, const vboold4& a) {
|
||||
return cout << "<" << a[0] << ", " << a[1] << ", " << a[2] << ", " << a[3] << ", "
|
||||
<< a[4] << ", " << a[5] << ", " << a[6] << ", " << a[7] << ">";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -33,8 +33,8 @@ namespace embree
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboold() {}
|
||||
__forceinline vboold(const vboold4 &t) { v = t.v; }
|
||||
__forceinline vboold4& operator=(const vboold4 &f) { v = f.v; return *this; }
|
||||
__forceinline vboold(const vboold4& t) { v = t.v; }
|
||||
__forceinline vboold4& operator =(const vboold4& f) { v = f.v; return *this; }
|
||||
|
||||
__forceinline vboold(const __mmask8 &t) { v = t; }
|
||||
__forceinline operator __mmask8() const { return v; }
|
||||
@@ -62,42 +62,50 @@ namespace embree
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboold( FalseTy ) : v(0x0) {}
|
||||
__forceinline vboold( TrueTy ) : v(0xf) {}
|
||||
__forceinline vboold(FalseTy) : v(0x0) {}
|
||||
__forceinline vboold(TrueTy) : v(0xf) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline bool operator [](size_t index) const {
|
||||
assert(index < 4); return (mm512_mask2int(v) >> index) & 1;
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboold4 operator!(const vboold4 &a) { return _mm512_kandn(a, 0xf); }
|
||||
__forceinline vboold4 operator !(const vboold4& a) { return _mm512_kandn(a, 0xf); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboold4 operator&(const vboold4 &a, const vboold4 &b) { return _mm512_kand(a, b); }
|
||||
__forceinline vboold4 operator|(const vboold4 &a, const vboold4 &b) { return _mm512_kor(a, b); }
|
||||
__forceinline vboold4 operator^(const vboold4 &a, const vboold4 &b) { return _mm512_kxor(a, b); }
|
||||
__forceinline vboold4 operator &(const vboold4& a, const vboold4& b) { return _mm512_kand(a, b); }
|
||||
__forceinline vboold4 operator |(const vboold4& a, const vboold4& b) { return _mm512_kor(a, b); }
|
||||
__forceinline vboold4 operator ^(const vboold4& a, const vboold4& b) { return _mm512_kxor(a, b); }
|
||||
|
||||
__forceinline vboold4 andn(const vboold4 &a, const vboold4 &b) { return _mm512_kandn(b, a); }
|
||||
__forceinline vboold4 andn(const vboold4& a, const vboold4& b) { return _mm512_kandn(b, a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboold4 operator &=( vboold4& a, const vboold4& b ) { return a = a & b; }
|
||||
__forceinline const vboold4 operator |=( vboold4& a, const vboold4& b ) { return a = a | b; }
|
||||
__forceinline const vboold4 operator ^=( vboold4& a, const vboold4& b ) { return a = a ^ b; }
|
||||
__forceinline vboold4& operator &=(vboold4& a, const vboold4& b) { return a = a & b; }
|
||||
__forceinline vboold4& operator |=(vboold4& a, const vboold4& b) { return a = a | b; }
|
||||
__forceinline vboold4& operator ^=(vboold4& a, const vboold4& b) { return a = a ^ b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboold4 operator !=( const vboold4& a, const vboold4& b ) { return _mm512_kxor(a, b); }
|
||||
__forceinline const vboold4 operator ==( const vboold4& a, const vboold4& b ) { return _mm512_kand(_mm512_kxnor(a, b), 0xf); }
|
||||
__forceinline vboold4 operator !=(const vboold4& a, const vboold4& b) { return _mm512_kxor(a, b); }
|
||||
__forceinline vboold4 operator ==(const vboold4& a, const vboold4& b) { return _mm512_kand(_mm512_kxnor(a, b), 0xf); }
|
||||
|
||||
__forceinline vboold4 select (const vboold4 &s, const vboold4 &a, const vboold4 &b) {
|
||||
__forceinline vboold4 select(const vboold4& s, const vboold4& a, const vboold4& b) {
|
||||
return _mm512_kor(_mm512_kand(s, a), _mm512_kandn(s, b));
|
||||
}
|
||||
|
||||
@@ -105,22 +113,22 @@ namespace embree
|
||||
/// Reduction Operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline int all (const vboold4 &a) { return a.v == 0xf; }
|
||||
__forceinline int any (const vboold4 &a) { return _mm512_kortestz(a, a) == 0; }
|
||||
__forceinline int none(const vboold4 &a) { return _mm512_kortestz(a, a) != 0; }
|
||||
__forceinline int all (const vboold4& a) { return a.v == 0xf; }
|
||||
__forceinline int any (const vboold4& a) { return _mm512_kortestz(a, a) == 0; }
|
||||
__forceinline int none(const vboold4& a) { return _mm512_kortestz(a, a) != 0; }
|
||||
|
||||
__forceinline int all ( const vboold4& valid, const vboold4& b ) { return all((!valid) | b); }
|
||||
__forceinline int any ( const vboold4& valid, const vboold4& b ) { return any( valid & b); }
|
||||
__forceinline int none( const vboold4& valid, const vboold4& b ) { return none(valid & b); }
|
||||
__forceinline int all (const vboold4& valid, const vboold4& b) { return all((!valid) | b); }
|
||||
__forceinline int any (const vboold4& valid, const vboold4& b) { return any(valid & b); }
|
||||
__forceinline int none(const vboold4& valid, const vboold4& b) { return none(valid & b); }
|
||||
|
||||
__forceinline size_t movemask( const vboold4& a ) { return _mm512_kmov(a); }
|
||||
__forceinline size_t popcnt ( const vboold4& a ) { return __popcnt(a.v); }
|
||||
__forceinline size_t movemask(const vboold4& a) { return _mm512_kmov(a); }
|
||||
__forceinline size_t popcnt (const vboold4& a) { return popcnt(a.v); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Conversion Operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline unsigned int toInt(const vboold4 &a) { return mm512_mask2int(a); }
|
||||
__forceinline unsigned int toInt(const vboold4& a) { return mm512_mask2int(a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Get/Set Functions
|
||||
@@ -134,7 +142,7 @@ namespace embree
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& cout, const vboold4& a)
|
||||
inline std::ostream& operator <<(std::ostream& cout, const vboold4& a)
|
||||
{
|
||||
cout << "<";
|
||||
for (size_t i=0; i<4; i++) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -33,10 +33,10 @@ namespace embree
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboold() {}
|
||||
__forceinline vboold(const vboold8 &t) { v = t.v; }
|
||||
__forceinline vboold8& operator=(const vboold8 &f) { v = f.v; return *this; }
|
||||
__forceinline vboold(const vboold8& t) { v = t.v; }
|
||||
__forceinline vboold8& operator =(const vboold8& f) { v = f.v; return *this; }
|
||||
|
||||
__forceinline vboold(const __mmask8 &t) { v = t; }
|
||||
__forceinline vboold(const __mmask8& t) { v = t; }
|
||||
__forceinline operator __mmask8() const { return v; }
|
||||
|
||||
__forceinline vboold(bool b) { v = b ? 0xff : 0x00; }
|
||||
@@ -70,42 +70,50 @@ namespace embree
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboold( FalseTy ) : v(0x00) {}
|
||||
__forceinline vboold( TrueTy ) : v(0xff) {}
|
||||
__forceinline vboold(FalseTy) : v(0x00) {}
|
||||
__forceinline vboold(TrueTy) : v(0xff) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline bool operator [](size_t index) const {
|
||||
assert(index < 8); return (mm512_mask2int(v) >> index) & 1;
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboold8 operator!(const vboold8 &a) { return _mm512_knot(a); }
|
||||
__forceinline vboold8 operator !(const vboold8& a) { return _mm512_knot(a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboold8 operator&(const vboold8 &a, const vboold8 &b) { return _mm512_kand(a, b); }
|
||||
__forceinline vboold8 operator|(const vboold8 &a, const vboold8 &b) { return _mm512_kor(a, b); }
|
||||
__forceinline vboold8 operator^(const vboold8 &a, const vboold8 &b) { return _mm512_kxor(a, b); }
|
||||
__forceinline vboold8 operator &(const vboold8& a, const vboold8& b) { return _mm512_kand(a, b); }
|
||||
__forceinline vboold8 operator |(const vboold8& a, const vboold8& b) { return _mm512_kor(a, b); }
|
||||
__forceinline vboold8 operator ^(const vboold8& a, const vboold8& b) { return _mm512_kxor(a, b); }
|
||||
|
||||
__forceinline vboold8 andn(const vboold8 &a, const vboold8 &b) { return _mm512_kandn(b, a); }
|
||||
__forceinline vboold8 andn(const vboold8& a, const vboold8& b) { return _mm512_kandn(b, a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboold8 operator &=( vboold8& a, const vboold8& b ) { return a = a & b; }
|
||||
__forceinline const vboold8 operator |=( vboold8& a, const vboold8& b ) { return a = a | b; }
|
||||
__forceinline const vboold8 operator ^=( vboold8& a, const vboold8& b ) { return a = a ^ b; }
|
||||
__forceinline vboold8& operator &=(vboold8& a, const vboold8& b) { return a = a & b; }
|
||||
__forceinline vboold8& operator |=(vboold8& a, const vboold8& b) { return a = a | b; }
|
||||
__forceinline vboold8& operator ^=(vboold8& a, const vboold8& b) { return a = a ^ b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboold8 operator !=( const vboold8& a, const vboold8& b ) { return _mm512_kxor(a, b); }
|
||||
__forceinline const vboold8 operator ==( const vboold8& a, const vboold8& b ) { return _mm512_kxnor(a, b); }
|
||||
__forceinline vboold8 operator !=(const vboold8& a, const vboold8& b) { return _mm512_kxor(a, b); }
|
||||
__forceinline vboold8 operator ==(const vboold8& a, const vboold8& b) { return _mm512_kxnor(a, b); }
|
||||
|
||||
__forceinline vboold8 select(const vboold8 &s, const vboold8 &a, const vboold8 &b) {
|
||||
__forceinline vboold8 select(const vboold8& s, const vboold8& a, const vboold8& b) {
|
||||
return _mm512_kor(_mm512_kand(s, a), _mm512_kandn(s, b));
|
||||
}
|
||||
|
||||
@@ -113,22 +121,22 @@ namespace embree
|
||||
/// Reduction Operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline int all (const vboold8 &a) { return a.v == 0xff; }
|
||||
__forceinline int any (const vboold8 &a) { return _mm512_kortestz(a, a) == 0; }
|
||||
__forceinline int none(const vboold8 &a) { return _mm512_kortestz(a, a) != 0; }
|
||||
__forceinline int all (const vboold8& a) { return a.v == 0xff; }
|
||||
__forceinline int any (const vboold8& a) { return _mm512_kortestz(a, a) == 0; }
|
||||
__forceinline int none(const vboold8& a) { return _mm512_kortestz(a, a) != 0; }
|
||||
|
||||
__forceinline int all ( const vboold8& valid, const vboold8& b ) { return all((!valid) | b); }
|
||||
__forceinline int any ( const vboold8& valid, const vboold8& b ) { return any( valid & b); }
|
||||
__forceinline int none( const vboold8& valid, const vboold8& b ) { return none(valid & b); }
|
||||
__forceinline int all (const vboold8& valid, const vboold8& b) { return all((!valid) | b); }
|
||||
__forceinline int any (const vboold8& valid, const vboold8& b) { return any(valid & b); }
|
||||
__forceinline int none(const vboold8& valid, const vboold8& b) { return none(valid & b); }
|
||||
|
||||
__forceinline size_t movemask( const vboold8& a ) { return _mm512_kmov(a); }
|
||||
__forceinline size_t popcnt ( const vboold8& a ) { return __popcnt(a.v); }
|
||||
__forceinline size_t movemask(const vboold8& a) { return _mm512_kmov(a); }
|
||||
__forceinline size_t popcnt (const vboold8& a) { return popcnt(a.v); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Conversion Operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline unsigned int toInt(const vboold8 &a) { return mm512_mask2int(a); }
|
||||
__forceinline unsigned int toInt(const vboold8& a) { return mm512_mask2int(a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Get/Set Functions
|
||||
@@ -142,7 +150,7 @@ namespace embree
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& cout, const vboold8& a)
|
||||
inline std::ostream& operator <<(std::ostream& cout, const vboold8& a)
|
||||
{
|
||||
cout << "<";
|
||||
for (size_t i=0; i<8; i++) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -34,15 +34,15 @@ namespace embree
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf() {}
|
||||
__forceinline vboolf(const vboolf16 &t) { v = t.v; }
|
||||
__forceinline vboolf16& operator=(const vboolf16 &f) { v = f.v; return *this; }
|
||||
__forceinline vboolf(const vboolf16& t) { v = t.v; }
|
||||
__forceinline vboolf16& operator =(const vboolf16& f) { v = f.v; return *this; }
|
||||
|
||||
__forceinline vboolf(const __mmask16 &t) { v = t; }
|
||||
__forceinline operator __mmask16 () const { return v; }
|
||||
__forceinline vboolf(const __mmask16& t) { v = t; }
|
||||
__forceinline operator __mmask16() const { return v; }
|
||||
|
||||
__forceinline vboolf(bool b) { v = b ? 0xFFFF : 0x0000; }
|
||||
__forceinline vboolf(int t ) { v = (__mmask16)t; }
|
||||
__forceinline vboolf(unsigned int t ) { v = (__mmask16)t; }
|
||||
__forceinline vboolf(int t) { v = (__mmask16)t; }
|
||||
__forceinline vboolf(unsigned int t) { v = (__mmask16)t; }
|
||||
|
||||
/* return int8 mask */
|
||||
__forceinline __m128i mask8() const {
|
||||
@@ -71,14 +71,14 @@ namespace embree
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf( FalseTy ) : v(0x0000) {}
|
||||
__forceinline vboolf( TrueTy ) : v(0xffff) {}
|
||||
__forceinline vboolf(FalseTy) : v(0x0000) {}
|
||||
__forceinline vboolf(TrueTy) : v(0xffff) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline bool operator []( const size_t index ) const {
|
||||
__forceinline bool operator [](size_t index) const {
|
||||
assert(index < 16); return (mm512_mask2int(v) >> index) & 1;
|
||||
}
|
||||
};
|
||||
@@ -87,34 +87,34 @@ namespace embree
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf16 operator!(const vboolf16 &a) { return _mm512_knot(a); }
|
||||
__forceinline vboolf16 operator !(const vboolf16& a) { return _mm512_knot(a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf16 operator&(const vboolf16 &a, const vboolf16 &b) { return _mm512_kand(a,b); }
|
||||
__forceinline vboolf16 operator|(const vboolf16 &a, const vboolf16 &b) { return _mm512_kor(a,b); }
|
||||
__forceinline vboolf16 operator^(const vboolf16 &a, const vboolf16 &b) { return _mm512_kxor(a,b); }
|
||||
__forceinline vboolf16 operator &(const vboolf16& a, const vboolf16& b) { return _mm512_kand(a,b); }
|
||||
__forceinline vboolf16 operator |(const vboolf16& a, const vboolf16& b) { return _mm512_kor(a,b); }
|
||||
__forceinline vboolf16 operator ^(const vboolf16& a, const vboolf16& b) { return _mm512_kxor(a,b); }
|
||||
|
||||
__forceinline vboolf16 andn(const vboolf16 &a, const vboolf16 &b) { return _mm512_kandn(b,a); }
|
||||
__forceinline vboolf16 andn(const vboolf16& a, const vboolf16& b) { return _mm512_kandn(b,a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf16 operator &=( vboolf16& a, const vboolf16& b ) { return a = a & b; }
|
||||
__forceinline const vboolf16 operator |=( vboolf16& a, const vboolf16& b ) { return a = a | b; }
|
||||
__forceinline const vboolf16 operator ^=( vboolf16& a, const vboolf16& b ) { return a = a ^ b; }
|
||||
__forceinline vboolf16& operator &=(vboolf16& a, const vboolf16& b) { return a = a & b; }
|
||||
__forceinline vboolf16& operator |=(vboolf16& a, const vboolf16& b) { return a = a | b; }
|
||||
__forceinline vboolf16& operator ^=(vboolf16& a, const vboolf16& b) { return a = a ^ b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf16 operator !=( const vboolf16& a, const vboolf16& b ) { return _mm512_kxor(a, b); }
|
||||
__forceinline const vboolf16 operator ==( const vboolf16& a, const vboolf16& b ) { return _mm512_kxnor(a, b); }
|
||||
__forceinline vboolf16 operator !=(const vboolf16& a, const vboolf16& b) { return _mm512_kxor(a, b); }
|
||||
__forceinline vboolf16 operator ==(const vboolf16& a, const vboolf16& b) { return _mm512_kxnor(a, b); }
|
||||
|
||||
__forceinline vboolf16 select (const vboolf16 &s, const vboolf16 &a, const vboolf16 &b) {
|
||||
__forceinline vboolf16 select(const vboolf16& s, const vboolf16& a, const vboolf16& b) {
|
||||
return _mm512_kor(_mm512_kand(s,a),_mm512_kandn(s,b));
|
||||
}
|
||||
|
||||
@@ -122,23 +122,23 @@ namespace embree
|
||||
/// Reduction Operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline int all (const vboolf16 &a) { return _mm512_kortestc(a,a) != 0; }
|
||||
__forceinline int any (const vboolf16 &a) { return _mm512_kortestz(a,a) == 0; }
|
||||
__forceinline int none(const vboolf16 &a) { return _mm512_kortestz(a,a) != 0; }
|
||||
__forceinline int all (const vboolf16& a) { return _mm512_kortestc(a,a) != 0; }
|
||||
__forceinline int any (const vboolf16& a) { return _mm512_kortestz(a,a) == 0; }
|
||||
__forceinline int none(const vboolf16& a) { return _mm512_kortestz(a,a) != 0; }
|
||||
|
||||
__forceinline int all ( const vboolf16& valid, const vboolf16& b ) { return all((!valid) | b); }
|
||||
__forceinline int any ( const vboolf16& valid, const vboolf16& b ) { return any( valid & b); }
|
||||
__forceinline int none( const vboolf16& valid, const vboolf16& b ) { return none(valid & b); }
|
||||
__forceinline int all (const vboolf16& valid, const vboolf16& b) { return all((!valid) | b); }
|
||||
__forceinline int any (const vboolf16& valid, const vboolf16& b) { return any(valid & b); }
|
||||
__forceinline int none(const vboolf16& valid, const vboolf16& b) { return none(valid & b); }
|
||||
|
||||
__forceinline size_t movemask( const vboolf16& a ) { return _mm512_kmov(a); }
|
||||
__forceinline size_t popcnt ( const vboolf16& a ) { return __popcnt(a.v); }
|
||||
__forceinline size_t movemask(const vboolf16& a) { return _mm512_kmov(a); }
|
||||
__forceinline size_t popcnt (const vboolf16& a) { return popcnt(a.v); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Convertion Operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline unsigned int toInt (const vboolf16 &a) { return mm512_mask2int(a); }
|
||||
__forceinline vboolf16 toMask(const int &a) { return mm512_int2mask(a); }
|
||||
__forceinline unsigned int toInt (const vboolf16& a) { return mm512_mask2int(a); }
|
||||
__forceinline vboolf16 toMask(const int& a) { return mm512_int2mask(a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Get/Set Functions
|
||||
@@ -152,7 +152,7 @@ namespace embree
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& cout, const vboolf16& a)
|
||||
inline std::ostream& operator <<(std::ostream& cout, const vboolf16& a)
|
||||
{
|
||||
cout << "<";
|
||||
for (size_t i=0; i<16; i++) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -33,8 +33,8 @@ namespace embree
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf() {}
|
||||
__forceinline vboolf(const vboolf4 &t) { v = t.v; }
|
||||
__forceinline vboolf4& operator=(const vboolf4 &f) { v = f.v; return *this; }
|
||||
__forceinline vboolf(const vboolf4& t) { v = t.v; }
|
||||
__forceinline vboolf4& operator =(const vboolf4& f) { v = f.v; return *this; }
|
||||
|
||||
__forceinline vboolf(const __mmask8 &t) { v = t; }
|
||||
__forceinline operator __mmask8() const { return v; }
|
||||
@@ -43,6 +43,9 @@ namespace embree
|
||||
__forceinline vboolf(int t) { v = (__mmask8)t; }
|
||||
__forceinline vboolf(unsigned int t) { v = (__mmask8)t; }
|
||||
|
||||
__forceinline vboolf(bool a, bool b, bool c, bool d)
|
||||
: v((__mmask8)((int(d) << 3) | (int(c) << 2) | (int(b) << 1) | int(a))) {}
|
||||
|
||||
/* return int8 mask */
|
||||
__forceinline __m128i mask8() const {
|
||||
return _mm_movm_epi8(v);
|
||||
@@ -62,42 +65,50 @@ namespace embree
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf( FalseTy ) : v(0x0) {}
|
||||
__forceinline vboolf( TrueTy ) : v(0xf) {}
|
||||
__forceinline vboolf(FalseTy) : v(0x0) {}
|
||||
__forceinline vboolf(TrueTy) : v(0xf) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline bool operator [](size_t index) const {
|
||||
assert(index < 4); return (mm512_mask2int(v) >> index) & 1;
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf4 operator!(const vboolf4 &a) { return _mm512_kandn(a, 0xf); }
|
||||
__forceinline vboolf4 operator !(const vboolf4& a) { return _mm512_kandn(a, 0xf); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf4 operator&(const vboolf4 &a, const vboolf4 &b) { return _mm512_kand(a, b); }
|
||||
__forceinline vboolf4 operator|(const vboolf4 &a, const vboolf4 &b) { return _mm512_kor(a, b); }
|
||||
__forceinline vboolf4 operator^(const vboolf4 &a, const vboolf4 &b) { return _mm512_kxor(a, b); }
|
||||
__forceinline vboolf4 operator &(const vboolf4& a, const vboolf4& b) { return _mm512_kand(a, b); }
|
||||
__forceinline vboolf4 operator |(const vboolf4& a, const vboolf4& b) { return _mm512_kor(a, b); }
|
||||
__forceinline vboolf4 operator ^(const vboolf4& a, const vboolf4& b) { return _mm512_kxor(a, b); }
|
||||
|
||||
__forceinline vboolf4 andn(const vboolf4 &a, const vboolf4 &b) { return _mm512_kandn(b, a); }
|
||||
__forceinline vboolf4 andn(const vboolf4& a, const vboolf4& b) { return _mm512_kandn(b, a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf4 operator &=( vboolf4& a, const vboolf4& b ) { return a = a & b; }
|
||||
__forceinline const vboolf4 operator |=( vboolf4& a, const vboolf4& b ) { return a = a | b; }
|
||||
__forceinline const vboolf4 operator ^=( vboolf4& a, const vboolf4& b ) { return a = a ^ b; }
|
||||
__forceinline vboolf4& operator &=(vboolf4& a, const vboolf4& b) { return a = a & b; }
|
||||
__forceinline vboolf4& operator |=(vboolf4& a, const vboolf4& b) { return a = a | b; }
|
||||
__forceinline vboolf4& operator ^=(vboolf4& a, const vboolf4& b) { return a = a ^ b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf4 operator !=( const vboolf4& a, const vboolf4& b ) { return _mm512_kxor(a, b); }
|
||||
__forceinline const vboolf4 operator ==( const vboolf4& a, const vboolf4& b ) { return _mm512_kand(_mm512_kxnor(a, b), 0xf); }
|
||||
__forceinline vboolf4 operator !=(const vboolf4& a, const vboolf4& b) { return _mm512_kxor(a, b); }
|
||||
__forceinline vboolf4 operator ==(const vboolf4& a, const vboolf4& b) { return _mm512_kand(_mm512_kxnor(a, b), 0xf); }
|
||||
|
||||
__forceinline vboolf4 select (const vboolf4 &s, const vboolf4 &a, const vboolf4 &b) {
|
||||
__forceinline vboolf4 select(const vboolf4& s, const vboolf4& a, const vboolf4& b) {
|
||||
return _mm512_kor(_mm512_kand(s, a), _mm512_kandn(s, b));
|
||||
}
|
||||
|
||||
@@ -105,22 +116,22 @@ namespace embree
|
||||
/// Reduction Operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline int all (const vboolf4 &a) { return a.v == 0xf; }
|
||||
__forceinline int any (const vboolf4 &a) { return _mm512_kortestz(a, a) == 0; }
|
||||
__forceinline int none(const vboolf4 &a) { return _mm512_kortestz(a, a) != 0; }
|
||||
__forceinline int all (const vboolf4& a) { return a.v == 0xf; }
|
||||
__forceinline int any (const vboolf4& a) { return _mm512_kortestz(a, a) == 0; }
|
||||
__forceinline int none(const vboolf4& a) { return _mm512_kortestz(a, a) != 0; }
|
||||
|
||||
__forceinline int all ( const vboolf4& valid, const vboolf4& b ) { return all((!valid) | b); }
|
||||
__forceinline int any ( const vboolf4& valid, const vboolf4& b ) { return any( valid & b); }
|
||||
__forceinline int none( const vboolf4& valid, const vboolf4& b ) { return none(valid & b); }
|
||||
__forceinline int all (const vboolf4& valid, const vboolf4& b) { return all((!valid) | b); }
|
||||
__forceinline int any (const vboolf4& valid, const vboolf4& b) { return any(valid & b); }
|
||||
__forceinline int none(const vboolf4& valid, const vboolf4& b) { return none(valid & b); }
|
||||
|
||||
__forceinline size_t movemask( const vboolf4& a ) { return _mm512_kmov(a); }
|
||||
__forceinline size_t popcnt ( const vboolf4& a ) { return __popcnt(a.v); }
|
||||
__forceinline size_t movemask(const vboolf4& a) { return _mm512_kmov(a); }
|
||||
__forceinline size_t popcnt (const vboolf4& a) { return popcnt(a.v); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Conversion Operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline unsigned int toInt(const vboolf4 &a) { return mm512_mask2int(a); }
|
||||
__forceinline unsigned int toInt(const vboolf4& a) { return mm512_mask2int(a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Get/Set Functions
|
||||
@@ -134,7 +145,7 @@ namespace embree
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& cout, const vboolf4& a)
|
||||
inline std::ostream& operator <<(std::ostream& cout, const vboolf4& a)
|
||||
{
|
||||
cout << "<";
|
||||
for (size_t i=0; i<4; i++) {
|
||||
|
||||
+60
-55
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -33,23 +33,23 @@ namespace embree
|
||||
/// Constructors, Assignment & Cast Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf ( ) {}
|
||||
__forceinline vboolf ( const vboolf4& other ) { v = other.v; }
|
||||
__forceinline vboolf4& operator=( const vboolf4& other ) { v = other.v; return *this; }
|
||||
__forceinline vboolf() {}
|
||||
__forceinline vboolf(const vboolf4& other) { v = other.v; }
|
||||
__forceinline vboolf4& operator =(const vboolf4& other) { v = other.v; return *this; }
|
||||
|
||||
__forceinline vboolf( const __m128 input ) : v(input) {}
|
||||
__forceinline operator const __m128&( void ) const { return v; }
|
||||
__forceinline operator const __m128i( void ) const { return _mm_castps_si128(v); }
|
||||
__forceinline operator const __m128d( void ) const { return _mm_castps_pd(v); }
|
||||
__forceinline vboolf(__m128 input) : v(input) {}
|
||||
__forceinline operator const __m128&() const { return v; }
|
||||
__forceinline operator const __m128i() const { return _mm_castps_si128(v); }
|
||||
__forceinline operator const __m128d() const { return _mm_castps_pd(v); }
|
||||
|
||||
__forceinline vboolf( bool a )
|
||||
: v(_mm_lookupmask_ps[(size_t(a) << 3) | (size_t(a) << 2) | (size_t(a) << 1) | size_t(a)]) {}
|
||||
__forceinline vboolf( bool a, bool b )
|
||||
: v(_mm_lookupmask_ps[(size_t(b) << 3) | (size_t(a) << 2) | (size_t(b) << 1) | size_t(a)]) {}
|
||||
__forceinline vboolf( bool a, bool b, bool c, bool d )
|
||||
: v(_mm_lookupmask_ps[(size_t(d) << 3) | (size_t(c) << 2) | (size_t(b) << 1) | size_t(a)]) {}
|
||||
__forceinline vboolf( int mask ) { assert(mask >= 0 && mask < 16); v = _mm_lookupmask_ps[mask]; }
|
||||
__forceinline vboolf( unsigned mask ) { assert(mask >= 0 && mask < 16); v = _mm_lookupmask_ps[mask]; }
|
||||
__forceinline vboolf(bool a)
|
||||
: v(mm_lookupmask_ps[(size_t(a) << 3) | (size_t(a) << 2) | (size_t(a) << 1) | size_t(a)]) {}
|
||||
__forceinline vboolf(bool a, bool b)
|
||||
: v(mm_lookupmask_ps[(size_t(b) << 3) | (size_t(a) << 2) | (size_t(b) << 1) | size_t(a)]) {}
|
||||
__forceinline vboolf(bool a, bool b, bool c, bool d)
|
||||
: v(mm_lookupmask_ps[(size_t(d) << 3) | (size_t(c) << 2) | (size_t(b) << 1) | size_t(a)]) {}
|
||||
__forceinline vboolf(int mask) { assert(mask >= 0 && mask < 16); v = mm_lookupmask_ps[mask]; }
|
||||
__forceinline vboolf(unsigned int mask) { assert(mask < 16); v = mm_lookupmask_ps[mask]; }
|
||||
|
||||
/* return int32 mask */
|
||||
__forceinline __m128i mask32() const {
|
||||
@@ -60,47 +60,49 @@ namespace embree
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf( FalseTy ) : v(_mm_setzero_ps()) {}
|
||||
__forceinline vboolf( TrueTy ) : v(_mm_castsi128_ps(_mm_cmpeq_epi32(_mm_setzero_si128(), _mm_setzero_si128()))) {}
|
||||
__forceinline vboolf(FalseTy) : v(_mm_setzero_ps()) {}
|
||||
__forceinline vboolf(TrueTy) : v(_mm_castsi128_ps(_mm_cmpeq_epi32(_mm_setzero_si128(), _mm_setzero_si128()))) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline bool operator []( const size_t index ) const { assert(index < 4); return (_mm_movemask_ps(v) >> index) & 1; }
|
||||
__forceinline int& operator []( const size_t index ) { assert(index < 4); return i[index]; }
|
||||
__forceinline bool operator [](size_t index) const { assert(index < 4); return (_mm_movemask_ps(v) >> index) & 1; }
|
||||
__forceinline int& operator [](size_t index) { assert(index < 4); return i[index]; }
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf4 operator !( const vboolf4& a ) { return _mm_xor_ps(a, vboolf4(embree::True)); }
|
||||
__forceinline vboolf4 operator !(const vboolf4& a) { return _mm_xor_ps(a, vboolf4(embree::True)); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf4 operator &( const vboolf4& a, const vboolf4& b ) { return _mm_and_ps(a, b); }
|
||||
__forceinline const vboolf4 operator |( const vboolf4& a, const vboolf4& b ) { return _mm_or_ps (a, b); }
|
||||
__forceinline const vboolf4 operator ^( const vboolf4& a, const vboolf4& b ) { return _mm_xor_ps(a, b); }
|
||||
__forceinline vboolf4 operator &(const vboolf4& a, const vboolf4& b) { return _mm_and_ps(a, b); }
|
||||
__forceinline vboolf4 operator |(const vboolf4& a, const vboolf4& b) { return _mm_or_ps (a, b); }
|
||||
__forceinline vboolf4 operator ^(const vboolf4& a, const vboolf4& b) { return _mm_xor_ps(a, b); }
|
||||
|
||||
__forceinline vboolf4 andn(const vboolf4& a, const vboolf4& b) { return _mm_andnot_ps(b, a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf4 operator &=( vboolf4& a, const vboolf4& b ) { return a = a & b; }
|
||||
__forceinline const vboolf4 operator |=( vboolf4& a, const vboolf4& b ) { return a = a | b; }
|
||||
__forceinline const vboolf4 operator ^=( vboolf4& a, const vboolf4& b ) { return a = a ^ b; }
|
||||
__forceinline vboolf4& operator &=(vboolf4& a, const vboolf4& b) { return a = a & b; }
|
||||
__forceinline vboolf4& operator |=(vboolf4& a, const vboolf4& b) { return a = a | b; }
|
||||
__forceinline vboolf4& operator ^=(vboolf4& a, const vboolf4& b) { return a = a ^ b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf4 operator !=( const vboolf4& a, const vboolf4& b ) { return _mm_xor_ps(a, b); }
|
||||
__forceinline const vboolf4 operator ==( const vboolf4& a, const vboolf4& b ) { return _mm_castsi128_ps(_mm_cmpeq_epi32(a, b)); }
|
||||
__forceinline vboolf4 operator !=(const vboolf4& a, const vboolf4& b) { return _mm_xor_ps(a, b); }
|
||||
__forceinline vboolf4 operator ==(const vboolf4& a, const vboolf4& b) { return _mm_castsi128_ps(_mm_cmpeq_epi32(a, b)); }
|
||||
|
||||
__forceinline const vboolf4 select( const vboolf4& m, const vboolf4& t, const vboolf4& f ) {
|
||||
__forceinline vboolf4 select(const vboolf4& m, const vboolf4& t, const vboolf4& f) {
|
||||
#if defined(__SSE4_1__)
|
||||
return _mm_blendv_ps(f, t, m);
|
||||
#else
|
||||
@@ -112,53 +114,56 @@ namespace embree
|
||||
/// Movement/Shifting/Shuffling Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf4 unpacklo( const vboolf4& a, const vboolf4& b ) { return _mm_unpacklo_ps(a, b); }
|
||||
__forceinline const vboolf4 unpackhi( const vboolf4& a, const vboolf4& b ) { return _mm_unpackhi_ps(a, b); }
|
||||
__forceinline vboolf4 unpacklo(const vboolf4& a, const vboolf4& b) { return _mm_unpacklo_ps(a, b); }
|
||||
__forceinline vboolf4 unpackhi(const vboolf4& a, const vboolf4& b) { return _mm_unpackhi_ps(a, b); }
|
||||
|
||||
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vboolf4 shuffle( const vboolf4& a ) {
|
||||
return _mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vboolf4 shuffle(const vboolf4& v) {
|
||||
return _mm_castsi128_ps(_mm_shuffle_epi32(v, _MM_SHUFFLE(i3, i2, i1, i0)));
|
||||
}
|
||||
|
||||
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vboolf4 shuffle( const vboolf4& a, const vboolf4& b ) {
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vboolf4 shuffle(const vboolf4& a, const vboolf4& b) {
|
||||
return _mm_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
}
|
||||
|
||||
template<size_t i0> __forceinline const vboolf4 shuffle( const vboolf4& b ) {
|
||||
return shuffle<i0,i0,i0,i0>(b);
|
||||
template<int i0>
|
||||
__forceinline vboolf4 shuffle(const vboolf4& v) {
|
||||
return shuffle<i0,i0,i0,i0>(v);
|
||||
}
|
||||
|
||||
#if defined(__SSE3__)
|
||||
template<> __forceinline const vboolf4 shuffle<0, 0, 2, 2>( const vboolf4& a ) { return _mm_moveldup_ps(a); }
|
||||
template<> __forceinline const vboolf4 shuffle<1, 1, 3, 3>( const vboolf4& a ) { return _mm_movehdup_ps(a); }
|
||||
template<> __forceinline const vboolf4 shuffle<0, 1, 0, 1>( const vboolf4& a ) { return _mm_castpd_ps(_mm_movedup_pd (a)); }
|
||||
template<> __forceinline vboolf4 shuffle<0, 0, 2, 2>(const vboolf4& v) { return _mm_moveldup_ps(v); }
|
||||
template<> __forceinline vboolf4 shuffle<1, 1, 3, 3>(const vboolf4& v) { return _mm_movehdup_ps(v); }
|
||||
template<> __forceinline vboolf4 shuffle<0, 1, 0, 1>(const vboolf4& v) { return _mm_castpd_ps(_mm_movedup_pd(v)); }
|
||||
#endif
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
template<size_t dst, size_t src, size_t clr> __forceinline const vboolf4 insert( const vboolf4& a, const vboolf4& b ) { return _mm_insert_ps(a, b, (dst << 4) | (src << 6) | clr); }
|
||||
template<size_t dst, size_t src> __forceinline const vboolf4 insert( const vboolf4& a, const vboolf4& b ) { return insert<dst, src, 0>(a, b); }
|
||||
template<size_t dst> __forceinline const vboolf4 insert( const vboolf4& a, const bool b ) { return insert<dst,0>(a, vboolf4(b)); }
|
||||
template<int dst, int src, int clr> __forceinline vboolf4 insert(const vboolf4& a, const vboolf4& b) { return _mm_insert_ps(a, b, (dst << 4) | (src << 6) | clr); }
|
||||
template<int dst, int src> __forceinline vboolf4 insert(const vboolf4& a, const vboolf4& b) { return insert<dst, src, 0>(a, b); }
|
||||
template<int dst> __forceinline vboolf4 insert(const vboolf4& a, const bool b) { return insert<dst, 0>(a, vboolf4(b)); }
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Reduction Operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline bool reduce_and( const vboolf4& a ) { return _mm_movemask_ps(a) == 0xf; }
|
||||
__forceinline bool reduce_or ( const vboolf4& a ) { return _mm_movemask_ps(a) != 0x0; }
|
||||
__forceinline bool reduce_and(const vboolf4& a) { return _mm_movemask_ps(a) == 0xf; }
|
||||
__forceinline bool reduce_or (const vboolf4& a) { return _mm_movemask_ps(a) != 0x0; }
|
||||
|
||||
__forceinline bool all ( const vboolf4& b ) { return _mm_movemask_ps(b) == 0xf; }
|
||||
__forceinline bool any ( const vboolf4& b ) { return _mm_movemask_ps(b) != 0x0; }
|
||||
__forceinline bool none ( const vboolf4& b ) { return _mm_movemask_ps(b) == 0x0; }
|
||||
__forceinline bool all (const vboolf4& b) { return _mm_movemask_ps(b) == 0xf; }
|
||||
__forceinline bool any (const vboolf4& b) { return _mm_movemask_ps(b) != 0x0; }
|
||||
__forceinline bool none(const vboolf4& b) { return _mm_movemask_ps(b) == 0x0; }
|
||||
|
||||
__forceinline bool all ( const vboolf4& valid, const vboolf4& b ) { return all((!valid) | b); }
|
||||
__forceinline bool any ( const vboolf4& valid, const vboolf4& b ) { return any( valid & b); }
|
||||
__forceinline bool none ( const vboolf4& valid, const vboolf4& b ) { return none(valid & b); }
|
||||
__forceinline bool all (const vboolf4& valid, const vboolf4& b) { return all((!valid) | b); }
|
||||
__forceinline bool any (const vboolf4& valid, const vboolf4& b) { return any(valid & b); }
|
||||
__forceinline bool none(const vboolf4& valid, const vboolf4& b) { return none(valid & b); }
|
||||
|
||||
__forceinline size_t movemask( const vboolf4& a ) { return _mm_movemask_ps(a); }
|
||||
__forceinline size_t movemask(const vboolf4& a) { return _mm_movemask_ps(a); }
|
||||
#if defined(__SSE4_2__)
|
||||
__forceinline size_t popcnt( const vboolf4& a ) { return __popcnt((size_t)_mm_movemask_ps(a)); }
|
||||
__forceinline size_t popcnt(const vboolf4& a) { return popcnt((size_t)_mm_movemask_ps(a)); }
|
||||
#else
|
||||
__forceinline size_t popcnt( const vboolf4& a ) { return bool(a[0])+bool(a[1])+bool(a[2])+bool(a[3]); }
|
||||
__forceinline size_t popcnt(const vboolf4& a) { return bool(a[0])+bool(a[1])+bool(a[2])+bool(a[3]); }
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -173,7 +178,7 @@ namespace embree
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& cout, const vboolf4& a) {
|
||||
inline std::ostream& operator <<(std::ostream& cout, const vboolf4& a) {
|
||||
return cout << "<" << a[0] << ", " << a[1] << ", " << a[2] << ", " << a[3] << ">";
|
||||
}
|
||||
}
|
||||
+66
-59
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -37,16 +37,16 @@ namespace embree
|
||||
/// Constructors, Assignment & Cast Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf () {}
|
||||
__forceinline vboolf ( const vboolf8& a ) { v = a.v; }
|
||||
__forceinline vboolf8& operator=( const vboolf8& a ) { v = a.v; return *this; }
|
||||
__forceinline vboolf() {}
|
||||
__forceinline vboolf(const vboolf8& a) { v = a.v; }
|
||||
__forceinline vboolf8& operator =(const vboolf8& a) { v = a.v; return *this; }
|
||||
|
||||
__forceinline vboolf( const __m256 a ) : v(a) {}
|
||||
__forceinline operator const __m256&( void ) const { return v; }
|
||||
__forceinline operator const __m256i( void ) const { return _mm256_castps_si256(v); }
|
||||
__forceinline operator const __m256d( void ) const { return _mm256_castps_pd(v); }
|
||||
__forceinline vboolf(__m256 a) : v(a) {}
|
||||
__forceinline operator const __m256&() const { return v; }
|
||||
__forceinline operator const __m256i() const { return _mm256_castps_si256(v); }
|
||||
__forceinline operator const __m256d() const { return _mm256_castps_pd(v); }
|
||||
|
||||
__forceinline vboolf ( const int a )
|
||||
__forceinline vboolf(int a)
|
||||
{
|
||||
assert(a >= 0 && a <= 255);
|
||||
#if defined (__AVX2__)
|
||||
@@ -55,19 +55,19 @@ namespace embree
|
||||
const __m256i c = _mm256_and_si256(b,mask);
|
||||
v = _mm256_castsi256_ps(_mm256_cmpeq_epi32(c,mask));
|
||||
#else
|
||||
vl = _mm_lookupmask_ps[a & 0xF];
|
||||
vh = _mm_lookupmask_ps[a >> 4];
|
||||
vl = mm_lookupmask_ps[a & 0xF];
|
||||
vh = mm_lookupmask_ps[a >> 4];
|
||||
#endif
|
||||
}
|
||||
|
||||
__forceinline vboolf ( const vboolf4& a ) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),a,1)) {}
|
||||
__forceinline vboolf ( const vboolf4& a, const vboolf4& b) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),b,1)) {}
|
||||
__forceinline vboolf ( const __m128 a, const __m128 b) : vl(a), vh(b) {}
|
||||
__forceinline vboolf(const vboolf4& a) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),a,1)) {}
|
||||
__forceinline vboolf(const vboolf4& a, const vboolf4& b) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),b,1)) {}
|
||||
__forceinline vboolf(__m128 a, __m128 b) : vl(a), vh(b) {}
|
||||
|
||||
__forceinline vboolf ( bool a ) : v(vboolf8(vboolf4(a), vboolf4(a))) {}
|
||||
__forceinline vboolf ( bool a, bool b) : v(vboolf8(vboolf4(a), vboolf4(b))) {}
|
||||
__forceinline vboolf ( bool a, bool b, bool c, bool d) : v(vboolf8(vboolf4(a,b), vboolf4(c,d))) {}
|
||||
__forceinline vboolf ( bool a, bool b, bool c, bool d, bool e, bool f, bool g, bool vh ) : v(vboolf8(vboolf4(a,b,c,d), vboolf4(e,f,g,vh))) {}
|
||||
__forceinline vboolf(bool a) : v(vboolf8(vboolf4(a), vboolf4(a))) {}
|
||||
__forceinline vboolf(bool a, bool b) : v(vboolf8(vboolf4(a), vboolf4(b))) {}
|
||||
__forceinline vboolf(bool a, bool b, bool c, bool d) : v(vboolf8(vboolf4(a,b), vboolf4(c,d))) {}
|
||||
__forceinline vboolf(bool a, bool b, bool c, bool d, bool e, bool f, bool g, bool h) : v(vboolf8(vboolf4(a,b,c,d), vboolf4(e,f,g,h))) {}
|
||||
|
||||
/* return int32 mask */
|
||||
__forceinline __m256i mask32() const {
|
||||
@@ -78,43 +78,45 @@ namespace embree
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf( FalseTy ) : v(_mm256_setzero_ps()) {}
|
||||
__forceinline vboolf( TrueTy ) : v(_mm256_cmp_ps(_mm256_setzero_ps(), _mm256_setzero_ps(), _CMP_EQ_OQ)) {}
|
||||
__forceinline vboolf(FalseTy) : v(_mm256_setzero_ps()) {}
|
||||
__forceinline vboolf(TrueTy) : v(_mm256_cmp_ps(_mm256_setzero_ps(), _mm256_setzero_ps(), _CMP_EQ_OQ)) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline bool operator []( const size_t index ) const { assert(index < 8); return (_mm256_movemask_ps(v) >> index) & 1; }
|
||||
__forceinline int& operator []( const size_t index ) { assert(index < 8); return i[index]; }
|
||||
__forceinline bool operator [](size_t index) const { assert(index < 8); return (_mm256_movemask_ps(v) >> index) & 1; }
|
||||
__forceinline int& operator [](size_t index) { assert(index < 8); return i[index]; }
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf8 operator !( const vboolf8& a ) { return _mm256_xor_ps(a, vboolf8(embree::True)); }
|
||||
__forceinline vboolf8 operator !(const vboolf8& a) { return _mm256_xor_ps(a, vboolf8(embree::True)); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf8 operator &( const vboolf8& a, const vboolf8& b ) { return _mm256_and_ps(a, b); }
|
||||
__forceinline const vboolf8 operator |( const vboolf8& a, const vboolf8& b ) { return _mm256_or_ps (a, b); }
|
||||
__forceinline const vboolf8 operator ^( const vboolf8& a, const vboolf8& b ) { return _mm256_xor_ps(a, b); }
|
||||
__forceinline vboolf8 operator &(const vboolf8& a, const vboolf8& b) { return _mm256_and_ps(a, b); }
|
||||
__forceinline vboolf8 operator |(const vboolf8& a, const vboolf8& b) { return _mm256_or_ps (a, b); }
|
||||
__forceinline vboolf8 operator ^(const vboolf8& a, const vboolf8& b) { return _mm256_xor_ps(a, b); }
|
||||
|
||||
__forceinline vboolf8 operator &=( vboolf8& a, const vboolf8& b ) { return a = a & b; }
|
||||
__forceinline vboolf8 operator |=( vboolf8& a, const vboolf8& b ) { return a = a | b; }
|
||||
__forceinline vboolf8 operator ^=( vboolf8& a, const vboolf8& b ) { return a = a ^ b; }
|
||||
__forceinline vboolf8 andn(const vboolf8& a, const vboolf8& b) { return _mm256_andnot_ps(b, a); }
|
||||
|
||||
__forceinline vboolf8& operator &=(vboolf8& a, const vboolf8& b) { return a = a & b; }
|
||||
__forceinline vboolf8& operator |=(vboolf8& a, const vboolf8& b) { return a = a | b; }
|
||||
__forceinline vboolf8& operator ^=(vboolf8& a, const vboolf8& b) { return a = a ^ b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf8 operator !=( const vboolf8& a, const vboolf8& b ) { return _mm256_xor_ps(a, b); }
|
||||
__forceinline const vboolf8 operator ==( const vboolf8& a, const vboolf8& b ) { return _mm256_xor_ps(_mm256_xor_ps(a,b),vboolf8(embree::True)); }
|
||||
__forceinline vboolf8 operator !=(const vboolf8& a, const vboolf8& b) { return _mm256_xor_ps(a, b); }
|
||||
__forceinline vboolf8 operator ==(const vboolf8& a, const vboolf8& b) { return _mm256_xor_ps(_mm256_xor_ps(a,b),vboolf8(embree::True)); }
|
||||
|
||||
__forceinline const vboolf8 select( const vboolf8& mask, const vboolf8& t, const vboolf8& f ) {
|
||||
__forceinline vboolf8 select(const vboolf8& mask, const vboolf8& t, const vboolf8& f) {
|
||||
return _mm256_blendv_ps(f, t, mask);
|
||||
}
|
||||
|
||||
@@ -122,54 +124,59 @@ namespace embree
|
||||
/// Movement/Shifting/Shuffling Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf8 unpacklo( const vboolf8& a, const vboolf8& b ) { return _mm256_unpacklo_ps(a.v, b.v); }
|
||||
__forceinline vboolf8 unpackhi( const vboolf8& a, const vboolf8& b ) { return _mm256_unpackhi_ps(a.v, b.v); }
|
||||
__forceinline vboolf8 unpacklo(const vboolf8& a, const vboolf8& b) { return _mm256_unpacklo_ps(a, b); }
|
||||
__forceinline vboolf8 unpackhi(const vboolf8& a, const vboolf8& b) { return _mm256_unpackhi_ps(a, b); }
|
||||
|
||||
template<size_t i> __forceinline const vboolf8 shuffle( const vboolf8& a ) {
|
||||
return _mm256_permute_ps(a, _MM_SHUFFLE(i, i, i, i));
|
||||
template<int i>
|
||||
__forceinline vboolf8 shuffle(const vboolf8& v) {
|
||||
return _mm256_permute_ps(v, _MM_SHUFFLE(i, i, i, i));
|
||||
}
|
||||
|
||||
template<size_t i0, size_t i1> __forceinline const vboolf8 shuffle4( const vboolf8& a ) {
|
||||
return _mm256_permute2f128_ps(a, a, (i1 << 4) | (i0 << 0));
|
||||
template<int i0, int i1>
|
||||
__forceinline vboolf8 shuffle4(const vboolf8& v) {
|
||||
return _mm256_permute2f128_ps(v, v, (i1 << 4) | (i0 << 0));
|
||||
}
|
||||
|
||||
template<size_t i0, size_t i1> __forceinline const vboolf8 shuffle4( const vboolf8& a, const vboolf8& b) {
|
||||
template<int i0, int i1>
|
||||
__forceinline vboolf8 shuffle4(const vboolf8& a, const vboolf8& b) {
|
||||
return _mm256_permute2f128_ps(a, b, (i1 << 4) | (i0 << 0));
|
||||
}
|
||||
|
||||
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vboolf8 shuffle( const vboolf8& a ) {
|
||||
return _mm256_permute_ps(a, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vboolf8 shuffle(const vboolf8& v) {
|
||||
return _mm256_permute_ps(v, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
}
|
||||
|
||||
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vboolf8 shuffle( const vboolf8& a, const vboolf8& b ) {
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vboolf8 shuffle(const vboolf8& a, const vboolf8& b) {
|
||||
return _mm256_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
}
|
||||
|
||||
template<> __forceinline const vboolf8 shuffle<0, 0, 2, 2>( const vboolf8& b ) { return _mm256_moveldup_ps(b); }
|
||||
template<> __forceinline const vboolf8 shuffle<1, 1, 3, 3>( const vboolf8& b ) { return _mm256_movehdup_ps(b); }
|
||||
template<> __forceinline const vboolf8 shuffle<0, 1, 0, 1>( const vboolf8& b ) { return _mm256_castpd_ps(_mm256_movedup_pd(_mm256_castps_pd(b))); }
|
||||
template<> __forceinline vboolf8 shuffle<0, 0, 2, 2>(const vboolf8& v) { return _mm256_moveldup_ps(v); }
|
||||
template<> __forceinline vboolf8 shuffle<1, 1, 3, 3>(const vboolf8& v) { return _mm256_movehdup_ps(v); }
|
||||
template<> __forceinline vboolf8 shuffle<0, 1, 0, 1>(const vboolf8& v) { return _mm256_castpd_ps(_mm256_movedup_pd(_mm256_castps_pd(v))); }
|
||||
|
||||
template<size_t i> __forceinline const vboolf8 insert4(const vboolf8& a, const vboolf4& b) { return _mm256_insertf128_ps(a, b, i); }
|
||||
template<size_t i> __forceinline const vboolf4 extract4 (const vboolf8& a) { return _mm256_extractf128_ps(a, i); }
|
||||
template<> __forceinline const vboolf4 extract4<0>(const vboolf8& a) { return _mm256_castps256_ps128(a); }
|
||||
template<int i> __forceinline vboolf8 insert4(const vboolf8& a, const vboolf4& b) { return _mm256_insertf128_ps(a, b, i); }
|
||||
template<int i> __forceinline vboolf4 extract4 (const vboolf8& a) { return _mm256_extractf128_ps(a, i); }
|
||||
template<> __forceinline vboolf4 extract4<0>(const vboolf8& a) { return _mm256_castps256_ps128(a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Reduction Operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline bool reduce_and( const vboolf8& a ) { return _mm256_movemask_ps(a) == (unsigned int)0xff; }
|
||||
__forceinline bool reduce_or ( const vboolf8& a ) { return !_mm256_testz_ps(a,a); }
|
||||
__forceinline bool reduce_and(const vboolf8& a) { return _mm256_movemask_ps(a) == (unsigned int)0xff; }
|
||||
__forceinline bool reduce_or (const vboolf8& a) { return !_mm256_testz_ps(a,a); }
|
||||
|
||||
__forceinline bool all ( const vboolf8& a ) { return _mm256_movemask_ps(a) == (unsigned int)0xff; }
|
||||
__forceinline bool any ( const vboolf8& a ) { return !_mm256_testz_ps(a,a); }
|
||||
__forceinline bool none ( const vboolf8& a ) { return _mm256_testz_ps(a,a) != 0; }
|
||||
__forceinline bool all (const vboolf8& a) { return _mm256_movemask_ps(a) == (unsigned int)0xff; }
|
||||
__forceinline bool any (const vboolf8& a) { return !_mm256_testz_ps(a,a); }
|
||||
__forceinline bool none(const vboolf8& a) { return _mm256_testz_ps(a,a) != 0; }
|
||||
|
||||
__forceinline bool all ( const vboolf8& valid, const vboolf8& b ) { return all((!valid) | b); }
|
||||
__forceinline bool any ( const vboolf8& valid, const vboolf8& b ) { return any( valid & b); }
|
||||
__forceinline bool none ( const vboolf8& valid, const vboolf8& b ) { return none(valid & b); }
|
||||
__forceinline bool all (const vboolf8& valid, const vboolf8& b) { return all((!valid) | b); }
|
||||
__forceinline bool any (const vboolf8& valid, const vboolf8& b) { return any(valid & b); }
|
||||
__forceinline bool none(const vboolf8& valid, const vboolf8& b) { return none(valid & b); }
|
||||
|
||||
__forceinline unsigned int movemask( const vboolf8& a ) { return _mm256_movemask_ps(a); }
|
||||
__forceinline size_t popcnt ( const vboolf8& a ) { return __popcnt((size_t)_mm256_movemask_ps(a)); }
|
||||
__forceinline unsigned int movemask(const vboolf8& a) { return _mm256_movemask_ps(a); }
|
||||
__forceinline size_t popcnt (const vboolf8& a) { return popcnt((size_t)_mm256_movemask_ps(a)); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Get/Set Functions
|
||||
@@ -183,7 +190,7 @@ namespace embree
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& cout, const vboolf8& a) {
|
||||
inline std::ostream& operator <<(std::ostream& cout, const vboolf8& a) {
|
||||
return cout << "<" << a[0] << ", " << a[1] << ", " << a[2] << ", " << a[3] << ", "
|
||||
<< a[4] << ", " << a[5] << ", " << a[6] << ", " << a[7] << ">";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -33,8 +33,8 @@ namespace embree
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf() {}
|
||||
__forceinline vboolf(const vboolf8 &t) { v = t.v; }
|
||||
__forceinline vboolf8& operator=(const vboolf8 &f) { v = f.v; return *this; }
|
||||
__forceinline vboolf(const vboolf8& t) { v = t.v; }
|
||||
__forceinline vboolf8& operator =(const vboolf8& f) { v = f.v; return *this; }
|
||||
|
||||
__forceinline vboolf(const __mmask8 &t) { v = t; }
|
||||
__forceinline operator __mmask8() const { return v; }
|
||||
@@ -43,6 +43,9 @@ namespace embree
|
||||
__forceinline vboolf(int t) { v = (__mmask8)t; }
|
||||
__forceinline vboolf(unsigned int t) { v = (__mmask8)t; }
|
||||
|
||||
__forceinline vboolf(bool a, bool b, bool c, bool d, bool e, bool f, bool g, bool h)
|
||||
: v((__mmask8)((int(h) << 7) | (int(g) << 6) | (int(f) << 5) | (int(e) << 4) | (int(d) << 3) | (int(c) << 2) | (int(b) << 1) | int(a))) {}
|
||||
|
||||
/* return int8 mask */
|
||||
__forceinline __m128i mask8() const {
|
||||
return _mm_movm_epi8(v);
|
||||
@@ -62,42 +65,50 @@ namespace embree
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf( FalseTy ) : v(0x00) {}
|
||||
__forceinline vboolf( TrueTy ) : v(0xff) {}
|
||||
__forceinline vboolf(FalseTy) : v(0x00) {}
|
||||
__forceinline vboolf(TrueTy) : v(0xff) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline bool operator [](size_t index) const {
|
||||
assert(index < 8); return (mm512_mask2int(v) >> index) & 1;
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf8 operator!(const vboolf8 &a) { return _mm512_knot(a); }
|
||||
__forceinline vboolf8 operator !(const vboolf8& a) { return _mm512_knot(a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vboolf8 operator&(const vboolf8 &a, const vboolf8 &b) { return _mm512_kand(a, b); }
|
||||
__forceinline vboolf8 operator|(const vboolf8 &a, const vboolf8 &b) { return _mm512_kor(a, b); }
|
||||
__forceinline vboolf8 operator^(const vboolf8 &a, const vboolf8 &b) { return _mm512_kxor(a, b); }
|
||||
__forceinline vboolf8 operator &(const vboolf8& a, const vboolf8& b) { return _mm512_kand(a, b); }
|
||||
__forceinline vboolf8 operator |(const vboolf8& a, const vboolf8& b) { return _mm512_kor(a, b); }
|
||||
__forceinline vboolf8 operator ^(const vboolf8& a, const vboolf8& b) { return _mm512_kxor(a, b); }
|
||||
|
||||
__forceinline vboolf8 andn(const vboolf8 &a, const vboolf8 &b) { return _mm512_kandn(b, a); }
|
||||
__forceinline vboolf8 andn(const vboolf8& a, const vboolf8& b) { return _mm512_kandn(b, a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf8 operator &=( vboolf8& a, const vboolf8& b ) { return a = a & b; }
|
||||
__forceinline const vboolf8 operator |=( vboolf8& a, const vboolf8& b ) { return a = a | b; }
|
||||
__forceinline const vboolf8 operator ^=( vboolf8& a, const vboolf8& b ) { return a = a ^ b; }
|
||||
__forceinline vboolf8& operator &=(vboolf8& a, const vboolf8& b) { return a = a & b; }
|
||||
__forceinline vboolf8& operator |=(vboolf8& a, const vboolf8& b) { return a = a | b; }
|
||||
__forceinline vboolf8& operator ^=(vboolf8& a, const vboolf8& b) { return a = a ^ b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf8 operator !=( const vboolf8& a, const vboolf8& b ) { return _mm512_kxor(a, b); }
|
||||
__forceinline const vboolf8 operator ==( const vboolf8& a, const vboolf8& b ) { return _mm512_kxnor(a, b); }
|
||||
__forceinline vboolf8 operator !=(const vboolf8& a, const vboolf8& b) { return _mm512_kxor(a, b); }
|
||||
__forceinline vboolf8 operator ==(const vboolf8& a, const vboolf8& b) { return _mm512_kxnor(a, b); }
|
||||
|
||||
__forceinline vboolf8 select(const vboolf8 &s, const vboolf8 &a, const vboolf8 &b) {
|
||||
__forceinline vboolf8 select(const vboolf8& s, const vboolf8& a, const vboolf8& b) {
|
||||
return _mm512_kor(_mm512_kand(s, a), _mm512_kandn(s, b));
|
||||
}
|
||||
|
||||
@@ -105,22 +116,22 @@ namespace embree
|
||||
/// Reduction Operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline int all (const vboolf8 &a) { return a.v == 0xff; }
|
||||
__forceinline int any (const vboolf8 &a) { return _mm512_kortestz(a, a) == 0; }
|
||||
__forceinline int none(const vboolf8 &a) { return _mm512_kortestz(a, a) != 0; }
|
||||
__forceinline int all (const vboolf8& a) { return a.v == 0xff; }
|
||||
__forceinline int any (const vboolf8& a) { return _mm512_kortestz(a, a) == 0; }
|
||||
__forceinline int none(const vboolf8& a) { return _mm512_kortestz(a, a) != 0; }
|
||||
|
||||
__forceinline int all ( const vboolf8& valid, const vboolf8& b ) { return all((!valid) | b); }
|
||||
__forceinline int any ( const vboolf8& valid, const vboolf8& b ) { return any( valid & b); }
|
||||
__forceinline int none( const vboolf8& valid, const vboolf8& b ) { return none(valid & b); }
|
||||
__forceinline int all (const vboolf8& valid, const vboolf8& b) { return all((!valid) | b); }
|
||||
__forceinline int any (const vboolf8& valid, const vboolf8& b) { return any(valid & b); }
|
||||
__forceinline int none(const vboolf8& valid, const vboolf8& b) { return none(valid & b); }
|
||||
|
||||
__forceinline size_t movemask( const vboolf8& a ) { return _mm512_kmov(a); }
|
||||
__forceinline size_t popcnt ( const vboolf8& a ) { return __popcnt(a.v); }
|
||||
__forceinline size_t movemask(const vboolf8& a) { return _mm512_kmov(a); }
|
||||
__forceinline size_t popcnt (const vboolf8& a) { return popcnt(a.v); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Conversion Operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline unsigned int toInt(const vboolf8 &a) { return mm512_mask2int(a); }
|
||||
__forceinline unsigned int toInt(const vboolf8& a) { return mm512_mask2int(a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Get/Set Functions
|
||||
@@ -134,7 +145,7 @@ namespace embree
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& cout, const vboolf8& a)
|
||||
inline std::ostream& operator <<(std::ostream& cout, const vboolf8& a)
|
||||
{
|
||||
cout << "<";
|
||||
for (size_t i=0; i<8; i++) {
|
||||
|
||||
+127
-113
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -18,19 +18,9 @@
|
||||
|
||||
namespace embree
|
||||
{
|
||||
#ifndef _MM_SHUF_PERM2
|
||||
#define _MM_SHUF_PERM2(e3, e2, e1, e0) \
|
||||
((int)(((e3)<<3) | ((e2)<<2) | ((e1)<<1) | (e0)))
|
||||
#endif
|
||||
|
||||
#ifndef _MM_SHUF_PERM3
|
||||
#define _MM_SHUF_PERM3(e1, e0) \
|
||||
((int)(((e1)<<4) | (e0)))
|
||||
#endif
|
||||
|
||||
/* 4-wide AVX 64bit double type */
|
||||
/* 4-wide AVX 64-bit double type */
|
||||
template<>
|
||||
struct vdouble<4>
|
||||
struct vdouble<4>
|
||||
{
|
||||
typedef vboold4 Bool;
|
||||
|
||||
@@ -46,16 +36,16 @@ namespace embree
|
||||
|
||||
__forceinline vdouble() {}
|
||||
__forceinline vdouble(const vdouble4& t) { v = t.v; }
|
||||
__forceinline vdouble4& operator=(const vdouble4& f) { v = f.v; return *this; }
|
||||
__forceinline vdouble4& operator =(const vdouble4& f) { v = f.v; return *this; }
|
||||
|
||||
__forceinline vdouble(const __m256d& t) { v = t; }
|
||||
__forceinline operator __m256d () const { return v; }
|
||||
__forceinline operator __m256d() const { return v; }
|
||||
|
||||
__forceinline vdouble(const double i) {
|
||||
__forceinline vdouble(double i) {
|
||||
v = _mm256_set1_pd(i);
|
||||
}
|
||||
|
||||
__forceinline vdouble(const double a, const double b, const double c, const double d) {
|
||||
__forceinline vdouble(double a, double b, double c, double d) {
|
||||
v = _mm256_set_pd(d,c,b,a);
|
||||
}
|
||||
|
||||
@@ -64,25 +54,20 @@ namespace embree
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vdouble( ZeroTy ) : v(_mm256_setzero_pd()) {}
|
||||
__forceinline vdouble( OneTy ) : v(_mm256_set1_pd(1)) {}
|
||||
__forceinline vdouble( StepTy ) : v(_mm256_set_pd(3.0,2.0,1.0,0.0)) {}
|
||||
__forceinline vdouble( ReverseStepTy ) : v(_mm256_setr_pd(3.0,2.0,1.0,0.0)) {}
|
||||
|
||||
__forceinline static vdouble4 zero() { return _mm256_setzero_pd(); }
|
||||
__forceinline static vdouble4 one () { return _mm256_set1_pd(1.0); }
|
||||
__forceinline static vdouble4 neg_one () { return _mm256_set1_pd(-1.0); }
|
||||
__forceinline vdouble(ZeroTy) : v(_mm256_setzero_pd()) {}
|
||||
__forceinline vdouble(OneTy) : v(_mm256_set1_pd(1)) {}
|
||||
__forceinline vdouble(StepTy) : v(_mm256_set_pd(3.0,2.0,1.0,0.0)) {}
|
||||
__forceinline vdouble(ReverseStepTy) : v(_mm256_setr_pd(3.0,2.0,1.0,0.0)) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Loads and Stores
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static __forceinline void store_nt(double *__restrict__ ptr, const vdouble4& a) {
|
||||
_mm256_stream_pd(ptr,a);
|
||||
_mm256_stream_pd(ptr, a);
|
||||
}
|
||||
|
||||
static __forceinline vdouble4 loadu(const double* addr)
|
||||
{
|
||||
static __forceinline vdouble4 loadu(const double* addr) {
|
||||
return _mm256_loadu_pd(addr);
|
||||
}
|
||||
|
||||
@@ -95,84 +80,105 @@ namespace embree
|
||||
}
|
||||
|
||||
static __forceinline void store(double* ptr, const vdouble4& v) {
|
||||
_mm256_store_pd(ptr,v);
|
||||
_mm256_store_pd(ptr, v);
|
||||
}
|
||||
|
||||
static __forceinline void storeu(double* ptr, const vdouble4& v ) {
|
||||
_mm256_storeu_pd(ptr,v);
|
||||
static __forceinline void storeu(double* ptr, const vdouble4& v) {
|
||||
_mm256_storeu_pd(ptr, v);
|
||||
}
|
||||
|
||||
static __forceinline vdouble4 broadcast(const void* a) { return _mm256_set1_pd(*(double*)a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline double& operator[](const size_t index) { assert(index < 8); return i[index]; }
|
||||
__forceinline const double& operator[](const size_t index) const { assert(index < 8); return i[index]; }
|
||||
|
||||
__forceinline double& operator [](size_t index) { assert(index < 4); return i[index]; }
|
||||
__forceinline const double& operator [](size_t index) const { assert(index < 4); return i[index]; }
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vdouble4 operator +( const vdouble4& a ) { return a; }
|
||||
__forceinline const vdouble4 operator -( const vdouble4& a ) { return _mm256_sub_pd(_mm256_setzero_pd(), a); }
|
||||
#if defined(__AVX2__)
|
||||
__forceinline vdouble4 asDouble(const vllong4& a) { return _mm256_castsi256_pd(a); }
|
||||
__forceinline vllong4 asLLong (const vdouble4& a) { return _mm256_castpd_si256(a); }
|
||||
#endif
|
||||
|
||||
__forceinline vdouble4 operator +(const vdouble4& a) { return a; }
|
||||
__forceinline vdouble4 operator -(const vdouble4& a) { return _mm256_sub_pd(_mm256_setzero_pd(), a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vdouble4 operator +( const vdouble4& a, const vdouble4& b ) { return _mm256_add_pd(a, b); }
|
||||
__forceinline const vdouble4 operator +( const vdouble4& a, const double b ) { return a + vdouble4(b); }
|
||||
__forceinline const vdouble4 operator +( const double a, const vdouble4& b ) { return vdouble4(a) + b; }
|
||||
__forceinline vdouble4 operator +(const vdouble4& a, const vdouble4& b) { return _mm256_add_pd(a, b); }
|
||||
__forceinline vdouble4 operator +(const vdouble4& a, double b) { return a + vdouble4(b); }
|
||||
__forceinline vdouble4 operator +(double a, const vdouble4& b) { return vdouble4(a) + b; }
|
||||
|
||||
__forceinline const vdouble4 operator -( const vdouble4& a, const vdouble4& b ) { return _mm256_sub_pd(a, b); }
|
||||
__forceinline const vdouble4 operator -( const vdouble4& a, const double b ) { return a - vdouble4(b); }
|
||||
__forceinline const vdouble4 operator -( const double a, const vdouble4& b ) { return vdouble4(a) - b; }
|
||||
__forceinline vdouble4 operator -(const vdouble4& a, const vdouble4& b) { return _mm256_sub_pd(a, b); }
|
||||
__forceinline vdouble4 operator -(const vdouble4& a, double b) { return a - vdouble4(b); }
|
||||
__forceinline vdouble4 operator -(double a, const vdouble4& b) { return vdouble4(a) - b; }
|
||||
|
||||
__forceinline const vdouble4 operator *( const vdouble4& a, const vdouble4& b ) { return _mm256_mul_pd(a, b); }
|
||||
__forceinline const vdouble4 operator *( const vdouble4& a, const double b ) { return a * vdouble4(b); }
|
||||
__forceinline const vdouble4 operator *( const double a, const vdouble4& b ) { return vdouble4(a) * b; }
|
||||
__forceinline vdouble4 operator *(const vdouble4& a, const vdouble4& b) { return _mm256_mul_pd(a, b); }
|
||||
__forceinline vdouble4 operator *(const vdouble4& a, double b) { return a * vdouble4(b); }
|
||||
__forceinline vdouble4 operator *(double a, const vdouble4& b) { return vdouble4(a) * b; }
|
||||
|
||||
__forceinline const vdouble4 operator &( const vdouble4& a, const vdouble4& b ) { return _mm256_and_pd(a, b); }
|
||||
__forceinline const vdouble4 operator &( const vdouble4& a, const double b ) { return a & vdouble4(b); }
|
||||
__forceinline const vdouble4 operator &( const double a, const vdouble4& b ) { return vdouble4(a) & b; }
|
||||
__forceinline vdouble4 operator &(const vdouble4& a, const vdouble4& b) { return _mm256_and_pd(a, b); }
|
||||
__forceinline vdouble4 operator &(const vdouble4& a, double b) { return a & vdouble4(b); }
|
||||
__forceinline vdouble4 operator &(double a, const vdouble4& b) { return vdouble4(a) & b; }
|
||||
|
||||
__forceinline const vdouble4 operator |( const vdouble4& a, const vdouble4& b ) { return _mm256_or_pd(a, b); }
|
||||
__forceinline const vdouble4 operator |( const vdouble4& a, const double b ) { return a | vdouble4(b); }
|
||||
__forceinline const vdouble4 operator |( const double a, const vdouble4& b ) { return vdouble4(a) | b; }
|
||||
__forceinline vdouble4 operator |(const vdouble4& a, const vdouble4& b) { return _mm256_or_pd(a, b); }
|
||||
__forceinline vdouble4 operator |(const vdouble4& a, double b) { return a | vdouble4(b); }
|
||||
__forceinline vdouble4 operator |(double a, const vdouble4& b) { return vdouble4(a) | b; }
|
||||
|
||||
__forceinline const vdouble4 operator ^( const vdouble4& a, const vdouble4& b ) { return _mm256_xor_pd(a, b); }
|
||||
__forceinline const vdouble4 operator ^( const vdouble4& a, const double b ) { return a ^ vdouble4(b); }
|
||||
__forceinline const vdouble4 operator ^( const double a, const vdouble4& b ) { return vdouble4(a) ^ b; }
|
||||
__forceinline vdouble4 operator ^(const vdouble4& a, const vdouble4& b) { return _mm256_xor_pd(a, b); }
|
||||
__forceinline vdouble4 operator ^(const vdouble4& a, double b) { return a ^ vdouble4(b); }
|
||||
__forceinline vdouble4 operator ^(double a, const vdouble4& b) { return vdouble4(a) ^ b; }
|
||||
|
||||
__forceinline const vdouble4 min( const vdouble4& a, const vdouble4& b ) { return _mm256_min_pd(a, b); }
|
||||
__forceinline const vdouble4 min( const vdouble4& a, const double b ) { return min(a,vdouble4(b)); }
|
||||
__forceinline const vdouble4 min( const double a, const vdouble4& b ) { return min(vdouble4(a),b); }
|
||||
__forceinline vdouble4 min(const vdouble4& a, const vdouble4& b) { return _mm256_min_pd(a, b); }
|
||||
__forceinline vdouble4 min(const vdouble4& a, double b) { return min(a,vdouble4(b)); }
|
||||
__forceinline vdouble4 min(double a, const vdouble4& b) { return min(vdouble4(a),b); }
|
||||
|
||||
__forceinline const vdouble4 max( const vdouble4& a, const vdouble4& b ) { return _mm256_max_pd(a, b); }
|
||||
__forceinline const vdouble4 max( const vdouble4& a, const double b ) { return max(a,vdouble4(b)); }
|
||||
__forceinline const vdouble4 max( const double a, const vdouble4& b ) { return max(vdouble4(a),b); }
|
||||
__forceinline vdouble4 max(const vdouble4& a, const vdouble4& b) { return _mm256_max_pd(a, b); }
|
||||
__forceinline vdouble4 max(const vdouble4& a, double b) { return max(a,vdouble4(b)); }
|
||||
__forceinline vdouble4 max(double a, const vdouble4& b) { return max(vdouble4(a),b); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Ternary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__FMA__)
|
||||
__forceinline vdouble4 madd (const vdouble4& a, const vdouble4& b, const vdouble4& c) { return _mm256_fmadd_pd(a,b,c); }
|
||||
__forceinline vdouble4 msub (const vdouble4& a, const vdouble4& b, const vdouble4& c) { return _mm256_fmsub_pd(a,b,c); }
|
||||
__forceinline vdouble4 nmadd(const vdouble4& a, const vdouble4& b, const vdouble4& c) { return _mm256_fnmadd_pd(a,b,c); }
|
||||
__forceinline vdouble4 nmsub(const vdouble4& a, const vdouble4& b, const vdouble4& c) { return _mm256_fnmsub_pd(a,b,c); }
|
||||
#else
|
||||
__forceinline vdouble4 madd (const vdouble4& a, const vdouble4& b, const vdouble4& c) { return a*b+c; }
|
||||
__forceinline vdouble4 msub (const vdouble4& a, const vdouble4& b, const vdouble4& c) { return a*b-c; }
|
||||
__forceinline vdouble4 nmadd(const vdouble4& a, const vdouble4& b, const vdouble4& c) { return -a*b+c;}
|
||||
__forceinline vdouble4 nmsub(const vdouble4& a, const vdouble4& b, const vdouble4& c) { return -a*b-c; }
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vdouble4& operator +=( vdouble4& a, const vdouble4& b ) { return a = a + b; }
|
||||
__forceinline vdouble4& operator +=( vdouble4& a, const double b ) { return a = a + b; }
|
||||
__forceinline vdouble4& operator +=(vdouble4& a, const vdouble4& b) { return a = a + b; }
|
||||
__forceinline vdouble4& operator +=(vdouble4& a, double b) { return a = a + b; }
|
||||
|
||||
__forceinline vdouble4& operator -=( vdouble4& a, const vdouble4& b ) { return a = a - b; }
|
||||
__forceinline vdouble4& operator -=( vdouble4& a, const double b ) { return a = a - b; }
|
||||
__forceinline vdouble4& operator -=(vdouble4& a, const vdouble4& b) { return a = a - b; }
|
||||
__forceinline vdouble4& operator -=(vdouble4& a, double b) { return a = a - b; }
|
||||
|
||||
__forceinline vdouble4& operator *=( vdouble4& a, const vdouble4& b ) { return a = a * b; }
|
||||
__forceinline vdouble4& operator *=( vdouble4& a, const double b ) { return a = a * b; }
|
||||
__forceinline vdouble4& operator *=(vdouble4& a, const vdouble4& b) { return a = a * b; }
|
||||
__forceinline vdouble4& operator *=(vdouble4& a, double b) { return a = a * b; }
|
||||
|
||||
__forceinline vdouble4& operator &=( vdouble4& a, const vdouble4& b ) { return a = a & b; }
|
||||
__forceinline vdouble4& operator &=( vdouble4& a, const double b ) { return a = a & b; }
|
||||
__forceinline vdouble4& operator &=(vdouble4& a, const vdouble4& b) { return a = a & b; }
|
||||
__forceinline vdouble4& operator &=(vdouble4& a, double b) { return a = a & b; }
|
||||
|
||||
__forceinline vdouble4& operator |=( vdouble4& a, const vdouble4& b ) { return a = a | b; }
|
||||
__forceinline vdouble4& operator |=( vdouble4& a, const double b ) { return a = a | b; }
|
||||
__forceinline vdouble4& operator |=(vdouble4& a, const vdouble4& b) { return a = a | b; }
|
||||
__forceinline vdouble4& operator |=(vdouble4& a, double b) { return a = a | b; }
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -180,38 +186,38 @@ namespace embree
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__AVX512VL__)
|
||||
__forceinline const vboold4 operator ==( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd_mask(a,b,_MM_CMPINT_EQ); }
|
||||
__forceinline const vboold4 operator !=( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd_mask(a,b,_MM_CMPINT_NE); }
|
||||
__forceinline const vboold4 operator < ( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd_mask(a,b,_MM_CMPINT_LT); }
|
||||
__forceinline const vboold4 operator >=( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd_mask(a,b,_MM_CMPINT_GE); }
|
||||
__forceinline const vboold4 operator > ( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd_mask(a,b,_MM_CMPINT_GT); }
|
||||
__forceinline const vboold4 operator <=( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd_mask(a,b,_MM_CMPINT_LE); }
|
||||
__forceinline vboold4 operator ==(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd_mask(a, b, _MM_CMPINT_EQ); }
|
||||
__forceinline vboold4 operator !=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd_mask(a, b, _MM_CMPINT_NE); }
|
||||
__forceinline vboold4 operator < (const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd_mask(a, b, _MM_CMPINT_LT); }
|
||||
__forceinline vboold4 operator >=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd_mask(a, b, _MM_CMPINT_GE); }
|
||||
__forceinline vboold4 operator > (const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd_mask(a, b, _MM_CMPINT_GT); }
|
||||
__forceinline vboold4 operator <=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd_mask(a, b, _MM_CMPINT_LE); }
|
||||
#else
|
||||
__forceinline const vboold4 operator ==( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd(a,b,_CMP_EQ_UQ); }
|
||||
__forceinline const vboold4 operator !=( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd(a,b,_CMP_NEQ_UQ); }
|
||||
__forceinline const vboold4 operator < ( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd(a,b,_CMP_LT_OQ); }
|
||||
__forceinline const vboold4 operator >=( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd(a,b,_CMP_GE_OQ); }
|
||||
__forceinline const vboold4 operator > ( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd(a,b,_CMP_GT_OQ); }
|
||||
__forceinline const vboold4 operator <=( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd(a,b,_CMP_LE_OQ); }
|
||||
__forceinline vboold4 operator ==(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a, b, _CMP_EQ_OQ); }
|
||||
__forceinline vboold4 operator !=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a, b, _CMP_NEQ_UQ); }
|
||||
__forceinline vboold4 operator < (const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a, b, _CMP_LT_OS); }
|
||||
__forceinline vboold4 operator >=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a, b, _CMP_NLT_US); }
|
||||
__forceinline vboold4 operator > (const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a, b, _CMP_NLE_US); }
|
||||
__forceinline vboold4 operator <=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a, b, _CMP_LE_OS); }
|
||||
#endif
|
||||
|
||||
__forceinline const vboold4 operator ==( const vdouble4& a, const double b ) { return a == vdouble4(b); }
|
||||
__forceinline const vboold4 operator ==( const double a, const vdouble4& b ) { return vdouble4(a) == b; }
|
||||
__forceinline vboold4 operator ==(const vdouble4& a, double b) { return a == vdouble4(b); }
|
||||
__forceinline vboold4 operator ==(double a, const vdouble4& b) { return vdouble4(a) == b; }
|
||||
|
||||
__forceinline const vboold4 operator !=( const vdouble4& a, const double b ) { return a != vdouble4(b); }
|
||||
__forceinline const vboold4 operator !=( const double a, const vdouble4& b ) { return vdouble4(a) != b; }
|
||||
__forceinline vboold4 operator !=(const vdouble4& a, double b) { return a != vdouble4(b); }
|
||||
__forceinline vboold4 operator !=(double a, const vdouble4& b) { return vdouble4(a) != b; }
|
||||
|
||||
__forceinline const vboold4 operator < ( const vdouble4& a, const double b ) { return a < vdouble4(b); }
|
||||
__forceinline const vboold4 operator < ( const double a, const vdouble4& b ) { return vdouble4(a) < b; }
|
||||
__forceinline vboold4 operator < (const vdouble4& a, double b) { return a < vdouble4(b); }
|
||||
__forceinline vboold4 operator < (double a, const vdouble4& b) { return vdouble4(a) < b; }
|
||||
|
||||
__forceinline const vboold4 operator >=( const vdouble4& a, const double b ) { return a >= vdouble4(b); }
|
||||
__forceinline const vboold4 operator >=( const double a, const vdouble4& b ) { return vdouble4(a) >= b; }
|
||||
__forceinline vboold4 operator >=(const vdouble4& a, double b) { return a >= vdouble4(b); }
|
||||
__forceinline vboold4 operator >=(double a, const vdouble4& b) { return vdouble4(a) >= b; }
|
||||
|
||||
__forceinline const vboold4 operator > ( const vdouble4& a, const double b ) { return a > vdouble4(b); }
|
||||
__forceinline const vboold4 operator > ( const double a, const vdouble4& b ) { return vdouble4(a) > b; }
|
||||
__forceinline vboold4 operator > (const vdouble4& a, double b) { return a > vdouble4(b); }
|
||||
__forceinline vboold4 operator > (double a, const vdouble4& b) { return vdouble4(a) > b; }
|
||||
|
||||
__forceinline const vboold4 operator <=( const vdouble4& a, const double b ) { return a <= vdouble4(b); }
|
||||
__forceinline const vboold4 operator <=( const double a, const vdouble4& b ) { return vdouble4(a) <= b; }
|
||||
__forceinline vboold4 operator <=(const vdouble4& a, double b) { return a <= vdouble4(b); }
|
||||
__forceinline vboold4 operator <=(double a, const vdouble4& b) { return vdouble4(a) <= b; }
|
||||
|
||||
__forceinline vboold4 eq(const vdouble4& a, const vdouble4& b) { return a == b; }
|
||||
__forceinline vboold4 ne(const vdouble4& a, const vdouble4& b) { return a != b; }
|
||||
@@ -236,7 +242,7 @@ namespace embree
|
||||
__forceinline vboold4 le(const vboold4& mask, const vdouble4& a, const vdouble4& b) { return mask & (a <= b); }
|
||||
#endif
|
||||
|
||||
__forceinline const vdouble4 select( const vboold4& m, const vdouble4& t, const vdouble4& f ) {
|
||||
__forceinline vdouble4 select(const vboold4& m, const vdouble4& t, const vdouble4& f) {
|
||||
#if defined(__AVX512VL__)
|
||||
return _mm256_mask_blend_pd(m, f, t);
|
||||
#else
|
||||
@@ -260,35 +266,43 @@ namespace embree
|
||||
// Movement/Shifting/Shuffling Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<int B, int A> __forceinline vdouble4 shuffle (const vdouble4& v) { return _mm256_permute_pd(v,(int)_MM_SHUF_PERM2(B,A,B,A)); }
|
||||
template<int A> __forceinline vdouble4 shuffle (const vdouble4& x) { return shuffle<A,A>(x); }
|
||||
template<int i0, int i1>
|
||||
__forceinline vdouble4 shuffle(const vdouble4& v) {
|
||||
return _mm256_permute_pd(v, (i1 << 3) | (i0 << 2) | (i1 << 1) | i0);
|
||||
}
|
||||
|
||||
template<int B, int A> __forceinline vdouble4 shuffle2 (const vdouble4& v) { return _mm256_permute2f128_pd(v,v,(int)_MM_SHUF_PERM3(B,A)); }
|
||||
template<int i>
|
||||
__forceinline vdouble4 shuffle(const vdouble4& v) {
|
||||
return shuffle<i, i>(v);
|
||||
}
|
||||
|
||||
__forceinline double toScalar(const vdouble4& a)
|
||||
{
|
||||
return _mm_cvtsd_f64(_mm256_castpd256_pd128(a));
|
||||
template<int i0, int i1>
|
||||
__forceinline vdouble4 shuffle2(const vdouble4& v) {
|
||||
return _mm256_permute2f128_pd(v, v, (i1 << 4) | i0);
|
||||
}
|
||||
|
||||
__forceinline double toScalar(const vdouble4& v) {
|
||||
return _mm_cvtsd_f64(_mm256_castpd256_pd128(v));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Reductions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
__forceinline vdouble4 vreduce_min2(const vdouble4& x) { return min(x,shuffle<0,1>(x)); }
|
||||
__forceinline vdouble4 vreduce_min (const vdouble4& y) { const vdouble4 x = vreduce_min2(y); return min(x,shuffle2<0,1>(x)); }
|
||||
__forceinline vdouble4 vreduce_min2(const vdouble4& x) { return min(x, shuffle<1,0>(x)); }
|
||||
__forceinline vdouble4 vreduce_min (const vdouble4& y) { const vdouble4 x = vreduce_min2(y); return min(x, shuffle2<1,0>(x)); }
|
||||
|
||||
__forceinline vdouble4 vreduce_max2(const vdouble4& x) { return max(x,shuffle<0,1>(x)); }
|
||||
__forceinline vdouble4 vreduce_max (const vdouble4& y) { const vdouble4 x = vreduce_max2(y); return max(x,shuffle2<0,1>(x)); }
|
||||
__forceinline vdouble4 vreduce_max2(const vdouble4& x) { return max(x,shuffle<1,0>(x)); }
|
||||
__forceinline vdouble4 vreduce_max (const vdouble4& y) { const vdouble4 x = vreduce_max2(y); return max(x, shuffle2<1,0>(x)); }
|
||||
|
||||
__forceinline vdouble4 vreduce_and2(const vdouble4& x) { return x & shuffle<0,1>(x); }
|
||||
__forceinline vdouble4 vreduce_and (const vdouble4& y) { const vdouble4 x = vreduce_and2(y); return x & shuffle2<0,1>(x); }
|
||||
__forceinline vdouble4 vreduce_and2(const vdouble4& x) { return x & shuffle<1,0>(x); }
|
||||
__forceinline vdouble4 vreduce_and (const vdouble4& y) { const vdouble4 x = vreduce_and2(y); return x & shuffle2<1,0>(x); }
|
||||
|
||||
__forceinline vdouble4 vreduce_or2(const vdouble4& x) { return x | shuffle<0,1>(x); }
|
||||
__forceinline vdouble4 vreduce_or (const vdouble4& y) { const vdouble4 x = vreduce_or2(y); return x | shuffle2<0,1>(x); }
|
||||
__forceinline vdouble4 vreduce_or2(const vdouble4& x) { return x | shuffle<1,0>(x); }
|
||||
__forceinline vdouble4 vreduce_or (const vdouble4& y) { const vdouble4 x = vreduce_or2(y); return x | shuffle2<1,0>(x); }
|
||||
|
||||
__forceinline vdouble4 vreduce_add2(const vdouble4& x) { return x + shuffle<0,1>(x); }
|
||||
__forceinline vdouble4 vreduce_add (const vdouble4& y) { const vdouble4 x = vreduce_add2(y); return x + shuffle2<0,1>(x); }
|
||||
__forceinline vdouble4 vreduce_add2(const vdouble4& x) { return x + shuffle<1,0>(x); }
|
||||
__forceinline vdouble4 vreduce_add (const vdouble4& y) { const vdouble4 x = vreduce_add2(y); return x + shuffle2<1,0>(x); }
|
||||
|
||||
__forceinline double reduce_add(const vdouble4& a) { return toScalar(vreduce_add(a)); }
|
||||
__forceinline double reduce_min(const vdouble4& a) { return toScalar(vreduce_min(a)); }
|
||||
@@ -304,7 +318,7 @@ namespace embree
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline std::ostream& operator<<(std::ostream& cout, const vdouble4& v)
|
||||
__forceinline std::ostream& operator <<(std::ostream& cout, const vdouble4& v)
|
||||
{
|
||||
cout << "<" << v[0];
|
||||
for (size_t i=1; i<4; i++) cout << ", " << v[i];
|
||||
|
||||
+140
-127
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
namespace embree
|
||||
{
|
||||
/* 8-wide AVX-512 64bit double type */
|
||||
/* 8-wide AVX-512 64-bit double type */
|
||||
template<>
|
||||
struct vdouble<8>
|
||||
struct vdouble<8>
|
||||
{
|
||||
typedef vboold8 Bool;
|
||||
|
||||
@@ -36,22 +36,22 @@ namespace embree
|
||||
|
||||
__forceinline vdouble() {}
|
||||
__forceinline vdouble(const vdouble8& t) { v = t.v; }
|
||||
__forceinline vdouble8& operator=(const vdouble8& f) { v = f.v; return *this; }
|
||||
__forceinline vdouble8& operator =(const vdouble8& f) { v = f.v; return *this; }
|
||||
|
||||
__forceinline vdouble(const __m512d& t) { v = t; }
|
||||
__forceinline operator __m512d () const { return v; }
|
||||
__forceinline operator __m256d () const { return _mm512_castpd512_pd256(v); }
|
||||
__forceinline operator __m512d() const { return v; }
|
||||
__forceinline operator __m256d() const { return _mm512_castpd512_pd256(v); }
|
||||
|
||||
__forceinline vdouble(const double i) {
|
||||
__forceinline vdouble(double i) {
|
||||
v = _mm512_set1_pd(i);
|
||||
}
|
||||
|
||||
__forceinline vdouble(const double a, const double b, const double c, const double d) {
|
||||
__forceinline vdouble(double a, double b, double c, double d) {
|
||||
v = _mm512_set4_pd(d,c,b,a);
|
||||
}
|
||||
|
||||
__forceinline vdouble(const double a0 , const double a1 , const double a2 , const double a3,
|
||||
const double a4 , const double a5 , const double a6 , const double a7)
|
||||
__forceinline vdouble(double a0, double a1, double a2, double a3,
|
||||
double a4, double a5, double a6, double a7)
|
||||
{
|
||||
v = _mm512_set_pd(a7,a6,a5,a4,a3,a2,a1,a0);
|
||||
}
|
||||
@@ -61,21 +61,17 @@ namespace embree
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vdouble( ZeroTy ) : v(_mm512_setzero_pd()) {}
|
||||
__forceinline vdouble( OneTy ) : v(_mm512_set1_pd(1)) {}
|
||||
__forceinline vdouble( StepTy ) : v(_mm512_set_pd(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)) {}
|
||||
__forceinline vdouble( ReverseStepTy ) : v(_mm512_setr_pd(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)) {}
|
||||
|
||||
__forceinline static vdouble8 zero() { return _mm512_setzero_pd(); }
|
||||
__forceinline static vdouble8 one () { return _mm512_set1_pd(1); }
|
||||
__forceinline static vdouble8 neg_one () { return _mm512_set1_pd(-1); }
|
||||
__forceinline vdouble(ZeroTy) : v(_mm512_setzero_pd()) {}
|
||||
__forceinline vdouble(OneTy) : v(_mm512_set1_pd(1)) {}
|
||||
__forceinline vdouble(StepTy) : v(_mm512_set_pd(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)) {}
|
||||
__forceinline vdouble(ReverseStepTy) : v(_mm512_setr_pd(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Loads and Stores
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static __forceinline void store_nt(void *__restrict__ ptr, const vdouble8& a) {
|
||||
_mm512_stream_pd((double*)ptr,a);
|
||||
_mm512_stream_pd((double*)ptr, a);
|
||||
}
|
||||
|
||||
static __forceinline vdouble8 loadu(const void* addr) {
|
||||
@@ -91,45 +87,46 @@ namespace embree
|
||||
}
|
||||
|
||||
static __forceinline void store(void* ptr, const vdouble8& v) {
|
||||
_mm512_store_pd(ptr,v);
|
||||
_mm512_store_pd(ptr, v);
|
||||
}
|
||||
|
||||
static __forceinline void storeu(void* ptr, const vdouble8& v ) {
|
||||
_mm512_storeu_pd(ptr,v);
|
||||
static __forceinline void storeu(void* ptr, const vdouble8& v) {
|
||||
_mm512_storeu_pd(ptr, v);
|
||||
}
|
||||
|
||||
static __forceinline void storeu(const vboold8& mask, double* ptr, const vdouble8& f ) {
|
||||
_mm512_mask_storeu_pd(ptr,mask,f);
|
||||
static __forceinline void storeu(const vboold8& mask, double* ptr, const vdouble8& f) {
|
||||
_mm512_mask_storeu_pd(ptr, mask, f);
|
||||
}
|
||||
|
||||
static __forceinline void store(const vboold8& mask, void* addr, const vdouble8& v2) {
|
||||
_mm512_mask_store_pd(addr,mask,v2);
|
||||
_mm512_mask_store_pd(addr, mask, v2);
|
||||
}
|
||||
|
||||
/* pass by value to avoid compiler generating inefficient code */
|
||||
static __forceinline void storeu_compact(const vboold8 mask,void * addr, const vdouble8& reg) {
|
||||
_mm512_mask_compressstoreu_pd(addr,mask,reg);
|
||||
_mm512_mask_compressstoreu_pd(addr, mask, reg);
|
||||
}
|
||||
|
||||
static __forceinline vdouble8 compact64bit(const vboold8& mask, vdouble8& v) {
|
||||
return _mm512_mask_compress_pd(v,mask,v);
|
||||
return _mm512_mask_compress_pd(v, mask, v);
|
||||
}
|
||||
|
||||
static __forceinline vdouble8 compact(const vboold8& mask, vdouble8& v) {
|
||||
return _mm512_mask_compress_pd(v,mask,v);
|
||||
return _mm512_mask_compress_pd(v, mask, v);
|
||||
}
|
||||
|
||||
static __forceinline vdouble8 compact(const vboold8& mask, const vdouble8& a, vdouble8& b) {
|
||||
return _mm512_mask_compress_pd(a,mask,b);
|
||||
return _mm512_mask_compress_pd(a, mask, b);
|
||||
}
|
||||
|
||||
static __forceinline vdouble8 broadcast(const void* a) { return _mm512_set1_pd(*(double*)a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline double& operator[](const size_t index) { assert(index < 8); return i[index]; }
|
||||
__forceinline const double& operator[](const size_t index) const { assert(index < 8); return i[index]; }
|
||||
__forceinline double& operator [](size_t index) { assert(index < 8); return i[index]; }
|
||||
__forceinline const double& operator [](size_t index) const { assert(index < 8); return i[index]; }
|
||||
|
||||
};
|
||||
|
||||
@@ -137,112 +134,124 @@ namespace embree
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vdouble8 asDouble ( const __m512& a ) { return _mm512_castps_pd(a); }
|
||||
__forceinline const vdouble8 operator +( const vdouble8& a ) { return a; }
|
||||
__forceinline const vdouble8 operator -( const vdouble8& a ) { return _mm512_sub_pd(_mm512_setzero_pd(), a); }
|
||||
__forceinline vdouble8 asDouble(const vllong8& a) { return _mm512_castsi512_pd(a); }
|
||||
__forceinline vllong8 asLLong (const vdouble8& a) { return _mm512_castpd_si512(a); }
|
||||
|
||||
__forceinline vdouble8 operator +(const vdouble8& a) { return a; }
|
||||
__forceinline vdouble8 operator -(const vdouble8& a) { return _mm512_sub_pd(_mm512_setzero_pd(), a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vdouble8 operator +( const vdouble8& a, const vdouble8& b ) { return _mm512_add_pd(a, b); }
|
||||
__forceinline const vdouble8 operator +( const vdouble8& a, const double b ) { return a + vdouble8(b); }
|
||||
__forceinline const vdouble8 operator +( const double a, const vdouble8& b ) { return vdouble8(a) + b; }
|
||||
__forceinline vdouble8 operator +(const vdouble8& a, const vdouble8& b) { return _mm512_add_pd(a, b); }
|
||||
__forceinline vdouble8 operator +(const vdouble8& a, double b) { return a + vdouble8(b); }
|
||||
__forceinline vdouble8 operator +(double a, const vdouble8& b) { return vdouble8(a) + b; }
|
||||
|
||||
__forceinline const vdouble8 operator -( const vdouble8& a, const vdouble8& b ) { return _mm512_sub_pd(a, b); }
|
||||
__forceinline const vdouble8 operator -( const vdouble8& a, const double b ) { return a - vdouble8(b); }
|
||||
__forceinline const vdouble8 operator -( const double a, const vdouble8& b ) { return vdouble8(a) - b; }
|
||||
__forceinline vdouble8 operator -(const vdouble8& a, const vdouble8& b) { return _mm512_sub_pd(a, b); }
|
||||
__forceinline vdouble8 operator -(const vdouble8& a, double b) { return a - vdouble8(b); }
|
||||
__forceinline vdouble8 operator -(double a, const vdouble8& b) { return vdouble8(a) - b; }
|
||||
|
||||
__forceinline const vdouble8 operator *( const vdouble8& a, const vdouble8& b ) { return _mm512_mul_pd(a, b); }
|
||||
__forceinline const vdouble8 operator *( const vdouble8& a, const double b ) { return a * vdouble8(b); }
|
||||
__forceinline const vdouble8 operator *( const double a, const vdouble8& b ) { return vdouble8(a) * b; }
|
||||
__forceinline vdouble8 operator *(const vdouble8& a, const vdouble8& b) { return _mm512_mul_pd(a, b); }
|
||||
__forceinline vdouble8 operator *(const vdouble8& a, double b) { return a * vdouble8(b); }
|
||||
__forceinline vdouble8 operator *(double a, const vdouble8& b) { return vdouble8(a) * b; }
|
||||
|
||||
__forceinline const vdouble8 operator &( const vdouble8& a, const vdouble8& b ) { return _mm512_and_pd(a, b); }
|
||||
__forceinline const vdouble8 operator &( const vdouble8& a, const double b ) { return a & vdouble8(b); }
|
||||
__forceinline const vdouble8 operator &( const double a, const vdouble8& b ) { return vdouble8(a) & b; }
|
||||
__forceinline vdouble8 operator &(const vdouble8& a, const vdouble8& b) { return _mm512_and_pd(a, b); }
|
||||
__forceinline vdouble8 operator &(const vdouble8& a, double b) { return a & vdouble8(b); }
|
||||
__forceinline vdouble8 operator &(double a, const vdouble8& b) { return vdouble8(a) & b; }
|
||||
|
||||
__forceinline const vdouble8 operator |( const vdouble8& a, const vdouble8& b ) { return _mm512_or_pd(a, b); }
|
||||
__forceinline const vdouble8 operator |( const vdouble8& a, const double b ) { return a | vdouble8(b); }
|
||||
__forceinline const vdouble8 operator |( const double a, const vdouble8& b ) { return vdouble8(a) | b; }
|
||||
__forceinline vdouble8 operator |(const vdouble8& a, const vdouble8& b) { return _mm512_or_pd(a, b); }
|
||||
__forceinline vdouble8 operator |(const vdouble8& a, double b) { return a | vdouble8(b); }
|
||||
__forceinline vdouble8 operator |(double a, const vdouble8& b) { return vdouble8(a) | b; }
|
||||
|
||||
__forceinline const vdouble8 operator ^( const vdouble8& a, const vdouble8& b ) { return _mm512_xor_pd(a, b); }
|
||||
__forceinline const vdouble8 operator ^( const vdouble8& a, const double b ) { return a ^ vdouble8(b); }
|
||||
__forceinline const vdouble8 operator ^( const double a, const vdouble8& b ) { return vdouble8(a) ^ b; }
|
||||
__forceinline vdouble8 operator ^(const vdouble8& a, const vdouble8& b) { return _mm512_xor_pd(a, b); }
|
||||
__forceinline vdouble8 operator ^(const vdouble8& a, double b) { return a ^ vdouble8(b); }
|
||||
__forceinline vdouble8 operator ^(double a, const vdouble8& b) { return vdouble8(a) ^ b; }
|
||||
|
||||
__forceinline const vdouble8 operator <<( const vdouble8& a, const unsigned int n ) { return _mm512_castsi512_pd(_mm512_slli_epi64(_mm512_castpd_si512(a), n)); }
|
||||
__forceinline const vdouble8 operator >>( const vdouble8& a, const unsigned int n ) { return _mm512_castsi512_pd(_mm512_srai_epi64(_mm512_castpd_si512(a), n)); }
|
||||
__forceinline vdouble8 operator <<(const vdouble8& a, const unsigned int n) { return _mm512_castsi512_pd(_mm512_slli_epi64(_mm512_castpd_si512(a), n)); }
|
||||
__forceinline vdouble8 operator >>(const vdouble8& a, const unsigned int n) { return _mm512_castsi512_pd(_mm512_srai_epi64(_mm512_castpd_si512(a), n)); }
|
||||
|
||||
__forceinline const vdouble8 operator <<( const vdouble8& a, const vllong8& n ) { return _mm512_castsi512_pd(_mm512_sllv_epi64(_mm512_castpd_si512(a), n)); }
|
||||
__forceinline const vdouble8 operator >>( const vdouble8& a, const vllong8& n ) { return _mm512_castsi512_pd(_mm512_srav_epi64(_mm512_castpd_si512(a), n)); }
|
||||
__forceinline vdouble8 operator <<(const vdouble8& a, const vllong8& n) { return _mm512_castsi512_pd(_mm512_sllv_epi64(_mm512_castpd_si512(a), n)); }
|
||||
__forceinline vdouble8 operator >>(const vdouble8& a, const vllong8& n) { return _mm512_castsi512_pd(_mm512_srav_epi64(_mm512_castpd_si512(a), n)); }
|
||||
|
||||
__forceinline const vdouble8 sll ( const vdouble8& a, const unsigned int b ) { return _mm512_castsi512_pd(_mm512_slli_epi64(_mm512_castpd_si512(a), b)); }
|
||||
__forceinline const vdouble8 sra ( const vdouble8& a, const unsigned int b ) { return _mm512_castsi512_pd(_mm512_srai_epi64(_mm512_castpd_si512(a), b)); }
|
||||
__forceinline const vdouble8 srl ( const vdouble8& a, const unsigned int b ) { return _mm512_castsi512_pd(_mm512_srli_epi64(_mm512_castpd_si512(a), b)); }
|
||||
__forceinline vdouble8 sll (const vdouble8& a, const unsigned int b) { return _mm512_castsi512_pd(_mm512_slli_epi64(_mm512_castpd_si512(a), b)); }
|
||||
__forceinline vdouble8 sra (const vdouble8& a, const unsigned int b) { return _mm512_castsi512_pd(_mm512_srai_epi64(_mm512_castpd_si512(a), b)); }
|
||||
__forceinline vdouble8 srl (const vdouble8& a, const unsigned int b) { return _mm512_castsi512_pd(_mm512_srli_epi64(_mm512_castpd_si512(a), b)); }
|
||||
|
||||
__forceinline const vdouble8 min( const vdouble8& a, const vdouble8& b ) { return _mm512_min_pd(a, b); }
|
||||
__forceinline const vdouble8 min( const vdouble8& a, const double b ) { return min(a,vdouble8(b)); }
|
||||
__forceinline const vdouble8 min( const double a, const vdouble8& b ) { return min(vdouble8(a),b); }
|
||||
__forceinline vdouble8 min(const vdouble8& a, const vdouble8& b) { return _mm512_min_pd(a, b); }
|
||||
__forceinline vdouble8 min(const vdouble8& a, double b) { return min(a,vdouble8(b)); }
|
||||
__forceinline vdouble8 min(double a, const vdouble8& b) { return min(vdouble8(a),b); }
|
||||
|
||||
__forceinline const vdouble8 max( const vdouble8& a, const vdouble8& b ) { return _mm512_max_pd(a, b); }
|
||||
__forceinline const vdouble8 max( const vdouble8& a, const double b ) { return max(a,vdouble8(b)); }
|
||||
__forceinline const vdouble8 max( const double a, const vdouble8& b ) { return max(vdouble8(a),b); }
|
||||
__forceinline vdouble8 max(const vdouble8& a, const vdouble8& b) { return _mm512_max_pd(a, b); }
|
||||
__forceinline vdouble8 max(const vdouble8& a, double b) { return max(a,vdouble8(b)); }
|
||||
__forceinline vdouble8 max(double a, const vdouble8& b) { return max(vdouble8(a),b); }
|
||||
|
||||
__forceinline const vdouble8 mask_add(const vboold8& mask, vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_add_pd(c,mask,a,b); }
|
||||
__forceinline const vdouble8 mask_sub(const vboold8& mask, vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_sub_pd(c,mask,a,b); }
|
||||
__forceinline vdouble8 mask_add(const vboold8& mask, vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_add_pd(c,mask,a,b); }
|
||||
__forceinline vdouble8 mask_sub(const vboold8& mask, vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_sub_pd(c,mask,a,b); }
|
||||
|
||||
__forceinline vdouble8 mask_and(const vboold8& m,vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_and_pd(c,m,a,b); }
|
||||
__forceinline vdouble8 mask_or (const vboold8& m,vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_or_pd(c,m,a,b); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Ternary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vdouble8 madd (const vdouble8& a, const vdouble8& b, const vdouble8& c) { return _mm512_fmadd_pd(a,b,c); }
|
||||
__forceinline vdouble8 msub (const vdouble8& a, const vdouble8& b, const vdouble8& c) { return _mm512_fmsub_pd(a,b,c); }
|
||||
__forceinline vdouble8 nmadd(const vdouble8& a, const vdouble8& b, const vdouble8& c) { return _mm512_fnmadd_pd(a,b,c); }
|
||||
__forceinline vdouble8 nmsub(const vdouble8& a, const vdouble8& b, const vdouble8& c) { return _mm512_fnmsub_pd(a,b,c); }
|
||||
|
||||
__forceinline const vdouble8 mask_and(const vboold8& m,vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_and_pd(c,m,a,b); }
|
||||
__forceinline const vdouble8 mask_or (const vboold8& m,vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_or_pd(c,m,a,b); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vdouble8& operator +=( vdouble8& a, const vdouble8& b ) { return a = a + b; }
|
||||
__forceinline vdouble8& operator +=( vdouble8& a, const double b ) { return a = a + b; }
|
||||
__forceinline vdouble8& operator +=(vdouble8& a, const vdouble8& b) { return a = a + b; }
|
||||
__forceinline vdouble8& operator +=(vdouble8& a, double b) { return a = a + b; }
|
||||
|
||||
__forceinline vdouble8& operator -=( vdouble8& a, const vdouble8& b ) { return a = a - b; }
|
||||
__forceinline vdouble8& operator -=( vdouble8& a, const double b ) { return a = a - b; }
|
||||
__forceinline vdouble8& operator -=(vdouble8& a, const vdouble8& b) { return a = a - b; }
|
||||
__forceinline vdouble8& operator -=(vdouble8& a, double b) { return a = a - b; }
|
||||
|
||||
__forceinline vdouble8& operator *=( vdouble8& a, const vdouble8& b ) { return a = a * b; }
|
||||
__forceinline vdouble8& operator *=( vdouble8& a, const double b ) { return a = a * b; }
|
||||
__forceinline vdouble8& operator *=(vdouble8& a, const vdouble8& b) { return a = a * b; }
|
||||
__forceinline vdouble8& operator *=(vdouble8& a, double b) { return a = a * b; }
|
||||
|
||||
__forceinline vdouble8& operator &=( vdouble8& a, const vdouble8& b ) { return a = a & b; }
|
||||
__forceinline vdouble8& operator &=( vdouble8& a, const double b ) { return a = a & b; }
|
||||
__forceinline vdouble8& operator &=(vdouble8& a, const vdouble8& b) { return a = a & b; }
|
||||
__forceinline vdouble8& operator &=(vdouble8& a, double b) { return a = a & b; }
|
||||
|
||||
__forceinline vdouble8& operator |=( vdouble8& a, const vdouble8& b ) { return a = a | b; }
|
||||
__forceinline vdouble8& operator |=( vdouble8& a, const double b ) { return a = a | b; }
|
||||
__forceinline vdouble8& operator |=(vdouble8& a, const vdouble8& b) { return a = a | b; }
|
||||
__forceinline vdouble8& operator |=(vdouble8& a, double b) { return a = a | b; }
|
||||
|
||||
__forceinline vdouble8& operator <<=( vdouble8& a, const double b ) { return a = a << b; }
|
||||
__forceinline vdouble8& operator >>=( vdouble8& a, const double b ) { return a = a >> b; }
|
||||
__forceinline vdouble8& operator <<=(vdouble8& a, const double b) { return a = a << b; }
|
||||
__forceinline vdouble8& operator >>=(vdouble8& a, const double b) { return a = a >> b; }
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboold8 operator ==( const vdouble8& a, const vdouble8& b ) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_EQ); }
|
||||
__forceinline const vboold8 operator ==( const vdouble8& a, const double b ) { return a == vdouble8(b); }
|
||||
__forceinline const vboold8 operator ==( const double a, const vdouble8& b ) { return vdouble8(a) == b; }
|
||||
__forceinline vboold8 operator ==(const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_EQ); }
|
||||
__forceinline vboold8 operator ==(const vdouble8& a, double b) { return a == vdouble8(b); }
|
||||
__forceinline vboold8 operator ==(double a, const vdouble8& b) { return vdouble8(a) == b; }
|
||||
|
||||
__forceinline const vboold8 operator !=( const vdouble8& a, const vdouble8& b ) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_NE); }
|
||||
__forceinline const vboold8 operator !=( const vdouble8& a, const double b ) { return a != vdouble8(b); }
|
||||
__forceinline const vboold8 operator !=( const double a, const vdouble8& b ) { return vdouble8(a) != b; }
|
||||
__forceinline vboold8 operator !=(const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_NE); }
|
||||
__forceinline vboold8 operator !=(const vdouble8& a, double b) { return a != vdouble8(b); }
|
||||
__forceinline vboold8 operator !=(double a, const vdouble8& b) { return vdouble8(a) != b; }
|
||||
|
||||
__forceinline const vboold8 operator < ( const vdouble8& a, const vdouble8& b ) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_LT); }
|
||||
__forceinline const vboold8 operator < ( const vdouble8& a, const double b ) { return a < vdouble8(b); }
|
||||
__forceinline const vboold8 operator < ( const double a, const vdouble8& b ) { return vdouble8(a) < b; }
|
||||
__forceinline vboold8 operator < (const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_LT); }
|
||||
__forceinline vboold8 operator < (const vdouble8& a, double b) { return a < vdouble8(b); }
|
||||
__forceinline vboold8 operator < (double a, const vdouble8& b) { return vdouble8(a) < b; }
|
||||
|
||||
__forceinline const vboold8 operator >=( const vdouble8& a, const vdouble8& b ) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_GE); }
|
||||
__forceinline const vboold8 operator >=( const vdouble8& a, const double b ) { return a >= vdouble8(b); }
|
||||
__forceinline const vboold8 operator >=( const double a, const vdouble8& b ) { return vdouble8(a) >= b; }
|
||||
__forceinline vboold8 operator >=(const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_GE); }
|
||||
__forceinline vboold8 operator >=(const vdouble8& a, double b) { return a >= vdouble8(b); }
|
||||
__forceinline vboold8 operator >=(double a, const vdouble8& b) { return vdouble8(a) >= b; }
|
||||
|
||||
__forceinline const vboold8 operator > ( const vdouble8& a, const vdouble8& b ) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_GT); }
|
||||
__forceinline const vboold8 operator > ( const vdouble8& a, const double b ) { return a > vdouble8(b); }
|
||||
__forceinline const vboold8 operator > ( const double a, const vdouble8& b ) { return vdouble8(a) > b; }
|
||||
__forceinline vboold8 operator > (const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_GT); }
|
||||
__forceinline vboold8 operator > (const vdouble8& a, double b) { return a > vdouble8(b); }
|
||||
__forceinline vboold8 operator > (double a, const vdouble8& b) { return vdouble8(a) > b; }
|
||||
|
||||
__forceinline const vboold8 operator <=( const vdouble8& a, const vdouble8& b ) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_LE); }
|
||||
__forceinline const vboold8 operator <=( const vdouble8& a, const double b ) { return a <= vdouble8(b); }
|
||||
__forceinline const vboold8 operator <=( const double a, const vdouble8& b ) { return vdouble8(a) <= b; }
|
||||
__forceinline vboold8 operator <=(const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_LE); }
|
||||
__forceinline vboold8 operator <=(const vdouble8& a, double b) { return a <= vdouble8(b); }
|
||||
__forceinline vboold8 operator <=(double a, const vdouble8& b) { return vdouble8(a) <= b; }
|
||||
|
||||
__forceinline vboold8 eq(const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_EQ); }
|
||||
__forceinline vboold8 ne(const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_NE); }
|
||||
@@ -258,7 +267,7 @@ namespace embree
|
||||
__forceinline vboold8 gt(const vboold8 mask, const vdouble8& a, const vdouble8& b) { return _mm512_mask_cmp_pd_mask(mask,a,b,_MM_CMPINT_GT); }
|
||||
__forceinline vboold8 le(const vboold8 mask, const vdouble8& a, const vdouble8& b) { return _mm512_mask_cmp_pd_mask(mask,a,b,_MM_CMPINT_LE); }
|
||||
|
||||
__forceinline const vdouble8 select( const vboold8& m, const vdouble8& t, const vdouble8& f ) {
|
||||
__forceinline vdouble8 select(const vboold8& m, const vdouble8& t, const vdouble8& f) {
|
||||
return _mm512_mask_or_pd(f,m,t,t);
|
||||
}
|
||||
|
||||
@@ -278,34 +287,38 @@ namespace embree
|
||||
// Movement/Shifting/Shuffling Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<size_t i>
|
||||
__forceinline const vdouble8 shuffle( const vdouble8& a ) {
|
||||
return _mm512_permute_pd(a, _MM_SHUFFLE(i, i, i, i));
|
||||
}
|
||||
|
||||
template<int A, int B, int C, int D>
|
||||
__forceinline vdouble8 shuffle (const vdouble8& v) {
|
||||
return _mm512_permute_pd(v,_MM_SHUFFLE(D,C,B,A));
|
||||
template<int i0, int i1>
|
||||
__forceinline vdouble8 shuffle(const vdouble8& v) {
|
||||
return _mm512_permute_pd(v, (i1 << 7) | (i0 << 6) | (i1 << 5) | (i0 << 4) | (i1 << 3) | (i0 << 2) | (i1 << 1) | i0);
|
||||
}
|
||||
|
||||
template<int i>
|
||||
__forceinline vdouble8 shuffle4(const vdouble8& x) {
|
||||
return _mm512_shuffle_f64x2(x,x,_MM_SHUFFLE(i,i,i,i));
|
||||
__forceinline vdouble8 shuffle(const vdouble8& v) {
|
||||
return shuffle<i, i>(v);
|
||||
}
|
||||
|
||||
template<int A, int B>
|
||||
__forceinline vdouble8 shuffle4(const vdouble8& x) {
|
||||
return _mm512_shuffle_f64x2(x,x,_MM_SHUFFLE(0,0,B,A));
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vdouble8 shuffle(const vdouble8& v) {
|
||||
return _mm512_permutex_pd(v, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
}
|
||||
|
||||
template<int i0, int i1>
|
||||
__forceinline vdouble8 shuffle4(const vdouble8& v) {
|
||||
return _mm512_shuffle_f64x2(v, v, _MM_SHUFFLE(i1*2+1, i1*2, i0*2+1, i0*2));
|
||||
}
|
||||
|
||||
template<int i>
|
||||
__forceinline vdouble8 shuffle4(const vdouble8& v) {
|
||||
return shuffle4<i, i>(v);
|
||||
}
|
||||
|
||||
template<int i>
|
||||
__forceinline vdouble8 align_shift_right(const vdouble8& a, const vdouble8& b)
|
||||
{
|
||||
return _mm512_castsi512_pd(_mm512_alignr_epi64(_mm512_castpd_si512(a),_mm512_castpd_si512(b),i));
|
||||
__forceinline vdouble8 align_shift_right(const vdouble8& a, const vdouble8& b) {
|
||||
return _mm512_castsi512_pd(_mm512_alignr_epi64(_mm512_castpd_si512(a), _mm512_castpd_si512(b), i));
|
||||
}
|
||||
|
||||
__forceinline double toScalar(const vdouble8& a) {
|
||||
return _mm_cvtsd_f64(_mm512_castpd512_pd128(a));
|
||||
__forceinline double toScalar(const vdouble8& v) {
|
||||
return _mm_cvtsd_f64(_mm512_castpd512_pd128(v));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -316,13 +329,13 @@ namespace embree
|
||||
__forceinline vdouble8 vreduce_add4(vdouble8 x) { x = vreduce_add2(x); return x + shuffle<2,3,0,1>(x); }
|
||||
__forceinline vdouble8 vreduce_add (vdouble8 x) { x = vreduce_add4(x); return x + shuffle4<1,0>(x); }
|
||||
|
||||
__forceinline vdouble8 vreduce_min2(vdouble8 x) { return min(x,shuffle<1,0,3,2>(x)); }
|
||||
__forceinline vdouble8 vreduce_min4(vdouble8 x) { x = vreduce_min2(x); return min(x,shuffle<2,3,0,1>(x)); }
|
||||
__forceinline vdouble8 vreduce_min (vdouble8 x) { x = vreduce_min4(x); return min(x,shuffle4<1,0>(x)); }
|
||||
__forceinline vdouble8 vreduce_min2(vdouble8 x) { return min(x, shuffle<1,0,3,2>(x)); }
|
||||
__forceinline vdouble8 vreduce_min4(vdouble8 x) { x = vreduce_min2(x); return min(x, shuffle<2,3,0,1>(x)); }
|
||||
__forceinline vdouble8 vreduce_min (vdouble8 x) { x = vreduce_min4(x); return min(x, shuffle4<1,0>(x)); }
|
||||
|
||||
__forceinline vdouble8 vreduce_max2(vdouble8 x) { return max(x,shuffle<1,0,3,2>(x)); }
|
||||
__forceinline vdouble8 vreduce_max4(vdouble8 x) { x = vreduce_max2(x); return max(x,shuffle<2,3,0,1>(x)); }
|
||||
__forceinline vdouble8 vreduce_max (vdouble8 x) { x = vreduce_max4(x); return max(x,shuffle4<1,0>(x)); }
|
||||
__forceinline vdouble8 vreduce_max2(vdouble8 x) { return max(x, shuffle<1,0,3,2>(x)); }
|
||||
__forceinline vdouble8 vreduce_max4(vdouble8 x) { x = vreduce_max2(x); return max(x, shuffle<2,3,0,1>(x)); }
|
||||
__forceinline vdouble8 vreduce_max (vdouble8 x) { x = vreduce_max4(x); return max(x, shuffle4<1,0>(x)); }
|
||||
|
||||
__forceinline double reduce_add(const vdouble8& v) { return toScalar(vreduce_add(v)); }
|
||||
__forceinline double reduce_min(const vdouble8& v) { return toScalar(vreduce_min(v)); }
|
||||
@@ -333,18 +346,18 @@ namespace embree
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vdouble8 permute(const vdouble8& v, const vllong8& index) {
|
||||
return _mm512_permutexvar_pd(index,v);
|
||||
return _mm512_permutexvar_pd(index, v);
|
||||
}
|
||||
|
||||
__forceinline vdouble8 reverse(const vdouble8& a) {
|
||||
return permute(a,vllong8(reverse_step));
|
||||
return permute(a, vllong8(reverse_step));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline std::ostream& operator<<(std::ostream& cout, const vdouble8& v)
|
||||
__forceinline std::ostream& operator <<(std::ostream& cout, const vdouble8& v)
|
||||
{
|
||||
cout << "<" << v[0];
|
||||
for (size_t i=1; i<8; i++) cout << ", " << v[i];
|
||||
|
||||
+310
-201
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -20,7 +20,7 @@ namespace embree
|
||||
{
|
||||
/* 16-wide AVX-512 float type */
|
||||
template<>
|
||||
struct vfloat<16>
|
||||
struct vfloat<16>
|
||||
{
|
||||
typedef vboolf16 Bool;
|
||||
typedef vint16 Int;
|
||||
@@ -39,161 +39,188 @@ namespace embree
|
||||
|
||||
__forceinline vfloat() {}
|
||||
__forceinline vfloat(const vfloat16& t) { v = t; }
|
||||
__forceinline vfloat16& operator=(const vfloat16& f) { v = f.v; return *this; }
|
||||
__forceinline vfloat16& operator =(const vfloat16& f) { v = f.v; return *this; }
|
||||
|
||||
__forceinline vfloat(const __m512& t) { v = t; }
|
||||
__forceinline operator __m512 () const { return v; }
|
||||
__forceinline operator __m256 () const { return _mm512_castps512_ps256(v); }
|
||||
|
||||
__forceinline vfloat(const float& f) {
|
||||
__forceinline operator __m512() const { return v; }
|
||||
__forceinline operator __m256() const { return _mm512_castps512_ps256(v); }
|
||||
__forceinline operator __m128() const { return _mm512_castps512_ps128(v); }
|
||||
|
||||
__forceinline vfloat(float f) {
|
||||
v = _mm512_set1_ps(f);
|
||||
}
|
||||
__forceinline vfloat(const float& a, const float& b, const float& c, const float& d) {
|
||||
v = _mm512_set4_ps(a,b,c,d);
|
||||
|
||||
__forceinline vfloat(float a, float b, float c, float d) {
|
||||
v = _mm512_set4_ps(a, b, c, d);
|
||||
}
|
||||
|
||||
__forceinline vfloat(const vfloat4 &i) {
|
||||
__forceinline vfloat(const vfloat4& i) {
|
||||
v = _mm512_broadcast_f32x4(i);
|
||||
}
|
||||
|
||||
__forceinline vfloat(const vfloat4 &a, const vfloat4 &b, const vfloat4 &c, const vfloat4 &d) {
|
||||
v = _mm512_broadcast_f32x4(a);
|
||||
__forceinline vfloat(const vfloat4& a, const vfloat4& b, const vfloat4& c, const vfloat4& d) {
|
||||
v = _mm512_castps128_ps512(a);
|
||||
v = _mm512_insertf32x4(v, b, 1);
|
||||
v = _mm512_insertf32x4(v, c, 2);
|
||||
v = _mm512_insertf32x4(v, d, 3);
|
||||
}
|
||||
|
||||
__forceinline vfloat(const vboolf16& mask, const vfloat4 &a, const vfloat4 &b) {
|
||||
__forceinline vfloat(const vboolf16& mask, const vfloat4& a, const vfloat4& b) {
|
||||
v = _mm512_broadcast_f32x4(a);
|
||||
v = _mm512_mask_broadcast_f32x4(v,mask,b);
|
||||
}
|
||||
|
||||
__forceinline vfloat(const vfloat8 &i) {
|
||||
__forceinline vfloat(const vfloat8& i) {
|
||||
v = _mm512_castpd_ps(_mm512_broadcast_f64x4(_mm256_castps_pd(i)));
|
||||
}
|
||||
|
||||
__forceinline vfloat(const vfloat8 &a, const vfloat8 &b) { // FIXME: optimize
|
||||
const vfloat aa = _mm512_castpd_ps(_mm512_broadcast_f64x4(_mm256_castps_pd(a)));
|
||||
const vfloat bb = _mm512_castpd_ps(_mm512_broadcast_f64x4(_mm256_castps_pd(b)));
|
||||
v = _mm512_mask_blend_ps(0xff, bb, aa);
|
||||
__forceinline vfloat(const vfloat8& a, const vfloat8& b) {
|
||||
v = _mm512_castps256_ps512(a);
|
||||
#if defined(__AVX512DQ__)
|
||||
v = _mm512_insertf32x8(v, b, 1);
|
||||
#else
|
||||
v = _mm512_castpd_ps(_mm512_insertf64x4(_mm512_castps_pd(v), _mm256_castps_pd(b), 1));
|
||||
#endif
|
||||
}
|
||||
|
||||
/* WARNING: due to f64x4 the mask is considered as an 8bit mask */
|
||||
__forceinline vfloat(const vboolf16& mask, const vfloat8 &a, const vfloat8 &b) {
|
||||
__forceinline vfloat(const vboolf16& mask, const vfloat8& a, const vfloat8& b) {
|
||||
__m512d aa = _mm512_broadcast_f64x4(_mm256_castps_pd(a));
|
||||
aa = _mm512_mask_broadcast_f64x4(aa,mask,_mm256_castps_pd(b));
|
||||
v = _mm512_castpd_ps(aa);
|
||||
}
|
||||
|
||||
__forceinline explicit vfloat(const __m512i& a) {
|
||||
__forceinline explicit vfloat(const vint16& a) {
|
||||
v = _mm512_cvtepi32_ps(a);
|
||||
}
|
||||
|
||||
__forceinline explicit vfloat(const vuint16& a) {
|
||||
v = _mm512_cvtepu32_ps(a);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vfloat(ZeroTy) : v(_mm512_setzero_ps()) {}
|
||||
__forceinline vfloat(OneTy) : v(_mm512_set1_ps(1.0f)) {}
|
||||
__forceinline vfloat(PosInfTy) : v(_mm512_set1_ps(pos_inf)) {}
|
||||
__forceinline vfloat(NegInfTy) : v(_mm512_set1_ps(neg_inf)) {}
|
||||
__forceinline vfloat(StepTy) : v(_mm512_set_ps(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) {}
|
||||
__forceinline vfloat(NaNTy) : v(_mm512_set1_ps(nan)) {}
|
||||
__forceinline vfloat(UndefinedTy) : v(_mm512_undefined_ps()) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Loads and Stores
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static __forceinline vfloat16 load (const void* const ptr) { return _mm512_load_ps((float*)ptr); }
|
||||
static __forceinline vfloat16 loadu(const void* const ptr) { return _mm512_loadu_ps((float*)ptr); }
|
||||
static __forceinline vfloat16 load (const void* ptr) { return _mm512_load_ps((float*)ptr); }
|
||||
static __forceinline vfloat16 loadu(const void* ptr) { return _mm512_loadu_ps((float*)ptr); }
|
||||
|
||||
static __forceinline vfloat16 load (const vboolf16& mask, const void* const ptr) { return _mm512_mask_load_ps (_mm512_setzero_ps(),mask,(float*)ptr); }
|
||||
static __forceinline vfloat16 loadu(const vboolf16& mask, const void* const ptr) { return _mm512_mask_loadu_ps(_mm512_setzero_ps(),mask,(float*)ptr); }
|
||||
static __forceinline vfloat16 load (const vboolf16& mask, const void* ptr) { return _mm512_mask_load_ps (_mm512_setzero_ps(),mask,(float*)ptr); }
|
||||
static __forceinline vfloat16 loadu(const vboolf16& mask, const void* ptr) { return _mm512_mask_loadu_ps(_mm512_setzero_ps(),mask,(float*)ptr); }
|
||||
|
||||
static __forceinline void store (void* const ptr, const vfloat16& v) { _mm512_store_ps ((float*)ptr,v); }
|
||||
static __forceinline void storeu(void* const ptr, const vfloat16& v) { _mm512_storeu_ps((float*)ptr,v); }
|
||||
static __forceinline void store (void* ptr, const vfloat16& v) { _mm512_store_ps ((float*)ptr,v); }
|
||||
static __forceinline void storeu(void* ptr, const vfloat16& v) { _mm512_storeu_ps((float*)ptr,v); }
|
||||
|
||||
static __forceinline void store (const vboolf16& mask, void* ptr, const vfloat16& v) { _mm512_mask_store_ps ((float*)ptr,mask,v); }
|
||||
static __forceinline void storeu(const vboolf16& mask, void* ptr, const vfloat16& v) { _mm512_mask_storeu_ps((float*)ptr,mask,v); }
|
||||
|
||||
static __forceinline void store_nt(void *__restrict__ ptr, const vfloat16& a) {
|
||||
static __forceinline void store_nt(void* __restrict__ ptr, const vfloat16& a) {
|
||||
_mm512_stream_ps((float*)ptr,a);
|
||||
}
|
||||
|
||||
static __forceinline vfloat16 broadcast(const float *const f) {
|
||||
static __forceinline vfloat16 broadcast(const float* f) {
|
||||
return _mm512_set1_ps(*f);
|
||||
}
|
||||
|
||||
static __forceinline vfloat16 compact(const vboolf16& mask, vfloat16 &v) {
|
||||
return _mm512_mask_compress_ps(v,mask,v);
|
||||
return _mm512_mask_compress_ps(v, mask, v);
|
||||
}
|
||||
static __forceinline vfloat16 compact(const vboolf16& mask, vfloat16 &a, const vfloat16 &b) {
|
||||
return _mm512_mask_compress_ps(a,mask,b);
|
||||
static __forceinline vfloat16 compact(const vboolf16& mask, vfloat16 &a, const vfloat16& b) {
|
||||
return _mm512_mask_compress_ps(a, mask, b);
|
||||
}
|
||||
|
||||
static __forceinline vfloat16 expand(const vboolf16& mask, const vfloat16& a, vfloat16& b) {
|
||||
return _mm512_mask_expand_ps(b,mask,a);
|
||||
return _mm512_mask_expand_ps(b, mask, a);
|
||||
}
|
||||
|
||||
static __forceinline vfloat16 loadu_compact(const vboolf16& mask, const void *const ptr) {
|
||||
return _mm512_mask_expandloadu_ps(vfloat16::undefined(),mask,(float*)ptr);
|
||||
static __forceinline vfloat16 loadu_compact(const vboolf16& mask, const void* ptr) {
|
||||
return _mm512_mask_expandloadu_ps(_mm512_setzero_ps(), mask, (float*)ptr);
|
||||
}
|
||||
|
||||
static __forceinline void storeu_compact(const vboolf16& mask, float *addr, const vfloat16 reg) {
|
||||
_mm512_mask_compressstoreu_ps(addr,mask,reg);
|
||||
_mm512_mask_compressstoreu_ps(addr, mask, reg);
|
||||
}
|
||||
|
||||
static __forceinline void storeu_compact_single(const vboolf16& mask, float * addr, const vfloat16 ®) {
|
||||
static __forceinline void storeu_compact_single(const vboolf16& mask, float * addr, const vfloat16& reg) {
|
||||
//_mm512_mask_compressstoreu_ps(addr,mask,reg);
|
||||
*addr = mm512_cvtss_f32(_mm512_mask_compress_ps(reg,mask,reg));
|
||||
*addr = mm512_cvtss_f32(_mm512_mask_compress_ps(reg, mask, reg));
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline vfloat16 gather(const float* ptr, const vint16& index) {
|
||||
return _mm512_i32gather_ps(index, ptr, scale);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vfloat( ZeroTy ) : v(_mm512_setzero_ps()) {}
|
||||
__forceinline vfloat( OneTy ) : v(_mm512_set1_ps(1.0f)) {}
|
||||
__forceinline vfloat( PosInfTy ) : v(_mm512_set1_ps(pos_inf)) {}
|
||||
__forceinline vfloat( NegInfTy ) : v(_mm512_set1_ps(neg_inf)) {}
|
||||
__forceinline vfloat( StepTy ) : v(_mm512_set_ps(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) {}
|
||||
__forceinline vfloat( NaNTy ) : v(_mm512_set1_ps(nan)) {}
|
||||
template<int scale = 4>
|
||||
static __forceinline vfloat16 gather(const vboolf16& mask, const float* ptr, const vint16& index) {
|
||||
vfloat16 r = zero;
|
||||
return _mm512_mask_i32gather_ps(r, mask, index, ptr, scale);
|
||||
}
|
||||
|
||||
__forceinline static vfloat16 undefined() { return _mm512_undefined_ps(); }
|
||||
__forceinline static vfloat16 zero() { return _mm512_setzero_ps(); }
|
||||
__forceinline static vfloat16 one () { return _mm512_set1_ps(1.0f); }
|
||||
__forceinline static vfloat16 ulp () { return _mm512_set1_ps(embree::ulp); }
|
||||
__forceinline static vfloat16 inf () { return _mm512_set1_ps((float)pos_inf); }
|
||||
__forceinline static vfloat16 minus_inf () { return _mm512_set1_ps((float)neg_inf); }
|
||||
template<int scale = 4>
|
||||
static __forceinline void scatter(float* ptr, const vint16& index, const vfloat16& v) {
|
||||
_mm512_i32scatter_ps(ptr, index, v, scale);
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline void scatter(const vboolf16& mask, float* ptr, const vint16& index, const vfloat16& v) {
|
||||
_mm512_mask_i32scatter_ps(ptr, mask, index, v, scale);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline float& operator [](const size_t index) { assert(index < 16); return f[index]; }
|
||||
__forceinline const float& operator [](const size_t index) const { assert(index < 16); return f[index]; }
|
||||
__forceinline float& operator [](size_t index) { assert(index < 16); return f[index]; }
|
||||
__forceinline const float& operator [](size_t index) const { assert(index < 16); return f[index]; }
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vfloat16 asFloat ( const __m512i& a ) { return _mm512_castsi512_ps(a); }
|
||||
__forceinline const vfloat16 operator +( const vfloat16& a ) { return a; }
|
||||
__forceinline const vfloat16 operator -( const vfloat16& a ) { return _mm512_mul_ps(a,vfloat16(-1)); }
|
||||
__forceinline const vfloat16 abs ( const vfloat16& a ) { return _mm512_castsi512_ps(_mm512_and_epi32(_mm512_castps_si512(a),_mm512_set1_epi32(0x7FFFFFFF))); }
|
||||
__forceinline const vfloat16 signmsk ( const vfloat16& a ) { return _mm512_castsi512_ps(_mm512_and_epi32(_mm512_castps_si512(a),_mm512_set1_epi32(0x80000000))); }
|
||||
__forceinline vfloat16 asFloat(const vint16& a) { return _mm512_castsi512_ps(a); }
|
||||
__forceinline vint16 asInt (const vfloat16& a) { return _mm512_castps_si512(a); }
|
||||
__forceinline vuint16 asUInt (const vfloat16& a) { return _mm512_castps_si512(a); }
|
||||
|
||||
__forceinline const vfloat16 rcp(const vfloat16& a) {
|
||||
__forceinline vfloat16 operator +(const vfloat16& a) { return a; }
|
||||
__forceinline vfloat16 operator -(const vfloat16& a) { return _mm512_mul_ps(a,vfloat16(-1)); }
|
||||
|
||||
__forceinline vfloat16 abs (const vfloat16& a) { return _mm512_castsi512_ps(_mm512_and_epi32(_mm512_castps_si512(a),_mm512_set1_epi32(0x7FFFFFFF))); }
|
||||
__forceinline vfloat16 signmsk(const vfloat16& a) { return _mm512_castsi512_ps(_mm512_and_epi32(_mm512_castps_si512(a),_mm512_set1_epi32(0x80000000))); }
|
||||
|
||||
__forceinline vfloat16 rcp(const vfloat16& a) {
|
||||
#if defined(__AVX512ER__)
|
||||
return _mm512_rcp28_ps(a);
|
||||
#else
|
||||
const vfloat16 r = _mm512_rcp14_ps(a.v);
|
||||
const vfloat16 r = _mm512_rcp14_ps(a);
|
||||
return _mm512_mul_ps(r, _mm512_fnmadd_ps(r, a, vfloat16(2.0f)));
|
||||
#endif
|
||||
}
|
||||
|
||||
__forceinline const vfloat16 sqr ( const vfloat16& a ) { return _mm512_mul_ps(a,a); }
|
||||
__forceinline const vfloat16 sqrt ( const vfloat16& a ) { return _mm512_sqrt_ps(a); }
|
||||
__forceinline vfloat16 sqr (const vfloat16& a) { return _mm512_mul_ps(a,a); }
|
||||
__forceinline vfloat16 sqrt(const vfloat16& a) { return _mm512_sqrt_ps(a); }
|
||||
|
||||
__forceinline const vfloat16 rsqrt( const vfloat16& a )
|
||||
__forceinline vfloat16 rsqrt(const vfloat16& a)
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
const vfloat16 r = _mm512_rsqrt14_ps(a.v);
|
||||
const vfloat16 r = _mm512_rsqrt14_ps(a);
|
||||
return _mm512_fmadd_ps(_mm512_set1_ps(1.5f), r,
|
||||
_mm512_mul_ps(_mm512_mul_ps(_mm512_mul_ps(a, _mm512_set1_ps(-0.5f)), r), _mm512_mul_ps(r, r)));
|
||||
#else
|
||||
return _mm512_rsqrt28_ps(a.v);
|
||||
return _mm512_rsqrt28_ps(a);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -201,43 +228,43 @@ namespace embree
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vfloat16 operator +( const vfloat16& a, const vfloat16& b ) { return _mm512_add_ps(a, b); }
|
||||
__forceinline const vfloat16 operator +( const vfloat16& a, const float& b ) { return a + vfloat16(b); }
|
||||
__forceinline const vfloat16 operator +( const float& a, const vfloat16& b ) { return vfloat16(a) + b; }
|
||||
__forceinline vfloat16 operator +(const vfloat16& a, const vfloat16& b) { return _mm512_add_ps(a, b); }
|
||||
__forceinline vfloat16 operator +(const vfloat16& a, float b) { return a + vfloat16(b); }
|
||||
__forceinline vfloat16 operator +(float a, const vfloat16& b) { return vfloat16(a) + b; }
|
||||
|
||||
__forceinline const vfloat16 operator -( const vfloat16& a, const vfloat16& b ) { return _mm512_sub_ps(a, b); }
|
||||
__forceinline const vfloat16 operator -( const vfloat16& a, const float& b ) { return a - vfloat16(b); }
|
||||
__forceinline const vfloat16 operator -( const float& a, const vfloat16& b ) { return vfloat16(a) - b; }
|
||||
__forceinline vfloat16 operator -(const vfloat16& a, const vfloat16& b) { return _mm512_sub_ps(a, b); }
|
||||
__forceinline vfloat16 operator -(const vfloat16& a, float b) { return a - vfloat16(b); }
|
||||
__forceinline vfloat16 operator -(float a, const vfloat16& b) { return vfloat16(a) - b; }
|
||||
|
||||
__forceinline const vfloat16 operator *( const vfloat16& a, const vfloat16& b ) { return _mm512_mul_ps(a, b); }
|
||||
__forceinline const vfloat16 operator *( const vfloat16& a, const float& b ) { return a * vfloat16(b); }
|
||||
__forceinline const vfloat16 operator *( const float& a, const vfloat16& b ) { return vfloat16(a) * b; }
|
||||
__forceinline vfloat16 operator *(const vfloat16& a, const vfloat16& b) { return _mm512_mul_ps(a, b); }
|
||||
__forceinline vfloat16 operator *(const vfloat16& a, float b) { return a * vfloat16(b); }
|
||||
__forceinline vfloat16 operator *(float a, const vfloat16& b) { return vfloat16(a) * b; }
|
||||
|
||||
__forceinline const vfloat16 operator /( const vfloat16& a, const vfloat16& b ) { return _mm512_div_ps(a,b); }
|
||||
__forceinline const vfloat16 operator /( const vfloat16& a, const float& b ) { return a/vfloat16(b); }
|
||||
__forceinline const vfloat16 operator /( const float& a, const vfloat16& b ) { return vfloat16(a)/b; }
|
||||
__forceinline vfloat16 operator /(const vfloat16& a, const vfloat16& b) { return _mm512_div_ps(a,b); }
|
||||
__forceinline vfloat16 operator /(const vfloat16& a, float b) { return a/vfloat16(b); }
|
||||
__forceinline vfloat16 operator /(float a, const vfloat16& b) { return vfloat16(a)/b; }
|
||||
|
||||
__forceinline const vfloat16 operator^(const vfloat16& a, const vfloat16& b) {
|
||||
__forceinline vfloat16 operator ^(const vfloat16& a, const vfloat16& b) {
|
||||
return _mm512_castsi512_ps(_mm512_xor_epi32(_mm512_castps_si512(a),_mm512_castps_si512(b)));
|
||||
}
|
||||
|
||||
__forceinline const vfloat16 min( const vfloat16& a, const vfloat16& b ) {
|
||||
__forceinline vfloat16 min(const vfloat16& a, const vfloat16& b) {
|
||||
return _mm512_min_ps(a,b);
|
||||
}
|
||||
__forceinline const vfloat16 min( const vfloat16& a, const float& b ) {
|
||||
__forceinline vfloat16 min(const vfloat16& a, float b) {
|
||||
return _mm512_min_ps(a,vfloat16(b));
|
||||
}
|
||||
__forceinline const vfloat16 min( const float& a, const vfloat16& b ) {
|
||||
__forceinline vfloat16 min(const float& a, const vfloat16& b) {
|
||||
return _mm512_min_ps(vfloat16(a),b);
|
||||
}
|
||||
|
||||
__forceinline const vfloat16 max( const vfloat16& a, const vfloat16& b ) {
|
||||
__forceinline vfloat16 max(const vfloat16& a, const vfloat16& b) {
|
||||
return _mm512_max_ps(a,b);
|
||||
}
|
||||
__forceinline const vfloat16 max( const vfloat16& a, const float& b ) {
|
||||
__forceinline vfloat16 max(const vfloat16& a, float b) {
|
||||
return _mm512_max_ps(a,vfloat16(b));
|
||||
}
|
||||
__forceinline const vfloat16 max( const float& a, const vfloat16& b ) {
|
||||
__forceinline vfloat16 max(const float& a, const vfloat16& b) {
|
||||
return _mm512_max_ps(vfloat16(a),b);
|
||||
}
|
||||
|
||||
@@ -276,12 +303,11 @@ namespace embree
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vfloat16 madd (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmadd_ps(a,b,c); }
|
||||
|
||||
__forceinline vfloat16 msub (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmsub_ps(a,b,c); }
|
||||
__forceinline vfloat16 nmadd (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fnmadd_ps(a,b,c); }
|
||||
__forceinline vfloat16 nmsub (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fnmsub_ps(a,b,c); }
|
||||
__forceinline vfloat16 nmadd(const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fnmadd_ps(a,b,c); }
|
||||
__forceinline vfloat16 nmsub(const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fnmsub_ps(a,b,c); }
|
||||
|
||||
__forceinline vfloat16 mask_msub (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_fmsub_ps(a,mask,b,c); }
|
||||
__forceinline vfloat16 mask_msub(const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_fmsub_ps(a,mask,b,c); }
|
||||
|
||||
__forceinline vfloat16 madd231 (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmadd_ps(c,b,a); }
|
||||
__forceinline vfloat16 msub213 (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmsub_ps(a,b,c); }
|
||||
@@ -293,74 +319,74 @@ namespace embree
|
||||
/// Operators with rounding
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vfloat16 madd_round_down (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmadd_round_ps(a,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 madd_round_up (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmadd_round_ps(a,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 madd_round_down(const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmadd_round_ps(a,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 madd_round_up (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmadd_round_ps(a,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
|
||||
__forceinline vfloat16 mul_round_down (const vfloat16& a, const vfloat16& b) { return _mm512_mul_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 mul_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_mul_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 mul_round_down(const vfloat16& a, const vfloat16& b) { return _mm512_mul_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 mul_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_mul_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
|
||||
__forceinline vfloat16 add_round_down (const vfloat16& a, const vfloat16& b) { return _mm512_add_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 add_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_add_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 add_round_down(const vfloat16& a, const vfloat16& b) { return _mm512_add_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 add_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_add_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
|
||||
__forceinline vfloat16 sub_round_down (const vfloat16& a, const vfloat16& b) { return _mm512_sub_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 sub_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_sub_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 sub_round_down(const vfloat16& a, const vfloat16& b) { return _mm512_sub_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 sub_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_sub_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
|
||||
__forceinline vfloat16 div_round_down (const vfloat16& a, const vfloat16& b) { return _mm512_div_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 div_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_div_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 div_round_down(const vfloat16& a, const vfloat16& b) { return _mm512_div_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 div_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_div_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
|
||||
__forceinline vfloat16 mask_msub_round_down (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_fmsub_round_ps(a,mask,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 mask_msub_round_up (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_fmsub_round_ps(a,mask,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 mask_msub_round_down(const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_fmsub_round_ps(a,mask,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 mask_msub_round_up (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_fmsub_round_ps(a,mask,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
|
||||
__forceinline vfloat16 mask_mul_round_down (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_mul_round_ps(a,mask,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 mask_mul_round_up (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_mul_round_ps(a,mask,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 mask_mul_round_down(const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_mul_round_ps(a,mask,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 mask_mul_round_up (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_mul_round_ps(a,mask,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
|
||||
__forceinline vfloat16 mask_sub_round_down (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_sub_round_ps(a,mask,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 mask_sub_round_up (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_sub_round_ps(a,mask,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 mask_sub_round_down(const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_sub_round_ps(a,mask,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
|
||||
__forceinline vfloat16 mask_sub_round_up (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_sub_round_ps(a,mask,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vfloat16& operator +=( vfloat16& a, const vfloat16& b ) { return a = a + b; }
|
||||
__forceinline vfloat16& operator +=( vfloat16& a, const float& b ) { return a = a + b; }
|
||||
__forceinline vfloat16& operator +=(vfloat16& a, const vfloat16& b) { return a = a + b; }
|
||||
__forceinline vfloat16& operator +=(vfloat16& a, float b) { return a = a + b; }
|
||||
|
||||
__forceinline vfloat16& operator -=( vfloat16& a, const vfloat16& b ) { return a = a - b; }
|
||||
__forceinline vfloat16& operator -=( vfloat16& a, const float& b ) { return a = a - b; }
|
||||
__forceinline vfloat16& operator -=(vfloat16& a, const vfloat16& b) { return a = a - b; }
|
||||
__forceinline vfloat16& operator -=(vfloat16& a, float b) { return a = a - b; }
|
||||
|
||||
__forceinline vfloat16& operator *=( vfloat16& a, const vfloat16& b ) { return a = a * b; }
|
||||
__forceinline vfloat16& operator *=( vfloat16& a, const float& b ) { return a = a * b; }
|
||||
__forceinline vfloat16& operator *=(vfloat16& a, const vfloat16& b) { return a = a * b; }
|
||||
__forceinline vfloat16& operator *=(vfloat16& a, float b) { return a = a * b; }
|
||||
|
||||
__forceinline vfloat16& operator /=( vfloat16& a, const vfloat16& b ) { return a = a / b; }
|
||||
__forceinline vfloat16& operator /=( vfloat16& a, const float& b ) { return a = a / b; }
|
||||
__forceinline vfloat16& operator /=(vfloat16& a, const vfloat16& b) { return a = a / b; }
|
||||
__forceinline vfloat16& operator /=(vfloat16& a, float b) { return a = a / b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf16 operator ==( const vfloat16& a, const vfloat16& b ) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_EQ); }
|
||||
__forceinline const vboolf16 operator ==( const vfloat16& a, const float& b ) { return a == vfloat16(b); }
|
||||
__forceinline const vboolf16 operator ==( const float& a, const vfloat16& b ) { return vfloat16(a) == b; }
|
||||
__forceinline vboolf16 operator ==(const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_EQ); }
|
||||
__forceinline vboolf16 operator ==(const vfloat16& a, float b) { return a == vfloat16(b); }
|
||||
__forceinline vboolf16 operator ==(float a, const vfloat16& b) { return vfloat16(a) == b; }
|
||||
|
||||
__forceinline const vboolf16 operator !=( const vfloat16& a, const vfloat16& b ) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_NE); }
|
||||
__forceinline const vboolf16 operator !=( const vfloat16& a, const float& b ) { return a != vfloat16(b); }
|
||||
__forceinline const vboolf16 operator !=( const float& a, const vfloat16& b ) { return vfloat16(a) != b; }
|
||||
__forceinline vboolf16 operator !=(const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_NE); }
|
||||
__forceinline vboolf16 operator !=(const vfloat16& a, float b) { return a != vfloat16(b); }
|
||||
__forceinline vboolf16 operator !=(float a, const vfloat16& b) { return vfloat16(a) != b; }
|
||||
|
||||
__forceinline const vboolf16 operator < ( const vfloat16& a, const vfloat16& b ) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_LT); }
|
||||
__forceinline const vboolf16 operator < ( const vfloat16& a, const float& b ) { return a < vfloat16(b); }
|
||||
__forceinline const vboolf16 operator < ( const float& a, const vfloat16& b ) { return vfloat16(a) < b; }
|
||||
__forceinline vboolf16 operator < (const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_LT); }
|
||||
__forceinline vboolf16 operator < (const vfloat16& a, float b) { return a < vfloat16(b); }
|
||||
__forceinline vboolf16 operator < (float a, const vfloat16& b) { return vfloat16(a) < b; }
|
||||
|
||||
__forceinline const vboolf16 operator >=( const vfloat16& a, const vfloat16& b ) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_GE); }
|
||||
__forceinline const vboolf16 operator >=( const vfloat16& a, const float& b ) { return a >= vfloat16(b); }
|
||||
__forceinline const vboolf16 operator >=( const float& a, const vfloat16& b ) { return vfloat16(a) >= b; }
|
||||
__forceinline vboolf16 operator >=(const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_GE); }
|
||||
__forceinline vboolf16 operator >=(const vfloat16& a, float b) { return a >= vfloat16(b); }
|
||||
__forceinline vboolf16 operator >=(float a, const vfloat16& b) { return vfloat16(a) >= b; }
|
||||
|
||||
__forceinline const vboolf16 operator > ( const vfloat16& a, const vfloat16& b ) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_GT); }
|
||||
__forceinline const vboolf16 operator > ( const vfloat16& a, const float& b ) { return a > vfloat16(b); }
|
||||
__forceinline const vboolf16 operator > ( const float& a, const vfloat16& b ) { return vfloat16(a) > b; }
|
||||
__forceinline vboolf16 operator > (const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_GT); }
|
||||
__forceinline vboolf16 operator > (const vfloat16& a, float b) { return a > vfloat16(b); }
|
||||
__forceinline vboolf16 operator > (float a, const vfloat16& b) { return vfloat16(a) > b; }
|
||||
|
||||
__forceinline const vboolf16 operator <=( const vfloat16& a, const vfloat16& b ) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_LE); }
|
||||
__forceinline const vboolf16 operator <=( const vfloat16& a, const float& b ) { return a <= vfloat16(b); }
|
||||
__forceinline const vboolf16 operator <=( const float& a, const vfloat16& b ) { return vfloat16(a) <= b; }
|
||||
__forceinline vboolf16 operator <=(const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_LE); }
|
||||
__forceinline vboolf16 operator <=(const vfloat16& a, float b) { return a <= vfloat16(b); }
|
||||
__forceinline vboolf16 operator <=(float a, const vfloat16& b) { return vfloat16(a) <= b; }
|
||||
|
||||
__forceinline vboolf16 eq(const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_EQ); }
|
||||
__forceinline vboolf16 ne(const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_NE); }
|
||||
@@ -376,7 +402,7 @@ namespace embree
|
||||
__forceinline vboolf16 gt(const vboolf16& mask, const vfloat16& a, const vfloat16& b) { return _mm512_mask_cmp_ps_mask(mask,a,b,_MM_CMPINT_GT); }
|
||||
__forceinline vboolf16 le(const vboolf16& mask, const vfloat16& a, const vfloat16& b) { return _mm512_mask_cmp_ps_mask(mask,a,b,_MM_CMPINT_LE); }
|
||||
|
||||
__forceinline const vfloat16 select( const vboolf16& s, const vfloat16& t, const vfloat16& f ) {
|
||||
__forceinline vfloat16 select(const vboolf16& s, const vfloat16& t, const vfloat16& f) {
|
||||
return _mm512_mask_blend_ps(s, f, t);
|
||||
}
|
||||
|
||||
@@ -409,61 +435,86 @@ namespace embree
|
||||
/// Movement/Shifting/Shuffling Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<size_t i>
|
||||
__forceinline const vfloat16 shuffle( const vfloat16& a ) {
|
||||
return _mm512_permute_ps(a, _MM_SHUFFLE(i, i, i, i));
|
||||
__forceinline vfloat16 unpacklo(const vfloat16& a, const vfloat16& b) { return _mm512_unpacklo_ps(a, b); }
|
||||
__forceinline vfloat16 unpackhi(const vfloat16& a, const vfloat16& b) { return _mm512_unpackhi_ps(a, b); }
|
||||
|
||||
template<int i>
|
||||
__forceinline vfloat16 shuffle(const vfloat16& v) {
|
||||
return _mm512_permute_ps(v, _MM_SHUFFLE(i, i, i, i));
|
||||
}
|
||||
|
||||
template<int A, int B, int C, int D>
|
||||
__forceinline vfloat16 shuffle (const vfloat16& v) {
|
||||
return _mm512_permute_ps(v,_MM_SHUFFLE(D,C,B,A));
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vfloat16 shuffle(const vfloat16& v) {
|
||||
return _mm512_permute_ps(v, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
}
|
||||
|
||||
template<int i>
|
||||
__forceinline vfloat16 shuffle4(const vfloat16& x) {
|
||||
return _mm512_shuffle_f32x4(x,x,_MM_SHUFFLE(i,i,i,i));
|
||||
__forceinline vfloat16 shuffle4(const vfloat16& v) {
|
||||
return _mm512_shuffle_f32x4(v, v ,_MM_SHUFFLE(i, i, i, i));
|
||||
}
|
||||
|
||||
template<int A, int B, int C, int D>
|
||||
__forceinline vfloat16 shuffle4(const vfloat16& x) {
|
||||
return _mm512_shuffle_f32x4(x,x,_MM_SHUFFLE(D,C,B,A));
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vfloat16 shuffle4(const vfloat16& v) {
|
||||
return _mm512_shuffle_f32x4(v, v, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
}
|
||||
|
||||
__forceinline vfloat16 permute(vfloat16 v,__m512i index)
|
||||
{
|
||||
return _mm512_castsi512_ps(_mm512_permutexvar_epi32(index,_mm512_castps_si512(v)));
|
||||
__forceinline vfloat16 interleave_even(const vfloat16& a, const vfloat16& b) {
|
||||
return _mm512_castsi512_ps(_mm512_mask_shuffle_epi32(_mm512_castps_si512(a), mm512_int2mask(0xaaaa), _mm512_castps_si512(b), (_MM_PERM_ENUM)0xb1));
|
||||
}
|
||||
|
||||
__forceinline vfloat16 reverse(const vfloat16 &a)
|
||||
{
|
||||
return permute(a,_mm512_setr_epi32(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0));
|
||||
__forceinline vfloat16 interleave_odd(const vfloat16& a, const vfloat16& b) {
|
||||
return _mm512_castsi512_ps(_mm512_mask_shuffle_epi32(_mm512_castps_si512(b), mm512_int2mask(0x5555), _mm512_castps_si512(a), (_MM_PERM_ENUM)0xb1));
|
||||
}
|
||||
|
||||
__forceinline vfloat16 interleave2_even(const vfloat16& a, const vfloat16& b) {
|
||||
/* mask should be 8-bit but is 16-bit to reuse for interleave_even */
|
||||
return _mm512_castsi512_ps(_mm512_mask_permutex_epi64(_mm512_castps_si512(a), mm512_int2mask(0xaaaa), _mm512_castps_si512(b), (_MM_PERM_ENUM)0xb1));
|
||||
}
|
||||
|
||||
__forceinline vfloat16 interleave2_odd(const vfloat16& a, const vfloat16& b) {
|
||||
/* mask should be 8-bit but is 16-bit to reuse for interleave_odd */
|
||||
return _mm512_castsi512_ps(_mm512_mask_permutex_epi64(_mm512_castps_si512(b), mm512_int2mask(0x5555), _mm512_castps_si512(a), (_MM_PERM_ENUM)0xb1));
|
||||
}
|
||||
|
||||
__forceinline vfloat16 interleave4_even(const vfloat16& a, const vfloat16& b) {
|
||||
return _mm512_castsi512_ps(_mm512_mask_permutex_epi64(_mm512_castps_si512(a), mm512_int2mask(0xcc), _mm512_castps_si512(b), (_MM_PERM_ENUM)0x4e));
|
||||
}
|
||||
|
||||
__forceinline vfloat16 interleave4_odd(const vfloat16& a, const vfloat16& b) {
|
||||
return _mm512_castsi512_ps(_mm512_mask_permutex_epi64(_mm512_castps_si512(b), mm512_int2mask(0x33), _mm512_castps_si512(a), (_MM_PERM_ENUM)0x4e));
|
||||
}
|
||||
|
||||
__forceinline vfloat16 permute(vfloat16 v, __m512i index) {
|
||||
return _mm512_castsi512_ps(_mm512_permutexvar_epi32(index, _mm512_castps_si512(v)));
|
||||
}
|
||||
|
||||
__forceinline vfloat16 reverse(const vfloat16& v) {
|
||||
return permute(v,_mm512_setr_epi32(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0));
|
||||
}
|
||||
|
||||
template<int i>
|
||||
__forceinline vfloat16 align_shift_right(const vfloat16 &a, const vfloat16 &b)
|
||||
{
|
||||
__forceinline vfloat16 align_shift_right(const vfloat16& a, const vfloat16& b) {
|
||||
return _mm512_castsi512_ps(_mm512_alignr_epi32(_mm512_castps_si512(a),_mm512_castps_si512(b),i));
|
||||
};
|
||||
|
||||
template<int i>
|
||||
__forceinline vfloat16 mask_align_shift_right(const vboolf16 &mask,vfloat16 &c,const vfloat16 &a, const vfloat16 &b)
|
||||
{
|
||||
__forceinline vfloat16 mask_align_shift_right(const vboolf16& mask, vfloat16& c, const vfloat16& a, const vfloat16& b) {
|
||||
return _mm512_castsi512_ps(_mm512_mask_alignr_epi32(_mm512_castps_si512(c),mask,_mm512_castps_si512(a),_mm512_castps_si512(b),i));
|
||||
};
|
||||
|
||||
__forceinline vfloat16 shift_left_1(const vfloat16 &a) {
|
||||
vfloat16 z = vfloat16::zero();
|
||||
__forceinline vfloat16 shift_left_1(const vfloat16& a) {
|
||||
vfloat16 z = zero;
|
||||
return mask_align_shift_right<15>(0xfffe,z,a,a);
|
||||
}
|
||||
|
||||
__forceinline vfloat16 shift_right_1( const vfloat16& x) {
|
||||
__forceinline vfloat16 shift_right_1(const vfloat16& x) {
|
||||
return align_shift_right<1>(zero,x);
|
||||
}
|
||||
|
||||
__forceinline float toScalar(const vfloat16& a) { return mm512_cvtss_f32(a); }
|
||||
__forceinline float toScalar(const vfloat16& v) { return mm512_cvtss_f32(v); }
|
||||
|
||||
|
||||
template<int i> __forceinline const vfloat16 insert4(const vfloat16& a, const vfloat4& b) { return _mm512_insertf32x4(a, b, i); }
|
||||
template<int i> __forceinline vfloat16 insert4(const vfloat16& a, const vfloat4& b) { return _mm512_insertf32x4(a, b, i); }
|
||||
|
||||
template<int N, int i>
|
||||
vfloat<N> extractN(const vfloat16& v);
|
||||
@@ -482,6 +533,79 @@ namespace embree
|
||||
template<int i> __forceinline vfloat8 extract8 (const vfloat16& v) { return _mm512_extractf32x8_ps(v, i); }
|
||||
template<> __forceinline vfloat8 extract8<0>(const vfloat16& v) { return _mm512_castps512_ps256(v); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Transpose
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline void transpose(const vfloat16& r0, const vfloat16& r1, const vfloat16& r2, const vfloat16& r3,
|
||||
vfloat16& c0, vfloat16& c1, vfloat16& c2, vfloat16& c3)
|
||||
{
|
||||
#if defined(__AVX512F__) && !defined(__AVX512VL__) // KNL
|
||||
vfloat16 a0a1_c0c1 = interleave_even(r0, r1);
|
||||
vfloat16 a2a3_c2c3 = interleave_even(r2, r3);
|
||||
vfloat16 b0b1_d0d1 = interleave_odd (r0, r1);
|
||||
vfloat16 b2b3_d2d3 = interleave_odd (r2, r3);
|
||||
|
||||
c0 = interleave2_even(a0a1_c0c1, a2a3_c2c3);
|
||||
c1 = interleave2_even(b0b1_d0d1, b2b3_d2d3);
|
||||
c2 = interleave2_odd (a0a1_c0c1, a2a3_c2c3);
|
||||
c3 = interleave2_odd (b0b1_d0d1, b2b3_d2d3);
|
||||
#else
|
||||
vfloat16 a0a2_b0b2 = unpacklo(r0, r2);
|
||||
vfloat16 c0c2_d0d2 = unpackhi(r0, r2);
|
||||
vfloat16 a1a3_b1b3 = unpacklo(r1, r3);
|
||||
vfloat16 c1c3_d1d3 = unpackhi(r1, r3);
|
||||
|
||||
c0 = unpacklo(a0a2_b0b2, a1a3_b1b3);
|
||||
c1 = unpackhi(a0a2_b0b2, a1a3_b1b3);
|
||||
c2 = unpacklo(c0c2_d0d2, c1c3_d1d3);
|
||||
c3 = unpackhi(c0c2_d0d2, c1c3_d1d3);
|
||||
#endif
|
||||
}
|
||||
|
||||
__forceinline void transpose(const vfloat4& r0, const vfloat4& r1, const vfloat4& r2, const vfloat4& r3,
|
||||
const vfloat4& r4, const vfloat4& r5, const vfloat4& r6, const vfloat4& r7,
|
||||
const vfloat4& r8, const vfloat4& r9, const vfloat4& r10, const vfloat4& r11,
|
||||
const vfloat4& r12, const vfloat4& r13, const vfloat4& r14, const vfloat4& r15,
|
||||
vfloat16& c0, vfloat16& c1, vfloat16& c2, vfloat16& c3)
|
||||
{
|
||||
return transpose(vfloat16(r0, r4, r8, r12), vfloat16(r1, r5, r9, r13), vfloat16(r2, r6, r10, r14), vfloat16(r3, r7, r11, r15),
|
||||
c0, c1, c2, c3);
|
||||
}
|
||||
|
||||
__forceinline void transpose(const vfloat16& r0, const vfloat16& r1, const vfloat16& r2, const vfloat16& r3,
|
||||
const vfloat16& r4, const vfloat16& r5, const vfloat16& r6, const vfloat16& r7,
|
||||
vfloat16& c0, vfloat16& c1, vfloat16& c2, vfloat16& c3,
|
||||
vfloat16& c4, vfloat16& c5, vfloat16& c6, vfloat16& c7)
|
||||
{
|
||||
vfloat16 a0a1a2a3_e0e1e2e3, b0b1b2b3_f0f1f2f3, c0c1c2c3_g0g1g2g3, d0d1d2d3_h0h1h2h3;
|
||||
transpose(r0, r1, r2, r3, a0a1a2a3_e0e1e2e3, b0b1b2b3_f0f1f2f3, c0c1c2c3_g0g1g2g3, d0d1d2d3_h0h1h2h3);
|
||||
|
||||
vfloat16 a4a5a6a7_e4e5e6e7, b4b5b6b7_f4f5f6f7, c4c5c6c7_g4g5g6g7, d4d5d6d7_h4h5h6h7;
|
||||
transpose(r4, r5, r6, r7, a4a5a6a7_e4e5e6e7, b4b5b6b7_f4f5f6f7, c4c5c6c7_g4g5g6g7, d4d5d6d7_h4h5h6h7);
|
||||
|
||||
c0 = interleave4_even(a0a1a2a3_e0e1e2e3, a4a5a6a7_e4e5e6e7);
|
||||
c1 = interleave4_even(b0b1b2b3_f0f1f2f3, b4b5b6b7_f4f5f6f7);
|
||||
c2 = interleave4_even(c0c1c2c3_g0g1g2g3, c4c5c6c7_g4g5g6g7);
|
||||
c3 = interleave4_even(d0d1d2d3_h0h1h2h3, d4d5d6d7_h4h5h6h7);
|
||||
c4 = interleave4_odd (a0a1a2a3_e0e1e2e3, a4a5a6a7_e4e5e6e7);
|
||||
c5 = interleave4_odd (b0b1b2b3_f0f1f2f3, b4b5b6b7_f4f5f6f7);
|
||||
c6 = interleave4_odd (c0c1c2c3_g0g1g2g3, c4c5c6c7_g4g5g6g7);
|
||||
c7 = interleave4_odd (d0d1d2d3_h0h1h2h3, d4d5d6d7_h4h5h6h7);
|
||||
}
|
||||
|
||||
__forceinline void transpose(const vfloat8& r0, const vfloat8& r1, const vfloat8& r2, const vfloat8& r3,
|
||||
const vfloat8& r4, const vfloat8& r5, const vfloat8& r6, const vfloat8& r7,
|
||||
const vfloat8& r8, const vfloat8& r9, const vfloat8& r10, const vfloat8& r11,
|
||||
const vfloat8& r12, const vfloat8& r13, const vfloat8& r14, const vfloat8& r15,
|
||||
vfloat16& c0, vfloat16& c1, vfloat16& c2, vfloat16& c3,
|
||||
vfloat16& c4, vfloat16& c5, vfloat16& c6, vfloat16& c7)
|
||||
{
|
||||
return transpose(vfloat16(r0, r8), vfloat16(r1, r9), vfloat16(r2, r10), vfloat16(r3, r11),
|
||||
vfloat16(r4, r12), vfloat16(r5, r13), vfloat16(r6, r14), vfloat16(r7, r15),
|
||||
c0, c1, c2, c3, c4, c5, c6, c7);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Reductions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -491,40 +615,40 @@ namespace embree
|
||||
__forceinline vfloat16 vreduce_add8(vfloat16 x) { x = vreduce_add4(x); return x + shuffle4<1,0,3,2>(x); }
|
||||
__forceinline vfloat16 vreduce_add (vfloat16 x) { x = vreduce_add8(x); return x + shuffle4<2,3,0,1>(x); }
|
||||
|
||||
__forceinline vfloat16 vreduce_min2(vfloat16 x) { return min(x,shuffle<1,0,3,2>(x)); }
|
||||
__forceinline vfloat16 vreduce_min4(vfloat16 x) { x = vreduce_min2(x); return min(x,shuffle<2,3,0,1>(x)); }
|
||||
__forceinline vfloat16 vreduce_min8(vfloat16 x) { x = vreduce_min4(x); return min(x,shuffle4<1,0,3,2>(x)); }
|
||||
__forceinline vfloat16 vreduce_min (vfloat16 x) { x = vreduce_min8(x); return min(x,shuffle4<2,3,0,1>(x)); }
|
||||
__forceinline vfloat16 vreduce_min2(vfloat16 x) { return min(x, shuffle<1,0,3,2>(x)); }
|
||||
__forceinline vfloat16 vreduce_min4(vfloat16 x) { x = vreduce_min2(x); return min(x, shuffle<2,3,0,1>(x)); }
|
||||
__forceinline vfloat16 vreduce_min8(vfloat16 x) { x = vreduce_min4(x); return min(x, shuffle4<1,0,3,2>(x)); }
|
||||
__forceinline vfloat16 vreduce_min (vfloat16 x) { x = vreduce_min8(x); return min(x, shuffle4<2,3,0,1>(x)); }
|
||||
|
||||
__forceinline vfloat16 vreduce_max2(vfloat16 x) { return max(x,shuffle<1,0,3,2>(x)); }
|
||||
__forceinline vfloat16 vreduce_max4(vfloat16 x) { x = vreduce_max2(x); return max(x,shuffle<2,3,0,1>(x)); }
|
||||
__forceinline vfloat16 vreduce_max8(vfloat16 x) { x = vreduce_max4(x); return max(x,shuffle4<1,0,3,2>(x)); }
|
||||
__forceinline vfloat16 vreduce_max (vfloat16 x) { x = vreduce_max8(x); return max(x,shuffle4<2,3,0,1>(x)); }
|
||||
__forceinline vfloat16 vreduce_max2(vfloat16 x) { return max(x, shuffle<1,0,3,2>(x)); }
|
||||
__forceinline vfloat16 vreduce_max4(vfloat16 x) { x = vreduce_max2(x); return max(x, shuffle<2,3,0,1>(x)); }
|
||||
__forceinline vfloat16 vreduce_max8(vfloat16 x) { x = vreduce_max4(x); return max(x, shuffle4<1,0,3,2>(x)); }
|
||||
__forceinline vfloat16 vreduce_max (vfloat16 x) { x = vreduce_max8(x); return max(x, shuffle4<2,3,0,1>(x)); }
|
||||
|
||||
__forceinline float reduce_add(const vfloat16& v) { return toScalar(vreduce_add(v)); }
|
||||
__forceinline float reduce_min(const vfloat16& v) { return toScalar(vreduce_min(v)); }
|
||||
__forceinline float reduce_max(const vfloat16& v) { return toScalar(vreduce_max(v)); }
|
||||
|
||||
__forceinline size_t select_min(const vfloat16& v) {
|
||||
return __bsf(_mm512_kmov(_mm512_cmp_epi32_mask(_mm512_castps_si512(v),_mm512_castps_si512(vreduce_min(v)),_MM_CMPINT_EQ)));
|
||||
return bsf(_mm512_kmov(_mm512_cmp_epi32_mask(_mm512_castps_si512(v),_mm512_castps_si512(vreduce_min(v)),_MM_CMPINT_EQ)));
|
||||
}
|
||||
|
||||
__forceinline size_t select_max(const vfloat16& v) {
|
||||
return __bsf(_mm512_kmov(_mm512_cmp_epi32_mask(_mm512_castps_si512(v),_mm512_castps_si512(vreduce_max(v)),_MM_CMPINT_EQ)));
|
||||
return bsf(_mm512_kmov(_mm512_cmp_epi32_mask(_mm512_castps_si512(v),_mm512_castps_si512(vreduce_max(v)),_MM_CMPINT_EQ)));
|
||||
}
|
||||
|
||||
__forceinline size_t select_min(const vboolf16& valid, const vfloat16& v)
|
||||
{
|
||||
const vfloat16 a = select(valid,v,vfloat16(pos_inf));
|
||||
const vbool16 valid_min = valid & (a == vreduce_min(a));
|
||||
return __bsf(movemask(any(valid_min) ? valid_min : valid));
|
||||
return bsf(movemask(any(valid_min) ? valid_min : valid));
|
||||
}
|
||||
|
||||
__forceinline size_t select_max(const vboolf16& valid, const vfloat16& v)
|
||||
{
|
||||
const vfloat16 a = select(valid,v,vfloat16(neg_inf));
|
||||
const vbool16 valid_max = valid & (a == vreduce_max(a));
|
||||
return __bsf(movemask(any(valid_max) ? valid_max : valid));
|
||||
return bsf(movemask(any(valid_max) ? valid_max : valid));
|
||||
}
|
||||
|
||||
__forceinline vfloat16 prefix_sum(const vfloat16& a)
|
||||
@@ -598,47 +722,32 @@ namespace embree
|
||||
/// Memory load and store operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline void compactustore16f_low(const vboolf16& mask, float * addr, const vfloat16 ®) {
|
||||
_mm512_mask_compressstoreu_ps(addr,mask,reg);
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
__forceinline vfloat16 gather16f(const vboolf16& mask, const float *const ptr, __m512i index) {
|
||||
vfloat16 r = vfloat16::undefined();
|
||||
return _mm512_mask_i32gather_ps(r,mask,index,ptr,scale);
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
__forceinline void scatter16f(const vboolf16& mask,const float *const ptr, const __m512i index,const vfloat16 v) {
|
||||
_mm512_mask_i32scatter_ps(ptr,mask,index,v,scale);
|
||||
}
|
||||
|
||||
__forceinline vfloat16 loadAOS4to16f(const float& x,const float& y, const float& z)
|
||||
__forceinline vfloat16 loadAOS4to16f(const float& x, const float& y, const float& z)
|
||||
{
|
||||
vfloat16 f = vfloat16::zero();
|
||||
vfloat16 f = zero;
|
||||
f = select(0x1111,vfloat16::broadcast(&x),f);
|
||||
f = select(0x2222,vfloat16::broadcast(&y),f);
|
||||
f = select(0x4444,vfloat16::broadcast(&z),f);
|
||||
return f;
|
||||
}
|
||||
|
||||
__forceinline vfloat16 loadAOS4to16f(const unsigned int index,
|
||||
const vfloat16 &x,
|
||||
const vfloat16 &y,
|
||||
const vfloat16 &z)
|
||||
__forceinline vfloat16 loadAOS4to16f(unsigned int index,
|
||||
const vfloat16& x,
|
||||
const vfloat16& y,
|
||||
const vfloat16& z)
|
||||
{
|
||||
vfloat16 f = vfloat16::zero();
|
||||
vfloat16 f = zero;
|
||||
f = select(0x1111,vfloat16::broadcast((float*)&x + index),f);
|
||||
f = select(0x2222,vfloat16::broadcast((float*)&y + index),f);
|
||||
f = select(0x4444,vfloat16::broadcast((float*)&z + index),f);
|
||||
return f;
|
||||
}
|
||||
|
||||
__forceinline vfloat16 loadAOS4to16f(const unsigned int index,
|
||||
const vfloat16 &x,
|
||||
const vfloat16 &y,
|
||||
const vfloat16 &z,
|
||||
const vfloat16 &fill)
|
||||
__forceinline vfloat16 loadAOS4to16f(unsigned int index,
|
||||
const vfloat16& x,
|
||||
const vfloat16& y,
|
||||
const vfloat16& z,
|
||||
const vfloat16& fill)
|
||||
{
|
||||
vfloat16 f = fill;
|
||||
f = select(0x1111,vfloat16::broadcast((float*)&x + index),f);
|
||||
@@ -647,15 +756,15 @@ namespace embree
|
||||
return f;
|
||||
}
|
||||
|
||||
__forceinline vfloat16 rcp_safe( const vfloat16& a ) {
|
||||
return rcp(select(a != vfloat16::zero(),a,vfloat16(min_rcp_input)));
|
||||
__forceinline vfloat16 rcp_safe(const vfloat16& a) {
|
||||
return rcp(select(a != vfloat16(zero), a, vfloat16(min_rcp_input)));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline std::ostream &operator<<(std::ostream& cout, const vfloat16& v)
|
||||
__forceinline std::ostream& operator <<(std::ostream& cout, const vfloat16& v)
|
||||
{
|
||||
cout << "<" << v[0];
|
||||
for (int i=1; i<16; i++) cout << ", " << v[i];
|
||||
|
||||
+267
-172
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -33,67 +33,83 @@ namespace embree
|
||||
/// Constructors, Assignment & Cast Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vfloat ( ) {}
|
||||
__forceinline vfloat ( const vfloat4& other ) { v = other.v; }
|
||||
__forceinline vfloat4& operator=( const vfloat4& other ) { v = other.v; return *this; }
|
||||
__forceinline vfloat() {}
|
||||
__forceinline vfloat(const vfloat4& other) { v = other.v; }
|
||||
__forceinline vfloat4& operator =(const vfloat4& other) { v = other.v; return *this; }
|
||||
|
||||
__forceinline vfloat( const __m128 a ) : v(a) {}
|
||||
__forceinline operator const __m128&( void ) const { return v; }
|
||||
__forceinline operator __m128&( void ) { return v; }
|
||||
__forceinline vfloat(__m128 a) : v(a) {}
|
||||
__forceinline operator const __m128&() const { return v; }
|
||||
__forceinline operator __m128&() { return v; }
|
||||
|
||||
__forceinline vfloat( float a ) : v(_mm_set1_ps(a)) {}
|
||||
__forceinline vfloat( float a, float b, float c, float d) : v(_mm_set_ps(d, c, b, a)) {}
|
||||
__forceinline vfloat(float a) : v(_mm_set1_ps(a)) {}
|
||||
__forceinline vfloat(float a, float b, float c, float d) : v(_mm_set_ps(d, c, b, a)) {}
|
||||
|
||||
__forceinline explicit vfloat( const __m128i a ) : v(_mm_cvtepi32_ps(a)) {}
|
||||
__forceinline explicit vfloat(const vint4& a) : v(_mm_cvtepi32_ps(a)) {}
|
||||
__forceinline explicit vfloat(const vuint4& x) {
|
||||
const __m128i a = _mm_and_si128(x,_mm_set1_epi32(0x7FFFFFFF));
|
||||
const __m128i b = _mm_and_si128(_mm_srai_epi32(x,31),_mm_set1_epi32(0x4F000000)); //0x4F000000 = 2^31
|
||||
const __m128 af = _mm_cvtepi32_ps(a);
|
||||
const __m128 bf = _mm_castsi128_ps(b);
|
||||
v = _mm_add_ps(af,bf);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vfloat( ZeroTy ) : v(_mm_setzero_ps()) {}
|
||||
__forceinline vfloat( OneTy ) : v(_mm_set1_ps(1.0f)) {}
|
||||
__forceinline vfloat( PosInfTy ) : v(_mm_set1_ps(pos_inf)) {}
|
||||
__forceinline vfloat( NegInfTy ) : v(_mm_set1_ps(neg_inf)) {}
|
||||
__forceinline vfloat( StepTy ) : v(_mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f)) {}
|
||||
__forceinline vfloat( NaNTy ) : v(_mm_set1_ps(nan)) {}
|
||||
__forceinline vfloat(ZeroTy) : v(_mm_setzero_ps()) {}
|
||||
__forceinline vfloat(OneTy) : v(_mm_set1_ps(1.0f)) {}
|
||||
__forceinline vfloat(PosInfTy) : v(_mm_set1_ps(pos_inf)) {}
|
||||
__forceinline vfloat(NegInfTy) : v(_mm_set1_ps(neg_inf)) {}
|
||||
__forceinline vfloat(StepTy) : v(_mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f)) {}
|
||||
__forceinline vfloat(NaNTy) : v(_mm_set1_ps(nan)) {}
|
||||
__forceinline vfloat(UndefinedTy) : v(_mm_undefined_ps()) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Loads and Stores
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static __forceinline vfloat4 load ( const void* const a ) { return _mm_load_ps((float*)a); }
|
||||
static __forceinline vfloat4 loadu( const void* const a ) { return _mm_loadu_ps((float*)a); }
|
||||
static __forceinline vfloat4 load (const void* a) { return _mm_load_ps((float*)a); }
|
||||
static __forceinline vfloat4 loadu(const void* a) { return _mm_loadu_ps((float*)a); }
|
||||
|
||||
static __forceinline void store ( void* ptr, const vfloat4& v ) { _mm_store_ps((float*)ptr,v); }
|
||||
static __forceinline void storeu( void* ptr, const vfloat4& v ) { _mm_storeu_ps((float*)ptr,v); }
|
||||
static __forceinline void store (void* ptr, const vfloat4& v) { _mm_store_ps((float*)ptr,v); }
|
||||
static __forceinline void storeu(void* ptr, const vfloat4& v) { _mm_storeu_ps((float*)ptr,v); }
|
||||
|
||||
#if defined(__AVX512VL__)
|
||||
static __forceinline vfloat4 load ( const vboolf4& mask, const void* const ptr) { return _mm_mask_load_ps (_mm_setzero_ps(),mask,(float*)ptr); }
|
||||
static __forceinline vfloat4 loadu( const vboolf4& mask, const void* const ptr) { return _mm_mask_loadu_ps(_mm_setzero_ps(),mask,(float*)ptr); }
|
||||
|
||||
static __forceinline void store ( const vboolf4& mask, void* ptr, const vfloat4& v) { _mm_mask_store_ps ((float*)ptr,mask,v); }
|
||||
static __forceinline void storeu( const vboolf4& mask, void* ptr, const vfloat4& v) { _mm_mask_storeu_ps((float*)ptr,mask,v); }
|
||||
static __forceinline vfloat4 compact(const vboolf4& mask, vfloat4 &v) {
|
||||
return _mm_mask_compress_ps(v, mask, v);
|
||||
}
|
||||
static __forceinline vfloat4 compact(const vboolf4& mask, vfloat4 &a, const vfloat4& b) {
|
||||
return _mm_mask_compress_ps(a, mask, b);
|
||||
}
|
||||
|
||||
static __forceinline vfloat4 load (const vboolf4& mask, const void* ptr) { return _mm_mask_load_ps (_mm_setzero_ps(),mask,(float*)ptr); }
|
||||
static __forceinline vfloat4 loadu(const vboolf4& mask, const void* ptr) { return _mm_mask_loadu_ps(_mm_setzero_ps(),mask,(float*)ptr); }
|
||||
|
||||
static __forceinline void store (const vboolf4& mask, void* ptr, const vfloat4& v) { _mm_mask_store_ps ((float*)ptr,mask,v); }
|
||||
static __forceinline void storeu(const vboolf4& mask, void* ptr, const vfloat4& v) { _mm_mask_storeu_ps((float*)ptr,mask,v); }
|
||||
#elif defined(__AVX__)
|
||||
static __forceinline vfloat4 load ( const vboolf4& mask, const void* const ptr ) { return _mm_maskload_ps((float*)ptr,mask); }
|
||||
static __forceinline vfloat4 loadu( const vboolf4& mask, const void* const ptr ) { return _mm_maskload_ps((float*)ptr,mask); }
|
||||
static __forceinline vfloat4 load (const vboolf4& mask, const void* ptr) { return _mm_maskload_ps((float*)ptr,mask); }
|
||||
static __forceinline vfloat4 loadu(const vboolf4& mask, const void* ptr) { return _mm_maskload_ps((float*)ptr,mask); }
|
||||
|
||||
static __forceinline void store ( const vboolf4& mask, void* ptr, const vfloat4& v ) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,v); }
|
||||
static __forceinline void storeu( const vboolf4& mask, void* ptr, const vfloat4& v ) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,v); }
|
||||
static __forceinline void store (const vboolf4& mask, void* ptr, const vfloat4& v) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,v); }
|
||||
static __forceinline void storeu(const vboolf4& mask, void* ptr, const vfloat4& v) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,v); }
|
||||
#else
|
||||
static __forceinline vfloat4 load ( const vboolf4& mask, const void* const ptr ) { return _mm_and_ps(_mm_load_ps ((float*)ptr),mask); }
|
||||
static __forceinline vfloat4 loadu( const vboolf4& mask, const void* const ptr ) { return _mm_and_ps(_mm_loadu_ps((float*)ptr),mask); }
|
||||
static __forceinline vfloat4 load (const vboolf4& mask, const void* ptr) { return _mm_and_ps(_mm_load_ps ((float*)ptr),mask); }
|
||||
static __forceinline vfloat4 loadu(const vboolf4& mask, const void* ptr) { return _mm_and_ps(_mm_loadu_ps((float*)ptr),mask); }
|
||||
|
||||
static __forceinline void store ( const vboolf4& mask, void* ptr, const vfloat4& v ) { store (ptr,select(mask,v,load (ptr))); }
|
||||
static __forceinline void storeu( const vboolf4& mask, void* ptr, const vfloat4& v ) { storeu(ptr,select(mask,v,loadu(ptr))); }
|
||||
static __forceinline void store (const vboolf4& mask, void* ptr, const vfloat4& v) { store (ptr,select(mask,v,load (ptr))); }
|
||||
static __forceinline void storeu(const vboolf4& mask, void* ptr, const vfloat4& v) { storeu(ptr,select(mask,v,loadu(ptr))); }
|
||||
#endif
|
||||
|
||||
#if defined(__AVX__)
|
||||
static __forceinline vfloat4 broadcast( const void* const a ) { return _mm_broadcast_ss((float*)a); }
|
||||
static __forceinline vfloat4 broadcast(const void* a) { return _mm_broadcast_ss((float*)a); }
|
||||
#else
|
||||
static __forceinline vfloat4 broadcast( const void* const a ) { return _mm_set1_ps(*(float*)a); }
|
||||
static __forceinline vfloat4 broadcast(const void* a) { return _mm_set1_ps(*(float*)a); }
|
||||
#endif
|
||||
|
||||
static __forceinline vfloat4 load_nt ( const float* ptr ) {
|
||||
static __forceinline vfloat4 load_nt (const float* ptr) {
|
||||
#if defined (__SSE4_1__)
|
||||
return _mm_castsi128_ps(_mm_stream_load_si128((__m128i*)ptr));
|
||||
#else
|
||||
@@ -102,21 +118,41 @@ namespace embree
|
||||
}
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
static __forceinline vfloat4 load( const unsigned char* const ptr ) {
|
||||
static __forceinline vfloat4 load(const char* ptr) {
|
||||
return _mm_cvtepi32_ps(_mm_cvtepi8_epi32(_mm_loadu_si128((__m128i*)ptr)));
|
||||
}
|
||||
#else
|
||||
static __forceinline vfloat4 load(const char* ptr) {
|
||||
return vfloat4(ptr[0],ptr[1],ptr[2],ptr[3]);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
static __forceinline vfloat4 load(const unsigned char* ptr) {
|
||||
return _mm_cvtepi32_ps(_mm_cvtepu8_epi32(_mm_loadu_si128((__m128i*)ptr)));
|
||||
}
|
||||
#else
|
||||
static __forceinline vfloat4 load( const unsigned char* const ptr ) {
|
||||
static __forceinline vfloat4 load(const unsigned char* ptr) {
|
||||
//return _mm_cvtpu8_ps(*(__m64*)ptr); // don't enable, will use MMX instructions
|
||||
return vfloat4(ptr[0],ptr[1],ptr[2],ptr[3]);
|
||||
}
|
||||
#endif
|
||||
|
||||
static __forceinline vfloat4 load(const unsigned short* const ptr) {
|
||||
return _mm_mul_ps(vfloat4(vint4::load(ptr)),vfloat4(1.0f/65535.0f));
|
||||
}
|
||||
#if defined(__SSE4_1__)
|
||||
static __forceinline vfloat4 load(const short* ptr) {
|
||||
return _mm_cvtepi32_ps(_mm_cvtepi16_epi32(_mm_loadu_si128((__m128i*)ptr)));
|
||||
}
|
||||
#else
|
||||
static __forceinline vfloat4 load(const short* ptr) {
|
||||
return vfloat4(ptr[0],ptr[1],ptr[2],ptr[3]);
|
||||
}
|
||||
#endif
|
||||
|
||||
static __forceinline void store_nt ( void* ptr, const vfloat4& v)
|
||||
static __forceinline vfloat4 load(const unsigned short* ptr) {
|
||||
return _mm_mul_ps(vfloat4(vint4::load(ptr)),vfloat4(1.0f/65535.0f));
|
||||
}
|
||||
|
||||
static __forceinline void store_nt(void* ptr, const vfloat4& v)
|
||||
{
|
||||
#if defined (__SSE4_1__)
|
||||
_mm_stream_ps((float*)ptr,v);
|
||||
@@ -125,16 +161,58 @@ namespace embree
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int scale>
|
||||
static __forceinline void scatter(const vboolf4& mask, void* ptr, const vint4& ofs, const vfloat4& v)
|
||||
template<int scale = 4>
|
||||
static __forceinline vfloat4 gather(const float* ptr, const vint4& index) {
|
||||
#if defined(__AVX2__)
|
||||
return _mm_i32gather_ps(ptr, index, scale);
|
||||
#else
|
||||
return vfloat4(
|
||||
*(float*)(((char*)ptr)+scale*index[0]),
|
||||
*(float*)(((char*)ptr)+scale*index[1]),
|
||||
*(float*)(((char*)ptr)+scale*index[2]),
|
||||
*(float*)(((char*)ptr)+scale*index[3]));
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline vfloat4 gather(const vboolf4& mask, const float* ptr, const vint4& index) {
|
||||
vfloat4 r = zero;
|
||||
#if defined(__AVX512VL__)
|
||||
return _mm_mmask_i32gather_ps(r, mask, index, ptr, scale);
|
||||
#elif defined(__AVX2__)
|
||||
return _mm_mask_i32gather_ps(r, ptr, index, mask, scale);
|
||||
#else
|
||||
if (likely(mask[0])) r[0] = *(float*)(((char*)ptr)+scale*index[0]);
|
||||
if (likely(mask[1])) r[1] = *(float*)(((char*)ptr)+scale*index[1]);
|
||||
if (likely(mask[2])) r[2] = *(float*)(((char*)ptr)+scale*index[2]);
|
||||
if (likely(mask[3])) r[3] = *(float*)(((char*)ptr)+scale*index[3]);
|
||||
return r;
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline void scatter(void* ptr, const vint4& index, const vfloat4& v)
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
_mm_mask_i32scatter_ps((float*)ptr,mask,ofs,v,scale);
|
||||
_mm_i32scatter_ps((float*)ptr, index, v, scale);
|
||||
#else
|
||||
if (likely(mask[0])) *(float*)(((char*)ptr)+scale*ofs[0]) = v[0];
|
||||
if (likely(mask[1])) *(float*)(((char*)ptr)+scale*ofs[1]) = v[1];
|
||||
if (likely(mask[2])) *(float*)(((char*)ptr)+scale*ofs[2]) = v[2];
|
||||
if (likely(mask[3])) *(float*)(((char*)ptr)+scale*ofs[3]) = v[3];
|
||||
*(float*)(((char*)ptr)+scale*index[0]) = v[0];
|
||||
*(float*)(((char*)ptr)+scale*index[1]) = v[1];
|
||||
*(float*)(((char*)ptr)+scale*index[2]) = v[2];
|
||||
*(float*)(((char*)ptr)+scale*index[3]) = v[3];
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline void scatter(const vboolf4& mask, void* ptr, const vint4& index, const vfloat4& v)
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
_mm_mask_i32scatter_ps((float*)ptr ,mask, index, v, scale);
|
||||
#else
|
||||
if (likely(mask[0])) *(float*)(((char*)ptr)+scale*index[0]) = v[0];
|
||||
if (likely(mask[1])) *(float*)(((char*)ptr)+scale*index[1]) = v[1];
|
||||
if (likely(mask[2])) *(float*)(((char*)ptr)+scale*index[2]) = v[2];
|
||||
if (likely(mask[3])) *(float*)(((char*)ptr)+scale*index[3]) = v[3];
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -149,10 +227,10 @@ namespace embree
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const float& operator []( const size_t index ) const { assert(index < 4); return f[index]; }
|
||||
__forceinline float& operator []( const size_t index ) { assert(index < 4); return f[index]; }
|
||||
__forceinline const float& operator [](size_t index) const { assert(index < 4); return f[index]; }
|
||||
__forceinline float& operator [](size_t index) { assert(index < 4); return f[index]; }
|
||||
|
||||
friend __forceinline const vfloat4 select( const vboolf4& m, const vfloat4& t, const vfloat4& f ) {
|
||||
friend __forceinline vfloat4 select(const vboolf4& m, const vfloat4& t, const vfloat4& f) {
|
||||
#if defined(__AVX512VL__)
|
||||
return _mm_mask_blend_ps(m, f, t);
|
||||
#elif defined(__SSE4_1__)
|
||||
@@ -168,23 +246,27 @@ namespace embree
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vfloat4 asFloat ( const __m128i& a ) { return _mm_castsi128_ps(a); }
|
||||
__forceinline const vfloat4 operator +( const vfloat4& a ) { return a; }
|
||||
__forceinline const vfloat4 operator -( const vfloat4& a ) { return _mm_xor_ps(a.v, _mm_castsi128_ps(_mm_set1_epi32(0x80000000))); }
|
||||
__forceinline const vfloat4 abs ( const vfloat4& a ) { return _mm_and_ps(a.v, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff))); }
|
||||
__forceinline vfloat4 asFloat(const vint4& a) { return _mm_castsi128_ps(a); }
|
||||
__forceinline vint4 asInt (const vfloat4& a) { return _mm_castps_si128(a); }
|
||||
__forceinline vuint4 asUInt (const vfloat4& a) { return _mm_castps_si128(a); }
|
||||
|
||||
__forceinline vfloat4 operator +(const vfloat4& a) { return a; }
|
||||
__forceinline vfloat4 operator -(const vfloat4& a) { return _mm_xor_ps(a, _mm_castsi128_ps(_mm_set1_epi32(0x80000000))); }
|
||||
|
||||
__forceinline vfloat4 abs(const vfloat4& a) { return _mm_and_ps(a, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff))); }
|
||||
#if defined(__AVX512VL__)
|
||||
__forceinline const vfloat4 sign ( const vfloat4& a ) { return _mm_mask_blend_ps(_mm_cmp_ps_mask(a, vfloat4(zero), _CMP_LT_OQ), vfloat4(one), -vfloat4(one)); }
|
||||
__forceinline vfloat4 sign(const vfloat4& a) { return _mm_mask_blend_ps(_mm_cmp_ps_mask(a, vfloat4(zero), _CMP_LT_OQ), vfloat4(one), -vfloat4(one)); }
|
||||
#else
|
||||
__forceinline const vfloat4 sign ( const vfloat4& a ) { return blendv_ps(vfloat4(one), -vfloat4(one), _mm_cmplt_ps(a, vfloat4(zero))); }
|
||||
__forceinline vfloat4 sign(const vfloat4& a) { return blendv_ps(vfloat4(one), -vfloat4(one), _mm_cmplt_ps(a, vfloat4(zero))); }
|
||||
#endif
|
||||
__forceinline const vfloat4 signmsk ( const vfloat4& a ) { return _mm_and_ps(a.v,_mm_castsi128_ps(_mm_set1_epi32(0x80000000))); }
|
||||
__forceinline vfloat4 signmsk(const vfloat4& a) { return _mm_and_ps(a,_mm_castsi128_ps(_mm_set1_epi32(0x80000000))); }
|
||||
|
||||
__forceinline const vfloat4 rcp ( const vfloat4& a )
|
||||
__forceinline vfloat4 rcp(const vfloat4& a)
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
const vfloat4 r = _mm_rcp14_ps(a.v);
|
||||
const vfloat4 r = _mm_rcp14_ps(a);
|
||||
#else
|
||||
const vfloat4 r = _mm_rcp_ps(a.v);
|
||||
const vfloat4 r = _mm_rcp_ps(a);
|
||||
#endif
|
||||
|
||||
#if defined(__AVX2__)
|
||||
@@ -193,15 +275,15 @@ namespace embree
|
||||
return _mm_mul_ps(r,_mm_sub_ps(vfloat4(2.0f), _mm_mul_ps(r, a)));
|
||||
#endif
|
||||
}
|
||||
__forceinline const vfloat4 sqr ( const vfloat4& a ) { return _mm_mul_ps(a,a); }
|
||||
__forceinline const vfloat4 sqrt ( const vfloat4& a ) { return _mm_sqrt_ps(a.v); }
|
||||
__forceinline vfloat4 sqr (const vfloat4& a) { return _mm_mul_ps(a,a); }
|
||||
__forceinline vfloat4 sqrt(const vfloat4& a) { return _mm_sqrt_ps(a); }
|
||||
|
||||
__forceinline const vfloat4 rsqrt( const vfloat4& a )
|
||||
__forceinline vfloat4 rsqrt(const vfloat4& a)
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
const vfloat4 r = _mm_rsqrt14_ps(a.v);
|
||||
const vfloat4 r = _mm_rsqrt14_ps(a);
|
||||
#else
|
||||
const vfloat4 r = _mm_rsqrt_ps(a.v);
|
||||
const vfloat4 r = _mm_rsqrt_ps(a);
|
||||
#endif
|
||||
|
||||
#if defined(__AVX2__)
|
||||
@@ -213,8 +295,8 @@ namespace embree
|
||||
#endif
|
||||
}
|
||||
|
||||
__forceinline const vboolf4 isnan( const vfloat4& a ) {
|
||||
const vfloat4 b = _mm_and_ps(a.v, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff)));
|
||||
__forceinline vboolf4 isnan(const vfloat4& a) {
|
||||
const vfloat4 b = _mm_and_ps(a, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff)));
|
||||
#if defined(__AVX512VL__)
|
||||
return _mm_cmp_epi32_mask(_mm_castps_si128(b), _mm_set1_epi32(0x7f800000), _MM_CMPINT_GT);
|
||||
#else
|
||||
@@ -226,32 +308,32 @@ namespace embree
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vfloat4 operator +( const vfloat4& a, const vfloat4& b ) { return _mm_add_ps(a.v, b.v); }
|
||||
__forceinline const vfloat4 operator +( const vfloat4& a, const float& b ) { return a + vfloat4(b); }
|
||||
__forceinline const vfloat4 operator +( const float& a, const vfloat4& b ) { return vfloat4(a) + b; }
|
||||
__forceinline vfloat4 operator +(const vfloat4& a, const vfloat4& b) { return _mm_add_ps(a, b); }
|
||||
__forceinline vfloat4 operator +(const vfloat4& a, float b) { return a + vfloat4(b); }
|
||||
__forceinline vfloat4 operator +(float a, const vfloat4& b) { return vfloat4(a) + b; }
|
||||
|
||||
__forceinline const vfloat4 operator -( const vfloat4& a, const vfloat4& b ) { return _mm_sub_ps(a.v, b.v); }
|
||||
__forceinline const vfloat4 operator -( const vfloat4& a, const float& b ) { return a - vfloat4(b); }
|
||||
__forceinline const vfloat4 operator -( const float& a, const vfloat4& b ) { return vfloat4(a) - b; }
|
||||
__forceinline vfloat4 operator -(const vfloat4& a, const vfloat4& b) { return _mm_sub_ps(a, b); }
|
||||
__forceinline vfloat4 operator -(const vfloat4& a, float b) { return a - vfloat4(b); }
|
||||
__forceinline vfloat4 operator -(float a, const vfloat4& b) { return vfloat4(a) - b; }
|
||||
|
||||
__forceinline const vfloat4 operator *( const vfloat4& a, const vfloat4& b ) { return _mm_mul_ps(a.v, b.v); }
|
||||
__forceinline const vfloat4 operator *( const vfloat4& a, const float& b ) { return a * vfloat4(b); }
|
||||
__forceinline const vfloat4 operator *( const float& a, const vfloat4& b ) { return vfloat4(a) * b; }
|
||||
__forceinline vfloat4 operator *(const vfloat4& a, const vfloat4& b) { return _mm_mul_ps(a, b); }
|
||||
__forceinline vfloat4 operator *(const vfloat4& a, float b) { return a * vfloat4(b); }
|
||||
__forceinline vfloat4 operator *(float a, const vfloat4& b) { return vfloat4(a) * b; }
|
||||
|
||||
__forceinline const vfloat4 operator /( const vfloat4& a, const vfloat4& b ) { return _mm_div_ps(a.v,b.v); }
|
||||
__forceinline const vfloat4 operator /( const vfloat4& a, const float& b ) { return a/vfloat4(b); }
|
||||
__forceinline const vfloat4 operator /( const float& a, const vfloat4& b ) { return vfloat4(a)/b; }
|
||||
__forceinline vfloat4 operator /(const vfloat4& a, const vfloat4& b) { return _mm_div_ps(a,b); }
|
||||
__forceinline vfloat4 operator /(const vfloat4& a, float b) { return a/vfloat4(b); }
|
||||
__forceinline vfloat4 operator /(float a, const vfloat4& b) { return vfloat4(a)/b; }
|
||||
|
||||
__forceinline const vfloat4 operator^( const vfloat4& a, const vfloat4& b ) { return _mm_xor_ps(a.v,b.v); }
|
||||
__forceinline const vfloat4 operator^( const vfloat4& a, const vint4& b ) { return _mm_xor_ps(a.v,_mm_castsi128_ps(b.v)); }
|
||||
__forceinline vfloat4 operator ^(const vfloat4& a, const vfloat4& b) { return _mm_xor_ps(a,b); }
|
||||
__forceinline vfloat4 operator ^(const vfloat4& a, const vint4& b) { return _mm_xor_ps(a,_mm_castsi128_ps(b)); }
|
||||
|
||||
__forceinline const vfloat4 min( const vfloat4& a, const vfloat4& b ) { return _mm_min_ps(a.v,b.v); }
|
||||
__forceinline const vfloat4 min( const vfloat4& a, const float& b ) { return _mm_min_ps(a.v,vfloat4(b)); }
|
||||
__forceinline const vfloat4 min( const float& a, const vfloat4& b ) { return _mm_min_ps(vfloat4(a),b.v); }
|
||||
__forceinline vfloat4 min(const vfloat4& a, const vfloat4& b) { return _mm_min_ps(a,b); }
|
||||
__forceinline vfloat4 min(const vfloat4& a, float b) { return _mm_min_ps(a,vfloat4(b)); }
|
||||
__forceinline vfloat4 min(float a, const vfloat4& b) { return _mm_min_ps(vfloat4(a),b); }
|
||||
|
||||
__forceinline const vfloat4 max( const vfloat4& a, const vfloat4& b ) { return _mm_max_ps(a.v,b.v); }
|
||||
__forceinline const vfloat4 max( const vfloat4& a, const float& b ) { return _mm_max_ps(a.v,vfloat4(b)); }
|
||||
__forceinline const vfloat4 max( const float& a, const vfloat4& b ) { return _mm_max_ps(vfloat4(a),b.v); }
|
||||
__forceinline vfloat4 max(const vfloat4& a, const vfloat4& b) { return _mm_max_ps(a,b); }
|
||||
__forceinline vfloat4 max(const vfloat4& a, float b) { return _mm_max_ps(a,vfloat4(b)); }
|
||||
__forceinline vfloat4 max(float a, const vfloat4& b) { return _mm_max_ps(vfloat4(a),b); }
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
__forceinline vfloat4 mini(const vfloat4& a, const vfloat4& b) {
|
||||
@@ -260,6 +342,7 @@ namespace embree
|
||||
const vint4 ci = _mm_min_epi32(ai,bi);
|
||||
return _mm_castsi128_ps(ci);
|
||||
}
|
||||
|
||||
__forceinline vfloat4 maxi(const vfloat4& a, const vfloat4& b) {
|
||||
const vint4 ai = _mm_castps_si128(a);
|
||||
const vint4 bi = _mm_castps_si128(b);
|
||||
@@ -273,17 +356,18 @@ namespace embree
|
||||
const vint4 ci = _mm_min_epu32(ai,bi);
|
||||
return _mm_castsi128_ps(ci);
|
||||
}
|
||||
|
||||
__forceinline vfloat4 maxui(const vfloat4& a, const vfloat4& b) {
|
||||
const vint4 ai = _mm_castps_si128(a);
|
||||
const vint4 bi = _mm_castps_si128(b);
|
||||
const vint4 ci = _mm_max_epu32(ai,bi);
|
||||
return _mm_castsi128_ps(ci);
|
||||
}
|
||||
|
||||
#else
|
||||
__forceinline vfloat4 mini(const vfloat4& a, const vfloat4& b) {
|
||||
return min(a,b);
|
||||
}
|
||||
|
||||
__forceinline vfloat4 maxi(const vfloat4& a, const vfloat4& b) {
|
||||
return max(a,b);
|
||||
}
|
||||
@@ -294,70 +378,70 @@ namespace embree
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__AVX2__)
|
||||
__forceinline const vfloat4 madd ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fmadd_ps(a,b,c); }
|
||||
__forceinline const vfloat4 msub ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fmsub_ps(a,b,c); }
|
||||
__forceinline const vfloat4 nmadd ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fnmadd_ps(a,b,c); }
|
||||
__forceinline const vfloat4 nmsub ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fnmsub_ps(a,b,c); }
|
||||
__forceinline vfloat4 madd (const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fmadd_ps(a,b,c); }
|
||||
__forceinline vfloat4 msub (const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fmsub_ps(a,b,c); }
|
||||
__forceinline vfloat4 nmadd(const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fnmadd_ps(a,b,c); }
|
||||
__forceinline vfloat4 nmsub(const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fnmsub_ps(a,b,c); }
|
||||
#else
|
||||
__forceinline const vfloat4 madd ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return a*b+c; }
|
||||
__forceinline const vfloat4 msub ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return a*b-c; }
|
||||
__forceinline const vfloat4 nmadd ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return -a*b+c;}
|
||||
__forceinline const vfloat4 nmsub ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return -a*b-c; }
|
||||
__forceinline vfloat4 madd (const vfloat4& a, const vfloat4& b, const vfloat4& c) { return a*b+c; }
|
||||
__forceinline vfloat4 msub (const vfloat4& a, const vfloat4& b, const vfloat4& c) { return a*b-c; }
|
||||
__forceinline vfloat4 nmadd(const vfloat4& a, const vfloat4& b, const vfloat4& c) { return -a*b+c;}
|
||||
__forceinline vfloat4 nmsub(const vfloat4& a, const vfloat4& b, const vfloat4& c) { return -a*b-c; }
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vfloat4& operator +=( vfloat4& a, const vfloat4& b ) { return a = a + b; }
|
||||
__forceinline vfloat4& operator +=( vfloat4& a, const float& b ) { return a = a + b; }
|
||||
__forceinline vfloat4& operator +=(vfloat4& a, const vfloat4& b) { return a = a + b; }
|
||||
__forceinline vfloat4& operator +=(vfloat4& a, float b) { return a = a + b; }
|
||||
|
||||
__forceinline vfloat4& operator -=( vfloat4& a, const vfloat4& b ) { return a = a - b; }
|
||||
__forceinline vfloat4& operator -=( vfloat4& a, const float& b ) { return a = a - b; }
|
||||
__forceinline vfloat4& operator -=(vfloat4& a, const vfloat4& b) { return a = a - b; }
|
||||
__forceinline vfloat4& operator -=(vfloat4& a, float b) { return a = a - b; }
|
||||
|
||||
__forceinline vfloat4& operator *=( vfloat4& a, const vfloat4& b ) { return a = a * b; }
|
||||
__forceinline vfloat4& operator *=( vfloat4& a, const float& b ) { return a = a * b; }
|
||||
__forceinline vfloat4& operator *=(vfloat4& a, const vfloat4& b) { return a = a * b; }
|
||||
__forceinline vfloat4& operator *=(vfloat4& a, float b) { return a = a * b; }
|
||||
|
||||
__forceinline vfloat4& operator /=( vfloat4& a, const vfloat4& b ) { return a = a / b; }
|
||||
__forceinline vfloat4& operator /=( vfloat4& a, const float& b ) { return a = a / b; }
|
||||
__forceinline vfloat4& operator /=(vfloat4& a, const vfloat4& b) { return a = a / b; }
|
||||
__forceinline vfloat4& operator /=(vfloat4& a, float b) { return a = a / b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__AVX512VL__)
|
||||
__forceinline const vboolf4 operator ==( const vfloat4& a, const vfloat4& b ) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_EQ); }
|
||||
__forceinline const vboolf4 operator !=( const vfloat4& a, const vfloat4& b ) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_NE); }
|
||||
__forceinline const vboolf4 operator < ( const vfloat4& a, const vfloat4& b ) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_LT); }
|
||||
__forceinline const vboolf4 operator >=( const vfloat4& a, const vfloat4& b ) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_GE); }
|
||||
__forceinline const vboolf4 operator > ( const vfloat4& a, const vfloat4& b ) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_GT); }
|
||||
__forceinline const vboolf4 operator <=( const vfloat4& a, const vfloat4& b ) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_LE); }
|
||||
__forceinline vboolf4 operator ==(const vfloat4& a, const vfloat4& b) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_EQ); }
|
||||
__forceinline vboolf4 operator !=(const vfloat4& a, const vfloat4& b) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_NE); }
|
||||
__forceinline vboolf4 operator < (const vfloat4& a, const vfloat4& b) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_LT); }
|
||||
__forceinline vboolf4 operator >=(const vfloat4& a, const vfloat4& b) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_GE); }
|
||||
__forceinline vboolf4 operator > (const vfloat4& a, const vfloat4& b) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_GT); }
|
||||
__forceinline vboolf4 operator <=(const vfloat4& a, const vfloat4& b) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_LE); }
|
||||
#else
|
||||
__forceinline const vboolf4 operator ==( const vfloat4& a, const vfloat4& b ) { return _mm_cmpeq_ps (a, b); }
|
||||
__forceinline const vboolf4 operator !=( const vfloat4& a, const vfloat4& b ) { return _mm_cmpneq_ps(a, b); }
|
||||
__forceinline const vboolf4 operator < ( const vfloat4& a, const vfloat4& b ) { return _mm_cmplt_ps (a, b); }
|
||||
__forceinline const vboolf4 operator >=( const vfloat4& a, const vfloat4& b ) { return _mm_cmpnlt_ps(a, b); }
|
||||
__forceinline const vboolf4 operator > ( const vfloat4& a, const vfloat4& b ) { return _mm_cmpnle_ps(a, b); }
|
||||
__forceinline const vboolf4 operator <=( const vfloat4& a, const vfloat4& b ) { return _mm_cmple_ps (a, b); }
|
||||
__forceinline vboolf4 operator ==(const vfloat4& a, const vfloat4& b) { return _mm_cmpeq_ps (a, b); }
|
||||
__forceinline vboolf4 operator !=(const vfloat4& a, const vfloat4& b) { return _mm_cmpneq_ps(a, b); }
|
||||
__forceinline vboolf4 operator < (const vfloat4& a, const vfloat4& b) { return _mm_cmplt_ps (a, b); }
|
||||
__forceinline vboolf4 operator >=(const vfloat4& a, const vfloat4& b) { return _mm_cmpnlt_ps(a, b); }
|
||||
__forceinline vboolf4 operator > (const vfloat4& a, const vfloat4& b) { return _mm_cmpnle_ps(a, b); }
|
||||
__forceinline vboolf4 operator <=(const vfloat4& a, const vfloat4& b) { return _mm_cmple_ps (a, b); }
|
||||
#endif
|
||||
|
||||
__forceinline const vboolf4 operator ==( const vfloat4& a, const float& b ) { return a == vfloat4(b); }
|
||||
__forceinline const vboolf4 operator ==( const float& a, const vfloat4& b ) { return vfloat4(a) == b; }
|
||||
__forceinline vboolf4 operator ==(const vfloat4& a, float b) { return a == vfloat4(b); }
|
||||
__forceinline vboolf4 operator ==(float a, const vfloat4& b) { return vfloat4(a) == b; }
|
||||
|
||||
__forceinline const vboolf4 operator !=( const vfloat4& a, const float& b ) { return a != vfloat4(b); }
|
||||
__forceinline const vboolf4 operator !=( const float& a, const vfloat4& b ) { return vfloat4(a) != b; }
|
||||
__forceinline vboolf4 operator !=(const vfloat4& a, float b) { return a != vfloat4(b); }
|
||||
__forceinline vboolf4 operator !=(float a, const vfloat4& b) { return vfloat4(a) != b; }
|
||||
|
||||
__forceinline const vboolf4 operator < ( const vfloat4& a, const float& b ) { return a < vfloat4(b); }
|
||||
__forceinline const vboolf4 operator < ( const float& a, const vfloat4& b ) { return vfloat4(a) < b; }
|
||||
__forceinline vboolf4 operator < (const vfloat4& a, float b) { return a < vfloat4(b); }
|
||||
__forceinline vboolf4 operator < (float a, const vfloat4& b) { return vfloat4(a) < b; }
|
||||
|
||||
__forceinline const vboolf4 operator >=( const vfloat4& a, const float& b ) { return a >= vfloat4(b); }
|
||||
__forceinline const vboolf4 operator >=( const float& a, const vfloat4& b ) { return vfloat4(a) >= b; }
|
||||
__forceinline vboolf4 operator >=(const vfloat4& a, float b) { return a >= vfloat4(b); }
|
||||
__forceinline vboolf4 operator >=(float a, const vfloat4& b) { return vfloat4(a) >= b; }
|
||||
|
||||
__forceinline const vboolf4 operator > ( const vfloat4& a, const float& b ) { return a > vfloat4(b); }
|
||||
__forceinline const vboolf4 operator > ( const float& a, const vfloat4& b ) { return vfloat4(a) > b; }
|
||||
__forceinline vboolf4 operator > (const vfloat4& a, float b) { return a > vfloat4(b); }
|
||||
__forceinline vboolf4 operator > (float a, const vfloat4& b) { return vfloat4(a) > b; }
|
||||
|
||||
__forceinline const vboolf4 operator <=( const vfloat4& a, const float& b ) { return a <= vfloat4(b); }
|
||||
__forceinline const vboolf4 operator <=( const float& a, const vfloat4& b ) { return vfloat4(a) <= b; }
|
||||
__forceinline vboolf4 operator <=(const vfloat4& a, float b) { return a <= vfloat4(b); }
|
||||
__forceinline vboolf4 operator <=(float a, const vfloat4& b) { return vfloat4(a) <= b; }
|
||||
|
||||
__forceinline vboolf4 eq(const vfloat4& a, const vfloat4& b) { return a == b; }
|
||||
__forceinline vboolf4 ne(const vfloat4& a, const vfloat4& b) { return a != b; }
|
||||
@@ -383,7 +467,7 @@ namespace embree
|
||||
#endif
|
||||
|
||||
template<int mask>
|
||||
__forceinline const vfloat4 select(const vfloat4& t, const vfloat4& f)
|
||||
__forceinline vfloat4 select(const vfloat4& t, const vfloat4& f)
|
||||
{
|
||||
#if defined(__SSE4_1__)
|
||||
return _mm_blend_ps(f, t, mask);
|
||||
@@ -396,15 +480,15 @@ namespace embree
|
||||
return madd(t,b-a,a);
|
||||
}
|
||||
|
||||
__forceinline bool isvalid ( const vfloat4& v ) {
|
||||
__forceinline bool isvalid(const vfloat4& v) {
|
||||
return all((v > vfloat4(-FLT_LARGE)) & (v < vfloat4(+FLT_LARGE)));
|
||||
}
|
||||
|
||||
__forceinline bool is_finite ( const vfloat4& a ) {
|
||||
__forceinline bool is_finite(const vfloat4& a) {
|
||||
return all((a >= vfloat4(-FLT_MAX)) & (a <= vfloat4(+FLT_MAX)));
|
||||
}
|
||||
|
||||
__forceinline bool is_finite ( const vboolf4& valid, const vfloat4& a ) {
|
||||
__forceinline bool is_finite(const vboolf4& valid, const vfloat4& a) {
|
||||
return all(valid, (a >= vfloat4(-FLT_MAX)) & (a <= vfloat4(+FLT_MAX)));
|
||||
}
|
||||
|
||||
@@ -413,17 +497,17 @@ namespace embree
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined (__SSE4_1__)
|
||||
__forceinline const vfloat4 floor ( const vfloat4& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
|
||||
__forceinline const vfloat4 ceil ( const vfloat4& a ) { return _mm_round_ps(a, _MM_FROUND_TO_POS_INF ); }
|
||||
__forceinline const vfloat4 trunc ( const vfloat4& a ) { return _mm_round_ps(a, _MM_FROUND_TO_ZERO ); }
|
||||
__forceinline vfloat4 floor(const vfloat4& a) { return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
|
||||
__forceinline vfloat4 ceil (const vfloat4& a) { return _mm_round_ps(a, _MM_FROUND_TO_POS_INF ); }
|
||||
__forceinline vfloat4 trunc(const vfloat4& a) { return _mm_round_ps(a, _MM_FROUND_TO_ZERO ); }
|
||||
#else
|
||||
__forceinline const vfloat4 floor ( const vfloat4& a ) { return vfloat4(floorf(a[0]),floorf(a[1]),floorf(a[2]),floorf(a[3])); }
|
||||
__forceinline const vfloat4 ceil ( const vfloat4& a ) { return vfloat4(ceilf (a[0]),ceilf (a[1]),ceilf (a[2]),ceilf (a[3])); }
|
||||
//__forceinline const vfloat4 trunc ( const vfloat4& a ) { return vfloat4(truncf(a[0]),truncf(a[1]),truncf(a[2]),truncf(a[3])); }
|
||||
__forceinline vfloat4 floor(const vfloat4& a) { return vfloat4(floorf(a[0]),floorf(a[1]),floorf(a[2]),floorf(a[3])); }
|
||||
__forceinline vfloat4 ceil (const vfloat4& a) { return vfloat4(ceilf (a[0]),ceilf (a[1]),ceilf (a[2]),ceilf (a[3])); }
|
||||
//__forceinline vfloat4 trunc(const vfloat4& a) { return vfloat4(truncf(a[0]),truncf(a[1]),truncf(a[2]),truncf(a[3])); }
|
||||
#endif
|
||||
__forceinline const vfloat4 frac ( const vfloat4& a ) { return a-floor(a); }
|
||||
__forceinline vfloat4 frac(const vfloat4& a) { return a-floor(a); }
|
||||
|
||||
__forceinline vint4 floori (const vfloat4& a) {
|
||||
__forceinline vint4 floori(const vfloat4& a) {
|
||||
#if defined(__SSE4_1__)
|
||||
return vint4(floor(a));
|
||||
#else
|
||||
@@ -435,56 +519,59 @@ namespace embree
|
||||
/// Movement/Shifting/Shuffling Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vfloat4 unpacklo( const vfloat4& a, const vfloat4& b ) { return _mm_unpacklo_ps(a.v, b.v); }
|
||||
__forceinline vfloat4 unpackhi( const vfloat4& a, const vfloat4& b ) { return _mm_unpackhi_ps(a.v, b.v); }
|
||||
__forceinline vfloat4 unpacklo(const vfloat4& a, const vfloat4& b) { return _mm_unpacklo_ps(a, b); }
|
||||
__forceinline vfloat4 unpackhi(const vfloat4& a, const vfloat4& b) { return _mm_unpackhi_ps(a, b); }
|
||||
|
||||
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vfloat4 shuffle( const vfloat4& b ) {
|
||||
return _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(b), _MM_SHUFFLE(i3, i2, i1, i0)));
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vfloat4 shuffle(const vfloat4& v) {
|
||||
return _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v), _MM_SHUFFLE(i3, i2, i1, i0)));
|
||||
}
|
||||
|
||||
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vfloat4 shuffle( const vfloat4& a, const vfloat4& b ) {
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vfloat4 shuffle(const vfloat4& a, const vfloat4& b) {
|
||||
return _mm_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
}
|
||||
|
||||
#if defined (__SSSE3__)
|
||||
__forceinline const vfloat4 shuffle8(const vfloat4& a, const vint4& shuf) {
|
||||
__forceinline vfloat4 shuffle8(const vfloat4& a, const vint4& shuf) {
|
||||
return _mm_castsi128_ps(_mm_shuffle_epi8(_mm_castps_si128(a), shuf));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__SSE3__)
|
||||
template<> __forceinline const vfloat4 shuffle<0, 0, 2, 2>( const vfloat4& b ) { return _mm_moveldup_ps(b); }
|
||||
template<> __forceinline const vfloat4 shuffle<1, 1, 3, 3>( const vfloat4& b ) { return _mm_movehdup_ps(b); }
|
||||
template<> __forceinline const vfloat4 shuffle<0, 1, 0, 1>( const vfloat4& b ) { return _mm_castpd_ps(_mm_movedup_pd(_mm_castps_pd(b))); }
|
||||
template<> __forceinline vfloat4 shuffle<0, 0, 2, 2>(const vfloat4& v) { return _mm_moveldup_ps(v); }
|
||||
template<> __forceinline vfloat4 shuffle<1, 1, 3, 3>(const vfloat4& v) { return _mm_movehdup_ps(v); }
|
||||
template<> __forceinline vfloat4 shuffle<0, 1, 0, 1>(const vfloat4& v) { return _mm_castpd_ps(_mm_movedup_pd(_mm_castps_pd(v))); }
|
||||
#endif
|
||||
|
||||
template<size_t i0> __forceinline const vfloat4 shuffle( const vfloat4& b ) {
|
||||
return shuffle<i0,i0,i0,i0>(b);
|
||||
template<int i>
|
||||
__forceinline vfloat4 shuffle(const vfloat4& v) {
|
||||
return shuffle<i,i,i,i>(v);
|
||||
}
|
||||
|
||||
#if defined (__SSE4_1__) && !defined(__GNUC__)
|
||||
template<size_t i> __forceinline float extract ( const vfloat4& a ) { return _mm_cvtss_f32(_mm_extract_ps(a,i)); }
|
||||
template<int i> __forceinline float extract(const vfloat4& a) { return _mm_cvtss_f32(_mm_extract_ps(a,i)); }
|
||||
#else
|
||||
template<size_t i> __forceinline float extract ( const vfloat4& a ) { return _mm_cvtss_f32(shuffle<i,i,i,i>(a)); }
|
||||
template<int i> __forceinline float extract(const vfloat4& a) { return _mm_cvtss_f32(shuffle<i,i,i,i>(a)); }
|
||||
#endif
|
||||
template<> __forceinline float extract<0>( const vfloat4& a ) { return _mm_cvtss_f32(a); }
|
||||
template<> __forceinline float extract<0>(const vfloat4& a) { return _mm_cvtss_f32(a); }
|
||||
|
||||
#if defined (__SSE4_1__)
|
||||
template<size_t dst, size_t src, size_t clr> __forceinline const vfloat4 insert( const vfloat4& a, const vfloat4& b ) { return _mm_insert_ps(a, b, (dst << 4) | (src << 6) | clr); }
|
||||
template<size_t dst, size_t src> __forceinline const vfloat4 insert( const vfloat4& a, const vfloat4& b ) { return insert<dst, src, 0>(a, b); }
|
||||
template<size_t dst> __forceinline const vfloat4 insert( const vfloat4& a, const float b ) { return insert<dst, 0>(a, _mm_set_ss(b)); }
|
||||
template<int dst, int src, int clr> __forceinline vfloat4 insert(const vfloat4& a, const vfloat4& b) { return _mm_insert_ps(a, b, (dst << 4) | (src << 6) | clr); }
|
||||
template<int dst, int src> __forceinline vfloat4 insert(const vfloat4& a, const vfloat4& b) { return insert<dst, src, 0>(a, b); }
|
||||
template<int dst> __forceinline vfloat4 insert(const vfloat4& a, const float b) { return insert<dst, 0>(a, _mm_set_ss(b)); }
|
||||
#else
|
||||
template<size_t dst, size_t src> __forceinline const vfloat4 insert( const vfloat4& a, const vfloat4& b ) { vfloat4 c = a; c[dst] = b[src]; return c; }
|
||||
template<size_t dst> __forceinline const vfloat4 insert( const vfloat4& a, const float b ) { vfloat4 c = a; c[dst] = b; return c; }
|
||||
template<int dst, int src> __forceinline vfloat4 insert(const vfloat4& a, const vfloat4& b) { vfloat4 c = a; c[dst&3] = b[src&3]; return c; }
|
||||
template<int dst> __forceinline vfloat4 insert(const vfloat4& a, float b) { vfloat4 c = a; c[dst&3] = b; return c; }
|
||||
#endif
|
||||
|
||||
__forceinline float toScalar(const vfloat4& a) { return _mm_cvtss_f32(a); }
|
||||
__forceinline float toScalar(const vfloat4& v) { return _mm_cvtss_f32(v); }
|
||||
|
||||
__forceinline vfloat4 broadcast4f( const vfloat4& a, const size_t k ) {
|
||||
__forceinline vfloat4 broadcast4f(const vfloat4& a, size_t k) {
|
||||
return vfloat4::broadcast(&a[k]);
|
||||
}
|
||||
|
||||
__forceinline vfloat4 shift_right_1( const vfloat4& x) {
|
||||
__forceinline vfloat4 shift_right_1(const vfloat4& x) {
|
||||
return _mm_castsi128_ps(_mm_srli_si128(_mm_castps_si128(x), 4));
|
||||
}
|
||||
|
||||
@@ -493,10 +580,18 @@ namespace embree
|
||||
return _mm_permutevar_ps(a,index);
|
||||
}
|
||||
|
||||
__forceinline vfloat4 broadcast1f( const void* const a ) { return _mm_broadcast_ss((float*)a); }
|
||||
__forceinline vfloat4 broadcast1f(const void* a) { return _mm_broadcast_ss((float*)a); }
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__AVX512VL__)
|
||||
template<int i>
|
||||
__forceinline vfloat4 align_shift_right(const vfloat4& a, const vfloat4& b) {
|
||||
return _mm_castsi128_ps(_mm_alignr_epi32(_mm_castps_si128(a), _mm_castps_si128(b), i));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Sorting Network
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -568,9 +663,9 @@ namespace embree
|
||||
/// Reductions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vfloat4 vreduce_min(const vfloat4& v) { vfloat4 h = min(shuffle<1,0,3,2>(v),v); return min(shuffle<2,3,0,1>(h),h); }
|
||||
__forceinline const vfloat4 vreduce_max(const vfloat4& v) { vfloat4 h = max(shuffle<1,0,3,2>(v),v); return max(shuffle<2,3,0,1>(h),h); }
|
||||
__forceinline const vfloat4 vreduce_add(const vfloat4& v) { vfloat4 h = shuffle<1,0,3,2>(v) + v ; return shuffle<2,3,0,1>(h) + h ; }
|
||||
__forceinline vfloat4 vreduce_min(const vfloat4& v) { vfloat4 h = min(shuffle<1,0,3,2>(v),v); return min(shuffle<2,3,0,1>(h),h); }
|
||||
__forceinline vfloat4 vreduce_max(const vfloat4& v) { vfloat4 h = max(shuffle<1,0,3,2>(v),v); return max(shuffle<2,3,0,1>(h),h); }
|
||||
__forceinline vfloat4 vreduce_add(const vfloat4& v) { vfloat4 h = shuffle<1,0,3,2>(v) + v ; return shuffle<2,3,0,1>(h) + h ; }
|
||||
|
||||
__forceinline float reduce_min(const vfloat4& v) { return _mm_cvtss_f32(vreduce_min(v)); }
|
||||
__forceinline float reduce_max(const vfloat4& v) { return _mm_cvtss_f32(vreduce_max(v)); }
|
||||
@@ -580,24 +675,24 @@ namespace embree
|
||||
{
|
||||
const vfloat4 a = select(valid,v,vfloat4(pos_inf));
|
||||
const vbool4 valid_min = valid & (a == vreduce_min(a));
|
||||
return __bsf(movemask(any(valid_min) ? valid_min : valid));
|
||||
return bsf(movemask(any(valid_min) ? valid_min : valid));
|
||||
}
|
||||
__forceinline size_t select_max(const vboolf4& valid, const vfloat4& v)
|
||||
{
|
||||
const vfloat4 a = select(valid,v,vfloat4(neg_inf));
|
||||
const vbool4 valid_max = valid & (a == vreduce_max(a));
|
||||
return __bsf(movemask(any(valid_max) ? valid_max : valid));
|
||||
return bsf(movemask(any(valid_max) ? valid_max : valid));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Euclidian Space Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline float dot ( const vfloat4& a, const vfloat4& b ) {
|
||||
__forceinline float dot(const vfloat4& a, const vfloat4& b) {
|
||||
return reduce_add(a*b);
|
||||
}
|
||||
|
||||
__forceinline vfloat4 cross ( const vfloat4& a, const vfloat4& b )
|
||||
__forceinline vfloat4 cross(const vfloat4& a, const vfloat4& b)
|
||||
{
|
||||
const vfloat4 a0 = a;
|
||||
const vfloat4 b0 = shuffle<1,2,0,3>(b);
|
||||
@@ -610,7 +705,7 @@ namespace embree
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& cout, const vfloat4& a) {
|
||||
inline std::ostream& operator <<(std::ostream& cout, const vfloat4& a) {
|
||||
return cout << "<" << a[0] << ", " << a[1] << ", " << a[2] << ", " << a[3] << ">";
|
||||
}
|
||||
|
||||
|
||||
+320
-219
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -33,45 +33,46 @@ namespace embree
|
||||
/// Constructors, Assignment & Cast Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vfloat ( ) {}
|
||||
__forceinline vfloat ( const vfloat8& other ) { v = other.v; }
|
||||
__forceinline vfloat8& operator=( const vfloat8& other ) { v = other.v; return *this; }
|
||||
__forceinline vfloat() {}
|
||||
__forceinline vfloat(const vfloat8& other) { v = other.v; }
|
||||
__forceinline vfloat8& operator =(const vfloat8& other) { v = other.v; return *this; }
|
||||
|
||||
__forceinline vfloat( const __m256 a ) : v(a) {}
|
||||
__forceinline operator const __m256&( void ) const { return v; }
|
||||
__forceinline operator __m256&( void ) { return v; }
|
||||
__forceinline vfloat(__m256 a) : v(a) {}
|
||||
__forceinline operator const __m256&() const { return v; }
|
||||
__forceinline operator __m256&() { return v; }
|
||||
|
||||
__forceinline explicit vfloat( const vfloat4& a ) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),a,1)) {}
|
||||
__forceinline vfloat( const vfloat4& a, const vfloat4& b ) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),b,1)) {}
|
||||
__forceinline explicit vfloat(const vfloat4& a) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),a,1)) {}
|
||||
__forceinline vfloat(const vfloat4& a, const vfloat4& b) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),b,1)) {}
|
||||
|
||||
__forceinline explicit vfloat( const char* const a ) : v(_mm256_loadu_ps((const float*)a)) {}
|
||||
__forceinline vfloat( const float& a ) : v(_mm256_broadcast_ss(&a)) {}
|
||||
__forceinline vfloat( float a, float b) : v(_mm256_set_ps(b, a, b, a, b, a, b, a)) {}
|
||||
__forceinline vfloat( float a, float b, float c, float d ) : v(_mm256_set_ps(d, c, b, a, d, c, b, a)) {}
|
||||
__forceinline vfloat( float a, float b, float c, float d, float e, float f, float g, float h ) : v(_mm256_set_ps(h, g, f, e, d, c, b, a)) {}
|
||||
__forceinline explicit vfloat(const char* a) : v(_mm256_loadu_ps((const float*)a)) {}
|
||||
__forceinline vfloat(float a) : v(_mm256_set1_ps(a)) {}
|
||||
__forceinline vfloat(float a, float b) : v(_mm256_set_ps(b, a, b, a, b, a, b, a)) {}
|
||||
__forceinline vfloat(float a, float b, float c, float d) : v(_mm256_set_ps(d, c, b, a, d, c, b, a)) {}
|
||||
__forceinline vfloat(float a, float b, float c, float d, float e, float f, float g, float h) : v(_mm256_set_ps(h, g, f, e, d, c, b, a)) {}
|
||||
|
||||
__forceinline explicit vfloat( const __m256i a ) : v(_mm256_cvtepi32_ps(a)) {}
|
||||
__forceinline explicit vfloat(__m256i a) : v(_mm256_cvtepi32_ps(a)) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vfloat( ZeroTy ) : v(_mm256_setzero_ps()) {}
|
||||
__forceinline vfloat( OneTy ) : v(_mm256_set1_ps(1.0f)) {}
|
||||
__forceinline vfloat( PosInfTy ) : v(_mm256_set1_ps(pos_inf)) {}
|
||||
__forceinline vfloat( NegInfTy ) : v(_mm256_set1_ps(neg_inf)) {}
|
||||
__forceinline vfloat( StepTy ) : v(_mm256_set_ps(7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f)) {}
|
||||
__forceinline vfloat( NaNTy ) : v(_mm256_set1_ps(nan)) {}
|
||||
__forceinline vfloat(ZeroTy) : v(_mm256_setzero_ps()) {}
|
||||
__forceinline vfloat(OneTy) : v(_mm256_set1_ps(1.0f)) {}
|
||||
__forceinline vfloat(PosInfTy) : v(_mm256_set1_ps(pos_inf)) {}
|
||||
__forceinline vfloat(NegInfTy) : v(_mm256_set1_ps(neg_inf)) {}
|
||||
__forceinline vfloat(StepTy) : v(_mm256_set_ps(7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f)) {}
|
||||
__forceinline vfloat(NaNTy) : v(_mm256_set1_ps(nan)) {}
|
||||
__forceinline vfloat(UndefinedTy) : v(_mm256_undefined_ps()) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Loads and Stores
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static __forceinline vfloat8 broadcast( const void* const a ) {
|
||||
static __forceinline vfloat8 broadcast(const void* a) {
|
||||
return _mm256_broadcast_ss((float*)a);
|
||||
}
|
||||
|
||||
static __forceinline vfloat8 broadcast2( const float* const a, const float* const b ) {
|
||||
static __forceinline vfloat8 broadcast2(const float* a, const float* b) {
|
||||
#if defined(__INTEL_COMPILER)
|
||||
const vfloat8 v0 = _mm256_broadcast_ss(a);
|
||||
const vfloat8 v1 = _mm256_broadcast_ss(b);
|
||||
@@ -81,36 +82,60 @@ namespace embree
|
||||
#endif
|
||||
}
|
||||
|
||||
static __forceinline const vfloat8 broadcast4f(const vfloat4* ptr) {
|
||||
static __forceinline vfloat8 broadcast4f(const vfloat4* ptr) {
|
||||
return _mm256_broadcast_ps((__m128*)ptr);
|
||||
}
|
||||
|
||||
static __forceinline vfloat8 load( const unsigned char* const ptr ) {
|
||||
static __forceinline vfloat8 load(const char* ptr) {
|
||||
#if defined(__AVX2__)
|
||||
return _mm256_cvtepi32_ps(_mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)ptr)));
|
||||
#else
|
||||
return vfloat8(vfloat4::load(ptr),vfloat4::load(ptr+4));
|
||||
#endif
|
||||
}
|
||||
|
||||
static __forceinline vfloat8 load(const unsigned char* ptr) {
|
||||
#if defined(__AVX2__)
|
||||
return _mm256_cvtepi32_ps(_mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)ptr)));
|
||||
#else
|
||||
return vfloat8(vfloat4::load(ptr),vfloat4::load(ptr+4));
|
||||
#endif
|
||||
}
|
||||
|
||||
static __forceinline vfloat8 load ( const void* const ptr) { return _mm256_load_ps((float*)ptr); }
|
||||
static __forceinline vfloat8 loadu( const void* const ptr) { return _mm256_loadu_ps((float*)ptr); }
|
||||
|
||||
static __forceinline void store ( void* ptr, const vfloat8& v) { return _mm256_store_ps((float*)ptr,v); }
|
||||
static __forceinline void storeu( void* ptr, const vfloat8& v) { return _mm256_storeu_ps((float*)ptr,v); }
|
||||
static __forceinline vfloat8 load(const short* ptr) {
|
||||
#if defined(__AVX2__)
|
||||
return _mm256_cvtepi32_ps(_mm256_cvtepi16_epi32(_mm_loadu_si128((__m128i*)ptr)));
|
||||
#else
|
||||
return vfloat8(vfloat4::load(ptr),vfloat4::load(ptr+4));
|
||||
#endif
|
||||
}
|
||||
|
||||
static __forceinline vfloat8 load (const void* ptr) { return _mm256_load_ps((float*)ptr); }
|
||||
static __forceinline vfloat8 loadu(const void* ptr) { return _mm256_loadu_ps((float*)ptr); }
|
||||
|
||||
static __forceinline void store (void* ptr, const vfloat8& v) { return _mm256_store_ps((float*)ptr,v); }
|
||||
static __forceinline void storeu(void* ptr, const vfloat8& v) { return _mm256_storeu_ps((float*)ptr,v); }
|
||||
|
||||
#if defined(__AVX512VL__)
|
||||
static __forceinline vfloat8 load ( const vboolf8& mask, const void* const ptr) { return _mm256_mask_load_ps (_mm256_setzero_ps(),mask,(float*)ptr); }
|
||||
static __forceinline vfloat8 loadu( const vboolf8& mask, const void* const ptr) { return _mm256_mask_loadu_ps(_mm256_setzero_ps(),mask,(float*)ptr); }
|
||||
|
||||
static __forceinline void store ( const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_mask_store_ps ((float*)ptr,mask,v); }
|
||||
static __forceinline void storeu( const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_mask_storeu_ps((float*)ptr,mask,v); }
|
||||
static __forceinline vfloat8 compact(const vboolf8& mask, vfloat8 &v) {
|
||||
return _mm256_mask_compress_ps(v, mask, v);
|
||||
}
|
||||
static __forceinline vfloat8 compact(const vboolf8& mask, vfloat8 &a, const vfloat8& b) {
|
||||
return _mm256_mask_compress_ps(a, mask, b);
|
||||
}
|
||||
|
||||
static __forceinline vfloat8 load (const vboolf8& mask, const void* ptr) { return _mm256_mask_load_ps (_mm256_setzero_ps(),mask,(float*)ptr); }
|
||||
static __forceinline vfloat8 loadu(const vboolf8& mask, const void* ptr) { return _mm256_mask_loadu_ps(_mm256_setzero_ps(),mask,(float*)ptr); }
|
||||
|
||||
static __forceinline void store (const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_mask_store_ps ((float*)ptr,mask,v); }
|
||||
static __forceinline void storeu(const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_mask_storeu_ps((float*)ptr,mask,v); }
|
||||
#else
|
||||
static __forceinline vfloat8 load ( const vboolf8& mask, const void* const ptr) { return _mm256_maskload_ps((float*)ptr,(__m256i)mask); }
|
||||
static __forceinline vfloat8 loadu( const vboolf8& mask, const void* const ptr) { return _mm256_maskload_ps((float*)ptr,(__m256i)mask); }
|
||||
static __forceinline vfloat8 load (const vboolf8& mask, const void* ptr) { return _mm256_maskload_ps((float*)ptr,(__m256i)mask); }
|
||||
static __forceinline vfloat8 loadu(const vboolf8& mask, const void* ptr) { return _mm256_maskload_ps((float*)ptr,(__m256i)mask); }
|
||||
|
||||
static __forceinline void store ( const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_maskstore_ps((float*)ptr,(__m256i)mask,v); }
|
||||
static __forceinline void storeu( const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_maskstore_ps((float*)ptr,(__m256i)mask,v); }
|
||||
static __forceinline void store (const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_maskstore_ps((float*)ptr,(__m256i)mask,v); }
|
||||
static __forceinline void storeu(const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_maskstore_ps((float*)ptr,(__m256i)mask,v); }
|
||||
#endif
|
||||
|
||||
#if defined(__AVX2__)
|
||||
@@ -123,11 +148,65 @@ namespace embree
|
||||
_mm256_stream_ps((float*)ptr,v);
|
||||
}
|
||||
|
||||
template<int scale>
|
||||
static __forceinline void scatter(const vboolf8& mask, void* ptr, const vint8& ofs, const vfloat8& v)
|
||||
template<int scale = 4>
|
||||
static __forceinline vfloat8 gather(const float* ptr, const vint8& index) {
|
||||
#if defined(__AVX2__)
|
||||
return _mm256_i32gather_ps(ptr, index ,scale);
|
||||
#else
|
||||
return vfloat8(
|
||||
*(float*)(((char*)ptr)+scale*index[0]),
|
||||
*(float*)(((char*)ptr)+scale*index[1]),
|
||||
*(float*)(((char*)ptr)+scale*index[2]),
|
||||
*(float*)(((char*)ptr)+scale*index[3]),
|
||||
*(float*)(((char*)ptr)+scale*index[4]),
|
||||
*(float*)(((char*)ptr)+scale*index[5]),
|
||||
*(float*)(((char*)ptr)+scale*index[6]),
|
||||
*(float*)(((char*)ptr)+scale*index[7]));
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline vfloat8 gather(const vboolf8& mask, const float* ptr, const vint8& index) {
|
||||
vfloat8 r = zero;
|
||||
#if defined(__AVX512VL__)
|
||||
return _mm256_mmask_i32gather_ps(r, mask, index, ptr, scale);
|
||||
#elif defined(__AVX2__)
|
||||
return _mm256_mask_i32gather_ps(r, ptr, index, mask, scale);
|
||||
#else
|
||||
if (likely(mask[0])) r[0] = *(float*)(((char*)ptr)+scale*index[0]);
|
||||
if (likely(mask[1])) r[1] = *(float*)(((char*)ptr)+scale*index[1]);
|
||||
if (likely(mask[2])) r[2] = *(float*)(((char*)ptr)+scale*index[2]);
|
||||
if (likely(mask[3])) r[3] = *(float*)(((char*)ptr)+scale*index[3]);
|
||||
if (likely(mask[4])) r[4] = *(float*)(((char*)ptr)+scale*index[4]);
|
||||
if (likely(mask[5])) r[5] = *(float*)(((char*)ptr)+scale*index[5]);
|
||||
if (likely(mask[6])) r[6] = *(float*)(((char*)ptr)+scale*index[6]);
|
||||
if (likely(mask[7])) r[7] = *(float*)(((char*)ptr)+scale*index[7]);
|
||||
return r;
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline void scatter(void* ptr, const vint8& ofs, const vfloat8& v)
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
_mm256_mask_i32scatter_ps((float*)ptr,mask,ofs,v,scale);
|
||||
_mm256_i32scatter_ps((float*)ptr, ofs, v, scale);
|
||||
#else
|
||||
*(float*)(((char*)ptr)+scale*ofs[0]) = v[0];
|
||||
*(float*)(((char*)ptr)+scale*ofs[1]) = v[1];
|
||||
*(float*)(((char*)ptr)+scale*ofs[2]) = v[2];
|
||||
*(float*)(((char*)ptr)+scale*ofs[3]) = v[3];
|
||||
*(float*)(((char*)ptr)+scale*ofs[4]) = v[4];
|
||||
*(float*)(((char*)ptr)+scale*ofs[5]) = v[5];
|
||||
*(float*)(((char*)ptr)+scale*ofs[6]) = v[6];
|
||||
*(float*)(((char*)ptr)+scale*ofs[7]) = v[7];
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline void scatter(const vboolf8& mask, void* ptr, const vint8& ofs, const vfloat8& v)
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
_mm256_mask_i32scatter_ps((float*)ptr, mask, ofs, v, scale);
|
||||
#else
|
||||
if (likely(mask[0])) *(float*)(((char*)ptr)+scale*ofs[0]) = v[0];
|
||||
if (likely(mask[1])) *(float*)(((char*)ptr)+scale*ofs[1]) = v[1];
|
||||
@@ -151,8 +230,8 @@ namespace embree
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const float& operator []( const size_t index ) const { assert(index < 8); return f[index]; }
|
||||
__forceinline float& operator []( const size_t index ) { assert(index < 8); return f[index]; }
|
||||
__forceinline const float& operator [](size_t index) const { assert(index < 8); return f[index]; }
|
||||
__forceinline float& operator [](size_t index) { assert(index < 8); return f[index]; }
|
||||
};
|
||||
|
||||
|
||||
@@ -160,44 +239,49 @@ namespace embree
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vfloat8 asFloat ( const vint8& a ) { return _mm256_castsi256_ps(a); }
|
||||
__forceinline const vint8 asInt ( const vfloat8& a ) { return _mm256_castps_si256(a); }
|
||||
__forceinline const vfloat8 operator +( const vfloat8& a ) { return a; }
|
||||
__forceinline const vfloat8 operator -( const vfloat8& a ) {
|
||||
__forceinline vfloat8 asFloat(const vint8& a) { return _mm256_castsi256_ps(a); }
|
||||
__forceinline vint8 asInt (const vfloat8& a) { return _mm256_castps_si256(a); }
|
||||
|
||||
#if defined(__AVX512VL__)
|
||||
|
||||
#endif
|
||||
|
||||
__forceinline vfloat8 operator +(const vfloat8& a) { return a; }
|
||||
__forceinline vfloat8 operator -(const vfloat8& a) {
|
||||
const __m256 mask = _mm256_castsi256_ps(_mm256_set1_epi32(0x80000000));
|
||||
return _mm256_xor_ps(a.v, mask);
|
||||
return _mm256_xor_ps(a, mask);
|
||||
}
|
||||
__forceinline const vfloat8 abs ( const vfloat8& a ) {
|
||||
__forceinline vfloat8 abs(const vfloat8& a) {
|
||||
const __m256 mask = _mm256_castsi256_ps(_mm256_set1_epi32(0x7fffffff));
|
||||
return _mm256_and_ps(a.v, mask);
|
||||
return _mm256_and_ps(a, mask);
|
||||
}
|
||||
__forceinline const vfloat8 sign ( const vfloat8& a ) { return _mm256_blendv_ps(vfloat8(one), -vfloat8(one), _mm256_cmp_ps(a, vfloat8(zero), _CMP_NGE_UQ )); }
|
||||
__forceinline const vfloat8 signmsk ( const vfloat8& a ) { return _mm256_and_ps(a.v,_mm256_castsi256_ps(_mm256_set1_epi32(0x80000000))); }
|
||||
__forceinline vfloat8 sign (const vfloat8& a) { return _mm256_blendv_ps(vfloat8(one), -vfloat8(one), _mm256_cmp_ps(a, vfloat8(zero), _CMP_NGE_UQ)); }
|
||||
__forceinline vfloat8 signmsk(const vfloat8& a) { return _mm256_and_ps(a,_mm256_castsi256_ps(_mm256_set1_epi32(0x80000000))); }
|
||||
|
||||
|
||||
__forceinline const vfloat8 rcp(const vfloat8& a)
|
||||
__forceinline vfloat8 rcp(const vfloat8& a)
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
const vfloat8 r = _mm256_rcp14_ps(a.v);
|
||||
const vfloat8 r = _mm256_rcp14_ps(a);
|
||||
#else
|
||||
const vfloat8 r = _mm256_rcp_ps(a.v);
|
||||
const vfloat8 r = _mm256_rcp_ps(a);
|
||||
#endif
|
||||
|
||||
#if defined(__AVX2__)
|
||||
return _mm256_mul_ps(r,_mm256_fnmadd_ps(r, a, vfloat8(2.0f)));
|
||||
return _mm256_mul_ps(r, _mm256_fnmadd_ps(r, a, vfloat8(2.0f)));
|
||||
#else
|
||||
return _mm256_mul_ps(r,_mm256_sub_ps(vfloat8(2.0f), _mm256_mul_ps(r, a)));
|
||||
return _mm256_mul_ps(r, _mm256_sub_ps(vfloat8(2.0f), _mm256_mul_ps(r, a)));
|
||||
#endif
|
||||
}
|
||||
__forceinline const vfloat8 sqr ( const vfloat8& a ) { return _mm256_mul_ps(a,a); }
|
||||
__forceinline const vfloat8 sqrt ( const vfloat8& a ) { return _mm256_sqrt_ps(a.v); }
|
||||
__forceinline vfloat8 sqr (const vfloat8& a) { return _mm256_mul_ps(a,a); }
|
||||
__forceinline vfloat8 sqrt(const vfloat8& a) { return _mm256_sqrt_ps(a); }
|
||||
|
||||
__forceinline const vfloat8 rsqrt( const vfloat8& a )
|
||||
__forceinline vfloat8 rsqrt(const vfloat8& a)
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
const vfloat8 r = _mm256_rsqrt14_ps(a.v);
|
||||
const vfloat8 r = _mm256_rsqrt14_ps(a);
|
||||
#else
|
||||
const vfloat8 r = _mm256_rsqrt_ps(a.v);
|
||||
const vfloat8 r = _mm256_rsqrt_ps(a);
|
||||
#endif
|
||||
|
||||
#if defined(__AVX2__)
|
||||
@@ -213,70 +297,75 @@ namespace embree
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vfloat8 operator +( const vfloat8& a, const vfloat8& b ) { return _mm256_add_ps(a.v, b.v); }
|
||||
__forceinline const vfloat8 operator +( const vfloat8& a, const float b ) { return a + vfloat8(b); }
|
||||
__forceinline const vfloat8 operator +( const float a, const vfloat8& b ) { return vfloat8(a) + b; }
|
||||
__forceinline vfloat8 operator +(const vfloat8& a, const vfloat8& b) { return _mm256_add_ps(a, b); }
|
||||
__forceinline vfloat8 operator +(const vfloat8& a, float b) { return a + vfloat8(b); }
|
||||
__forceinline vfloat8 operator +(float a, const vfloat8& b) { return vfloat8(a) + b; }
|
||||
|
||||
__forceinline const vfloat8 operator -( const vfloat8& a, const vfloat8& b ) { return _mm256_sub_ps(a.v, b.v); }
|
||||
__forceinline const vfloat8 operator -( const vfloat8& a, const float b ) { return a - vfloat8(b); }
|
||||
__forceinline const vfloat8 operator -( const float a, const vfloat8& b ) { return vfloat8(a) - b; }
|
||||
__forceinline vfloat8 operator -(const vfloat8& a, const vfloat8& b) { return _mm256_sub_ps(a, b); }
|
||||
__forceinline vfloat8 operator -(const vfloat8& a, float b) { return a - vfloat8(b); }
|
||||
__forceinline vfloat8 operator -(float a, const vfloat8& b) { return vfloat8(a) - b; }
|
||||
|
||||
__forceinline const vfloat8 operator *( const vfloat8& a, const vfloat8& b ) { return _mm256_mul_ps(a.v, b.v); }
|
||||
__forceinline const vfloat8 operator *( const vfloat8& a, const float b ) { return a * vfloat8(b); }
|
||||
__forceinline const vfloat8 operator *( const float a, const vfloat8& b ) { return vfloat8(a) * b; }
|
||||
__forceinline vfloat8 operator *(const vfloat8& a, const vfloat8& b) { return _mm256_mul_ps(a, b); }
|
||||
__forceinline vfloat8 operator *(const vfloat8& a, float b) { return a * vfloat8(b); }
|
||||
__forceinline vfloat8 operator *(float a, const vfloat8& b) { return vfloat8(a) * b; }
|
||||
|
||||
__forceinline const vfloat8 operator /( const vfloat8& a, const vfloat8& b ) { return _mm256_div_ps(a.v, b.v); }
|
||||
__forceinline const vfloat8 operator /( const vfloat8& a, const float b ) { return a / vfloat8(b); }
|
||||
__forceinline const vfloat8 operator /( const float a, const vfloat8& b ) { return vfloat8(a) / b; }
|
||||
__forceinline vfloat8 operator /(const vfloat8& a, const vfloat8& b) { return _mm256_div_ps(a, b); }
|
||||
__forceinline vfloat8 operator /(const vfloat8& a, float b) { return a / vfloat8(b); }
|
||||
__forceinline vfloat8 operator /(float a, const vfloat8& b) { return vfloat8(a) / b; }
|
||||
|
||||
__forceinline const vfloat8 operator^( const vfloat8& a, const vfloat8& b ) { return _mm256_xor_ps(a.v,b.v); }
|
||||
__forceinline const vfloat8 operator^( const vfloat8& a, const vint8& b ) { return _mm256_xor_ps(a.v,_mm256_castsi256_ps(b.v)); }
|
||||
__forceinline vfloat8 operator ^(const vfloat8& a, const vfloat8& b) { return _mm256_xor_ps(a,b); }
|
||||
__forceinline vfloat8 operator ^(const vfloat8& a, const vint8& b) { return _mm256_xor_ps(a,_mm256_castsi256_ps(b)); }
|
||||
|
||||
__forceinline const vfloat8 operator&( const vfloat8& a, const vfloat8& b ) { return _mm256_and_ps(a.v,b.v); }
|
||||
__forceinline vfloat8 operator &(const vfloat8& a, const vfloat8& b) { return _mm256_and_ps(a,b); }
|
||||
|
||||
__forceinline const vfloat8 min( const vfloat8& a, const vfloat8& b ) { return _mm256_min_ps(a.v, b.v); }
|
||||
__forceinline const vfloat8 min( const vfloat8& a, const float b ) { return _mm256_min_ps(a.v, vfloat8(b)); }
|
||||
__forceinline const vfloat8 min( const float a, const vfloat8& b ) { return _mm256_min_ps(vfloat8(a), b.v); }
|
||||
__forceinline vfloat8 min(const vfloat8& a, const vfloat8& b) { return _mm256_min_ps(a, b); }
|
||||
__forceinline vfloat8 min(const vfloat8& a, float b) { return _mm256_min_ps(a, vfloat8(b)); }
|
||||
__forceinline vfloat8 min(float a, const vfloat8& b) { return _mm256_min_ps(vfloat8(a), b); }
|
||||
|
||||
__forceinline const vfloat8 max( const vfloat8& a, const vfloat8& b ) { return _mm256_max_ps(a.v, b.v); }
|
||||
__forceinline const vfloat8 max( const vfloat8& a, const float b ) { return _mm256_max_ps(a.v, vfloat8(b)); }
|
||||
__forceinline const vfloat8 max( const float a, const vfloat8& b ) { return _mm256_max_ps(vfloat8(a), b.v); }
|
||||
__forceinline vfloat8 max(const vfloat8& a, const vfloat8& b) { return _mm256_max_ps(a, b); }
|
||||
__forceinline vfloat8 max(const vfloat8& a, float b) { return _mm256_max_ps(a, vfloat8(b)); }
|
||||
__forceinline vfloat8 max(float a, const vfloat8& b) { return _mm256_max_ps(vfloat8(a), b); }
|
||||
|
||||
#if defined (__AVX2__)
|
||||
#if defined(__AVX2__)
|
||||
|
||||
__forceinline vfloat8 mini(const vfloat8& a, const vfloat8& b) {
|
||||
const vint8 ai = _mm256_castps_si256(a);
|
||||
const vint8 bi = _mm256_castps_si256(b);
|
||||
const vint8 ci = _mm256_min_epi32(ai,bi);
|
||||
return _mm256_castsi256_ps(ci);
|
||||
}
|
||||
__forceinline vfloat8 maxi(const vfloat8& a, const vfloat8& b) {
|
||||
const vint8 ai = _mm256_castps_si256(a);
|
||||
const vint8 bi = _mm256_castps_si256(b);
|
||||
const vint8 ci = _mm256_max_epi32(ai,bi);
|
||||
return _mm256_castsi256_ps(ci);
|
||||
}
|
||||
__forceinline vfloat8 mini(const vfloat8& a, const vfloat8& b) {
|
||||
const vint8 ai = _mm256_castps_si256(a);
|
||||
const vint8 bi = _mm256_castps_si256(b);
|
||||
const vint8 ci = _mm256_min_epi32(ai,bi);
|
||||
return _mm256_castsi256_ps(ci);
|
||||
}
|
||||
|
||||
__forceinline vfloat8 minui(const vfloat8& a, const vfloat8& b) {
|
||||
const vint8 ai = _mm256_castps_si256(a);
|
||||
const vint8 bi = _mm256_castps_si256(b);
|
||||
const vint8 ci = _mm256_min_epu32(ai,bi);
|
||||
return _mm256_castsi256_ps(ci);
|
||||
}
|
||||
__forceinline vfloat8 maxui(const vfloat8& a, const vfloat8& b) {
|
||||
const vint8 ai = _mm256_castps_si256(a);
|
||||
const vint8 bi = _mm256_castps_si256(b);
|
||||
const vint8 ci = _mm256_max_epu32(ai,bi);
|
||||
return _mm256_castsi256_ps(ci);
|
||||
}
|
||||
__forceinline vfloat8 maxi(const vfloat8& a, const vfloat8& b) {
|
||||
const vint8 ai = _mm256_castps_si256(a);
|
||||
const vint8 bi = _mm256_castps_si256(b);
|
||||
const vint8 ci = _mm256_max_epi32(ai,bi);
|
||||
return _mm256_castsi256_ps(ci);
|
||||
}
|
||||
|
||||
__forceinline vfloat8 minui(const vfloat8& a, const vfloat8& b) {
|
||||
const vint8 ai = _mm256_castps_si256(a);
|
||||
const vint8 bi = _mm256_castps_si256(b);
|
||||
const vint8 ci = _mm256_min_epu32(ai,bi);
|
||||
return _mm256_castsi256_ps(ci);
|
||||
}
|
||||
|
||||
__forceinline vfloat8 maxui(const vfloat8& a, const vfloat8& b) {
|
||||
const vint8 ai = _mm256_castps_si256(a);
|
||||
const vint8 bi = _mm256_castps_si256(b);
|
||||
const vint8 ci = _mm256_max_epu32(ai,bi);
|
||||
return _mm256_castsi256_ps(ci);
|
||||
}
|
||||
|
||||
#else
|
||||
__forceinline vfloat8 mini(const vfloat8& a, const vfloat8& b) {
|
||||
return min(a,b);
|
||||
}
|
||||
__forceinline vfloat8 maxi(const vfloat8& a, const vfloat8& b) {
|
||||
return max(a,b);
|
||||
}
|
||||
|
||||
__forceinline vfloat8 mini(const vfloat8& a, const vfloat8& b) {
|
||||
return min(a,b);
|
||||
}
|
||||
|
||||
__forceinline vfloat8 maxi(const vfloat8& a, const vfloat8& b) {
|
||||
return max(a,b);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -284,83 +373,83 @@ namespace embree
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__AVX2__)
|
||||
__forceinline const vfloat8 madd ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fmadd_ps(a,b,c); }
|
||||
__forceinline const vfloat8 msub ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fmsub_ps(a,b,c); }
|
||||
__forceinline const vfloat8 nmadd ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fnmadd_ps(a,b,c); }
|
||||
__forceinline const vfloat8 nmsub ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fnmsub_ps(a,b,c); }
|
||||
__forceinline vfloat8 madd (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fmadd_ps(a,b,c); }
|
||||
__forceinline vfloat8 msub (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fmsub_ps(a,b,c); }
|
||||
__forceinline vfloat8 nmadd (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fnmadd_ps(a,b,c); }
|
||||
__forceinline vfloat8 nmsub (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fnmsub_ps(a,b,c); }
|
||||
#else
|
||||
__forceinline const vfloat8 madd ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return a*b+c; }
|
||||
__forceinline const vfloat8 msub ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return a*b-c; }
|
||||
__forceinline const vfloat8 nmadd ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return -a*b+c;}
|
||||
__forceinline const vfloat8 nmsub ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return -a*b-c; }
|
||||
__forceinline vfloat8 madd (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return a*b+c; }
|
||||
__forceinline vfloat8 msub (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return a*b-c; }
|
||||
__forceinline vfloat8 nmadd (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return -a*b+c;}
|
||||
__forceinline vfloat8 nmsub (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return -a*b-c; }
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vfloat8& operator +=( vfloat8& a, const vfloat8& b ) { return a = a + b; }
|
||||
__forceinline vfloat8& operator +=( vfloat8& a, const float b ) { return a = a + b; }
|
||||
__forceinline vfloat8& operator +=(vfloat8& a, const vfloat8& b) { return a = a + b; }
|
||||
__forceinline vfloat8& operator +=(vfloat8& a, float b) { return a = a + b; }
|
||||
|
||||
__forceinline vfloat8& operator -=( vfloat8& a, const vfloat8& b ) { return a = a - b; }
|
||||
__forceinline vfloat8& operator -=( vfloat8& a, const float b ) { return a = a - b; }
|
||||
__forceinline vfloat8& operator -=(vfloat8& a, const vfloat8& b) { return a = a - b; }
|
||||
__forceinline vfloat8& operator -=(vfloat8& a, float b) { return a = a - b; }
|
||||
|
||||
__forceinline vfloat8& operator *=( vfloat8& a, const vfloat8& b ) { return a = a * b; }
|
||||
__forceinline vfloat8& operator *=( vfloat8& a, const float b ) { return a = a * b; }
|
||||
__forceinline vfloat8& operator *=(vfloat8& a, const vfloat8& b) { return a = a * b; }
|
||||
__forceinline vfloat8& operator *=(vfloat8& a, float b) { return a = a * b; }
|
||||
|
||||
__forceinline vfloat8& operator /=( vfloat8& a, const vfloat8& b ) { return a = a / b; }
|
||||
__forceinline vfloat8& operator /=( vfloat8& a, const float b ) { return a = a / b; }
|
||||
__forceinline vfloat8& operator /=(vfloat8& a, const vfloat8& b) { return a = a / b; }
|
||||
__forceinline vfloat8& operator /=(vfloat8& a, float b) { return a = a / b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__AVX512VL__)
|
||||
__forceinline const vboolf8 operator ==( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_EQ); }
|
||||
__forceinline const vboolf8 operator !=( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_NE); }
|
||||
__forceinline const vboolf8 operator < ( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_LT); }
|
||||
__forceinline const vboolf8 operator >=( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_GE); }
|
||||
__forceinline const vboolf8 operator > ( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_GT); }
|
||||
__forceinline const vboolf8 operator <=( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_LE); }
|
||||
__forceinline vboolf8 operator ==(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_EQ); }
|
||||
__forceinline vboolf8 operator !=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_NE); }
|
||||
__forceinline vboolf8 operator < (const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_LT); }
|
||||
__forceinline vboolf8 operator >=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_GE); }
|
||||
__forceinline vboolf8 operator > (const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_GT); }
|
||||
__forceinline vboolf8 operator <=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_LE); }
|
||||
|
||||
__forceinline const vfloat8 select( const vboolf8& m, const vfloat8& t, const vfloat8& f ) {
|
||||
__forceinline vfloat8 select(const vboolf8& m, const vfloat8& t, const vfloat8& f) {
|
||||
return _mm256_mask_blend_ps(m, f, t);
|
||||
}
|
||||
#else
|
||||
__forceinline const vboolf8 operator ==( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps(a, b, _CMP_EQ_OQ ); }
|
||||
__forceinline const vboolf8 operator !=( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps(a, b, _CMP_NEQ_OQ); }
|
||||
__forceinline const vboolf8 operator < ( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps(a, b, _CMP_LT_OQ ); }
|
||||
__forceinline const vboolf8 operator >=( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps(a, b, _CMP_GE_OQ ); }
|
||||
__forceinline const vboolf8 operator > ( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps(a, b, _CMP_GT_OQ ); }
|
||||
__forceinline const vboolf8 operator <=( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps(a, b, _CMP_LE_OQ ); }
|
||||
__forceinline vboolf8 operator ==(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_EQ_OQ); }
|
||||
__forceinline vboolf8 operator !=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_NEQ_UQ); }
|
||||
__forceinline vboolf8 operator < (const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_LT_OS); }
|
||||
__forceinline vboolf8 operator >=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_NLT_US); }
|
||||
__forceinline vboolf8 operator > (const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_NLE_US); }
|
||||
__forceinline vboolf8 operator <=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_LE_OS); }
|
||||
|
||||
__forceinline const vfloat8 select( const vboolf8& m, const vfloat8& t, const vfloat8& f ) {
|
||||
__forceinline vfloat8 select(const vboolf8& m, const vfloat8& t, const vfloat8& f) {
|
||||
return _mm256_blendv_ps(f, t, m);
|
||||
}
|
||||
#endif
|
||||
|
||||
template<int mask>
|
||||
__forceinline const vfloat8 select( const vfloat8& t, const vfloat8& f ) {
|
||||
__forceinline vfloat8 select(const vfloat8& t, const vfloat8& f) {
|
||||
return _mm256_blend_ps(f, t, mask);
|
||||
}
|
||||
|
||||
__forceinline const vboolf8 operator ==( const vfloat8& a, const float& b ) { return a == vfloat8(b); }
|
||||
__forceinline const vboolf8 operator ==( const float& a, const vfloat8& b ) { return vfloat8(a) == b; }
|
||||
__forceinline vboolf8 operator ==(const vfloat8& a, const float& b) { return a == vfloat8(b); }
|
||||
__forceinline vboolf8 operator ==(const float& a, const vfloat8& b) { return vfloat8(a) == b; }
|
||||
|
||||
__forceinline const vboolf8 operator !=( const vfloat8& a, const float& b ) { return a != vfloat8(b); }
|
||||
__forceinline const vboolf8 operator !=( const float& a, const vfloat8& b ) { return vfloat8(a) != b; }
|
||||
__forceinline vboolf8 operator !=(const vfloat8& a, const float& b) { return a != vfloat8(b); }
|
||||
__forceinline vboolf8 operator !=(const float& a, const vfloat8& b) { return vfloat8(a) != b; }
|
||||
|
||||
__forceinline const vboolf8 operator < ( const vfloat8& a, const float& b ) { return a < vfloat8(b); }
|
||||
__forceinline const vboolf8 operator < ( const float& a, const vfloat8& b ) { return vfloat8(a) < b; }
|
||||
__forceinline vboolf8 operator < (const vfloat8& a, const float& b) { return a < vfloat8(b); }
|
||||
__forceinline vboolf8 operator < (const float& a, const vfloat8& b) { return vfloat8(a) < b; }
|
||||
|
||||
__forceinline const vboolf8 operator >=( const vfloat8& a, const float& b ) { return a >= vfloat8(b); }
|
||||
__forceinline const vboolf8 operator >=( const float& a, const vfloat8& b ) { return vfloat8(a) >= b; }
|
||||
__forceinline vboolf8 operator >=(const vfloat8& a, const float& b) { return a >= vfloat8(b); }
|
||||
__forceinline vboolf8 operator >=(const float& a, const vfloat8& b) { return vfloat8(a) >= b; }
|
||||
|
||||
__forceinline const vboolf8 operator > ( const vfloat8& a, const float& b ) { return a > vfloat8(b); }
|
||||
__forceinline const vboolf8 operator > ( const float& a, const vfloat8& b ) { return vfloat8(a) > b; }
|
||||
__forceinline vboolf8 operator > (const vfloat8& a, const float& b) { return a > vfloat8(b); }
|
||||
__forceinline vboolf8 operator > (const float& a, const vfloat8& b) { return vfloat8(a) > b; }
|
||||
|
||||
__forceinline const vboolf8 operator <=( const vfloat8& a, const float& b ) { return a <= vfloat8(b); }
|
||||
__forceinline const vboolf8 operator <=( const float& a, const vfloat8& b ) { return vfloat8(a) <= b; }
|
||||
__forceinline vboolf8 operator <=(const vfloat8& a, const float& b) { return a <= vfloat8(b); }
|
||||
__forceinline vboolf8 operator <=(const float& a, const vfloat8& b) { return vfloat8(a) <= b; }
|
||||
|
||||
__forceinline vboolf8 eq(const vfloat8& a, const vfloat8& b) { return a == b; }
|
||||
__forceinline vboolf8 ne(const vfloat8& a, const vfloat8& b) { return a != b; }
|
||||
@@ -389,15 +478,15 @@ namespace embree
|
||||
return madd(t,b-a,a);
|
||||
}
|
||||
|
||||
__forceinline bool isvalid ( const vfloat8& v ) {
|
||||
__forceinline bool isvalid (const vfloat8& v) {
|
||||
return all((v > vfloat8(-FLT_LARGE)) & (v < vfloat8(+FLT_LARGE)));
|
||||
}
|
||||
|
||||
__forceinline bool is_finite ( const vfloat8& a ) {
|
||||
__forceinline bool is_finite (const vfloat8& a) {
|
||||
return all((a >= vfloat8(-FLT_MAX)) & (a <= vfloat8(+FLT_MAX)));
|
||||
}
|
||||
|
||||
__forceinline bool is_finite ( const vboolf8& valid, const vfloat8& a ) {
|
||||
__forceinline bool is_finite (const vboolf8& valid, const vfloat8& a) {
|
||||
return all(valid, (a >= vfloat8(-FLT_MAX)) & (a <= vfloat8(+FLT_MAX)));
|
||||
}
|
||||
|
||||
@@ -405,98 +494,104 @@ namespace embree
|
||||
/// Rounding Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vfloat8 floor( const vfloat8& a ) { return _mm256_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
|
||||
__forceinline const vfloat8 ceil ( const vfloat8& a ) { return _mm256_round_ps(a, _MM_FROUND_TO_POS_INF ); }
|
||||
__forceinline const vfloat8 trunc( const vfloat8& a ) { return _mm256_round_ps(a, _MM_FROUND_TO_ZERO ); }
|
||||
__forceinline const vfloat8 frac ( const vfloat8& a ) { return a-floor(a); }
|
||||
__forceinline vfloat8 floor(const vfloat8& a) { return _mm256_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
|
||||
__forceinline vfloat8 ceil (const vfloat8& a) { return _mm256_round_ps(a, _MM_FROUND_TO_POS_INF ); }
|
||||
__forceinline vfloat8 trunc(const vfloat8& a) { return _mm256_round_ps(a, _MM_FROUND_TO_ZERO ); }
|
||||
__forceinline vfloat8 frac (const vfloat8& a) { return a-floor(a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Movement/Shifting/Shuffling Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vfloat8 unpacklo( const vfloat8& a, const vfloat8& b ) { return _mm256_unpacklo_ps(a.v, b.v); }
|
||||
__forceinline vfloat8 unpackhi( const vfloat8& a, const vfloat8& b ) { return _mm256_unpackhi_ps(a.v, b.v); }
|
||||
__forceinline vfloat8 unpacklo(const vfloat8& a, const vfloat8& b) { return _mm256_unpacklo_ps(a, b); }
|
||||
__forceinline vfloat8 unpackhi(const vfloat8& a, const vfloat8& b) { return _mm256_unpackhi_ps(a, b); }
|
||||
|
||||
template<size_t i> __forceinline const vfloat8 shuffle( const vfloat8& a ) {
|
||||
return _mm256_permute_ps(a, _MM_SHUFFLE(i, i, i, i));
|
||||
template<int i>
|
||||
__forceinline vfloat8 shuffle(const vfloat8& v) {
|
||||
return _mm256_permute_ps(v, _MM_SHUFFLE(i, i, i, i));
|
||||
}
|
||||
|
||||
template<size_t i0, size_t i1> __forceinline const vfloat8 shuffle4( const vfloat8& a ) {
|
||||
return _mm256_permute2f128_ps(a, a, (i1 << 4) | (i0 << 0));
|
||||
template<int i0, int i1>
|
||||
__forceinline vfloat8 shuffle4(const vfloat8& v) {
|
||||
return _mm256_permute2f128_ps(v, v, (i1 << 4) | (i0 << 0));
|
||||
}
|
||||
|
||||
template<size_t i0, size_t i1> __forceinline const vfloat8 shuffle4( const vfloat8& a, const vfloat8& b) {
|
||||
template<int i0, int i1>
|
||||
__forceinline vfloat8 shuffle4(const vfloat8& a, const vfloat8& b) {
|
||||
return _mm256_permute2f128_ps(a, b, (i1 << 4) | (i0 << 0));
|
||||
}
|
||||
|
||||
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vfloat8 shuffle( const vfloat8& a ) {
|
||||
return _mm256_permute_ps(a, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vfloat8 shuffle(const vfloat8& v) {
|
||||
return _mm256_permute_ps(v, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
}
|
||||
|
||||
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vfloat8 shuffle( const vfloat8& a, const vfloat8& b ) {
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vfloat8 shuffle(const vfloat8& a, const vfloat8& b) {
|
||||
return _mm256_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
}
|
||||
|
||||
template<> __forceinline const vfloat8 shuffle<0, 0, 2, 2>( const vfloat8& b ) { return _mm256_moveldup_ps(b); }
|
||||
template<> __forceinline const vfloat8 shuffle<1, 1, 3, 3>( const vfloat8& b ) { return _mm256_movehdup_ps(b); }
|
||||
template<> __forceinline const vfloat8 shuffle<0, 1, 0, 1>( const vfloat8& b ) { return _mm256_castpd_ps(_mm256_movedup_pd(_mm256_castps_pd(b))); }
|
||||
template<> __forceinline vfloat8 shuffle<0, 0, 2, 2>(const vfloat8& v) { return _mm256_moveldup_ps(v); }
|
||||
template<> __forceinline vfloat8 shuffle<1, 1, 3, 3>(const vfloat8& v) { return _mm256_movehdup_ps(v); }
|
||||
template<> __forceinline vfloat8 shuffle<0, 1, 0, 1>(const vfloat8& v) { return _mm256_castpd_ps(_mm256_movedup_pd(_mm256_castps_pd(v))); }
|
||||
|
||||
__forceinline const vfloat8 broadcast(const float* ptr) { return _mm256_broadcast_ss(ptr); }
|
||||
template<size_t i> __forceinline const vfloat8 insert4(const vfloat8& a, const vfloat4& b) { return _mm256_insertf128_ps(a, b, i); }
|
||||
template<size_t i> __forceinline const vfloat4 extract4 (const vfloat8& a) { return _mm256_extractf128_ps(a, i); }
|
||||
template<> __forceinline const vfloat4 extract4<0>(const vfloat8& a) { return _mm256_castps256_ps128(a); }
|
||||
__forceinline vfloat8 broadcast(const float* ptr) { return _mm256_broadcast_ss(ptr); }
|
||||
template<size_t i> __forceinline vfloat8 insert4(const vfloat8& a, const vfloat4& b) { return _mm256_insertf128_ps(a, b, i); }
|
||||
template<size_t i> __forceinline vfloat4 extract4 (const vfloat8& a) { return _mm256_extractf128_ps(a, i); }
|
||||
template<> __forceinline vfloat4 extract4<0>(const vfloat8& a) { return _mm256_castps256_ps128(a); }
|
||||
|
||||
__forceinline float toScalar(const vfloat8& a) { return _mm_cvtss_f32(_mm256_castps256_ps128(a)); }
|
||||
__forceinline float toScalar(const vfloat8& v) { return _mm_cvtss_f32(_mm256_castps256_ps128(v)); }
|
||||
|
||||
__forceinline vfloat8 assign( const vfloat4& a ) { return _mm256_castps128_ps256(a); }
|
||||
__forceinline vfloat8 assign(const vfloat4& a) { return _mm256_castps128_ps256(a); }
|
||||
|
||||
#if defined (__AVX2__)
|
||||
__forceinline vfloat8 permute(const vfloat8 &a, const __m256i &index) {
|
||||
return _mm256_permutevar8x32_ps(a,index);
|
||||
__forceinline vfloat8 permute(const vfloat8& a, const __m256i& index) {
|
||||
return _mm256_permutevar8x32_ps(a, index);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__AVX512VL__)
|
||||
template<int i>
|
||||
__forceinline vfloat8 align_shift_right(const vfloat8 &a, const vfloat8 &b) {
|
||||
__forceinline vfloat8 align_shift_right(const vfloat8& a, const vfloat8& b) {
|
||||
return _mm256_castsi256_ps(_mm256_alignr_epi32(_mm256_castps_si256(a), _mm256_castps_si256(b), i));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (__AVX_I__)
|
||||
template<const int mode>
|
||||
__forceinline vint4 convert_to_hf16(const vfloat8 &a) {
|
||||
return _mm256_cvtps_ph(a,mode);
|
||||
__forceinline vint4 convert_to_hf16(const vfloat8& a) {
|
||||
return _mm256_cvtps_ph(a, mode);
|
||||
}
|
||||
|
||||
__forceinline vfloat8 convert_from_hf16(const vint4 &a) {
|
||||
__forceinline vfloat8 convert_from_hf16(const vint4& a) {
|
||||
return _mm256_cvtph_ps(a);
|
||||
}
|
||||
#endif
|
||||
|
||||
__forceinline vfloat4 broadcast4f( const vfloat8& a, const size_t k ) {
|
||||
__forceinline vfloat4 broadcast4f(const vfloat8& a, const size_t k) {
|
||||
return vfloat4::broadcast(&a[k]);
|
||||
}
|
||||
|
||||
__forceinline vfloat8 broadcast8f( const vfloat8& a, const size_t k ) {
|
||||
__forceinline vfloat8 broadcast8f(const vfloat8& a, const size_t k) {
|
||||
return vfloat8::broadcast(&a[k]);
|
||||
}
|
||||
|
||||
#if defined(__AVX512VL__)
|
||||
__forceinline vfloat8 shift_right_1( const vfloat8& x) {
|
||||
__forceinline vfloat8 shift_right_1(const vfloat8& x) {
|
||||
return align_shift_right<1>(zero,x);
|
||||
}
|
||||
#else
|
||||
__forceinline vfloat8 shift_right_1( const vfloat8& x) {
|
||||
__forceinline vfloat8 shift_right_1(const vfloat8& x) {
|
||||
const vfloat8 t0 = shuffle<1,2,3,0>(x);
|
||||
const vfloat8 t1 = shuffle4<1,0>(t0);
|
||||
return _mm256_blend_ps(t0,t1,0x88);
|
||||
}
|
||||
#endif
|
||||
|
||||
__forceinline vint8 floori (const vfloat8& a) {
|
||||
__forceinline vint8 floori(const vfloat8& a) {
|
||||
return vint8(floor(a));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Transpose
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -539,6 +634,12 @@ namespace embree
|
||||
c7 = shuffle4<1,3>(h3,h7);
|
||||
}
|
||||
|
||||
__forceinline void transpose(const vfloat4& r0, const vfloat4& r1, const vfloat4& r2, const vfloat4& r3, const vfloat4& r4, const vfloat4& r5, const vfloat4& r6, const vfloat4& r7,
|
||||
vfloat8& c0, vfloat8& c1, vfloat8& c2, vfloat8& c3)
|
||||
{
|
||||
transpose(vfloat8(r0,r4), vfloat8(r1,r5), vfloat8(r2,r6), vfloat8(r3,r7), c0, c1, c2, c3);
|
||||
}
|
||||
|
||||
__forceinline void transpose(const vfloat4& r0, const vfloat4& r1, const vfloat4& r2, const vfloat4& r3, const vfloat4& r4, const vfloat4& r5, const vfloat4& r6, const vfloat4& r7,
|
||||
vfloat8& c0, vfloat8& c1, vfloat8& c2)
|
||||
{
|
||||
@@ -549,17 +650,17 @@ namespace embree
|
||||
/// Reductions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vfloat8 vreduce_min2(const vfloat8& v) { return min(v,shuffle<1,0,3,2>(v)); }
|
||||
__forceinline const vfloat8 vreduce_min4(const vfloat8& v) { vfloat8 v1 = vreduce_min2(v); return min(v1,shuffle<2,3,0,1>(v1)); }
|
||||
__forceinline const vfloat8 vreduce_min (const vfloat8& v) { vfloat8 v1 = vreduce_min4(v); return min(v1,shuffle4<1,0>(v1)); }
|
||||
__forceinline vfloat8 vreduce_min2(const vfloat8& v) { return min(v,shuffle<1,0,3,2>(v)); }
|
||||
__forceinline vfloat8 vreduce_min4(const vfloat8& v) { vfloat8 v1 = vreduce_min2(v); return min(v1,shuffle<2,3,0,1>(v1)); }
|
||||
__forceinline vfloat8 vreduce_min (const vfloat8& v) { vfloat8 v1 = vreduce_min4(v); return min(v1,shuffle4<1,0>(v1)); }
|
||||
|
||||
__forceinline const vfloat8 vreduce_max2(const vfloat8& v) { return max(v,shuffle<1,0,3,2>(v)); }
|
||||
__forceinline const vfloat8 vreduce_max4(const vfloat8& v) { vfloat8 v1 = vreduce_max2(v); return max(v1,shuffle<2,3,0,1>(v1)); }
|
||||
__forceinline const vfloat8 vreduce_max (const vfloat8& v) { vfloat8 v1 = vreduce_max4(v); return max(v1,shuffle4<1,0>(v1)); }
|
||||
__forceinline vfloat8 vreduce_max2(const vfloat8& v) { return max(v,shuffle<1,0,3,2>(v)); }
|
||||
__forceinline vfloat8 vreduce_max4(const vfloat8& v) { vfloat8 v1 = vreduce_max2(v); return max(v1,shuffle<2,3,0,1>(v1)); }
|
||||
__forceinline vfloat8 vreduce_max (const vfloat8& v) { vfloat8 v1 = vreduce_max4(v); return max(v1,shuffle4<1,0>(v1)); }
|
||||
|
||||
__forceinline const vfloat8 vreduce_add2(const vfloat8& v) { return v + shuffle<1,0,3,2>(v); }
|
||||
__forceinline const vfloat8 vreduce_add4(const vfloat8& v) { vfloat8 v1 = vreduce_add2(v); return v1 + shuffle<2,3,0,1>(v1); }
|
||||
__forceinline const vfloat8 vreduce_add (const vfloat8& v) { vfloat8 v1 = vreduce_add4(v); return v1 + shuffle4<1,0>(v1); }
|
||||
__forceinline vfloat8 vreduce_add2(const vfloat8& v) { return v + shuffle<1,0,3,2>(v); }
|
||||
__forceinline vfloat8 vreduce_add4(const vfloat8& v) { vfloat8 v1 = vreduce_add2(v); return v1 + shuffle<2,3,0,1>(v1); }
|
||||
__forceinline vfloat8 vreduce_add (const vfloat8& v) { vfloat8 v1 = vreduce_add4(v); return v1 + shuffle4<1,0>(v1); }
|
||||
|
||||
__forceinline float reduce_min(const vfloat8& v) { return toScalar(vreduce_min(v)); }
|
||||
__forceinline float reduce_max(const vfloat8& v) { return toScalar(vreduce_max(v)); }
|
||||
@@ -569,14 +670,14 @@ namespace embree
|
||||
{
|
||||
const vfloat8 a = select(valid,v,vfloat8(pos_inf));
|
||||
const vbool8 valid_min = valid & (a == vreduce_min(a));
|
||||
return __bsf(movemask(any(valid_min) ? valid_min : valid));
|
||||
return bsf(movemask(any(valid_min) ? valid_min : valid));
|
||||
}
|
||||
|
||||
__forceinline size_t select_max(const vboolf8& valid, const vfloat8& v)
|
||||
{
|
||||
const vfloat8 a = select(valid,v,vfloat8(neg_inf));
|
||||
const vbool8 valid_max = valid & (a == vreduce_max(a));
|
||||
return __bsf(movemask(any(valid_max) ? valid_max : valid));
|
||||
return bsf(movemask(any(valid_max) ? valid_max : valid));
|
||||
}
|
||||
|
||||
|
||||
@@ -584,15 +685,15 @@ namespace embree
|
||||
/// Euclidian Space Operators (pairs of Vec3fa's)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//__forceinline vfloat8 dot ( const vfloat8& a, const vfloat8& b ) {
|
||||
//__forceinline vfloat8 dot(const vfloat8& a, const vfloat8& b) {
|
||||
// return vreduce_add4(a*b);
|
||||
//}
|
||||
|
||||
__forceinline vfloat8 dot ( const vfloat8& a, const vfloat8& b ) {
|
||||
__forceinline vfloat8 dot(const vfloat8& a, const vfloat8& b) {
|
||||
return _mm256_dp_ps(a,b,0x7F);
|
||||
}
|
||||
|
||||
__forceinline vfloat8 cross ( const vfloat8& a, const vfloat8& b )
|
||||
__forceinline vfloat8 cross(const vfloat8& a, const vfloat8& b)
|
||||
{
|
||||
const vfloat8 a0 = a;
|
||||
const vfloat8 b0 = shuffle<1,2,0,3>(b);
|
||||
@@ -601,17 +702,17 @@ namespace embree
|
||||
return shuffle<1,2,0,3>(msub(a0,b0,a1*b1));
|
||||
}
|
||||
|
||||
//__forceinline float sqr_length ( const vfloat<8>& a ) { return dot(a,a); }
|
||||
//__forceinline float rcp_length ( const vfloat<8>& a ) { return rsqrt(dot(a,a)); }
|
||||
//__forceinline float rcp_length2( const vfloat<8>& a ) { return rcp(dot(a,a)); }
|
||||
//__forceinline float length ( const vfloat<8>& a ) { return sqrt(dot(a,a)); }
|
||||
__forceinline vfloat<8> normalize( const vfloat<8>& a ) { return a*rsqrt(dot(a,a)); }
|
||||
//__forceinline float distance ( const vfloat<8>& a, const vfloat<8>& b ) { return length(a-b); }
|
||||
//__forceinline float halfArea ( const vfloat<8>& d ) { return madd(d.x,(d.y+d.z),d.y*d.z); }
|
||||
//__forceinline float area ( const vfloat<8>& d ) { return 2.0f*halfArea(d); }
|
||||
//__forceinline vfloat<8> reflect ( const vfloat<8>& V, const vfloat<8>& N ) { return 2.0f*dot(V,N)*N-V; }
|
||||
//__forceinline float sqr_length (const vfloat<8>& a) { return dot(a,a); }
|
||||
//__forceinline float rcp_length (const vfloat<8>& a) { return rsqrt(dot(a,a)); }
|
||||
//__forceinline float rcp_length2(const vfloat<8>& a) { return rcp(dot(a,a)); }
|
||||
//__forceinline float length (const vfloat<8>& a) { return sqrt(dot(a,a)); }
|
||||
__forceinline vfloat<8> normalize(const vfloat<8>& a) { return a*rsqrt(dot(a,a)); }
|
||||
//__forceinline float distance(const vfloat<8>& a, const vfloat<8>& b) { return length(a-b); }
|
||||
//__forceinline float halfArea(const vfloat<8>& d) { return madd(d.x,(d.y+d.z),d.y*d.z); }
|
||||
//__forceinline float area (const vfloat<8>& d) { return 2.0f*halfArea(d); }
|
||||
//__forceinline vfloat<8> reflect(const vfloat<8>& V, const vfloat<8>& N) { return 2.0f*dot(V,N)*N-V; }
|
||||
|
||||
//__forceinline vfloat<8> normalize_safe( const vfloat<8>& a ) {
|
||||
//__forceinline vfloat<8> normalize_safe(const vfloat<8>& a) {
|
||||
// const float d = dot(a,a); if (unlikely(d == 0.0f)) return a; else return a*rsqrt(d);
|
||||
//}
|
||||
|
||||
@@ -683,7 +784,7 @@ namespace embree
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& cout, const vfloat8& a) {
|
||||
inline std::ostream& operator <<(std::ostream& cout, const vfloat8& a) {
|
||||
return cout << "<" << a[0] << ", " << a[1] << ", " << a[2] << ", " << a[3] << ", " << a[4] << ", " << a[5] << ", " << a[6] << ", " << a[7] << ">";
|
||||
}
|
||||
}
|
||||
+170
-157
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -20,7 +20,7 @@ namespace embree
|
||||
{
|
||||
/* 16-wide AVX-512 integer type */
|
||||
template<>
|
||||
struct vint<16>
|
||||
struct vint<16>
|
||||
{
|
||||
typedef vboolf16 Bool;
|
||||
typedef vint16 Int;
|
||||
@@ -38,24 +38,24 @@ namespace embree
|
||||
|
||||
__forceinline vint() {}
|
||||
__forceinline vint(const vint16& t) { v = t.v; }
|
||||
__forceinline vint16& operator=(const vint16& f) { v = f.v; return *this; }
|
||||
__forceinline vint16& operator =(const vint16& f) { v = f.v; return *this; }
|
||||
|
||||
__forceinline vint(const __m512i& t) { v = t; }
|
||||
__forceinline operator __m512i () const { return v; }
|
||||
__forceinline operator __m256i () const { return _mm512_castsi512_si256(v); }
|
||||
__forceinline operator __m512i() const { return v; }
|
||||
__forceinline operator __m256i() const { return _mm512_castsi512_si256(v); }
|
||||
|
||||
__forceinline vint(const int i) {
|
||||
__forceinline vint(int i) {
|
||||
v = _mm512_set1_epi32(i);
|
||||
}
|
||||
|
||||
__forceinline vint(const int a, const int b, const int c, const int d) {
|
||||
__forceinline vint(int a, int b, int c, int d) {
|
||||
v = _mm512_set4_epi32(d,c,b,a);
|
||||
}
|
||||
|
||||
__forceinline vint(const int a0 , const int a1 , const int a2 , const int a3,
|
||||
const int a4 , const int a5 , const int a6 , const int a7,
|
||||
const int a8 , const int a9 , const int a10, const int a11,
|
||||
const int a12, const int a13, const int a14, const int a15)
|
||||
__forceinline vint(int a0 , int a1 , int a2 , int a3,
|
||||
int a4 , int a5 , int a6 , int a7,
|
||||
int a8 , int a9 , int a10, int a11,
|
||||
int a12, int a13, int a14, int a15)
|
||||
{
|
||||
v = _mm512_set_epi32(a15,a14,a13,a12,a11,a10,a9,a8,a7,a6,a5,a4,a3,a2,a1,a0);
|
||||
}
|
||||
@@ -64,9 +64,21 @@ namespace embree
|
||||
v = _mm512_broadcast_i32x4(i);
|
||||
}
|
||||
|
||||
__forceinline vint(const vint4& a, const vint4& b, const vint4& c, const vint4& d) {
|
||||
v = _mm512_castsi128_si512(a);
|
||||
v = _mm512_inserti32x4(v, b, 1);
|
||||
v = _mm512_inserti32x4(v, c, 2);
|
||||
v = _mm512_inserti32x4(v, d, 3);
|
||||
}
|
||||
|
||||
__forceinline vint(const vint8& i) {
|
||||
v = _mm512_castps_si512(_mm512_castpd_ps(_mm512_broadcast_f64x4(_mm256_castsi256_pd(i))));
|
||||
}
|
||||
|
||||
__forceinline vint(const vint8& a, const vint8& b) {
|
||||
v = _mm512_castsi256_si512(a);
|
||||
v = _mm512_inserti64x4(v, b, 1);
|
||||
}
|
||||
|
||||
__forceinline explicit vint(const __m512& f) {
|
||||
v = _mm512_cvtps_epi32(f);
|
||||
@@ -76,17 +88,12 @@ namespace embree
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vint( ZeroTy ) : v(_mm512_setzero_epi32()) {}
|
||||
__forceinline vint( OneTy ) : v(_mm512_set1_epi32(1)) {}
|
||||
__forceinline vint( PosInfTy ) : v(_mm512_set1_epi32(pos_inf)) {}
|
||||
__forceinline vint( NegInfTy ) : v(_mm512_set1_epi32(neg_inf)) {}
|
||||
__forceinline vint( StepTy ) : v(_mm512_set_epi32(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) {}
|
||||
|
||||
__forceinline vint( ReverseStepTy ) : v(_mm512_setr_epi32(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) {}
|
||||
|
||||
__forceinline static vint16 zero() { return _mm512_setzero_epi32(); }
|
||||
__forceinline static vint16 one () { return _mm512_set1_epi32(1); }
|
||||
__forceinline static vint16 neg_one () { return _mm512_set1_epi32(-1); }
|
||||
__forceinline vint(ZeroTy) : v(_mm512_setzero_epi32()) {}
|
||||
__forceinline vint(OneTy) : v(_mm512_set1_epi32(1)) {}
|
||||
__forceinline vint(PosInfTy) : v(_mm512_set1_epi32(pos_inf)) {}
|
||||
__forceinline vint(NegInfTy) : v(_mm512_set1_epi32(neg_inf)) {}
|
||||
__forceinline vint(StepTy) : v(_mm512_set_epi32(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) {}
|
||||
__forceinline vint(ReverseStepTy) : v(_mm512_setr_epi32(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Loads and Stores
|
||||
@@ -94,8 +101,11 @@ namespace embree
|
||||
|
||||
static __forceinline vint16 load (const void* addr) { return _mm512_load_si512((int*)addr); }
|
||||
|
||||
static __forceinline const vint16 load( const unsigned char* const ptr ) { return _mm512_cvtepu8_epi32(_mm_load_si128((__m128i*)ptr)); }
|
||||
static __forceinline const vint16 load( const unsigned short* const ptr ) { return _mm512_cvtepu16_epi32(*(__m256i*)ptr); }
|
||||
static __forceinline vint16 load(const unsigned char* ptr) { return _mm512_cvtepu8_epi32(_mm_load_si128((__m128i*)ptr)); }
|
||||
static __forceinline vint16 load(const unsigned short* ptr) { return _mm512_cvtepu16_epi32(_mm256_load_si256((__m256i*)ptr)); }
|
||||
|
||||
static __forceinline vint16 loadu(const unsigned char* ptr) { return _mm512_cvtepu8_epi32(_mm_loadu_si128((__m128i*)ptr)); }
|
||||
static __forceinline vint16 loadu(const unsigned short* ptr) { return _mm512_cvtepu16_epi32(_mm256_loadu_si256((__m256i*)ptr)); }
|
||||
|
||||
static __forceinline vint16 loadu(const void* addr) { return _mm512_loadu_si512(addr); }
|
||||
|
||||
@@ -106,16 +116,16 @@ namespace embree
|
||||
static __forceinline void storeu(void* ptr, const vint16& v) { _mm512_storeu_si512(ptr,v); }
|
||||
|
||||
static __forceinline void store (const vboolf16& mask, void* addr, const vint16& v2) { _mm512_mask_store_epi32(addr,mask,v2); }
|
||||
static __forceinline void storeu(const vboolf16& mask, void* ptr, const vint16& f ) { _mm512_mask_storeu_epi32((int*)ptr,mask,f); }
|
||||
static __forceinline void storeu(const vboolf16& mask, void* ptr, const vint16& f) { _mm512_mask_storeu_epi32((int*)ptr,mask,f); }
|
||||
|
||||
static __forceinline void store_nt(void *__restrict__ ptr, const vint16& a) { _mm512_stream_si512((__m512i*)ptr,a); }
|
||||
static __forceinline void store_nt(void* __restrict__ ptr, const vint16& a) { _mm512_stream_si512((__m512i*)ptr,a); }
|
||||
|
||||
/* pass by value to avoid compiler generating inefficient code */
|
||||
static __forceinline void storeu_compact(const vboolf16 mask,void * addr, const vint16 reg) {
|
||||
static __forceinline void storeu_compact(const vboolf16 mask, void* addr, vint16 reg) {
|
||||
_mm512_mask_compressstoreu_epi32(addr,mask,reg);
|
||||
}
|
||||
|
||||
static __forceinline void storeu_compact_single(const vboolf16 mask,void * addr, const vint16 reg) {
|
||||
static __forceinline void storeu_compact_single(const vboolf16 mask, void* addr, vint16 reg) {
|
||||
//_mm512_mask_compressstoreu_epi32(addr,mask,reg);
|
||||
*(float*)addr = mm512_cvtss_f32(_mm512_mask_compress_ps(_mm512_castsi512_ps(reg),mask,_mm512_castsi512_ps(reg)));
|
||||
}
|
||||
@@ -136,135 +146,160 @@ namespace embree
|
||||
return _mm512_mask_expand_epi32(b,mask,a);
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline vint16 gather(const int* ptr, const vint16& index) {
|
||||
return _mm512_i32gather_epi32(index,ptr,scale);
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline vint16 gather(const vboolf16& mask, const int* ptr, const vint16& index) {
|
||||
return _mm512_mask_i32gather_epi32(_mm512_undefined_epi32(),mask,index,ptr,scale);
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline vint16 gather(const vboolf16& mask, vint16& dest, const int* ptr, const vint16& index) {
|
||||
return _mm512_mask_i32gather_epi32(dest,mask,index,ptr,scale);
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline void scatter(int* ptr, const vint16& index, const vint16& v) {
|
||||
_mm512_i32scatter_epi32((int*)ptr,index,v,scale);
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline void scatter(const vboolf16& mask, int* ptr, const vint16& index, const vint16& v) {
|
||||
_mm512_mask_i32scatter_epi32((int*)ptr,mask,index,v,scale);
|
||||
}
|
||||
|
||||
static __forceinline vint16 broadcast64bit(size_t v) {
|
||||
return _mm512_set1_epi64(v);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline int& operator[](const size_t index) { assert(index < 16); return i[index]; }
|
||||
__forceinline const int& operator[](const size_t index) const { assert(index < 16); return i[index]; }
|
||||
__forceinline int& operator [](size_t index) { assert(index < 16); return i[index]; }
|
||||
__forceinline const int& operator [](size_t index) const { assert(index < 16); return i[index]; }
|
||||
|
||||
__forceinline unsigned int uint (const size_t index) const { assert(index < 16); return ((unsigned int*)i)[index]; }
|
||||
__forceinline size_t& uint64_t(const size_t index) const { assert(index < 8); return ((size_t*)i)[index]; }
|
||||
__forceinline unsigned int uint (size_t index) const { assert(index < 16); return ((unsigned int*)i)[index]; }
|
||||
__forceinline size_t& uint64_t(size_t index) const { assert(index < 8); return ((size_t*)i)[index]; }
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vint16 asInt ( const __m512& a ) { return _mm512_castps_si512(a); }
|
||||
__forceinline const vint16 operator +( const vint16& a ) { return a; }
|
||||
__forceinline const vint16 operator -( const vint16& a ) { return _mm512_sub_epi32(_mm512_setzero_epi32(), a); }
|
||||
__forceinline vboolf16 asBool(const vint16& a) { return _mm512_movepi32_mask(a); }
|
||||
|
||||
__forceinline vint16 operator +(const vint16& a) { return a; }
|
||||
__forceinline vint16 operator -(const vint16& a) { return _mm512_sub_epi32(_mm512_setzero_epi32(), a); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vint16 operator +( const vint16& a, const vint16& b ) { return _mm512_add_epi32(a, b); }
|
||||
__forceinline const vint16 operator +( const vint16& a, const int b ) { return a + vint16(b); }
|
||||
__forceinline const vint16 operator +( const int a, const vint16& b ) { return vint16(a) + b; }
|
||||
__forceinline vint16 operator +(const vint16& a, const vint16& b) { return _mm512_add_epi32(a, b); }
|
||||
__forceinline vint16 operator +(const vint16& a, int b) { return a + vint16(b); }
|
||||
__forceinline vint16 operator +(int a, const vint16& b) { return vint16(a) + b; }
|
||||
|
||||
__forceinline const vint16 operator -( const vint16& a, const vint16& b ) { return _mm512_sub_epi32(a, b); }
|
||||
__forceinline const vint16 operator -( const vint16& a, const int b ) { return a - vint16(b); }
|
||||
__forceinline const vint16 operator -( const int a, const vint16& b ) { return vint16(a) - b; }
|
||||
__forceinline vint16 operator -(const vint16& a, const vint16& b) { return _mm512_sub_epi32(a, b); }
|
||||
__forceinline vint16 operator -(const vint16& a, int b) { return a - vint16(b); }
|
||||
__forceinline vint16 operator -(int a, const vint16& b) { return vint16(a) - b; }
|
||||
|
||||
__forceinline const vint16 operator *( const vint16& a, const vint16& b ) { return _mm512_mullo_epi32(a, b); }
|
||||
__forceinline const vint16 operator *( const vint16& a, const int b ) { return a * vint16(b); }
|
||||
__forceinline const vint16 operator *( const int a, const vint16& b ) { return vint16(a) * b; }
|
||||
__forceinline vint16 operator *(const vint16& a, const vint16& b) { return _mm512_mullo_epi32(a, b); }
|
||||
__forceinline vint16 operator *(const vint16& a, int b) { return a * vint16(b); }
|
||||
__forceinline vint16 operator *(int a, const vint16& b) { return vint16(a) * b; }
|
||||
|
||||
__forceinline const vint16 operator &( const vint16& a, const vint16& b ) { return _mm512_and_epi32(a, b); }
|
||||
__forceinline const vint16 operator &( const vint16& a, const int b ) { return a & vint16(b); }
|
||||
__forceinline const vint16 operator &( const int a, const vint16& b ) { return vint16(a) & b; }
|
||||
__forceinline vint16 operator &(const vint16& a, const vint16& b) { return _mm512_and_epi32(a, b); }
|
||||
__forceinline vint16 operator &(const vint16& a, int b) { return a & vint16(b); }
|
||||
__forceinline vint16 operator &(int a, const vint16& b) { return vint16(a) & b; }
|
||||
|
||||
__forceinline const vint16 operator |( const vint16& a, const vint16& b ) { return _mm512_or_epi32(a, b); }
|
||||
__forceinline const vint16 operator |( const vint16& a, const int b ) { return a | vint16(b); }
|
||||
__forceinline const vint16 operator |( const int a, const vint16& b ) { return vint16(a) | b; }
|
||||
__forceinline vint16 operator |(const vint16& a, const vint16& b) { return _mm512_or_epi32(a, b); }
|
||||
__forceinline vint16 operator |(const vint16& a, int b) { return a | vint16(b); }
|
||||
__forceinline vint16 operator |(int a, const vint16& b) { return vint16(a) | b; }
|
||||
|
||||
__forceinline const vint16 operator ^( const vint16& a, const vint16& b ) { return _mm512_xor_epi32(a, b); }
|
||||
__forceinline const vint16 operator ^( const vint16& a, const int b ) { return a ^ vint16(b); }
|
||||
__forceinline const vint16 operator ^( const int a, const vint16& b ) { return vint16(a) ^ b; }
|
||||
__forceinline vint16 operator ^(const vint16& a, const vint16& b) { return _mm512_xor_epi32(a, b); }
|
||||
__forceinline vint16 operator ^(const vint16& a, int b) { return a ^ vint16(b); }
|
||||
__forceinline vint16 operator ^(int a, const vint16& b) { return vint16(a) ^ b; }
|
||||
|
||||
__forceinline const vint16 operator <<( const vint16& a, const int n ) { return _mm512_slli_epi32(a, n); }
|
||||
__forceinline const vint16 operator >>( const vint16& a, const int n ) { return _mm512_srai_epi32(a, n); }
|
||||
__forceinline vint16 operator <<(const vint16& a, int n) { return _mm512_slli_epi32(a, n); }
|
||||
__forceinline vint16 operator >>(const vint16& a, int n) { return _mm512_srai_epi32(a, n); }
|
||||
|
||||
__forceinline const vint16 operator <<( const vint16& a, const vint16& n ) { return _mm512_sllv_epi32(a, n); }
|
||||
__forceinline const vint16 operator >>( const vint16& a, const vint16& n ) { return _mm512_srav_epi32(a, n); }
|
||||
__forceinline vint16 operator <<(const vint16& a, const vint16& n) { return _mm512_sllv_epi32(a, n); }
|
||||
__forceinline vint16 operator >>(const vint16& a, const vint16& n) { return _mm512_srav_epi32(a, n); }
|
||||
|
||||
__forceinline const vint16 sll ( const vint16& a, const int b ) { return _mm512_slli_epi32(a, b); }
|
||||
__forceinline const vint16 sra ( const vint16& a, const int b ) { return _mm512_srai_epi32(a, b); }
|
||||
__forceinline const vint16 srl ( const vint16& a, const int b ) { return _mm512_srli_epi32(a, b); }
|
||||
__forceinline vint16 sll (const vint16& a, int b) { return _mm512_slli_epi32(a, b); }
|
||||
__forceinline vint16 sra (const vint16& a, int b) { return _mm512_srai_epi32(a, b); }
|
||||
__forceinline vint16 srl (const vint16& a, int b) { return _mm512_srli_epi32(a, b); }
|
||||
|
||||
__forceinline const vint16 min( const vint16& a, const vint16& b ) { return _mm512_min_epi32(a, b); }
|
||||
__forceinline const vint16 min( const vint16& a, const int b ) { return min(a,vint16(b)); }
|
||||
__forceinline const vint16 min( const int a, const vint16& b ) { return min(vint16(a),b); }
|
||||
__forceinline vint16 min(const vint16& a, const vint16& b) { return _mm512_min_epi32(a, b); }
|
||||
__forceinline vint16 min(const vint16& a, int b) { return min(a,vint16(b)); }
|
||||
__forceinline vint16 min(int a, const vint16& b) { return min(vint16(a),b); }
|
||||
|
||||
__forceinline const vint16 max( const vint16& a, const vint16& b ) { return _mm512_max_epi32(a, b); }
|
||||
__forceinline const vint16 max( const vint16& a, const int b ) { return max(a,vint16(b)); }
|
||||
__forceinline const vint16 max( const int a, const vint16& b ) { return max(vint16(a),b); }
|
||||
__forceinline vint16 max(const vint16& a, const vint16& b) { return _mm512_max_epi32(a, b); }
|
||||
__forceinline vint16 max(const vint16& a, int b) { return max(a,vint16(b)); }
|
||||
__forceinline vint16 max(int a, const vint16& b) { return max(vint16(a),b); }
|
||||
|
||||
__forceinline const vint16 umin( const vint16& a, const vint16& b ) { return _mm512_min_epu32(a.v, b.v); }
|
||||
__forceinline const vint16 umax( const vint16& a, const vint16& b ) { return _mm512_max_epu32(a.v, b.v); }
|
||||
__forceinline vint16 umin(const vint16& a, const vint16& b) { return _mm512_min_epu32(a, b); }
|
||||
__forceinline vint16 umax(const vint16& a, const vint16& b) { return _mm512_max_epu32(a, b); }
|
||||
|
||||
__forceinline const vint16 mask_add(const vboolf16& mask, vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_add_epi32(c,mask,a,b); }
|
||||
__forceinline const vint16 mask_sub(const vboolf16& mask, vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_sub_epi32(c,mask,a,b); }
|
||||
__forceinline vint16 mask_add(const vboolf16& mask, vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_add_epi32(c,mask,a,b); }
|
||||
__forceinline vint16 mask_sub(const vboolf16& mask, vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_sub_epi32(c,mask,a,b); }
|
||||
|
||||
__forceinline const vint16 mask_and(const vboolf16& m,vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_and_epi32(c,m,a,b); }
|
||||
__forceinline const vint16 mask_or (const vboolf16& m,vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_or_epi32(c,m,a,b); }
|
||||
__forceinline vint16 mask_and(const vboolf16& m, vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_and_epi32(c,m,a,b); }
|
||||
__forceinline vint16 mask_or (const vboolf16& m, vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_or_epi32(c,m,a,b); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vint16& operator +=( vint16& a, const vint16& b ) { return a = a + b; }
|
||||
__forceinline vint16& operator +=( vint16& a, const int b ) { return a = a + b; }
|
||||
__forceinline vint16& operator +=(vint16& a, const vint16& b) { return a = a + b; }
|
||||
__forceinline vint16& operator +=(vint16& a, int b) { return a = a + b; }
|
||||
|
||||
__forceinline vint16& operator -=( vint16& a, const vint16& b ) { return a = a - b; }
|
||||
__forceinline vint16& operator -=( vint16& a, const int b ) { return a = a - b; }
|
||||
__forceinline vint16& operator -=(vint16& a, const vint16& b) { return a = a - b; }
|
||||
__forceinline vint16& operator -=(vint16& a, int b) { return a = a - b; }
|
||||
|
||||
__forceinline vint16& operator *=( vint16& a, const vint16& b ) { return a = a * b; }
|
||||
__forceinline vint16& operator *=( vint16& a, const int b ) { return a = a * b; }
|
||||
__forceinline vint16& operator *=(vint16& a, const vint16& b) { return a = a * b; }
|
||||
__forceinline vint16& operator *=(vint16& a, int b) { return a = a * b; }
|
||||
|
||||
__forceinline vint16& operator &=( vint16& a, const vint16& b ) { return a = a & b; }
|
||||
__forceinline vint16& operator &=( vint16& a, const int b ) { return a = a & b; }
|
||||
__forceinline vint16& operator &=(vint16& a, const vint16& b) { return a = a & b; }
|
||||
__forceinline vint16& operator &=(vint16& a, int b) { return a = a & b; }
|
||||
|
||||
__forceinline vint16& operator |=( vint16& a, const vint16& b ) { return a = a | b; }
|
||||
__forceinline vint16& operator |=( vint16& a, const int b ) { return a = a | b; }
|
||||
__forceinline vint16& operator |=(vint16& a, const vint16& b) { return a = a | b; }
|
||||
__forceinline vint16& operator |=(vint16& a, int b) { return a = a | b; }
|
||||
|
||||
__forceinline vint16& operator <<=( vint16& a, const int b ) { return a = a << b; }
|
||||
__forceinline vint16& operator >>=( vint16& a, const int b ) { return a = a >> b; }
|
||||
__forceinline vint16& operator <<=(vint16& a, int b) { return a = a << b; }
|
||||
__forceinline vint16& operator >>=(vint16& a, int b) { return a = a >> b; }
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vboolf16 operator ==( const vint16& a, const vint16& b ) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_EQ); }
|
||||
__forceinline const vboolf16 operator ==( const vint16& a, const int b ) { return a == vint16(b); }
|
||||
__forceinline const vboolf16 operator ==( const int a, const vint16& b ) { return vint16(a) == b; }
|
||||
__forceinline vboolf16 operator ==(const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_EQ); }
|
||||
__forceinline vboolf16 operator ==(const vint16& a, int b) { return a == vint16(b); }
|
||||
__forceinline vboolf16 operator ==(int a, const vint16& b) { return vint16(a) == b; }
|
||||
|
||||
__forceinline const vboolf16 operator !=( const vint16& a, const vint16& b ) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_NE); }
|
||||
__forceinline const vboolf16 operator !=( const vint16& a, const int b ) { return a != vint16(b); }
|
||||
__forceinline const vboolf16 operator !=( const int a, const vint16& b ) { return vint16(a) != b; }
|
||||
__forceinline vboolf16 operator !=(const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_NE); }
|
||||
__forceinline vboolf16 operator !=(const vint16& a, int b) { return a != vint16(b); }
|
||||
__forceinline vboolf16 operator !=(int a, const vint16& b) { return vint16(a) != b; }
|
||||
|
||||
__forceinline const vboolf16 operator < ( const vint16& a, const vint16& b ) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_LT); }
|
||||
__forceinline const vboolf16 operator < ( const vint16& a, const int b ) { return a < vint16(b); }
|
||||
__forceinline const vboolf16 operator < ( const int a, const vint16& b ) { return vint16(a) < b; }
|
||||
__forceinline vboolf16 operator < (const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_LT); }
|
||||
__forceinline vboolf16 operator < (const vint16& a, int b) { return a < vint16(b); }
|
||||
__forceinline vboolf16 operator < (int a, const vint16& b) { return vint16(a) < b; }
|
||||
|
||||
__forceinline const vboolf16 operator >=( const vint16& a, const vint16& b ) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_GE); }
|
||||
__forceinline const vboolf16 operator >=( const vint16& a, const int b ) { return a >= vint16(b); }
|
||||
__forceinline const vboolf16 operator >=( const int a, const vint16& b ) { return vint16(a) >= b; }
|
||||
__forceinline vboolf16 operator >=(const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_GE); }
|
||||
__forceinline vboolf16 operator >=(const vint16& a, int b) { return a >= vint16(b); }
|
||||
__forceinline vboolf16 operator >=(int a, const vint16& b) { return vint16(a) >= b; }
|
||||
|
||||
__forceinline const vboolf16 operator > ( const vint16& a, const vint16& b ) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_GT); }
|
||||
__forceinline const vboolf16 operator > ( const vint16& a, const int b ) { return a > vint16(b); }
|
||||
__forceinline const vboolf16 operator > ( const int a, const vint16& b ) { return vint16(a) > b; }
|
||||
__forceinline vboolf16 operator > (const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_GT); }
|
||||
__forceinline vboolf16 operator > (const vint16& a, int b) { return a > vint16(b); }
|
||||
__forceinline vboolf16 operator > (int a, const vint16& b) { return vint16(a) > b; }
|
||||
|
||||
__forceinline const vboolf16 operator <=( const vint16& a, const vint16& b ) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_LE); }
|
||||
__forceinline const vboolf16 operator <=( const vint16& a, const int b ) { return a <= vint16(b); }
|
||||
__forceinline const vboolf16 operator <=( const int a, const vint16& b ) { return vint16(a) <= b; }
|
||||
__forceinline vboolf16 operator <=(const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_LE); }
|
||||
__forceinline vboolf16 operator <=(const vint16& a, int b) { return a <= vint16(b); }
|
||||
__forceinline vboolf16 operator <=(int a, const vint16& b) { return vint16(a) <= b; }
|
||||
|
||||
__forceinline vboolf16 eq(const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_EQ); }
|
||||
__forceinline vboolf16 ne(const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_NE); }
|
||||
@@ -285,7 +320,7 @@ namespace embree
|
||||
__forceinline vboolf16 uint_gt(const vboolf16 mask, const vint16& a, const vint16& b) { return _mm512_mask_cmp_epu32_mask(mask,a,b,_MM_CMPINT_GT); }
|
||||
|
||||
|
||||
__forceinline const vint16 select( const vboolf16& m, const vint16& t, const vint16& f ) {
|
||||
__forceinline vint16 select(const vboolf16& m, const vint16& t, const vint16& f) {
|
||||
return _mm512_mask_or_epi32(f,m,t,t);
|
||||
}
|
||||
|
||||
@@ -305,41 +340,39 @@ namespace embree
|
||||
// Movement/Shifting/Shuffling Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vint16 unpacklo( const vint16& a, const vint16& b ) { return _mm512_unpacklo_epi32(a.v, b.v); }
|
||||
__forceinline vint16 unpackhi( const vint16& a, const vint16& b ) { return _mm512_unpackhi_epi32(a.v, b.v); }
|
||||
__forceinline vint16 unpacklo(const vint16& a, const vint16& b) { return _mm512_unpacklo_epi32(a, b); }
|
||||
__forceinline vint16 unpackhi(const vint16& a, const vint16& b) { return _mm512_unpackhi_epi32(a, b); }
|
||||
|
||||
template<size_t i>
|
||||
__forceinline const vint16 shuffle( const vint16& a ) {
|
||||
return _mm512_castps_si512(_mm512_permute_ps(_mm512_castsi512_ps(a), _MM_SHUFFLE(i, i, i, i)));
|
||||
template<int i>
|
||||
__forceinline vint16 shuffle(const vint16& v) {
|
||||
return _mm512_castps_si512(_mm512_permute_ps(_mm512_castsi512_ps(v), _MM_SHUFFLE(i, i, i, i)));
|
||||
}
|
||||
|
||||
template<int A, int B, int C, int D>
|
||||
__forceinline vint16 shuffle (const vint16& v) {
|
||||
return _mm512_castps_si512(_mm512_permute_ps(_mm512_castsi512_ps(v),_MM_SHUFFLE(D,C,B,A)));
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vint16 shuffle(const vint16& v) {
|
||||
return _mm512_castps_si512(_mm512_permute_ps(_mm512_castsi512_ps(v), _MM_SHUFFLE(i3, i2, i1, i0)));
|
||||
}
|
||||
|
||||
template<int i>
|
||||
__forceinline vint16 shuffle4(const vint16& x) {
|
||||
return _mm512_castps_si512(_mm512_shuffle_f32x4(_mm512_castsi512_ps(x),_mm512_castsi512_ps(x),_MM_SHUFFLE(i,i,i,i)));
|
||||
__forceinline vint16 shuffle4(const vint16& v) {
|
||||
return _mm512_castps_si512(_mm512_shuffle_f32x4(_mm512_castsi512_ps(v), _mm512_castsi512_ps(v), _MM_SHUFFLE(i, i, i, i)));
|
||||
}
|
||||
|
||||
template<int A, int B, int C, int D>
|
||||
__forceinline vint16 shuffle4(const vint16& x) {
|
||||
return _mm512_castps_si512(_mm512_shuffle_f32x4(_mm512_castsi512_ps(x),_mm512_castsi512_ps(x),_MM_SHUFFLE(D,C,B,A)));
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vint16 shuffle4(const vint16& v) {
|
||||
return _mm512_castps_si512(_mm512_shuffle_f32x4(_mm512_castsi512_ps(v), _mm512_castsi512_ps(v), _MM_SHUFFLE(i3, i2, i1, i0)));
|
||||
}
|
||||
|
||||
template<int i>
|
||||
__forceinline vint16 align_shift_right(const vint16& a, const vint16& b)
|
||||
{
|
||||
return _mm512_alignr_epi32(a,b,i);
|
||||
__forceinline vint16 align_shift_right(const vint16& a, const vint16& b) {
|
||||
return _mm512_alignr_epi32(a, b, i);
|
||||
};
|
||||
|
||||
__forceinline int toScalar(const vint16& a)
|
||||
{
|
||||
return _mm_cvtsi128_si32(_mm512_castsi512_si128(a));
|
||||
__forceinline int toScalar(const vint16& v) {
|
||||
return _mm_cvtsi128_si32(_mm512_castsi512_si128(v));
|
||||
}
|
||||
|
||||
template<int i> __forceinline const vint16 insert4(const vint16& a, const vint4& b) { return _mm512_inserti32x4(a, b, i); }
|
||||
template<int i> __forceinline vint16 insert4(const vint16& a, const vint4& b) { return _mm512_inserti32x4(a, b, i); }
|
||||
|
||||
__forceinline size_t extract64bit(const vint16& v) {
|
||||
return _mm_cvtsi128_si64(_mm512_castsi512_si128(v));
|
||||
@@ -366,15 +399,15 @@ namespace embree
|
||||
/// Reductions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vint16 vreduce_min2(vint16 x) { return min(x,shuffle<1,0,3,2>(x)); }
|
||||
__forceinline vint16 vreduce_min4(vint16 x) { x = vreduce_min2(x); return min(x,shuffle<2,3,0,1>(x)); }
|
||||
__forceinline vint16 vreduce_min8(vint16 x) { x = vreduce_min4(x); return min(x,shuffle4<1,0,3,2>(x)); }
|
||||
__forceinline vint16 vreduce_min (vint16 x) { x = vreduce_min8(x); return min(x,shuffle4<2,3,0,1>(x)); }
|
||||
__forceinline vint16 vreduce_min2(vint16 x) { return min(x, shuffle<1,0,3,2>(x)); }
|
||||
__forceinline vint16 vreduce_min4(vint16 x) { x = vreduce_min2(x); return min(x, shuffle<2,3,0,1>(x)); }
|
||||
__forceinline vint16 vreduce_min8(vint16 x) { x = vreduce_min4(x); return min(x, shuffle4<1,0,3,2>(x)); }
|
||||
__forceinline vint16 vreduce_min (vint16 x) { x = vreduce_min8(x); return min(x, shuffle4<2,3,0,1>(x)); }
|
||||
|
||||
__forceinline vint16 vreduce_max2(vint16 x) { return max(x,shuffle<1,0,3,2>(x)); }
|
||||
__forceinline vint16 vreduce_max4(vint16 x) { x = vreduce_max2(x); return max(x,shuffle<2,3,0,1>(x)); }
|
||||
__forceinline vint16 vreduce_max8(vint16 x) { x = vreduce_max4(x); return max(x,shuffle4<1,0,3,2>(x)); }
|
||||
__forceinline vint16 vreduce_max (vint16 x) { x = vreduce_max8(x); return max(x,shuffle4<2,3,0,1>(x)); }
|
||||
__forceinline vint16 vreduce_max2(vint16 x) { return max(x, shuffle<1,0,3,2>(x)); }
|
||||
__forceinline vint16 vreduce_max4(vint16 x) { x = vreduce_max2(x); return max(x, shuffle<2,3,0,1>(x)); }
|
||||
__forceinline vint16 vreduce_max8(vint16 x) { x = vreduce_max4(x); return max(x, shuffle4<1,0,3,2>(x)); }
|
||||
__forceinline vint16 vreduce_max (vint16 x) { x = vreduce_max8(x); return max(x, shuffle4<2,3,0,1>(x)); }
|
||||
|
||||
__forceinline vint16 vreduce_and2(vint16 x) { return x & shuffle<1,0,3,2>(x); }
|
||||
__forceinline vint16 vreduce_and4(vint16 x) { x = vreduce_and2(x); return x & shuffle<2,3,0,1>(x); }
|
||||
@@ -401,36 +434,16 @@ namespace embree
|
||||
/// Memory load and store operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<int scale = 4>
|
||||
__forceinline vint16 gather16i(const vboolf16& mask, const int *const ptr, const vint16& index) {
|
||||
return _mm512_mask_i32gather_epi32(_mm512_undefined_epi32(),mask,index,ptr,scale);
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
__forceinline vint16 gather16i(const vboolf16& mask, vint16& dest, const int *const ptr, const vint16& index) {
|
||||
return _mm512_mask_i32gather_epi32(dest,mask,index,ptr,scale);
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
__forceinline void scatter16i(const vboolf16& mask,int *const ptr, const vint16& index,const vint16& v) {
|
||||
_mm512_mask_i32scatter_epi32((int*)ptr,mask,index,v,scale);
|
||||
}
|
||||
|
||||
__forceinline vint16 conflict16i(const vint16& index)
|
||||
__forceinline vint16 conflict(const vint16& index)
|
||||
{
|
||||
return _mm512_conflict_epi32(index);
|
||||
}
|
||||
|
||||
__forceinline vint16 conflict16i(const vboolf16& mask, vint16& dest, const vint16& index)
|
||||
__forceinline vint16 conflict(const vboolf16& mask, vint16& dest, const vint16& index)
|
||||
{
|
||||
return _mm512_mask_conflict_epi32(dest,mask,index);
|
||||
}
|
||||
|
||||
__forceinline void compactustore16i_low(const vboolf16 mask, void *addr, const vint16& reg) {
|
||||
_mm512_mask_compressstoreu_epi32(addr,mask,reg);
|
||||
}
|
||||
|
||||
|
||||
__forceinline vint16 convert_uint32_t(const __m512& f) {
|
||||
return _mm512_cvtps_epu32(f);
|
||||
}
|
||||
@@ -467,10 +480,10 @@ namespace embree
|
||||
|
||||
/* this should use a vbool8 and a vint8_64...*/
|
||||
template<int scale = 1, int hint = _MM_HINT_T0>
|
||||
__forceinline void gather_prefetch64(void const* base_addr,const vbool16 &mask, const vint16& offset)
|
||||
__forceinline void gather_prefetch64(const void* base_addr, const vbool16& mask, const vint16& offset)
|
||||
{
|
||||
#if defined(__AVX512PF__)
|
||||
_mm512_mask_prefetch_i64gather_pd(offset,mask,base_addr,scale,hint);
|
||||
_mm512_mask_prefetch_i64gather_pd(offset, mask, base_addr, scale, hint);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -478,7 +491,7 @@ namespace embree
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline std::ostream& operator<<(std::ostream& cout, const vint16& v)
|
||||
__forceinline std::ostream& operator <<(std::ostream& cout, const vint16& v)
|
||||
{
|
||||
cout << "<" << v[0];
|
||||
for (int i=1; i<16; i++) cout << ", " << v[i];
|
||||
|
||||
+251
-150
@@ -1,5 +1,5 @@
|
||||
// ======================================================================== //
|
||||
// Copyright 2009-2017 Intel Corporation //
|
||||
// Copyright 2009-2018 Intel Corporation //
|
||||
// //
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); //
|
||||
// you may not use this file except in compliance with the License. //
|
||||
@@ -35,83 +35,101 @@ namespace embree
|
||||
/// Constructors, Assignment & Cast Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vint ( ) {}
|
||||
__forceinline vint ( const vint4& a ) { v = a.v; }
|
||||
__forceinline vint4& operator=( const vint4& a ) { v = a.v; return *this; }
|
||||
__forceinline vint() {}
|
||||
__forceinline vint(const vint4& a) { v = a.v; }
|
||||
__forceinline vint4& operator =(const vint4& a) { v = a.v; return *this; }
|
||||
|
||||
__forceinline vint( const __m128i a ) : v(a) {}
|
||||
__forceinline operator const __m128i&( void ) const { return v; }
|
||||
__forceinline operator __m128i&( void ) { return v; }
|
||||
__forceinline vint(__m128i a) : v(a) {}
|
||||
__forceinline operator const __m128i&() const { return v; }
|
||||
__forceinline operator __m128i&() { return v; }
|
||||
|
||||
__forceinline vint(int a) : v(_mm_set1_epi32(a)) {}
|
||||
__forceinline vint(int a, int b, int c, int d) : v(_mm_set_epi32(d, c, b, a)) {}
|
||||
|
||||
__forceinline vint( const int& a ) : v(_mm_shuffle_epi32(_mm_castps_si128(_mm_load_ss((float*)&a)), _MM_SHUFFLE(0, 0, 0, 0))) {}
|
||||
__forceinline vint( const uint32_t& a ) : v(_mm_shuffle_epi32(_mm_castps_si128(_mm_load_ss((float*)&a)), _MM_SHUFFLE(0, 0, 0, 0))) {}
|
||||
#if defined(__X86_64__)
|
||||
__forceinline vint( const size_t a ) : v(_mm_set1_epi32((int)a)) {}
|
||||
#endif
|
||||
__forceinline vint( int a, int b, int c, int d) : v(_mm_set_epi32(d, c, b, a)) {}
|
||||
|
||||
__forceinline explicit vint( const __m128 a ) : v(_mm_cvtps_epi32(a)) {}
|
||||
__forceinline explicit vint(__m128 a) : v(_mm_cvtps_epi32(a)) {}
|
||||
#if defined(__AVX512VL__)
|
||||
__forceinline explicit vint( const vboolf4 &a ) : v(_mm_movm_epi32(a)) {}
|
||||
__forceinline explicit vint(const vboolf4& a) : v(_mm_movm_epi32(a)) {}
|
||||
#else
|
||||
__forceinline explicit vint( const vboolf4 &a ) : v(_mm_castps_si128((__m128)a)) {}
|
||||
__forceinline explicit vint(const vboolf4& a) : v(_mm_castps_si128((__m128)a)) {}
|
||||
#endif
|
||||
|
||||
__forceinline vint(long long a, long long b) : v(_mm_set_epi64x(b,a)) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Constants
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vint( ZeroTy ) : v(_mm_setzero_si128()) {}
|
||||
__forceinline vint( OneTy ) : v(_mm_set_epi32(1, 1, 1, 1)) {}
|
||||
__forceinline vint( PosInfTy ) : v(_mm_set_epi32(pos_inf, pos_inf, pos_inf, pos_inf)) {}
|
||||
__forceinline vint( NegInfTy ) : v(_mm_set_epi32(neg_inf, neg_inf, neg_inf, neg_inf)) {}
|
||||
__forceinline vint( StepTy ) : v(_mm_set_epi32(3, 2, 1, 0)) {}
|
||||
__forceinline vint( TrueTy ) { v = _mm_cmpeq_epi32(v,v); }
|
||||
__forceinline vint(ZeroTy) : v(_mm_setzero_si128()) {}
|
||||
__forceinline vint(OneTy) : v(_mm_set_epi32(1, 1, 1, 1)) {}
|
||||
__forceinline vint(PosInfTy) : v(_mm_set_epi32(pos_inf, pos_inf, pos_inf, pos_inf)) {}
|
||||
__forceinline vint(NegInfTy) : v(_mm_set_epi32(neg_inf, neg_inf, neg_inf, neg_inf)) {}
|
||||
__forceinline vint(StepTy) : v(_mm_set_epi32(3, 2, 1, 0)) {}
|
||||
__forceinline vint(ReverseStepTy) : v(_mm_set_epi32(0, 1, 2, 3)) {}
|
||||
|
||||
__forceinline vint(TrueTy) { v = _mm_cmpeq_epi32(v,v); }
|
||||
__forceinline vint(UndefinedTy) : v(_mm_castps_si128(_mm_undefined_ps())) {}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Loads and Stores
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static __forceinline vint4 load ( const void* const a ) { return _mm_load_si128((__m128i*)a); }
|
||||
static __forceinline vint4 loadu( const void* const a ) { return _mm_loadu_si128((__m128i*)a); }
|
||||
static __forceinline vint4 load (const void* a) { return _mm_load_si128((__m128i*)a); }
|
||||
static __forceinline vint4 loadu(const void* a) { return _mm_loadu_si128((__m128i*)a); }
|
||||
|
||||
static __forceinline void store (void* ptr, const vint4& v) { _mm_store_si128((__m128i*)ptr,v); }
|
||||
static __forceinline void storeu(void* ptr, const vint4& v) { _mm_storeu_si128((__m128i*)ptr,v); }
|
||||
|
||||
#if defined(__AVX512VL__)
|
||||
static __forceinline vint4 load ( const vboolf4& mask, const void* const ptr ) { return _mm_mask_load_epi32 (_mm_setzero_si128(),mask,ptr); }
|
||||
static __forceinline vint4 loadu( const vboolf4& mask, const void* const ptr ) { return _mm_mask_loadu_epi32(_mm_setzero_si128(),mask,ptr); }
|
||||
|
||||
static __forceinline void store ( const vboolf4& mask, void* ptr, const vint4& v ) { _mm_mask_store_epi32 (ptr,mask,v); }
|
||||
static __forceinline void storeu( const vboolf4& mask, void* ptr, const vint4& v ) { _mm_mask_storeu_epi32(ptr,mask,v); }
|
||||
static __forceinline vint4 compact(const vboolf4& mask, vint4 &v) {
|
||||
return _mm_mask_compress_epi32(v, mask, v);
|
||||
}
|
||||
static __forceinline vint4 compact(const vboolf4& mask, vint4 &a, const vint4& b) {
|
||||
return _mm_mask_compress_epi32(a, mask, b);
|
||||
}
|
||||
|
||||
static __forceinline vint4 load (const vboolf4& mask, const void* ptr) { return _mm_mask_load_epi32 (_mm_setzero_si128(),mask,ptr); }
|
||||
static __forceinline vint4 loadu(const vboolf4& mask, const void* ptr) { return _mm_mask_loadu_epi32(_mm_setzero_si128(),mask,ptr); }
|
||||
|
||||
static __forceinline void store (const vboolf4& mask, void* ptr, const vint4& v) { _mm_mask_store_epi32 (ptr,mask,v); }
|
||||
static __forceinline void storeu(const vboolf4& mask, void* ptr, const vint4& v) { _mm_mask_storeu_epi32(ptr,mask,v); }
|
||||
#elif defined(__AVX__)
|
||||
static __forceinline vint4 load ( const vbool4& mask, const void* const a ) { return _mm_castps_si128(_mm_maskload_ps((float*)a,mask)); }
|
||||
static __forceinline vint4 loadu( const vbool4& mask, const void* const a ) { return _mm_castps_si128(_mm_maskload_ps((float*)a,mask)); }
|
||||
static __forceinline vint4 load (const vbool4& mask, const void* a) { return _mm_castps_si128(_mm_maskload_ps((float*)a,mask)); }
|
||||
static __forceinline vint4 loadu(const vbool4& mask, const void* a) { return _mm_castps_si128(_mm_maskload_ps((float*)a,mask)); }
|
||||
|
||||
static __forceinline void store ( const vboolf4& mask, void* ptr, const vint4& i ) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,_mm_castsi128_ps(i)); }
|
||||
static __forceinline void storeu( const vboolf4& mask, void* ptr, const vint4& i ) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,_mm_castsi128_ps(i)); }
|
||||
static __forceinline void store (const vboolf4& mask, void* ptr, const vint4& i) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,_mm_castsi128_ps(i)); }
|
||||
static __forceinline void storeu(const vboolf4& mask, void* ptr, const vint4& i) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,_mm_castsi128_ps(i)); }
|
||||
#else
|
||||
static __forceinline vint4 load ( const vbool4& mask, const void* const a ) { return _mm_and_si128(_mm_load_si128 ((__m128i*)a),mask); }
|
||||
static __forceinline vint4 loadu( const vbool4& mask, const void* const a ) { return _mm_and_si128(_mm_loadu_si128((__m128i*)a),mask); }
|
||||
static __forceinline vint4 load (const vbool4& mask, const void* a) { return _mm_and_si128(_mm_load_si128 ((__m128i*)a),mask); }
|
||||
static __forceinline vint4 loadu(const vbool4& mask, const void* a) { return _mm_and_si128(_mm_loadu_si128((__m128i*)a),mask); }
|
||||
|
||||
static __forceinline void store ( const vboolf4& mask, void* ptr, const vint4& i ) { store (ptr,select(mask,i,load (ptr))); }
|
||||
static __forceinline void storeu( const vboolf4& mask, void* ptr, const vint4& i ) { storeu(ptr,select(mask,i,loadu(ptr))); }
|
||||
static __forceinline void store (const vboolf4& mask, void* ptr, const vint4& i) { store (ptr,select(mask,i,load (ptr))); }
|
||||
static __forceinline void storeu(const vboolf4& mask, void* ptr, const vint4& i) { storeu(ptr,select(mask,i,loadu(ptr))); }
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
static __forceinline vint4 load( const unsigned char* const ptr ) {
|
||||
return _mm_cvtepu8_epi32(_mm_load_si128((__m128i*)ptr));
|
||||
static __forceinline vint4 load(const unsigned char* ptr) {
|
||||
return _mm_cvtepu8_epi32(_mm_loadl_epi64((__m128i*)ptr));
|
||||
}
|
||||
|
||||
static __forceinline vint4 loadu( const unsigned char* const ptr ) {
|
||||
return _mm_cvtepu8_epi32(_mm_loadu_si128((__m128i*)ptr));
|
||||
static __forceinline vint4 loadu(const unsigned char* ptr) {
|
||||
return _mm_cvtepu8_epi32(_mm_loadl_epi64((__m128i*)ptr));
|
||||
}
|
||||
#else
|
||||
|
||||
static __forceinline vint4 load(const unsigned char* ptr) {
|
||||
return vint4(ptr[0],ptr[1],ptr[2],ptr[3]);
|
||||
}
|
||||
|
||||
static __forceinline vint4 loadu(const unsigned char* ptr) {
|
||||
return vint4(ptr[0],ptr[1],ptr[2],ptr[3]);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static __forceinline vint4 load(const unsigned short* const ptr) {
|
||||
static __forceinline vint4 load(const unsigned short* ptr) {
|
||||
#if defined (__SSE4_1__)
|
||||
return _mm_cvtepu16_epi32(_mm_loadu_si128((__m128i*)ptr));
|
||||
#else
|
||||
@@ -119,7 +137,7 @@ namespace embree
|
||||
#endif
|
||||
}
|
||||
|
||||
static __forceinline void store( unsigned char* const ptr, const vint4& v ) {
|
||||
static __forceinline void store(unsigned char* ptr, const vint4& v) {
|
||||
#if defined(__SSE4_1__)
|
||||
__m128i x = v;
|
||||
x = _mm_packus_epi32(x, x);
|
||||
@@ -131,12 +149,12 @@ namespace embree
|
||||
#endif
|
||||
}
|
||||
|
||||
static __forceinline void store( unsigned short* const ptr, const vint4& v ) {
|
||||
static __forceinline void store(unsigned short* ptr, const vint4& v) {
|
||||
for (size_t i=0;i<4;i++)
|
||||
ptr[i] = (unsigned short)v[i];
|
||||
}
|
||||
|
||||
static __forceinline vint4 load_nt (void* ptr) {
|
||||
static __forceinline vint4 load_nt(void* ptr) {
|
||||
#if defined(__SSE4_1__)
|
||||
return _mm_stream_load_si128((__m128i*)ptr);
|
||||
#else
|
||||
@@ -146,26 +164,81 @@ namespace embree
|
||||
|
||||
static __forceinline void store_nt(void* ptr, const vint4& v) {
|
||||
#if defined(__SSE4_1__)
|
||||
_mm_stream_ps((float*)ptr,_mm_castsi128_ps(v));
|
||||
_mm_stream_ps((float*)ptr, _mm_castsi128_ps(v));
|
||||
#else
|
||||
_mm_store_si128((__m128i*)ptr,v);
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline vint4 gather(const int* ptr, const vint4& index) {
|
||||
#if defined(__AVX2__)
|
||||
return _mm_i32gather_epi32(ptr, index, scale);
|
||||
#else
|
||||
return vint4(
|
||||
*(int*)(((char*)ptr)+scale*index[0]),
|
||||
*(int*)(((char*)ptr)+scale*index[1]),
|
||||
*(int*)(((char*)ptr)+scale*index[2]),
|
||||
*(int*)(((char*)ptr)+scale*index[3]));
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline vint4 gather(const vboolf4& mask, const int* ptr, const vint4& index) {
|
||||
vint4 r = zero;
|
||||
#if defined(__AVX512VL__)
|
||||
return _mm_mmask_i32gather_epi32(r, mask, index, ptr, scale);
|
||||
#elif defined(__AVX2__)
|
||||
return _mm_mask_i32gather_epi32(r, ptr, index, mask, scale);
|
||||
#else
|
||||
if (likely(mask[0])) r[0] = *(int*)(((char*)ptr)+scale*index[0]);
|
||||
if (likely(mask[1])) r[1] = *(int*)(((char*)ptr)+scale*index[1]);
|
||||
if (likely(mask[2])) r[2] = *(int*)(((char*)ptr)+scale*index[2]);
|
||||
if (likely(mask[3])) r[3] = *(int*)(((char*)ptr)+scale*index[3]);
|
||||
return r;
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline void scatter(void* ptr, const vint4& index, const vint4& v)
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
_mm_i32scatter_epi32((int*)ptr, index, v, scale);
|
||||
#else
|
||||
*(int*)(((char*)ptr)+scale*index[0]) = v[0];
|
||||
*(int*)(((char*)ptr)+scale*index[1]) = v[1];
|
||||
*(int*)(((char*)ptr)+scale*index[2]) = v[2];
|
||||
*(int*)(((char*)ptr)+scale*index[3]) = v[3];
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int scale = 4>
|
||||
static __forceinline void scatter(const vboolf4& mask, void* ptr, const vint4& index, const vint4& v)
|
||||
{
|
||||
#if defined(__AVX512VL__)
|
||||
_mm_mask_i32scatter_epi32((int*)ptr, mask, index, v, scale);
|
||||
#else
|
||||
if (likely(mask[0])) *(int*)(((char*)ptr)+scale*index[0]) = v[0];
|
||||
if (likely(mask[1])) *(int*)(((char*)ptr)+scale*index[1]) = v[1];
|
||||
if (likely(mask[2])) *(int*)(((char*)ptr)+scale*index[2]) = v[2];
|
||||
if (likely(mask[3])) *(int*)(((char*)ptr)+scale*index[3]) = v[3];
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(__x86_64__)
|
||||
static __forceinline vint4 broadcast64(const long long &a) { return _mm_set1_epi64x(a); }
|
||||
static __forceinline vint4 broadcast64(long long a) { return _mm_set1_epi64x(a); }
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const int& operator []( const size_t index ) const { assert(index < 4); return i[index]; }
|
||||
__forceinline int& operator []( const size_t index ) { assert(index < 4); return i[index]; }
|
||||
__forceinline const int& operator [](size_t index) const { assert(index < 4); return i[index]; }
|
||||
__forceinline int& operator [](size_t index) { assert(index < 4); return i[index]; }
|
||||
|
||||
friend __forceinline const vint4 select( const vboolf4& m, const vint4& t, const vint4& f ) {
|
||||
friend __forceinline vint4 select(const vboolf4& m, const vint4& t, const vint4& f) {
|
||||
#if defined(__AVX512VL__)
|
||||
return _mm_mask_blend_epi32(m, f, t);
|
||||
return _mm_mask_blend_epi32(m, (__m128i)f, (__m128i)t);
|
||||
#elif defined(__SSE4_1__)
|
||||
return _mm_castps_si128(_mm_blendv_ps(_mm_castsi128_ps(f), _mm_castsi128_ps(t), m));
|
||||
#else
|
||||
@@ -178,113 +251,118 @@ namespace embree
|
||||
/// Unary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vint4 asInt ( const __m128& a ) { return _mm_castps_si128(a); }
|
||||
__forceinline const vint4 operator +( const vint4& a ) { return a; }
|
||||
__forceinline const vint4 operator -( const vint4& a ) { return _mm_sub_epi32(_mm_setzero_si128(), a.v); }
|
||||
#if defined(__AVX512VL__)
|
||||
__forceinline vboolf4 asBool(const vint4& a) { return _mm_movepi32_mask(a); }
|
||||
#else
|
||||
__forceinline vboolf4 asBool(const vint4& a) { return _mm_castsi128_ps(a); }
|
||||
#endif
|
||||
|
||||
__forceinline vint4 operator +(const vint4& a) { return a; }
|
||||
__forceinline vint4 operator -(const vint4& a) { return _mm_sub_epi32(_mm_setzero_si128(), a); }
|
||||
#if defined(__SSSE3__)
|
||||
__forceinline const vint4 abs ( const vint4& a ) { return _mm_abs_epi32(a.v); }
|
||||
__forceinline vint4 abs(const vint4& a) { return _mm_abs_epi32(a); }
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Binary Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const vint4 operator +( const vint4& a, const vint4& b ) { return _mm_add_epi32(a.v, b.v); }
|
||||
__forceinline const vint4 operator +( const vint4& a, const int& b ) { return a + vint4(b); }
|
||||
__forceinline const vint4 operator +( const int& a, const vint4& b ) { return vint4(a) + b; }
|
||||
__forceinline vint4 operator +(const vint4& a, const vint4& b) { return _mm_add_epi32(a, b); }
|
||||
__forceinline vint4 operator +(const vint4& a, int b) { return a + vint4(b); }
|
||||
__forceinline vint4 operator +(int a, const vint4& b) { return vint4(a) + b; }
|
||||
|
||||
__forceinline const vint4 operator -( const vint4& a, const vint4& b ) { return _mm_sub_epi32(a.v, b.v); }
|
||||
__forceinline const vint4 operator -( const vint4& a, const int& b ) { return a - vint4(b); }
|
||||
__forceinline const vint4 operator -( const int& a, const vint4& b ) { return vint4(a) - b; }
|
||||
__forceinline vint4 operator -(const vint4& a, const vint4& b) { return _mm_sub_epi32(a, b); }
|
||||
__forceinline vint4 operator -(const vint4& a, int b) { return a - vint4(b); }
|
||||
__forceinline vint4 operator -(int a, const vint4& b) { return vint4(a) - b; }
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
__forceinline const vint4 operator *( const vint4& a, const vint4& b ) { return _mm_mullo_epi32(a.v, b.v); }
|
||||
__forceinline vint4 operator *(const vint4& a, const vint4& b) { return _mm_mullo_epi32(a, b); }
|
||||
#else
|
||||
__forceinline const vint4 operator *( const vint4& a, const vint4& b ) { return vint4(a[0]*b[0],a[1]*b[1],a[2]*b[2],a[3]*b[3]); }
|
||||
__forceinline vint4 operator *(const vint4& a, const vint4& b) { return vint4(a[0]*b[0],a[1]*b[1],a[2]*b[2],a[3]*b[3]); }
|
||||
#endif
|
||||
__forceinline const vint4 operator *( const vint4& a, const int& b ) { return a * vint4(b); }
|
||||
__forceinline const vint4 operator *( const int& a, const vint4& b ) { return vint4(a) * b; }
|
||||
__forceinline vint4 operator *(const vint4& a, int b) { return a * vint4(b); }
|
||||
__forceinline vint4 operator *(int a, const vint4& b) { return vint4(a) * b; }
|
||||
|
||||
__forceinline const vint4 operator &( const vint4& a, const vint4& b ) { return _mm_and_si128(a.v, b.v); }
|
||||
__forceinline const vint4 operator &( const vint4& a, const int& b ) { return a & vint4(b); }
|
||||
__forceinline const vint4 operator &( const int& a, const vint4& b ) { return vint4(a) & b; }
|
||||
__forceinline vint4 operator &(const vint4& a, const vint4& b) { return _mm_and_si128(a, b); }
|
||||
__forceinline vint4 operator &(const vint4& a, int b) { return a & vint4(b); }
|
||||
__forceinline vint4 operator &(int a, const vint4& b) { return vint4(a) & b; }
|
||||
|
||||
__forceinline const vint4 operator |( const vint4& a, const vint4& b ) { return _mm_or_si128(a.v, b.v); }
|
||||
__forceinline const vint4 operator |( const vint4& a, const int& b ) { return a | vint4(b); }
|
||||
__forceinline const vint4 operator |( const int& a, const vint4& b ) { return vint4(a) | b; }
|
||||
__forceinline vint4 operator |(const vint4& a, const vint4& b) { return _mm_or_si128(a, b); }
|
||||
__forceinline vint4 operator |(const vint4& a, int b) { return a | vint4(b); }
|
||||
__forceinline vint4 operator |(int a, const vint4& b) { return vint4(a) | b; }
|
||||
|
||||
__forceinline const vint4 operator ^( const vint4& a, const vint4& b ) { return _mm_xor_si128(a.v, b.v); }
|
||||
__forceinline const vint4 operator ^( const vint4& a, const int& b ) { return a ^ vint4(b); }
|
||||
__forceinline const vint4 operator ^( const int& a, const vint4& b ) { return vint4(a) ^ b; }
|
||||
__forceinline vint4 operator ^(const vint4& a, const vint4& b) { return _mm_xor_si128(a, b); }
|
||||
__forceinline vint4 operator ^(const vint4& a, int b) { return a ^ vint4(b); }
|
||||
__forceinline vint4 operator ^(int a, const vint4& b) { return vint4(a) ^ b; }
|
||||
|
||||
__forceinline const vint4 operator <<( const vint4& a, const int& n ) { return _mm_slli_epi32(a.v, n); }
|
||||
__forceinline const vint4 operator >>( const vint4& a, const int& n ) { return _mm_srai_epi32(a.v, n); }
|
||||
__forceinline vint4 operator <<(const vint4& a, int n) { return _mm_slli_epi32(a, n); }
|
||||
__forceinline vint4 operator >>(const vint4& a, int n) { return _mm_srai_epi32(a, n); }
|
||||
|
||||
__forceinline const vint4 sll ( const vint4& a, const int& b ) { return _mm_slli_epi32(a.v, b); }
|
||||
__forceinline const vint4 sra ( const vint4& a, const int& b ) { return _mm_srai_epi32(a.v, b); }
|
||||
__forceinline const vint4 srl ( const vint4& a, const int& b ) { return _mm_srli_epi32(a.v, b); }
|
||||
__forceinline vint4 sll (const vint4& a, int b) { return _mm_slli_epi32(a, b); }
|
||||
__forceinline vint4 sra (const vint4& a, int b) { return _mm_srai_epi32(a, b); }
|
||||
__forceinline vint4 srl (const vint4& a, int b) { return _mm_srli_epi32(a, b); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Assignment Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vint4& operator +=( vint4& a, const vint4& b ) { return a = a + b; }
|
||||
__forceinline vint4& operator +=( vint4& a, const int& b ) { return a = a + b; }
|
||||
__forceinline vint4& operator +=(vint4& a, const vint4& b) { return a = a + b; }
|
||||
__forceinline vint4& operator +=(vint4& a, int b) { return a = a + b; }
|
||||
|
||||
__forceinline vint4& operator -=( vint4& a, const vint4& b ) { return a = a - b; }
|
||||
__forceinline vint4& operator -=( vint4& a, const int& b ) { return a = a - b; }
|
||||
__forceinline vint4& operator -=(vint4& a, const vint4& b) { return a = a - b; }
|
||||
__forceinline vint4& operator -=(vint4& a, int b) { return a = a - b; }
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
__forceinline vint4& operator *=( vint4& a, const vint4& b ) { return a = a * b; }
|
||||
__forceinline vint4& operator *=( vint4& a, const int& b ) { return a = a * b; }
|
||||
__forceinline vint4& operator *=(vint4& a, const vint4& b) { return a = a * b; }
|
||||
__forceinline vint4& operator *=(vint4& a, int b) { return a = a * b; }
|
||||
#endif
|
||||
|
||||
__forceinline vint4& operator &=( vint4& a, const vint4& b ) { return a = a & b; }
|
||||
__forceinline vint4& operator &=( vint4& a, const int& b ) { return a = a & b; }
|
||||
__forceinline vint4& operator &=(vint4& a, const vint4& b) { return a = a & b; }
|
||||
__forceinline vint4& operator &=(vint4& a, int b) { return a = a & b; }
|
||||
|
||||
__forceinline vint4& operator |=( vint4& a, const vint4& b ) { return a = a | b; }
|
||||
__forceinline vint4& operator |=( vint4& a, const int& b ) { return a = a | b; }
|
||||
__forceinline vint4& operator |=(vint4& a, const vint4& b) { return a = a | b; }
|
||||
__forceinline vint4& operator |=(vint4& a, int b) { return a = a | b; }
|
||||
|
||||
__forceinline vint4& operator <<=( vint4& a, const int& b ) { return a = a << b; }
|
||||
__forceinline vint4& operator >>=( vint4& a, const int& b ) { return a = a >> b; }
|
||||
__forceinline vint4& operator <<=(vint4& a, int b) { return a = a << b; }
|
||||
__forceinline vint4& operator >>=(vint4& a, int b) { return a = a >> b; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators + Select
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__AVX512VL__)
|
||||
__forceinline const vboolf4 operator ==( const vint4& a, const vint4& b ) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_EQ); }
|
||||
__forceinline const vboolf4 operator !=( const vint4& a, const vint4& b ) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_NE); }
|
||||
__forceinline const vboolf4 operator < ( const vint4& a, const vint4& b ) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_LT); }
|
||||
__forceinline const vboolf4 operator >=( const vint4& a, const vint4& b ) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_GE); }
|
||||
__forceinline const vboolf4 operator > ( const vint4& a, const vint4& b ) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_GT); }
|
||||
__forceinline const vboolf4 operator <=( const vint4& a, const vint4& b ) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_LE); }
|
||||
__forceinline vboolf4 operator ==(const vint4& a, const vint4& b) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_EQ); }
|
||||
__forceinline vboolf4 operator !=(const vint4& a, const vint4& b) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_NE); }
|
||||
__forceinline vboolf4 operator < (const vint4& a, const vint4& b) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_LT); }
|
||||
__forceinline vboolf4 operator >=(const vint4& a, const vint4& b) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_GE); }
|
||||
__forceinline vboolf4 operator > (const vint4& a, const vint4& b) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_GT); }
|
||||
__forceinline vboolf4 operator <=(const vint4& a, const vint4& b) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_LE); }
|
||||
#else
|
||||
__forceinline const vboolf4 operator ==( const vint4& a, const vint4& b ) { return _mm_castsi128_ps(_mm_cmpeq_epi32(a, b)); }
|
||||
__forceinline const vboolf4 operator !=( const vint4& a, const vint4& b ) { return !(a == b); }
|
||||
__forceinline const vboolf4 operator < ( const vint4& a, const vint4& b ) { return _mm_castsi128_ps(_mm_cmplt_epi32(a, b)); }
|
||||
__forceinline const vboolf4 operator >=( const vint4& a, const vint4& b ) { return !(a < b); }
|
||||
__forceinline const vboolf4 operator > ( const vint4& a, const vint4& b ) { return _mm_castsi128_ps(_mm_cmpgt_epi32(a, b)); }
|
||||
__forceinline const vboolf4 operator <=( const vint4& a, const vint4& b ) { return !(a > b); }
|
||||
__forceinline vboolf4 operator ==(const vint4& a, const vint4& b) { return _mm_castsi128_ps(_mm_cmpeq_epi32(a, b)); }
|
||||
__forceinline vboolf4 operator !=(const vint4& a, const vint4& b) { return !(a == b); }
|
||||
__forceinline vboolf4 operator < (const vint4& a, const vint4& b) { return _mm_castsi128_ps(_mm_cmplt_epi32(a, b)); }
|
||||
__forceinline vboolf4 operator >=(const vint4& a, const vint4& b) { return !(a < b); }
|
||||
__forceinline vboolf4 operator > (const vint4& a, const vint4& b) { return _mm_castsi128_ps(_mm_cmpgt_epi32(a, b)); }
|
||||
__forceinline vboolf4 operator <=(const vint4& a, const vint4& b) { return !(a > b); }
|
||||
#endif
|
||||
|
||||
__forceinline const vboolf4 operator ==( const vint4& a, const int& b ) { return a == vint4(b); }
|
||||
__forceinline const vboolf4 operator ==( const int& a, const vint4& b ) { return vint4(a) == b; }
|
||||
__forceinline vboolf4 operator ==(const vint4& a, int b) { return a == vint4(b); }
|
||||
__forceinline vboolf4 operator ==(int a, const vint4& b) { return vint4(a) == b; }
|
||||
|
||||
__forceinline const vboolf4 operator !=( const vint4& a, const int& b ) { return a != vint4(b); }
|
||||
__forceinline const vboolf4 operator !=( const int& a, const vint4& b ) { return vint4(a) != b; }
|
||||
__forceinline vboolf4 operator !=(const vint4& a, int b) { return a != vint4(b); }
|
||||
__forceinline vboolf4 operator !=(int a, const vint4& b) { return vint4(a) != b; }
|
||||
|
||||
__forceinline const vboolf4 operator < ( const vint4& a, const int& b ) { return a < vint4(b); }
|
||||
__forceinline const vboolf4 operator < ( const int& a, const vint4& b ) { return vint4(a) < b; }
|
||||
__forceinline vboolf4 operator < (const vint4& a, int b) { return a < vint4(b); }
|
||||
__forceinline vboolf4 operator < (int a, const vint4& b) { return vint4(a) < b; }
|
||||
|
||||
__forceinline const vboolf4 operator >=( const vint4& a, const int& b ) { return a >= vint4(b); }
|
||||
__forceinline const vboolf4 operator >=( const int& a, const vint4& b ) { return vint4(a) >= b; }
|
||||
__forceinline vboolf4 operator >=(const vint4& a, int b) { return a >= vint4(b); }
|
||||
__forceinline vboolf4 operator >=(int a, const vint4& b) { return vint4(a) >= b; }
|
||||
|
||||
__forceinline const vboolf4 operator > ( const vint4& a, const int& b ) { return a > vint4(b); }
|
||||
__forceinline const vboolf4 operator > ( const int& a, const vint4& b ) { return vint4(a) > b; }
|
||||
__forceinline vboolf4 operator > (const vint4& a, int b) { return a > vint4(b); }
|
||||
__forceinline vboolf4 operator > (int a, const vint4& b) { return vint4(a) > b; }
|
||||
|
||||
__forceinline const vboolf4 operator <=( const vint4& a, const int& b ) { return a <= vint4(b); }
|
||||
__forceinline const vboolf4 operator <=( const int& a, const vint4& b ) { return vint4(a) <= b; }
|
||||
__forceinline vboolf4 operator <=(const vint4& a, int b) { return a <= vint4(b); }
|
||||
__forceinline vboolf4 operator <=(int a, const vint4& b) { return vint4(a) <= b; }
|
||||
|
||||
__forceinline vboolf4 eq(const vint4& a, const vint4& b) { return a == b; }
|
||||
__forceinline vboolf4 ne(const vint4& a, const vint4& b) { return a != b; }
|
||||
@@ -310,7 +388,7 @@ namespace embree
|
||||
#endif
|
||||
|
||||
template<int mask>
|
||||
__forceinline const vint4 select(const vint4& t, const vint4& f) {
|
||||
__forceinline vint4 select(const vint4& t, const vint4& f) {
|
||||
#if defined(__SSE4_1__)
|
||||
return _mm_castps_si128(_mm_blend_ps(_mm_castsi128_ps(f), _mm_castsi128_ps(t), mask));
|
||||
#else
|
||||
@@ -319,78 +397,101 @@ namespace embree
|
||||
}
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
__forceinline const vint4 min( const vint4& a, const vint4& b ) { return _mm_min_epi32(a.v, b.v); }
|
||||
__forceinline const vint4 max( const vint4& a, const vint4& b ) { return _mm_max_epi32(a.v, b.v); }
|
||||
__forceinline vint4 min(const vint4& a, const vint4& b) { return _mm_min_epi32(a, b); }
|
||||
__forceinline vint4 max(const vint4& a, const vint4& b) { return _mm_max_epi32(a, b); }
|
||||
|
||||
__forceinline const vint4 umin( const vint4& a, const vint4& b ) { return _mm_min_epu32(a.v, b.v); }
|
||||
__forceinline const vint4 umax( const vint4& a, const vint4& b ) { return _mm_max_epu32(a.v, b.v); }
|
||||
__forceinline vint4 umin(const vint4& a, const vint4& b) { return _mm_min_epu32(a, b); }
|
||||
__forceinline vint4 umax(const vint4& a, const vint4& b) { return _mm_max_epu32(a, b); }
|
||||
|
||||
#else
|
||||
__forceinline const vint4 min( const vint4& a, const vint4& b ) { return select(a < b,a,b); }
|
||||
__forceinline const vint4 max( const vint4& a, const vint4& b ) { return select(a < b,b,a); }
|
||||
__forceinline vint4 min(const vint4& a, const vint4& b) { return select(a < b,a,b); }
|
||||
__forceinline vint4 max(const vint4& a, const vint4& b) { return select(a < b,b,a); }
|
||||
#endif
|
||||
|
||||
__forceinline const vint4 min( const vint4& a, const int& b ) { return min(a,vint4(b)); }
|
||||
__forceinline const vint4 min( const int& a, const vint4& b ) { return min(vint4(a),b); }
|
||||
__forceinline const vint4 max( const vint4& a, const int& b ) { return max(a,vint4(b)); }
|
||||
__forceinline const vint4 max( const int& a, const vint4& b ) { return max(vint4(a),b); }
|
||||
__forceinline vint4 min(const vint4& a, int b) { return min(a,vint4(b)); }
|
||||
__forceinline vint4 min(int a, const vint4& b) { return min(vint4(a),b); }
|
||||
__forceinline vint4 max(const vint4& a, int b) { return max(a,vint4(b)); }
|
||||
__forceinline vint4 max(int a, const vint4& b) { return max(vint4(a),b); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Movement/Shifting/Shuffling Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline vint4 unpacklo( const vint4& a, const vint4& b ) { return _mm_castps_si128(_mm_unpacklo_ps(_mm_castsi128_ps(a.v), _mm_castsi128_ps(b.v))); }
|
||||
__forceinline vint4 unpackhi( const vint4& a, const vint4& b ) { return _mm_castps_si128(_mm_unpackhi_ps(_mm_castsi128_ps(a.v), _mm_castsi128_ps(b.v))); }
|
||||
__forceinline vint4 unpacklo(const vint4& a, const vint4& b) { return _mm_castps_si128(_mm_unpacklo_ps(_mm_castsi128_ps(a), _mm_castsi128_ps(b))); }
|
||||
__forceinline vint4 unpackhi(const vint4& a, const vint4& b) { return _mm_castps_si128(_mm_unpackhi_ps(_mm_castsi128_ps(a), _mm_castsi128_ps(b))); }
|
||||
|
||||
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vint4 shuffle( const vint4& a ) {
|
||||
return _mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vint4 shuffle(const vint4& v) {
|
||||
return _mm_shuffle_epi32(v, _MM_SHUFFLE(i3, i2, i1, i0));
|
||||
}
|
||||
|
||||
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vint4 shuffle( const vint4& a, const vint4& b ) {
|
||||
template<int i0, int i1, int i2, int i3>
|
||||
__forceinline vint4 shuffle(const vint4& a, const vint4& b) {
|
||||
return _mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(a), _mm_castsi128_ps(b), _MM_SHUFFLE(i3, i2, i1, i0)));
|
||||
}
|
||||
|
||||
#if defined(__SSE3__)
|
||||
template<> __forceinline const vint4 shuffle<0, 0, 2, 2>( const vint4& a ) { return _mm_castps_si128(_mm_moveldup_ps(_mm_castsi128_ps(a))); }
|
||||
template<> __forceinline const vint4 shuffle<1, 1, 3, 3>( const vint4& a ) { return _mm_castps_si128(_mm_movehdup_ps(_mm_castsi128_ps(a))); }
|
||||
template<> __forceinline const vint4 shuffle<0, 1, 0, 1>( const vint4& a ) { return _mm_castpd_si128(_mm_movedup_pd (_mm_castsi128_pd(a))); }
|
||||
template<> __forceinline vint4 shuffle<0, 0, 2, 2>(const vint4& v) { return _mm_castps_si128(_mm_moveldup_ps(_mm_castsi128_ps(v))); }
|
||||
template<> __forceinline vint4 shuffle<1, 1, 3, 3>(const vint4& v) { return _mm_castps_si128(_mm_movehdup_ps(_mm_castsi128_ps(v))); }
|
||||
template<> __forceinline vint4 shuffle<0, 1, 0, 1>(const vint4& v) { return _mm_castpd_si128(_mm_movedup_pd (_mm_castsi128_pd(v))); }
|
||||
#endif
|
||||
|
||||
template<size_t i0> __forceinline const vint4 shuffle( const vint4& b ) {
|
||||
return shuffle<i0,i0,i0,i0>(b);
|
||||
template<int i>
|
||||
__forceinline vint4 shuffle(const vint4& v) {
|
||||
return shuffle<i,i,i,i>(v);
|
||||
}
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
template<size_t src> __forceinline int extract( const vint4& b ) { return _mm_extract_epi32(b, src); }
|
||||
template<size_t dst> __forceinline const vint4 insert( const vint4& a, const int b ) { return _mm_insert_epi32(a, b, dst); }
|
||||
template<int src> __forceinline int extract(const vint4& b) { return _mm_extract_epi32(b, src); }
|
||||
template<int dst> __forceinline vint4 insert(const vint4& a, const int b) { return _mm_insert_epi32(a, b, dst); }
|
||||
#else
|
||||
template<size_t src> __forceinline int extract( const vint4& b ) { return b[src]; }
|
||||
template<size_t dst> __forceinline const vint4 insert( const vint4& a, const int b ) { vint4 c = a; c[dst] = b; return c; }
|
||||
template<int src> __forceinline int extract(const vint4& b) { return b[src&3]; }
|
||||
template<int dst> __forceinline vint4 insert(const vint4& a, int b) { vint4 c = a; c[dst&3] = b; return c; }
|
||||
#endif
|
||||
|
||||
|
||||
template<> __forceinline int extract<0>( const vint4& b ) { return _mm_cvtsi128_si32(b); }
|
||||
template<> __forceinline int extract<0>(const vint4& b) { return _mm_cvtsi128_si32(b); }
|
||||
|
||||
__forceinline int toScalar(const vint4& a) { return _mm_cvtsi128_si32(a); }
|
||||
__forceinline int toScalar(const vint4& v) { return _mm_cvtsi128_si32(v); }
|
||||
|
||||
__forceinline size_t toSizeT(const vint4& v) {
|
||||
#if defined(__WIN32__) && !defined(__X86_64__) // win32 workaround
|
||||
return toScalar(v);
|
||||
#else
|
||||
return _mm_cvtsi128_si64(v);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(__AVX512VL__)
|
||||
|
||||
__forceinline vint4 permute(const vint4 &a, const vint4 &index) {
|
||||
return _mm_castps_si128(_mm_permutevar_ps(_mm_castsi128_ps(a),index));
|
||||
}
|
||||
|
||||
template<int i>
|
||||
__forceinline vint4 align_shift_right(const vint4& a, const vint4& b) {
|
||||
return _mm_alignr_epi32(a, b, i);
|
||||
}
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Reductions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__SSE4_1__)
|
||||
__forceinline const vint4 vreduce_min(const vint4& v) { vint4 h = min(shuffle<1,0,3,2>(v),v); return min(shuffle<2,3,0,1>(h),h); }
|
||||
__forceinline const vint4 vreduce_max(const vint4& v) { vint4 h = max(shuffle<1,0,3,2>(v),v); return max(shuffle<2,3,0,1>(h),h); }
|
||||
__forceinline const vint4 vreduce_add(const vint4& v) { vint4 h = shuffle<1,0,3,2>(v) + v ; return shuffle<2,3,0,1>(h) + h ; }
|
||||
__forceinline vint4 vreduce_min(const vint4& v) { vint4 h = min(shuffle<1,0,3,2>(v),v); return min(shuffle<2,3,0,1>(h),h); }
|
||||
__forceinline vint4 vreduce_max(const vint4& v) { vint4 h = max(shuffle<1,0,3,2>(v),v); return max(shuffle<2,3,0,1>(h),h); }
|
||||
__forceinline vint4 vreduce_add(const vint4& v) { vint4 h = shuffle<1,0,3,2>(v) + v ; return shuffle<2,3,0,1>(h) + h ; }
|
||||
|
||||
__forceinline int reduce_min(const vint4& v) { return toScalar(vreduce_min(v)); }
|
||||
__forceinline int reduce_max(const vint4& v) { return toScalar(vreduce_max(v)); }
|
||||
__forceinline int reduce_add(const vint4& v) { return toScalar(vreduce_add(v)); }
|
||||
|
||||
__forceinline size_t select_min(const vint4& v) { return __bsf(movemask(v == vreduce_min(v))); }
|
||||
__forceinline size_t select_max(const vint4& v) { return __bsf(movemask(v == vreduce_max(v))); }
|
||||
__forceinline size_t select_min(const vint4& v) { return bsf(movemask(v == vreduce_min(v))); }
|
||||
__forceinline size_t select_max(const vint4& v) { return bsf(movemask(v == vreduce_max(v))); }
|
||||
|
||||
__forceinline size_t select_min(const vboolf4& valid, const vint4& v) { const vint4 a = select(valid,v,vint4(pos_inf)); return __bsf(movemask(valid & (a == vreduce_min(a)))); }
|
||||
__forceinline size_t select_max(const vboolf4& valid, const vint4& v) { const vint4 a = select(valid,v,vint4(neg_inf)); return __bsf(movemask(valid & (a == vreduce_max(a)))); }
|
||||
__forceinline size_t select_min(const vboolf4& valid, const vint4& v) { const vint4 a = select(valid,v,vint4(pos_inf)); return bsf(movemask(valid & (a == vreduce_min(a)))); }
|
||||
__forceinline size_t select_max(const vboolf4& valid, const vint4& v) { const vint4 a = select(valid,v,vint4(neg_inf)); return bsf(movemask(valid & (a == vreduce_max(a)))); }
|
||||
|
||||
#else
|
||||
|
||||
@@ -486,7 +587,7 @@ namespace embree
|
||||
/// Output Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& cout, const vint4& a) {
|
||||
inline std::ostream& operator <<(std::ostream& cout, const vint4& a) {
|
||||
return cout << "<" << a[0] << ", " << a[1] << ", " << a[2] << ", " << a[3] << ">";
|
||||
}
|
||||
}
|
||||
|
||||
Loaded 100 of 920 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user