mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 18:00:17 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b1383d235 | ||
|
|
a73fab3bb5 | ||
|
|
7bd64d9c53 | ||
|
|
1786c2f157 | ||
|
|
958b671736 | ||
|
|
6549b66cf6 | ||
|
|
0c855a5ce3 | ||
|
|
6864d48dcf | ||
|
|
99816a23a8 | ||
|
|
2ff9546523 | ||
|
|
06541f21d6 | ||
|
|
45a37edd4a | ||
|
|
2a713a1f51 | ||
|
|
3e104de377 | ||
|
|
b22b316e70 | ||
|
|
df461546c5 | ||
|
|
1c1c43cd86 | ||
|
|
3eac9f937e | ||
|
|
f13a0d8e84 | ||
|
|
ca12dc9213 | ||
|
|
365ed2cd70 | ||
|
|
7efbfed0bf | ||
|
|
ed502738c6 | ||
|
|
ba162bb058 | ||
|
|
f194d35913 | ||
|
|
e81c84e00a | ||
|
|
68dc9030bc | ||
|
|
fedad275e7 | ||
|
|
f6b4c76d76 | ||
|
|
27854aa091 | ||
|
|
d966ae145e | ||
|
|
4cb37e6a1b | ||
|
|
d9da81e99b | ||
|
|
7d734740be | ||
|
|
06299cca4b | ||
|
|
af5aaab38b | ||
|
|
77bb01d384 | ||
|
|
a9eb1bd4e6 | ||
|
|
83ef2da95f | ||
|
|
ba13ccadb8 | ||
|
|
4a2dee873d | ||
|
|
589906e6e6 | ||
|
|
f0fcf6d9e6 | ||
|
|
1591ced5a7 | ||
|
|
0d235d63d0 | ||
|
|
820d5c1447 | ||
|
|
8093e8f5f1 | ||
|
|
802857e411 | ||
|
|
bf3a1839a2 | ||
|
|
ad7844d7da | ||
|
|
3ff9128a8a | ||
|
|
c865eb98ea | ||
|
|
217a9228f8 | ||
|
|
105d0a36ad | ||
|
|
263279d5dd | ||
|
|
861ecbec0f | ||
|
|
5ff9bb3669 | ||
|
|
e794584bb5 | ||
|
|
a792dd0703 | ||
|
|
a9a6a645bf | ||
|
|
7c93becd5f | ||
|
|
4bbaef58e9 | ||
|
|
95791a985a | ||
|
|
0dfefe9730 | ||
|
|
8481c797df | ||
|
|
a503b5e20b | ||
|
|
4078840ef1 | ||
|
|
ab51958b26 | ||
|
|
3376587b6a | ||
|
|
6681d7dcf9 | ||
|
|
34224481c6 | ||
|
|
1837aaabe4 | ||
|
|
5811914a78 | ||
|
|
a109a4efa1 | ||
|
|
a08a6ce5de | ||
|
|
3dc8a3ddc1 | ||
|
|
5e103365f7 | ||
|
|
cdea8d7f74 | ||
|
|
ef6dc3d802 | ||
|
|
e6edb349ba | ||
|
|
ad132267ec | ||
|
|
6f837281ef | ||
|
|
2a1d29d2df | ||
|
|
bdceb4ca89 | ||
|
|
656bb928cf | ||
|
|
0fbe69ebcf | ||
|
|
ece817c691 | ||
|
|
3fbc8204b7 | ||
|
|
44a5481254 | ||
|
|
cf2ff90f87 | ||
|
|
b8dd5d95b0 | ||
|
|
7cd52febc2 | ||
|
|
8e079c1965 | ||
|
|
4928af5a64 | ||
|
|
289df740cd | ||
|
|
6ad7392cd7 | ||
|
|
b15d5f299c | ||
|
|
5c7c959dd9 | ||
|
|
6927c7577a | ||
|
|
88682a457a | ||
|
|
61ae53cc03 | ||
|
|
0e67f30103 | ||
|
|
babd6e9a7b | ||
|
|
76caa2c6e3 | ||
|
|
dc9f8aa855 | ||
|
|
ded8b3284a | ||
|
|
2e24ee7a5f | ||
|
|
048ae597d2 | ||
|
|
0147f7aa19 | ||
|
|
23cda2c961 | ||
|
|
feb67658e1 | ||
|
|
65ee1fafa8 | ||
|
|
49f8332c5b | ||
|
|
afce108ed7 | ||
|
|
30f3b545af | ||
|
|
bf1597920c | ||
|
|
f66bf3811e | ||
|
|
a01e29ac99 | ||
|
|
3136a5e2f8 | ||
|
|
c4f00a05df | ||
|
|
e9a8f8a9ff | ||
|
|
261ae7a195 | ||
|
|
7eaf5ae9e0 | ||
|
|
10a02449b1 | ||
|
|
debc57e8c7 | ||
|
|
7a4fff8e5b | ||
|
|
ec0a2a8671 | ||
|
|
b8b516f7b6 | ||
|
|
3b1e91b1fc | ||
|
|
8532593d91 | ||
|
|
55bd16e2c8 | ||
|
|
c7797d56c9 | ||
|
|
9b573effd1 | ||
|
|
dfd1aedae5 | ||
|
|
221ae2d7b4 | ||
|
|
9127d206b5 | ||
|
|
ecc6fea54e | ||
|
|
99446da7c1 | ||
|
|
ad75563a26 | ||
|
|
197af972d9 | ||
|
|
fbd706c191 | ||
|
|
6b85fa5611 | ||
|
|
fae66a921f | ||
|
|
e6fc462e9d | ||
|
|
d11a265a53 | ||
|
|
395d870814 | ||
|
|
fec1ffaa6b | ||
|
|
d4fdb28e72 | ||
|
|
39a5c2021e | ||
|
|
f41501444d | ||
|
|
86b26b80ce | ||
|
|
ae9a5b1125 | ||
|
|
38579807c2 | ||
|
|
c19119bcd6 | ||
|
|
47f1ad693d | ||
|
|
2164d7bb96 | ||
|
|
c326e2d669 | ||
|
|
8eaf45414c | ||
|
|
b3297d106e | ||
|
|
2d0e19e6a7 | ||
|
|
fd2ee4dc46 | ||
|
|
b1bbc37c59 | ||
|
|
56409d4f2b | ||
|
|
ec0683b729 | ||
|
|
89e5041e70 | ||
|
|
8b3e7312e0 | ||
|
|
3c76a9176d | ||
|
|
a37def2c22 | ||
|
|
ee4ef0fe87 | ||
|
|
1dff7073de | ||
|
|
92a82c3134 | ||
|
|
a6a203c483 | ||
|
|
cdaa65f6fd | ||
|
|
31e5f706b8 | ||
|
|
00e05558ce | ||
|
|
c02b88baff | ||
|
|
794c80edad | ||
|
|
fb939600e2 | ||
|
|
9dbbd44d09 | ||
|
|
afcd93fe5f | ||
|
|
118faa5380 | ||
|
|
7ed17f68c5 | ||
|
|
96363143de | ||
|
|
cf5fcb2371 | ||
|
|
7d3699050e | ||
|
|
40e0a71f49 | ||
|
|
cdbcdfe397 | ||
|
|
4f2d2e646e | ||
|
|
f97cd24647 | ||
|
|
e5e75ad1ef | ||
|
|
fc052efb91 | ||
|
|
c5754145c5 | ||
|
|
9986e69622 | ||
|
|
00acf4d327 | ||
|
|
00ff549044 | ||
|
|
75a39c8939 | ||
|
|
5b9354cc74 | ||
|
|
f7049a6478 | ||
|
|
e1d032b5a6 | ||
|
|
f99691b0eb | ||
|
|
10d18f2f17 | ||
|
|
a236700c55 | ||
|
|
34d62fcea6 | ||
|
|
791502afef | ||
|
|
99114e1fc2 | ||
|
|
3c8bb53d1a | ||
|
|
bd0682b518 | ||
|
|
e89a913b69 | ||
|
|
293d77d412 | ||
|
|
6beb4b0f8b | ||
|
|
23a8462688 | ||
|
|
02f90fbc66 | ||
|
|
8cc23d0cf8 | ||
|
|
60b5b1414d | ||
|
|
cbab344822 | ||
|
|
32764ddf81 | ||
|
|
e31127e39e | ||
|
|
735f537846 | ||
|
|
b7790e10e9 | ||
|
|
3f7ad04054 | ||
|
|
670ddf9cd8 | ||
|
|
d377e26106 | ||
|
|
674f939690 | ||
|
|
64abfb1afe | ||
|
|
adcefe62cf | ||
|
|
bf77fa4275 | ||
|
|
e7fce2de40 | ||
|
|
8864637602 | ||
|
|
1a0d97d5f7 | ||
|
|
9ba46e395d | ||
|
|
be99fa0b05 | ||
|
|
c42b1858c5 | ||
|
|
cc11de16bf | ||
|
|
3ea7c2b014 | ||
|
|
e0e9f5aa16 | ||
|
|
63a2d1e1db | ||
|
|
644263a764 | ||
|
|
f912295690 | ||
|
|
79e57c320c | ||
|
|
4e6f183f77 | ||
|
|
23017af874 | ||
|
|
4d02126b77 | ||
|
|
30fefbd57d | ||
|
|
38304fa63a | ||
|
|
6525b8dd14 | ||
|
|
0155719b1a | ||
|
|
966dce6e95 | ||
|
|
e3088686db | ||
|
|
771162cf14 | ||
|
|
1a2398d2ce | ||
|
|
0f0e969d8f | ||
|
|
c8371087e6 | ||
|
|
3da6fc3972 | ||
|
|
0cbbd91e72 | ||
|
|
d71aca9e9b | ||
|
|
63035fd5f3 | ||
|
|
0fe28129a0 | ||
|
|
c44d8eed35 | ||
|
|
6f5588f71e | ||
|
|
68f8c244b4 | ||
|
|
d7a08fc7d4 | ||
|
|
572d6e0395 | ||
|
|
156b6745a2 | ||
|
|
b4eb38e2b7 | ||
|
|
bafcc8762b | ||
|
|
ec6ff7899d | ||
|
|
6330b398a5 | ||
|
|
86c492da13 | ||
|
|
8ff7497d59 | ||
|
|
73593ad4f1 | ||
|
|
572a58ed27 | ||
|
|
d7df4be379 | ||
|
|
f227722898 | ||
|
|
f371bf2bc4 | ||
|
|
e6841ea46d | ||
|
|
edbfe45a20 | ||
|
|
5f83e89be5 | ||
|
|
5850b26de5 | ||
|
|
416267a238 | ||
|
|
94499ed8fc | ||
|
|
da1868288d | ||
|
|
c8d6b39585 | ||
|
|
00f8181c3a | ||
|
|
60565cc2ef | ||
|
|
bfee39ae70 | ||
|
|
753c5e72be | ||
|
|
571a533543 | ||
|
|
222fcfd70e | ||
|
|
95c8a70ce6 | ||
|
|
0f6bec4d5e | ||
|
|
5fb0522c78 | ||
|
|
7c0bc2d972 | ||
|
|
cb972e165b | ||
|
|
fb319a352a | ||
|
|
e10646b436 | ||
|
|
211bec65d2 | ||
|
|
66807539ce | ||
|
|
2919c32a8f | ||
|
|
05be9e9c37 | ||
|
|
039aaae041 | ||
|
|
890653ae39 | ||
|
|
8644fdd595 | ||
|
|
4fca8fb8e6 | ||
|
|
9625201cbf | ||
|
|
e7dea56adf | ||
|
|
5b802d17d1 | ||
|
|
a43ddba87c | ||
|
|
f1d007ca4c | ||
|
|
c2111e7384 | ||
|
|
a1c6378317 | ||
|
|
f064013b9a | ||
|
|
d4480c3566 | ||
|
|
b3a4de7aa8 | ||
|
|
60d8131a4d | ||
|
|
6d78aefa13 | ||
|
|
badd953600 | ||
|
|
5d385c540d | ||
|
|
52351902ee | ||
|
|
6e697e5ec1 | ||
|
|
c55c8979f1 | ||
|
|
7ca757bb6d | ||
|
|
c2d59b02bd | ||
|
|
45b638fc45 | ||
|
|
5767c61a91 | ||
|
|
e3f8a817e0 | ||
|
|
4377603d7e | ||
|
|
bc72239181 | ||
|
|
2d7f37386e | ||
|
|
dffba2d83c | ||
|
|
0fbb6aa02f | ||
|
|
7364affd69 | ||
|
|
09e622d5a0 | ||
|
|
21ccaf56e6 | ||
|
|
d8cd807520 | ||
|
|
6069d05aa9 | ||
|
|
09a3d4851a | ||
|
|
d41374c55a | ||
|
|
dd8a1f00fc | ||
|
|
ffca27cbde | ||
|
|
82edd901fe | ||
|
|
a8c1a36c12 | ||
|
|
acfb24f871 | ||
|
|
ecff5aea71 | ||
|
|
74cb225ccb | ||
|
|
d5db2ccf18 | ||
|
|
cebcf50c65 | ||
|
|
3a3c9101c7 | ||
|
|
ec1c7797f4 | ||
|
|
313528c34b | ||
|
|
907fd6b04b | ||
|
|
aa0fc9071e | ||
|
|
0bd924eb7e | ||
|
|
852109c142 | ||
|
|
9b0bb29d78 | ||
|
|
c3e71de1d7 | ||
|
|
0256d6820c | ||
|
|
1b18bfaff5 | ||
|
|
6065e7a62b | ||
|
|
8aecdc536c | ||
|
|
86a2e9e655 | ||
|
|
8f50106187 | ||
|
|
02d3a319f9 | ||
|
|
d18d0435ae | ||
|
|
cdaf1c5262 | ||
|
|
4b0e3bff54 | ||
|
|
c4f7b27459 | ||
|
|
3eb8be9953 | ||
|
|
1f08f8df0d | ||
|
|
0038a0b19c | ||
|
|
166a7c7e53 | ||
|
|
8ac296bd6f | ||
|
|
e092a38e0f | ||
|
|
b145e894e4 | ||
|
|
63a8b66b28 | ||
|
|
a16cc87852 | ||
|
|
1050b60057 | ||
|
|
9188e85164 | ||
|
|
f9b369c550 | ||
|
|
949b205f42 | ||
|
|
31ee8d8178 | ||
|
|
3155590e87 | ||
|
|
feab0bce4b | ||
|
|
0599d80b13 | ||
|
|
d58e12c5e4 | ||
|
|
68939c5a5c | ||
|
|
25c4fb8508 | ||
|
|
88e6c48db7 | ||
|
|
218b0d491a | ||
|
|
bfba74dab9 | ||
|
|
5708846a07 | ||
|
|
fd28783f85 | ||
|
|
0ca34d11ad | ||
|
|
bf3275ba4a | ||
|
|
d8e4e00b2b | ||
|
|
8b38a6dd08 | ||
|
|
63f72621fc | ||
|
|
580a8c9c61 | ||
|
|
249351cef4 | ||
|
|
46690ae352 | ||
|
|
68b5a90518 | ||
|
|
cb54823622 | ||
|
|
3a2ca41724 | ||
|
|
dd4e6d29ca | ||
|
|
497ee32f59 | ||
|
|
d34c287f69 | ||
|
|
b744ca16e1 | ||
|
|
573c262bb2 | ||
|
|
ff2c2f1e1f | ||
|
|
8058391955 | ||
|
|
54dbb9f248 | ||
|
|
7d1351f402 | ||
|
|
21233430aa | ||
|
|
bd1d6820b7 | ||
|
|
18e84ae2e8 | ||
|
|
f9c29056e6 | ||
|
|
40b1c32008 | ||
|
|
b5ed804578 | ||
|
|
fbe3a86c4e | ||
|
|
498c86b47d | ||
|
|
b8b6f81c44 | ||
|
|
aab9e1b751 | ||
|
|
ec976f3f75 | ||
|
|
f169fa5da2 | ||
|
|
35ee12e7e9 | ||
|
|
4497ab8844 | ||
|
|
9f399f3313 | ||
|
|
3939213336 | ||
|
|
cc27a0f666 | ||
|
|
1ff2216063 | ||
|
|
b8165813b4 | ||
|
|
2215b153db | ||
|
|
cb91d585c3 | ||
|
|
c971d4044f | ||
|
|
fdb4a078f2 | ||
|
|
42ea711850 | ||
|
|
96721978c0 | ||
|
|
d64698e4c9 | ||
|
|
4565f2b689 | ||
|
|
5fa7f1d50d | ||
|
|
2cfc42bd6a | ||
|
|
003de2b659 | ||
|
|
4ab6c2252d | ||
|
|
8f9d818368 | ||
|
|
4ebc307744 | ||
|
|
0b519b29d9 | ||
|
|
8881e8d96e | ||
|
|
9a99608f68 | ||
|
|
26c26308db | ||
|
|
123c5d809e | ||
|
|
7c42c7798c | ||
|
|
0f98daf1d9 | ||
|
|
c3de7c63b4 | ||
|
|
ab9123a427 | ||
|
|
e504a8c979 | ||
|
|
f6dd87a3a1 | ||
|
|
89c530054d | ||
|
|
f87edbe1cb | ||
|
|
4aa477de3e | ||
|
|
694e674fe6 | ||
|
|
7ebc0f32b8 | ||
|
|
68cacc2fc3 | ||
|
|
43eb597044 | ||
|
|
7efd827e78 | ||
|
|
2f6f8b93e9 | ||
|
|
d48413cbec | ||
|
|
6bafca688b | ||
|
|
53356f1aa7 | ||
|
|
51281f6a3a | ||
|
|
7a5e08c5ab | ||
|
|
642903a7bf | ||
|
|
f51fd6c78d | ||
|
|
03cf15a9e1 | ||
|
|
fe19c04f6a | ||
|
|
b86cbda03d | ||
|
|
b1af6e23cf | ||
|
|
e26b9b12fa | ||
|
|
9bf47b3f23 | ||
|
|
2887416b2e | ||
|
|
9a92f6f743 | ||
|
|
4929480719 | ||
|
|
c8437d2303 | ||
|
|
ef25ae4d3b | ||
|
|
9399790c11 | ||
|
|
ab7f6484cf | ||
|
|
2d8c5da379 | ||
|
|
b18f148575 | ||
|
|
6426428718 | ||
|
|
af2ee426f5 | ||
|
|
6c4e9ff42d | ||
|
|
62a37a7d70 | ||
|
|
ef83addc74 | ||
|
|
fb308f5947 | ||
|
|
cedb93c11c | ||
|
|
61d2a09827 | ||
|
|
9c6423f37a | ||
|
|
e18a661b50 | ||
|
|
16e5777816 | ||
|
|
64020e8828 | ||
|
|
30798556fc | ||
|
|
cd3518d99d | ||
|
|
bc87c3d494 | ||
|
|
726228c418 | ||
|
|
929b111648 | ||
|
|
1700a73382 | ||
|
|
0f9d791911 | ||
|
|
61acc76be7 | ||
|
|
0f8ba5bf32 | ||
|
|
2cb8a96f0e | ||
|
|
1102122639 | ||
|
|
66e026a9e8 | ||
|
|
b901b42417 | ||
|
|
9f2f10a65f | ||
|
|
b0b41d00ee | ||
|
|
2d56f5eba0 | ||
|
|
8ffc6fbc6b | ||
|
|
0ffd94dadb | ||
|
|
585320093a | ||
|
|
bdd351a42c | ||
|
|
feaee702e9 | ||
|
|
d89fc84fcf | ||
|
|
688cd1a4bb | ||
|
|
c056875a00 | ||
|
|
054118139f | ||
|
|
447148d95a | ||
|
|
f6b1e42a0b | ||
|
|
90e74e5572 | ||
|
|
e4fc5fe5be | ||
|
|
809b2c6115 | ||
|
|
659538ef4b | ||
|
|
4b677f4b42 | ||
|
|
87699ea5a0 | ||
|
|
a2ae113ee9 | ||
|
|
901e2c75d4 | ||
|
|
871d140b7c | ||
|
|
2f6ae1ad02 | ||
|
|
806e98925c | ||
|
|
c7dbd2fac2 | ||
|
|
1b7729efed | ||
|
|
6d1d5aeffb | ||
|
|
9ae04b5771 | ||
|
|
fc61e3b1b5 | ||
|
|
fa1d9910e4 | ||
|
|
d425873eed | ||
|
|
d89c54dd95 | ||
|
|
5e023c55bd | ||
|
|
2487172df3 | ||
|
|
bdd078df17 | ||
|
|
db75335ad0 | ||
|
|
531ab5b5b1 | ||
|
|
0601a863f9 | ||
|
|
10d34c9564 | ||
|
|
a37d6a3841 | ||
|
|
d5234a43da | ||
|
|
b7733540c1 | ||
|
|
2ae02ded74 | ||
|
|
2e57ad644d | ||
|
|
031afbfb18 | ||
|
|
377ce2e2f6 | ||
|
|
a2fd3c077d | ||
|
|
0f5aff73ab | ||
|
|
f0b208e692 | ||
|
|
7fcb5fc590 | ||
|
|
b76f819759 | ||
|
|
4b36d4f1ea | ||
|
|
f4d0c6c807 | ||
|
|
79ab76b42e | ||
|
|
8c3ac61f8d | ||
|
|
a8bc20f76b | ||
|
|
53a55baf23 | ||
|
|
63d6800cf3 | ||
|
|
44492b4828 | ||
|
|
8ed9f8aef5 | ||
|
|
711021e24e | ||
|
|
55dea335fe | ||
|
|
7097532ddf | ||
|
|
66841ce35c | ||
|
|
3d814cb7c1 | ||
|
|
07afdca58b | ||
|
|
93ed346fd2 | ||
|
|
c9eee9bf7f | ||
|
|
d1a4029bc5 | ||
|
|
97070aad25 | ||
|
|
39640185a3 | ||
|
|
4b17506ffe | ||
|
|
2435ebecbe | ||
|
|
410a35b968 | ||
|
|
c8d234a767 | ||
|
|
2bf87ff40f | ||
|
|
ba347c49c9 | ||
|
|
81434cd233 | ||
|
|
46d0df9cba | ||
|
|
b7f58e68c5 | ||
|
|
6ba2accbdc | ||
|
|
29ee94d331 | ||
|
|
cdae654fe4 | ||
|
|
a506c84bc7 | ||
|
|
8e4a47181b | ||
|
|
b5241e0f60 | ||
|
|
57ed466a7f | ||
|
|
4f46f55f2d | ||
|
|
69cfc78ee1 | ||
|
|
04f1ab8571 | ||
|
|
95694b2017 | ||
|
|
00bed2f0c0 | ||
|
|
e718fc35f8 | ||
|
|
717015bae8 | ||
|
|
530d3d809b | ||
|
|
596b32d15c | ||
|
|
8d3918b4f0 | ||
|
|
4c7e31513b | ||
|
|
765509d7f5 | ||
|
|
dbb58d10a6 | ||
|
|
d448976b3c | ||
|
|
de6931b1f5 | ||
|
|
35268d185e | ||
|
|
beef9eee0a | ||
|
|
34a274d4e6 | ||
|
|
ef28a6c19a | ||
|
|
50b5971ee5 | ||
|
|
9a70ae18ea | ||
|
|
d10853b775 | ||
|
|
cdf6a16efc | ||
|
|
02d7261f51 | ||
|
|
9c9ddeffbe | ||
|
|
afa8b3a5c9 | ||
|
|
bbcd4c168c | ||
|
|
d22bd9cac7 | ||
|
|
5ccf25196e | ||
|
|
caf15a2dac | ||
|
|
982a05450c | ||
|
|
3e381b742c | ||
|
|
6b82664166 | ||
|
|
bb30a2eb1e | ||
|
|
b3fdf5c48f | ||
|
|
17d5ed847f | ||
|
|
4335d17fc0 | ||
|
|
ae07958577 | ||
|
|
c51b9ba3d6 | ||
|
|
cc6ff5e9e6 | ||
|
|
b968ea7e7e | ||
|
|
d14b6e160e | ||
|
|
b09b9488ef | ||
|
|
a8120ee7ef | ||
|
|
fb82059750 | ||
|
|
0fc6240d72 | ||
|
|
a7c6fdb1fc | ||
|
|
b76a2963cf | ||
|
|
42b0fbd34c | ||
|
|
f69ef8606f | ||
|
|
afa5ad5f9f | ||
|
|
1fc82708e9 | ||
|
|
917cbbadde | ||
|
|
c37dc81839 | ||
|
|
df718d55ef | ||
|
|
54412f1d5e | ||
|
|
da76023bea | ||
|
|
41e9309a36 | ||
|
|
116268b275 | ||
|
|
73802492b8 | ||
|
|
7cd4d53fa9 | ||
|
|
c44757975e | ||
|
|
f25cdcdf63 | ||
|
|
5d37253e85 | ||
|
|
cd5f42ec79 | ||
|
|
6651f9e94b | ||
|
|
e3ee579f92 | ||
|
|
73e7240574 | ||
|
|
391f9aa97d | ||
|
|
8ad54e7bd5 | ||
|
|
9eccc01dd3 | ||
|
|
39c1f816fc | ||
|
|
a32b892787 | ||
|
|
1b144ba3f0 | ||
|
|
6a39a8db72 | ||
|
|
602c530615 | ||
|
|
c8c27f26f7 | ||
|
|
549cdc4c2c | ||
|
|
3160e0a430 | ||
|
|
dcebe85f3a | ||
|
|
2ba0b66426 | ||
|
|
5c9543f159 | ||
|
|
f6e3689f30 | ||
|
|
a761343717 | ||
|
|
b4c47a3d24 | ||
|
|
906988c49b | ||
|
|
4186b2ad82 | ||
|
|
2943cff73f | ||
|
|
53ac5579fb | ||
|
|
0d7a9f911a | ||
|
|
dce9de222d | ||
|
|
d46722a95c | ||
|
|
3ba4da7736 | ||
|
|
6abf5b90b7 | ||
|
|
00aa4ddea0 | ||
|
|
d0c6f9de22 | ||
|
|
a85cc85081 | ||
|
|
75793300f2 | ||
|
|
672805584e | ||
|
|
5b4fd590d1 | ||
|
|
0ccd38f593 | ||
|
|
b46e5d4488 | ||
|
|
d7223d598f | ||
|
|
7a0368132d | ||
|
|
aff3914a66 | ||
|
|
8876047875 | ||
|
|
78e2aa16f0 | ||
|
|
3ef695cf70 | ||
|
|
c4d8dd6413 | ||
|
|
a49d30f6e2 | ||
|
|
d80daf2692 | ||
|
|
0e5c9e8b06 | ||
|
|
6bc4aed82c | ||
|
|
e69e1200f5 | ||
|
|
81e253b06b | ||
|
|
43dcc84c07 | ||
|
|
6e9d5f00de | ||
|
|
a65ca9663f | ||
|
|
02b767c0ea | ||
|
|
4b1c1d266d | ||
|
|
d9bf140971 | ||
|
|
1402776ba6 | ||
|
|
e36fb47d98 | ||
|
|
2bb37357c0 | ||
|
|
7494ac7615 | ||
|
|
44bc3fb90b | ||
|
|
423e29ba42 |
No files matched your search
@@ -3,8 +3,6 @@
|
||||
# Ignore all files in the External directory
|
||||
External/*
|
||||
|
||||
# SoftFloat-3e code doesn't belong to us
|
||||
FEXCore/Source/Common/SoftFloat-3e/*
|
||||
Source/Common/cpp-optparse/*
|
||||
|
||||
# Files with human-indented tables for readability - don't mess with these
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1
|
||||
with:
|
||||
separator: ","
|
||||
skip_initial_fetch: true
|
||||
|
||||
+3
-4
@@ -5,10 +5,6 @@
|
||||
[submodule "External/cpp-optparse"]
|
||||
path = Source/Common/cpp-optparse
|
||||
url = https://github.com/Sonicadvance1/cpp-optparse
|
||||
[submodule "External/xbyak"]
|
||||
shallow = true
|
||||
path = External/xbyak
|
||||
url = https://github.com/herumi/xbyak.git
|
||||
[submodule "External/fex-posixtest-bins"]
|
||||
shallow = true
|
||||
path = External/fex-posixtest-bins
|
||||
@@ -47,3 +43,6 @@
|
||||
[submodule "External/jemalloc_glibc"]
|
||||
path = External/jemalloc_glibc
|
||||
url = https://github.com/FEX-Emu/jemalloc.git
|
||||
[submodule "External/tracy"]
|
||||
path = External/tracy
|
||||
url = https://github.com/wolfpld/tracy
|
||||
+42
-7
@@ -13,6 +13,7 @@ option(ENABLE_IWYU "Enables include what you use program" FALSE)
|
||||
option(ENABLE_LTO "Enable LTO with compilation" TRUE)
|
||||
option(ENABLE_XRAY "Enable building with LLVM X-Ray" FALSE)
|
||||
set(USE_LINKER "" CACHE STRING "Allow overriding the linker path directly")
|
||||
option(ENABLE_UBSAN "Enables Clang UBSAN" FALSE)
|
||||
option(ENABLE_ASAN "Enables Clang ASAN" FALSE)
|
||||
option(ENABLE_TSAN "Enables Clang TSAN" FALSE)
|
||||
option(ENABLE_COVERAGE "Enables Coverage" FALSE)
|
||||
@@ -30,14 +31,17 @@ option(ENABLE_VIXL_SIMULATOR "Enable use of VIXL simulator for emulation (only u
|
||||
option(ENABLE_VIXL_DISASSEMBLER "Enables debug disassembler output with VIXL" FALSE)
|
||||
option(USE_LEGACY_BINFMTMISC "Uses legacy method of setting up binfmt_misc" FALSE)
|
||||
option(ENABLE_FEXCORE_PROFILER "Enables use of the FEXCore timeline profiling capabilities" FALSE)
|
||||
set (FEXCORE_PROFILER_BACKEND "gpuvis" CACHE STRING "Set which backend you want to use for the FEXCore profiler")
|
||||
set (FEXCORE_PROFILER_BACKEND "gpuvis" CACHE STRING "Set which backend to use for the FEXCore profiler (gpuvis, tracy)")
|
||||
option(ENABLE_GLIBC_ALLOCATOR_HOOK_FAULT "Enables glibc memory allocation hooking with fault for CI testing")
|
||||
option(USE_PDB_DEBUGINFO "Builds debug info in PDB format" FALSE)
|
||||
|
||||
set (X86_32_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/toolchain_x86_32.cmake" CACHE FILEPATH "Toolchain file for the (cross-)compiler targeting i686")
|
||||
set (X86_64_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/toolchain_x86_64.cmake" CACHE FILEPATH "Toolchain file for the (cross-)compiler targeting x86_64")
|
||||
set (X86_DEV_ROOTFS "/" CACHE FILEPATH "Path to the sysroot used for cross-compiling for i686 and x86_64")
|
||||
set (DATA_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/fex-emu" CACHE PATH "global data directory")
|
||||
set (DATA_DIRECTORY "" CACHE PATH "Global data directory (override)")
|
||||
if (NOT DATA_DIRECTORY)
|
||||
set (DATA_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/fex-emu")
|
||||
endif()
|
||||
|
||||
string(FIND ${CMAKE_BASE_NAME} mingw CONTAINS_MINGW)
|
||||
if (NOT CONTAINS_MINGW EQUAL -1)
|
||||
@@ -61,6 +65,22 @@ if (ENABLE_FEXCORE_PROFILER)
|
||||
|
||||
if (FEXCORE_PROFILER_BACKEND STREQUAL "GPUVIS")
|
||||
add_definitions(-DFEXCORE_PROFILER_BACKEND=1)
|
||||
elseif (FEXCORE_PROFILER_BACKEND STREQUAL "TRACY")
|
||||
add_definitions(-DFEXCORE_PROFILER_BACKEND=2)
|
||||
add_definitions(-DTRACY_ENABLE=1)
|
||||
# Required so that Tracy will only start in the selected guest application
|
||||
add_definitions(-DTRACY_MANUAL_LIFETIME=1)
|
||||
add_definitions(-DTRACY_DELAYED_INIT=1)
|
||||
# This interferes with FEX's signal handling
|
||||
add_definitions(-DTRACY_NO_CRASH_HANDLER=1)
|
||||
# Tracy can gather call stack samples in regular intervals, but this
|
||||
# isn't useful for us since it would usually sample opaque JIT code
|
||||
add_definitions(-DTRACY_NO_SAMPLING=1)
|
||||
# This pulls in libbacktrace which allocators in global constructors (before FEX can set up its allocator hooks)
|
||||
add_definitions(-DTRACY_NO_CALLSTACK=1)
|
||||
if (MINGW_BUILD)
|
||||
message(FATAL_ERROR "Tracy profiler not supported")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown FEXCore profiler backend ${FEXCORE_PROFILER_BACKEND}")
|
||||
endif()
|
||||
@@ -212,6 +232,19 @@ if (NOT ENABLE_OFFLINE_TELEMETRY)
|
||||
add_definitions(-DFEX_DISABLE_TELEMETRY=1)
|
||||
endif()
|
||||
|
||||
if (ENABLE_UBSAN)
|
||||
# See https://github.com/FEX-Emu/FEX/pull/4494#issuecomment-2800608944
|
||||
# and related discussion for the use of -fno-sanitize=alignment -fno-sanitize=function
|
||||
# with UBSAN.
|
||||
# alignment: we don't follow a strict alignment policy, for example IR uses packed structs
|
||||
# that are regularly access unaligned.
|
||||
# function: syscalls cast function pointers to void (*)(unsigned long...), causing warnings
|
||||
# related to this access.
|
||||
add_definitions(-DENABLE_UBSAN=1)
|
||||
add_compile_options(-fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize=alignment -fno-sanitize=function -fno-sanitize-recover=undefined)
|
||||
link_libraries(-fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize=alignment -fno-sanitize=function -fno-sanitize-recover=undefined)
|
||||
endif()
|
||||
|
||||
if (ENABLE_ASAN)
|
||||
add_definitions(-DENABLE_ASAN=1)
|
||||
add_compile_options(-fno-omit-frame-pointer -fsanitize=address -fsanitize-address-use-after-scope)
|
||||
@@ -270,6 +303,10 @@ if (BUILD_TESTS OR ENABLE_VIXL_DISASSEMBLER OR ENABLE_VIXL_SIMULATOR)
|
||||
include_directories(SYSTEM External/vixl/src/)
|
||||
endif()
|
||||
|
||||
if (ENABLE_FEXCORE_PROFILER AND FEXCORE_PROFILER_BACKEND STREQUAL "TRACY")
|
||||
add_subdirectory(External/tracy)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# This means we were attempted to get compiled with GCC
|
||||
message(FATAL_ERROR "FEX doesn't support getting compiled with GCC!")
|
||||
@@ -364,10 +401,6 @@ if (TUNE_CPU STREQUAL "native")
|
||||
list(APPEND FEX_TUNE_COMPILE_FLAGS "-mcpu=native")
|
||||
endif()
|
||||
else()
|
||||
# Due to an oversight in llvm, it declares any reasonably new Kryo CPU to only be ARMv8.0
|
||||
# Manually detect newer CPU revisions until clang and llvm fixes their bug
|
||||
# This script will either provide a supported CPU or 'native'
|
||||
# Additionally -march doesn't work under AArch64+Clang, so you have to use -mcpu or -mtune
|
||||
execute_process(COMMAND python3 "${PROJECT_SOURCE_DIR}/Scripts/aarch64_fit_native.py" "/proc/cpuinfo" "${CMAKE_CXX_COMPILER_VERSION}"
|
||||
OUTPUT_VARIABLE AARCH64_CPU)
|
||||
|
||||
@@ -384,7 +417,7 @@ if (TUNE_CPU STREQUAL "native")
|
||||
list(APPEND FEX_TUNE_COMPILE_FLAGS "-march=native")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
elseif (NOT TUNE_CPU STREQUAL "none")
|
||||
check_cxx_compiler_flag("-mcpu=${TUNE_CPU}" COMPILER_SUPPORTS_CPU_TYPE)
|
||||
if(COMPILER_SUPPORTS_CPU_TYPE)
|
||||
list(APPEND FEX_TUNE_COMPILE_FLAGS "-mcpu=${TUNE_CPU}")
|
||||
@@ -424,6 +457,8 @@ if (BUILD_TESTS)
|
||||
set(TEST_JOB_FLAG "-j${TEST_JOB_COUNT}")
|
||||
endif()
|
||||
|
||||
add_subdirectory(External/SoftFloat-3e/)
|
||||
add_subdirectory(External/cephes/)
|
||||
add_subdirectory(FEXHeaderUtils/)
|
||||
add_subdirectory(CodeEmitter/)
|
||||
add_subdirectory(FEXCore/)
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,6 +3,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <type_traits>
|
||||
|
||||
namespace ARMEmitter {
|
||||
class Buffer {
|
||||
@@ -21,42 +22,38 @@ public:
|
||||
Size = BaseSize;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
requires (std::is_trivially_copyable_v<T>)
|
||||
void dcn(const T& Data) {
|
||||
std::memcpy(CurrentOffset, &Data, sizeof(Data));
|
||||
CurrentOffset += sizeof(Data);
|
||||
}
|
||||
void dc8(uint8_t Data) {
|
||||
decltype(Data)* Memory = reinterpret_cast<decltype(Data)*>(CurrentOffset);
|
||||
*Memory = Data;
|
||||
CurrentOffset += sizeof(Data);
|
||||
dcn(Data);
|
||||
}
|
||||
|
||||
void dc16(uint16_t Data) {
|
||||
decltype(Data)* Memory = reinterpret_cast<decltype(Data)*>(CurrentOffset);
|
||||
*Memory = Data;
|
||||
CurrentOffset += sizeof(Data);
|
||||
dcn(Data);
|
||||
}
|
||||
|
||||
void dc32(uint32_t Data) {
|
||||
decltype(Data)* Memory = reinterpret_cast<decltype(Data)*>(CurrentOffset);
|
||||
*Memory = Data;
|
||||
CurrentOffset += sizeof(Data);
|
||||
dcn(Data);
|
||||
}
|
||||
void dc64(uint64_t Data) {
|
||||
dcn(Data);
|
||||
}
|
||||
|
||||
void dc64(uint64_t Data) {
|
||||
decltype(Data)* Memory = reinterpret_cast<decltype(Data)*>(CurrentOffset);
|
||||
*Memory = Data;
|
||||
CurrentOffset += sizeof(Data);
|
||||
}
|
||||
void EmitString(const char* String) {
|
||||
const auto StringLength = strlen(String);
|
||||
memcpy(CurrentOffset, String, StringLength);
|
||||
CurrentOffset += StringLength;
|
||||
}
|
||||
|
||||
void Align() {
|
||||
// Align the buffer to instruction size
|
||||
auto CurrentAlignment = reinterpret_cast<uint64_t>(CurrentOffset) & 0b11;
|
||||
void Align(size_t Size = 4) {
|
||||
// Align the buffer to provided size.
|
||||
auto CurrentAlignment = reinterpret_cast<uint64_t>(CurrentOffset) & (Size - 1);
|
||||
if (!CurrentAlignment) {
|
||||
return;
|
||||
}
|
||||
CurrentOffset += 4 - CurrentAlignment;
|
||||
CurrentOffset += Size - CurrentAlignment;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@@ -95,10 +92,6 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
void ResetBuffer() {
|
||||
CurrentOffset = BufferBase;
|
||||
}
|
||||
|
||||
uint8_t* BufferBase;
|
||||
uint8_t* CurrentOffset;
|
||||
uint64_t Size;
|
||||
|
||||
@@ -355,6 +355,7 @@ enum class SystemRegister : uint32_t {
|
||||
TPIDRRO_EL0 = GenSystemReg<0b11, 0b011, 0b1101, 0b0000, 0b011>,
|
||||
CNTFRQ_EL0 = GenSystemReg<0b11, 0b011, 0b1110, 0b0000, 0b000>,
|
||||
CNTVCT_EL0 = GenSystemReg<0b11, 0b011, 0b1110, 0b0000, 0b010>,
|
||||
CNTVCTSS_EL0 = GenSystemReg<0b11, 0b011, 0b1110, 0b0000, 0b110>,
|
||||
};
|
||||
|
||||
template<uint32_t op1, uint32_t CRm, uint32_t op2>
|
||||
@@ -572,6 +573,10 @@ enum class Rotation : uint32_t {
|
||||
template<typename T>
|
||||
concept IsXOrWRegister = std::is_same_v<T, XRegister> || std::is_same_v<T, WRegister>;
|
||||
|
||||
// Concept for contraining some instructions to accept only a QRegister or DRegister.
|
||||
template<typename T>
|
||||
concept IsQOrDRegister = std::is_same_v<T, QRegister> || std::is_same_v<T, DRegister>;
|
||||
|
||||
// Whether or not a given set of vector registers are sequential
|
||||
// in increasing order as far as the register file is concerned (modulo its size)
|
||||
//
|
||||
|
||||
@@ -416,8 +416,7 @@ public:
|
||||
0;
|
||||
ASIMDSTLD<size, true, 1>(Op, Opcode, rt, Index, rn, Reg::r0);
|
||||
}
|
||||
template<SubRegSize size, typename T>
|
||||
requires (std::is_same_v<QRegister, T> || std::is_same_v<DRegister, T>)
|
||||
template<SubRegSize size, IsQOrDRegister T>
|
||||
void ld1r(T rt, Register rn) {
|
||||
constexpr uint32_t Op = 0b0000'1101'000 << 21;
|
||||
constexpr uint32_t Opcode = 0b110;
|
||||
@@ -435,8 +434,7 @@ public:
|
||||
0;
|
||||
ASIMDSTLD<size, true, 2>(Op, Opcode, rt, Index, rn, Reg::r0);
|
||||
}
|
||||
template<SubRegSize size, typename T>
|
||||
requires (std::is_same_v<QRegister, T> || std::is_same_v<DRegister, T>)
|
||||
template<SubRegSize size, IsQOrDRegister T>
|
||||
void ld2r(T rt, T rt2, Register rn) {
|
||||
LOGMAN_THROW_A_FMT(AreVectorsSequential(rt, rt2), "rt and rt2 must be sequential");
|
||||
constexpr uint32_t Op = 0b0000'1101'000 << 21;
|
||||
@@ -455,8 +453,7 @@ public:
|
||||
0;
|
||||
ASIMDSTLD<size, true, 3>(Op, Opcode, rt, Index, rn, Reg::r0);
|
||||
}
|
||||
template<SubRegSize size, typename T>
|
||||
requires (std::is_same_v<QRegister, T> || std::is_same_v<DRegister, T>)
|
||||
template<SubRegSize size, IsQOrDRegister T>
|
||||
void ld3r(T rt, T rt2, T rt3, Register rn) {
|
||||
LOGMAN_THROW_A_FMT(AreVectorsSequential(rt, rt2, rt3), "rt, rt2, and rt3 must be sequential");
|
||||
constexpr uint32_t Op = 0b0000'1101'000 << 21;
|
||||
@@ -475,8 +472,7 @@ public:
|
||||
0;
|
||||
ASIMDSTLD<size, true, 4>(Op, Opcode, rt, Index, rn, Reg::r0);
|
||||
}
|
||||
template<SubRegSize size, typename T>
|
||||
requires (std::is_same_v<QRegister, T> || std::is_same_v<DRegister, T>)
|
||||
template<SubRegSize size, IsQOrDRegister T>
|
||||
void ld4r(T rt, T rt2, T rt3, T rt4, Register rn) {
|
||||
LOGMAN_THROW_A_FMT(AreVectorsSequential(rt, rt2, rt3, rt4), "rt, rt2, rt3, and rt4 must be sequential");
|
||||
constexpr uint32_t Op = 0b0000'1101'000 << 21;
|
||||
@@ -767,6 +763,7 @@ public:
|
||||
void st1(ARMEmitter::SubRegSize size, T rt, uint32_t Index, ARMEmitter::Register rn, uint32_t PostOffset) {
|
||||
LOGMAN_THROW_A_FMT(size == SubRegSize::i8Bit || size == SubRegSize::i16Bit || size == SubRegSize::i32Bit || size == SubRegSize::i64Bit,
|
||||
"Incorrect size");
|
||||
LOGMAN_THROW_A_FMT((PostOffset * 8) == SubRegSizeInBits(size), "Post-Index size must match element size");
|
||||
constexpr uint32_t Op = 0b0000'1101'1 << 23;
|
||||
uint32_t Q;
|
||||
uint32_t R = 0;
|
||||
@@ -808,6 +805,7 @@ public:
|
||||
void ld1(ARMEmitter::SubRegSize size, T rt, uint32_t Index, ARMEmitter::Register rn, uint32_t PostOffset) {
|
||||
LOGMAN_THROW_A_FMT(size == SubRegSize::i8Bit || size == SubRegSize::i16Bit || size == SubRegSize::i32Bit || size == SubRegSize::i64Bit,
|
||||
"Incorrect size");
|
||||
LOGMAN_THROW_A_FMT((PostOffset * 8) == SubRegSizeInBits(size), "Post-Index size must match element size");
|
||||
constexpr uint32_t Op = 0b0000'1101'1 << 23;
|
||||
uint32_t Q;
|
||||
uint32_t R = 0;
|
||||
@@ -899,6 +897,7 @@ public:
|
||||
void st2(SubRegSize size, T rt, T rt2, uint32_t Index, Register rn, uint32_t PostOffset) {
|
||||
LOGMAN_THROW_A_FMT(size == SubRegSize::i8Bit || size == SubRegSize::i16Bit || size == SubRegSize::i32Bit || size == SubRegSize::i64Bit,
|
||||
"Incorrect size");
|
||||
LOGMAN_THROW_A_FMT((PostOffset * 8) == (SubRegSizeInBits(size) * 2), "Post-Index size must match element size");
|
||||
LOGMAN_THROW_A_FMT(AreVectorsSequential(rt, rt2), "rt and rt2 must be sequential");
|
||||
|
||||
constexpr uint32_t Op = 0b0000'1101'1 << 23;
|
||||
@@ -942,6 +941,7 @@ public:
|
||||
void ld2(SubRegSize size, T rt, T rt2, uint32_t Index, Register rn, uint32_t PostOffset) {
|
||||
LOGMAN_THROW_A_FMT(size == SubRegSize::i8Bit || size == SubRegSize::i16Bit || size == SubRegSize::i32Bit || size == SubRegSize::i64Bit,
|
||||
"Incorrect size");
|
||||
LOGMAN_THROW_A_FMT((PostOffset * 8) == (SubRegSizeInBits(size) * 2), "Post-Index size must match element size");
|
||||
LOGMAN_THROW_A_FMT(AreVectorsSequential(rt, rt2), "rt and rt2 must be sequential");
|
||||
|
||||
constexpr uint32_t Op = 0b0000'1101'1 << 23;
|
||||
@@ -985,6 +985,7 @@ public:
|
||||
void st3(SubRegSize size, T rt, T rt2, T rt3, uint32_t Index, Register rn, uint32_t PostOffset) {
|
||||
LOGMAN_THROW_A_FMT(size == SubRegSize::i8Bit || size == SubRegSize::i16Bit || size == SubRegSize::i32Bit || size == SubRegSize::i64Bit,
|
||||
"Incorrect size");
|
||||
LOGMAN_THROW_A_FMT((PostOffset * 8) == (SubRegSizeInBits(size) * 3), "Post-Index size must match element size");
|
||||
LOGMAN_THROW_A_FMT(AreVectorsSequential(rt, rt2, rt3), "rt, rt2, and rt3 must be sequential");
|
||||
|
||||
constexpr uint32_t Op = 0b0000'1101'1 << 23;
|
||||
@@ -1028,6 +1029,7 @@ public:
|
||||
void ld3(SubRegSize size, T rt, T rt2, T rt3, uint32_t Index, Register rn, uint32_t PostOffset) {
|
||||
LOGMAN_THROW_A_FMT(size == SubRegSize::i8Bit || size == SubRegSize::i16Bit || size == SubRegSize::i32Bit || size == SubRegSize::i64Bit,
|
||||
"Incorrect size");
|
||||
LOGMAN_THROW_A_FMT((PostOffset * 8) == (SubRegSizeInBits(size) * 3), "Post-Index size must match element size");
|
||||
LOGMAN_THROW_A_FMT(AreVectorsSequential(rt, rt2, rt3), "rt, rt2, and rt3 must be sequential");
|
||||
|
||||
constexpr uint32_t Op = 0b0000'1101'1 << 23;
|
||||
@@ -1071,6 +1073,7 @@ public:
|
||||
void st4(SubRegSize size, T rt, T rt2, T rt3, T rt4, uint32_t Index, Register rn, uint32_t PostOffset) {
|
||||
LOGMAN_THROW_A_FMT(size == SubRegSize::i8Bit || size == SubRegSize::i16Bit || size == SubRegSize::i32Bit || size == SubRegSize::i64Bit,
|
||||
"Incorrect size");
|
||||
LOGMAN_THROW_A_FMT((PostOffset * 8) == (SubRegSizeInBits(size) * 4), "Post-Index size must match element size");
|
||||
LOGMAN_THROW_A_FMT(AreVectorsSequential(rt, rt2, rt3, rt4), "rt, rt2, rt3, and rt4 must be sequential");
|
||||
|
||||
constexpr uint32_t Op = 0b0000'1101'1 << 23;
|
||||
@@ -1114,6 +1117,7 @@ public:
|
||||
void ld4(SubRegSize size, T rt, T rt2, T rt3, T rt4, uint32_t Index, Register rn, uint32_t PostOffset) {
|
||||
LOGMAN_THROW_A_FMT(size == SubRegSize::i8Bit || size == SubRegSize::i16Bit || size == SubRegSize::i32Bit || size == SubRegSize::i64Bit,
|
||||
"Incorrect size");
|
||||
LOGMAN_THROW_A_FMT((PostOffset * 8) == (SubRegSizeInBits(size) * 4), "Post-Index size must match element size");
|
||||
LOGMAN_THROW_A_FMT(AreVectorsSequential(rt, rt2, rt3, rt4), "rt, rt2, rt3, and rt4 must be sequential");
|
||||
|
||||
constexpr uint32_t Op = 0b0000'1101'1 << 23;
|
||||
@@ -1644,8 +1648,8 @@ public:
|
||||
template<typename T>
|
||||
void ASIMDLoadStoreSinglePost(uint32_t Op, uint32_t Q, uint32_t L, uint32_t R, uint32_t opcode, uint32_t S, uint32_t size,
|
||||
ARMEmitter::Register rm, ARMEmitter::Register rn, T rt) {
|
||||
LOGMAN_THROW_A_FMT(std::is_same_v<ARMEmitter::QRegister, T> || std::is_same_v<ARMEmitter::DRegister, T>, "Only supports 128-bit and "
|
||||
"64-bit vector registers.");
|
||||
LOGMAN_THROW_A_FMT((std::is_same_v<ARMEmitter::QRegister, T> || std::is_same_v<ARMEmitter::DRegister, T>), "Only supports 128-bit and "
|
||||
"64-bit vector registers.");
|
||||
uint32_t Instr = Op;
|
||||
|
||||
Instr |= Q << 30;
|
||||
@@ -2128,7 +2132,370 @@ public:
|
||||
}
|
||||
|
||||
// Memory copy/set
|
||||
// TODO
|
||||
void cpyfp(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b0000, rs, rn, rd);
|
||||
}
|
||||
void cpyfm(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b0000, rs, rn, rd);
|
||||
}
|
||||
void cpyfe(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b0000, rs, rn, rd);
|
||||
}
|
||||
void cpyfpwt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b0001, rs, rn, rd);
|
||||
}
|
||||
void cpyfmwt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b0001, rs, rn, rd);
|
||||
}
|
||||
void cpyfewt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b0001, rs, rn, rd);
|
||||
}
|
||||
void cpyfprt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b0010, rs, rn, rd);
|
||||
}
|
||||
void cpyfmrt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b0010, rs, rn, rd);
|
||||
}
|
||||
void cpyfert(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b0010, rs, rn, rd);
|
||||
}
|
||||
void cpyfpt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b0011, rs, rn, rd);
|
||||
}
|
||||
void cpyfmt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b0011, rs, rn, rd);
|
||||
}
|
||||
void cpyfet(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b0011, rs, rn, rd);
|
||||
}
|
||||
void cpyfpwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b0100, rs, rn, rd);
|
||||
}
|
||||
void cpyfmwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b0100, rs, rn, rd);
|
||||
}
|
||||
void cpyfewn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b0100, rs, rn, rd);
|
||||
}
|
||||
void cpyfpwtwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b0101, rs, rn, rd);
|
||||
}
|
||||
void cpyfmwtwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b0101, rs, rn, rd);
|
||||
}
|
||||
void cpyfewtwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b0101, rs, rn, rd);
|
||||
}
|
||||
void cpyfprtwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b0110, rs, rn, rd);
|
||||
}
|
||||
void cpyfmrtwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b0110, rs, rn, rd);
|
||||
}
|
||||
void cpyfertwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b0110, rs, rn, rd);
|
||||
}
|
||||
void cpyfptwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b0111, rs, rn, rd);
|
||||
}
|
||||
void cpyfmtwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b0111, rs, rn, rd);
|
||||
}
|
||||
void cpyfetwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b0111, rs, rn, rd);
|
||||
}
|
||||
void cpyfprn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b1000, rs, rn, rd);
|
||||
}
|
||||
void cpyfmrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b1000, rs, rn, rd);
|
||||
}
|
||||
void cpyfern(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b1000, rs, rn, rd);
|
||||
}
|
||||
void cpyfpwtrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b1001, rs, rn, rd);
|
||||
}
|
||||
void cpyfmwtrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b1001, rs, rn, rd);
|
||||
}
|
||||
void cpyfewtrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b1001, rs, rn, rd);
|
||||
}
|
||||
void cpyfprtrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b1010, rs, rn, rd);
|
||||
}
|
||||
void cpyfmrtrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b1010, rs, rn, rd);
|
||||
}
|
||||
void cpyfertrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b1010, rs, rn, rd);
|
||||
}
|
||||
void cpyfptrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b1011, rs, rn, rd);
|
||||
}
|
||||
void cpyfmtrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b1011, rs, rn, rd);
|
||||
}
|
||||
void cpyfetrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b1011, rs, rn, rd);
|
||||
}
|
||||
void cpyfpn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b1100, rs, rn, rd);
|
||||
}
|
||||
void cpyfmn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b1100, rs, rn, rd);
|
||||
}
|
||||
void cpyfen(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b1100, rs, rn, rd);
|
||||
}
|
||||
void cpyfpwtn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b1101, rs, rn, rd);
|
||||
}
|
||||
void cpyfmwtn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b1101, rs, rn, rd);
|
||||
}
|
||||
void cpyfewtn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b1101, rs, rn, rd);
|
||||
}
|
||||
void cpyfprtn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b1110, rs, rn, rd);
|
||||
}
|
||||
void cpyfmrtn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b1110, rs, rn, rd);
|
||||
}
|
||||
void cpyfertn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b1110, rs, rn, rd);
|
||||
}
|
||||
void cpyfptn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b00, 0b1111, rs, rn, rd);
|
||||
}
|
||||
void cpyfmtn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b01, 0b1111, rs, rn, rd);
|
||||
}
|
||||
void cpyfetn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b10, 0b1111, rs, rn, rd);
|
||||
}
|
||||
|
||||
void setp(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b11, 0b0000, rs, rn, rd);
|
||||
}
|
||||
void setm(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b11, 0b0100, rs, rn, rd);
|
||||
}
|
||||
void sete(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b11, 0b1000, rs, rn, rd);
|
||||
}
|
||||
void setpt(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b11, 0b0001, rs, rn, rd);
|
||||
}
|
||||
void setmt(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b11, 0b0101, rs, rn, rd);
|
||||
}
|
||||
void setet(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b11, 0b1001, rs, rn, rd);
|
||||
}
|
||||
void setpn(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b11, 0b0010, rs, rn, rd);
|
||||
}
|
||||
void setmn(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b11, 0b0110, rs, rn, rd);
|
||||
}
|
||||
void seten(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b11, 0b1010, rs, rn, rd);
|
||||
}
|
||||
void setptn(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b11, 0b0011, rs, rn, rd);
|
||||
}
|
||||
void setmtn(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b11, 0b0111, rs, rn, rd);
|
||||
}
|
||||
void setetn(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 0, 0b11, 0b1011, rs, rn, rd);
|
||||
}
|
||||
|
||||
void cpyp(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b0000, rs, rn, rd);
|
||||
}
|
||||
void cpym(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b0000, rs, rn, rd);
|
||||
}
|
||||
void cpye(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b0000, rs, rn, rd);
|
||||
}
|
||||
void cpypwt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b0001, rs, rn, rd);
|
||||
}
|
||||
void cpymwt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b0001, rs, rn, rd);
|
||||
}
|
||||
void cpyewt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b0001, rs, rn, rd);
|
||||
}
|
||||
void cpyprt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b0010, rs, rn, rd);
|
||||
}
|
||||
void cpymrt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b0010, rs, rn, rd);
|
||||
}
|
||||
void cpyert(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b0010, rs, rn, rd);
|
||||
}
|
||||
void cpypt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b0011, rs, rn, rd);
|
||||
}
|
||||
void cpymt(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b0011, rs, rn, rd);
|
||||
}
|
||||
void cpyet(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b0011, rs, rn, rd);
|
||||
}
|
||||
void cpypwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b0100, rs, rn, rd);
|
||||
}
|
||||
void cpymwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b0100, rs, rn, rd);
|
||||
}
|
||||
void cpyewn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b0100, rs, rn, rd);
|
||||
}
|
||||
void cpypwtwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b0101, rs, rn, rd);
|
||||
}
|
||||
void cpymwtwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b0101, rs, rn, rd);
|
||||
}
|
||||
void cpyewtwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b0101, rs, rn, rd);
|
||||
}
|
||||
void cpyprtwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b0110, rs, rn, rd);
|
||||
}
|
||||
void cpymrtwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b0110, rs, rn, rd);
|
||||
}
|
||||
void cpyertwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b0110, rs, rn, rd);
|
||||
}
|
||||
void cpyptwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b0111, rs, rn, rd);
|
||||
}
|
||||
void cpymtwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b0111, rs, rn, rd);
|
||||
}
|
||||
void cpyetwn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b0111, rs, rn, rd);
|
||||
}
|
||||
void cpyprn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b1000, rs, rn, rd);
|
||||
}
|
||||
void cpymrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b1000, rs, rn, rd);
|
||||
}
|
||||
void cpyern(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b1000, rs, rn, rd);
|
||||
}
|
||||
void cpypwtrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b1001, rs, rn, rd);
|
||||
}
|
||||
void cpymwtrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b1001, rs, rn, rd);
|
||||
}
|
||||
void cpyewtrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b1001, rs, rn, rd);
|
||||
}
|
||||
void cpyprtrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b1010, rs, rn, rd);
|
||||
}
|
||||
void cpymrtrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b1010, rs, rn, rd);
|
||||
}
|
||||
void cpyertrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b1010, rs, rn, rd);
|
||||
}
|
||||
void cpyptrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b1011, rs, rn, rd);
|
||||
}
|
||||
void cpymtrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b1011, rs, rn, rd);
|
||||
}
|
||||
void cpyetrn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b1011, rs, rn, rd);
|
||||
}
|
||||
void cpypn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b1100, rs, rn, rd);
|
||||
}
|
||||
void cpymn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b1100, rs, rn, rd);
|
||||
}
|
||||
void cpyen(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b1100, rs, rn, rd);
|
||||
}
|
||||
void cpypwtn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b1101, rs, rn, rd);
|
||||
}
|
||||
void cpymwtn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b1101, rs, rn, rd);
|
||||
}
|
||||
void cpyewtn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b1101, rs, rn, rd);
|
||||
}
|
||||
void cpyprtn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b1110, rs, rn, rd);
|
||||
}
|
||||
void cpymrtn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b1110, rs, rn, rd);
|
||||
}
|
||||
void cpyertn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b1110, rs, rn, rd);
|
||||
}
|
||||
void cpyptn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b00, 0b1111, rs, rn, rd);
|
||||
}
|
||||
void cpymtn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b01, 0b1111, rs, rn, rd);
|
||||
}
|
||||
void cpyetn(Register rd, Register rs, Register rn) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b10, 0b1111, rs, rn, rd);
|
||||
}
|
||||
|
||||
void setgp(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b11, 0b0000, rs, rn, rd);
|
||||
}
|
||||
void setgm(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b11, 0b0100, rs, rn, rd);
|
||||
}
|
||||
void setge(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b11, 0b1000, rs, rn, rd);
|
||||
}
|
||||
void setgpt(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b11, 0b0001, rs, rn, rd);
|
||||
}
|
||||
void setgmt(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b11, 0b0101, rs, rn, rd);
|
||||
}
|
||||
void setget(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b11, 0b1001, rs, rn, rd);
|
||||
}
|
||||
void setgpn(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b11, 0b0010, rs, rn, rd);
|
||||
}
|
||||
void setgmn(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b11, 0b0110, rs, rn, rd);
|
||||
}
|
||||
void setgen(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b11, 0b1010, rs, rn, rd);
|
||||
}
|
||||
void setgptn(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b11, 0b0011, rs, rn, rd);
|
||||
}
|
||||
void setgmtn(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b11, 0b0111, rs, rn, rd);
|
||||
}
|
||||
void setgetn(Register rd, Register rn, Register rs) {
|
||||
MemoryCopyAndMemorySet(0, 1, 0b11, 0b1011, rs, rn, rd);
|
||||
}
|
||||
|
||||
// Loadstore no-allocate pair
|
||||
void stnp(ARMEmitter::WRegister rt, ARMEmitter::WRegister rt2, ARMEmitter::Register rn, int32_t Imm) {
|
||||
LOGMAN_THROW_A_FMT(Imm >= -256 && Imm <= 252 && ((Imm & 0b11) == 0), "Unscaled offset too large");
|
||||
@@ -3811,7 +4178,12 @@ public:
|
||||
}
|
||||
|
||||
// Loadstore PAC
|
||||
// TODO
|
||||
void ldraa(XRegister rt, XRegister rn, IndexType type, int32_t offset = 0) {
|
||||
LoadStorePAC(0b11, 0, 0, offset, type, rn, rt);
|
||||
}
|
||||
void ldrab(XRegister rt, XRegister rn, IndexType type, int32_t offset = 0) {
|
||||
LoadStorePAC(0b11, 0, 1, offset, type, rn, rt);
|
||||
}
|
||||
|
||||
// Loadstore unsigned immediate
|
||||
// Maximum values of unsigned immediate offsets for particular data sizes.
|
||||
@@ -3960,6 +4332,20 @@ private:
|
||||
dc32(Instr);
|
||||
}
|
||||
|
||||
void MemoryCopyAndMemorySet(uint32_t sz, uint32_t o0, uint32_t op1, uint32_t op2, Register rs, Register rn, Register rd) {
|
||||
uint32_t Instr = 0b0001'1001'0000'0000'0000'0100'0000'0000;
|
||||
|
||||
Instr |= sz << 30;
|
||||
Instr |= o0 << 26;
|
||||
Instr |= op1 << 22;
|
||||
Instr |= rs.Idx() << 16;
|
||||
Instr |= op2 << 12;
|
||||
Instr |= rn.Idx() << 5;
|
||||
Instr |= rd.Idx();
|
||||
|
||||
dc32(Instr);
|
||||
}
|
||||
|
||||
// Loadstore no-allocate pair
|
||||
template<typename T>
|
||||
void LoadStoreNoAllocate(uint32_t Op, T rt, T rt2, ARMEmitter::Register rn, uint32_t Imm) {
|
||||
@@ -4026,6 +4412,30 @@ private:
|
||||
dc32(Instr);
|
||||
}
|
||||
|
||||
void LoadStorePAC(uint32_t size, uint32_t VR, uint32_t M, int32_t imm, IndexType type, Register rn, Register rt) {
|
||||
LOGMAN_THROW_A_FMT((imm % 8) == 0, "Immediate ({}) must be divisible by 8", imm);
|
||||
LOGMAN_THROW_A_FMT(imm >= -4096 && imm <= 4088, "Immediate ({}) must be within [-4096, 4088]", imm);
|
||||
LOGMAN_THROW_A_FMT(type == IndexType::OFFSET || type == IndexType::PRE, "PAC may only use offset or pre-indexed values");
|
||||
|
||||
// The immediate is scaled down in order to fit within the available 10 immediate bits.
|
||||
const auto scaled_imm = static_cast<uint32_t>(imm / 8);
|
||||
const auto imm9 = scaled_imm & 0b1'1111'1111;
|
||||
const auto S = (scaled_imm >> 9) & 1;
|
||||
|
||||
const auto W = type == IndexType::OFFSET ? 0U : 1U;
|
||||
|
||||
uint32_t Instr = 0b0011'1000'0010'0000'0000'0100'0000'0000;
|
||||
Instr |= size << 30;
|
||||
Instr |= VR << 26;
|
||||
Instr |= M << 23;
|
||||
Instr |= S << 22;
|
||||
Instr |= imm9 << 12;
|
||||
Instr |= W << 11;
|
||||
Instr |= rn.Idx() << 5;
|
||||
Instr |= rt.Idx();
|
||||
dc32(Instr);
|
||||
}
|
||||
|
||||
// Loadstore unsigned immediate
|
||||
template<typename T>
|
||||
void LoadStoreUnsigned(uint32_t size, uint32_t V, uint32_t opc, T rt, Register rn, uint32_t Imm) {
|
||||
|
||||
@@ -30,9 +30,9 @@ public:
|
||||
private:
|
||||
uint32_t Index;
|
||||
};
|
||||
static_assert(sizeof(Register) == sizeof(uint32_t), "Needs to be uint32_t");
|
||||
static_assert(std::is_trivial_v<Register>, "Needs to be trivial");
|
||||
static_assert(std::is_standard_layout_v<Register>, "Needs to be standard");
|
||||
static_assert(sizeof(Register) == sizeof(uint32_t));
|
||||
static_assert(std::is_trivially_copyable_v<Register>);
|
||||
static_assert(std::is_standard_layout_v<Register>);
|
||||
|
||||
/* 32-bit GPR register class.
|
||||
* This class will imply a 32-bit register size being used.
|
||||
@@ -58,9 +58,9 @@ public:
|
||||
private:
|
||||
uint32_t Index;
|
||||
};
|
||||
static_assert(sizeof(Register) == sizeof(uint32_t), "Needs to be uint32_t");
|
||||
static_assert(std::is_trivial_v<Register>, "Needs to be trivial");
|
||||
static_assert(std::is_standard_layout_v<Register>, "Needs to be standard");
|
||||
static_assert(sizeof(WRegister) == sizeof(uint32_t));
|
||||
static_assert(std::is_trivially_copyable_v<WRegister>);
|
||||
static_assert(std::is_standard_layout_v<WRegister>);
|
||||
|
||||
/* 64-bit GPR register class.
|
||||
* This class will imply a 64-bit register size being used.
|
||||
@@ -86,9 +86,9 @@ public:
|
||||
private:
|
||||
uint32_t Index;
|
||||
};
|
||||
static_assert(sizeof(Register) == sizeof(uint32_t), "Needs to be uint32_t");
|
||||
static_assert(std::is_trivial_v<Register>, "Needs to be trivial");
|
||||
static_assert(std::is_standard_layout_v<Register>, "Needs to be standard");
|
||||
static_assert(sizeof(XRegister) == sizeof(uint32_t));
|
||||
static_assert(std::is_trivially_copyable_v<XRegister>);
|
||||
static_assert(std::is_standard_layout_v<XRegister>);
|
||||
|
||||
inline constexpr WRegister Register::W() const {
|
||||
return WRegister {Index};
|
||||
@@ -283,9 +283,9 @@ public:
|
||||
private:
|
||||
uint32_t Index;
|
||||
};
|
||||
static_assert(sizeof(VRegister) == sizeof(uint32_t), "Needs to be uint32_t");
|
||||
static_assert(std::is_trivial_v<VRegister>, "Needs to be trivial");
|
||||
static_assert(std::is_standard_layout_v<VRegister>, "Needs to be standard");
|
||||
static_assert(sizeof(VRegister) == sizeof(uint32_t));
|
||||
static_assert(std::is_trivially_copyable_v<VRegister>);
|
||||
static_assert(std::is_standard_layout_v<VRegister>);
|
||||
|
||||
/* 8-bit ASIMD register class
|
||||
* This class implies 8-bit scalar register.
|
||||
@@ -315,9 +315,9 @@ public:
|
||||
private:
|
||||
uint32_t Index;
|
||||
};
|
||||
static_assert(sizeof(BRegister) == sizeof(uint32_t), "Needs to be uint32_t");
|
||||
static_assert(std::is_trivial_v<BRegister>, "Needs to be trivial");
|
||||
static_assert(std::is_standard_layout_v<BRegister>, "Needs to be standard");
|
||||
static_assert(sizeof(BRegister) == sizeof(uint32_t));
|
||||
static_assert(std::is_trivially_copyable_v<BRegister>);
|
||||
static_assert(std::is_standard_layout_v<BRegister>);
|
||||
|
||||
/* 16-bit ASIMD register class
|
||||
* This class implies 16-bit scalar register.
|
||||
@@ -347,9 +347,9 @@ public:
|
||||
private:
|
||||
uint32_t Index;
|
||||
};
|
||||
static_assert(sizeof(HRegister) == sizeof(uint32_t), "Needs to be uint32_t");
|
||||
static_assert(std::is_trivial_v<HRegister>, "Needs to be trivial");
|
||||
static_assert(std::is_standard_layout_v<HRegister>, "Needs to be standard");
|
||||
static_assert(sizeof(HRegister) == sizeof(uint32_t));
|
||||
static_assert(std::is_trivially_copyable_v<HRegister>);
|
||||
static_assert(std::is_standard_layout_v<HRegister>);
|
||||
|
||||
/* 32-bit ASIMD register class
|
||||
* This class implies 32-bit scalar register.
|
||||
@@ -379,9 +379,9 @@ public:
|
||||
private:
|
||||
uint32_t Index;
|
||||
};
|
||||
static_assert(sizeof(SRegister) == sizeof(uint32_t), "Needs to be uint32_t");
|
||||
static_assert(std::is_trivial_v<SRegister>, "Needs to be trivial");
|
||||
static_assert(std::is_standard_layout_v<SRegister>, "Needs to be standard");
|
||||
static_assert(sizeof(SRegister) == sizeof(uint32_t));
|
||||
static_assert(std::is_trivially_copyable_v<SRegister>);
|
||||
static_assert(std::is_standard_layout_v<SRegister>);
|
||||
|
||||
/* 64-bit ASIMD register class
|
||||
* This class doesn't imply Vector or Scalar.
|
||||
@@ -412,9 +412,9 @@ public:
|
||||
private:
|
||||
uint32_t Index;
|
||||
};
|
||||
static_assert(sizeof(DRegister) == sizeof(uint32_t), "Needs to be uint32_t");
|
||||
static_assert(std::is_trivial_v<DRegister>, "Needs to be trivial");
|
||||
static_assert(std::is_standard_layout_v<DRegister>, "Needs to be standard");
|
||||
static_assert(sizeof(DRegister) == sizeof(uint32_t));
|
||||
static_assert(std::is_trivially_copyable_v<DRegister>);
|
||||
static_assert(std::is_standard_layout_v<DRegister>);
|
||||
|
||||
/* 128-bit ASIMD register class
|
||||
* This class doesn't imply Vector or Scalar.
|
||||
@@ -445,9 +445,9 @@ public:
|
||||
private:
|
||||
uint32_t Index;
|
||||
};
|
||||
static_assert(sizeof(QRegister) == sizeof(uint32_t), "Needs to be uint32_t");
|
||||
static_assert(std::is_trivial_v<QRegister>, "Needs to be trivial");
|
||||
static_assert(std::is_standard_layout_v<QRegister>, "Needs to be standard");
|
||||
static_assert(sizeof(QRegister) == sizeof(uint32_t));
|
||||
static_assert(std::is_trivially_copyable_v<QRegister>);
|
||||
static_assert(std::is_standard_layout_v<QRegister>);
|
||||
|
||||
/* Unsized SVE register class.
|
||||
* This class explicitly implies the instruction will operate using SVE.
|
||||
@@ -474,9 +474,9 @@ public:
|
||||
private:
|
||||
uint32_t Index;
|
||||
};
|
||||
static_assert(sizeof(ZRegister) == sizeof(uint32_t), "Needs to be uint32_t");
|
||||
static_assert(std::is_trivial_v<ZRegister>, "Needs to be trivial");
|
||||
static_assert(std::is_standard_layout_v<ZRegister>, "Needs to be standard");
|
||||
static_assert(sizeof(ZRegister) == sizeof(uint32_t));
|
||||
static_assert(std::is_trivially_copyable_v<ZRegister>);
|
||||
static_assert(std::is_standard_layout_v<ZRegister>);
|
||||
|
||||
// VRegister
|
||||
inline constexpr BRegister VRegister::B() const {
|
||||
@@ -919,9 +919,9 @@ public:
|
||||
private:
|
||||
uint32_t Index;
|
||||
};
|
||||
static_assert(sizeof(PRegister) == sizeof(uint32_t), "Needs to be uint32_t");
|
||||
static_assert(std::is_trivial_v<PRegister>, "Needs to be trivial");
|
||||
static_assert(std::is_standard_layout_v<PRegister>, "Needs to be standard");
|
||||
static_assert(sizeof(PRegister) == sizeof(uint32_t));
|
||||
static_assert(std::is_trivially_copyable_v<PRegister>);
|
||||
static_assert(std::is_standard_layout_v<PRegister>);
|
||||
|
||||
// Unsized predicate register for SVE with zeroing semantics.
|
||||
class PRegisterZero {
|
||||
@@ -947,9 +947,9 @@ public:
|
||||
private:
|
||||
uint32_t Index;
|
||||
};
|
||||
static_assert(sizeof(PRegisterZero) == sizeof(uint32_t), "Needs to be uint32_t");
|
||||
static_assert(std::is_trivial_v<PRegisterZero>, "Needs to be trivial");
|
||||
static_assert(std::is_standard_layout_v<PRegisterZero>, "Needs to be standard");
|
||||
static_assert(sizeof(PRegisterZero) == sizeof(uint32_t));
|
||||
static_assert(std::is_trivially_copyable_v<PRegisterZero>);
|
||||
static_assert(std::is_standard_layout_v<PRegisterZero>);
|
||||
|
||||
// Unsized predicate register for SVE with merging semantics.
|
||||
class PRegisterMerge {
|
||||
@@ -975,9 +975,9 @@ public:
|
||||
private:
|
||||
uint32_t Index;
|
||||
};
|
||||
static_assert(sizeof(PRegisterZero) == sizeof(uint32_t), "Needs to be uint32_t");
|
||||
static_assert(std::is_trivial_v<PRegisterZero>, "Needs to be trivial");
|
||||
static_assert(std::is_standard_layout_v<PRegisterZero>, "Needs to be standard");
|
||||
static_assert(sizeof(PRegisterMerge) == sizeof(uint32_t));
|
||||
static_assert(std::is_trivially_copyable_v<PRegisterMerge>);
|
||||
static_assert(std::is_standard_layout_v<PRegisterMerge>);
|
||||
|
||||
// PRegister
|
||||
inline constexpr PRegisterZero PRegister::Zeroing() const {
|
||||
|
||||
@@ -2134,11 +2134,31 @@ public:
|
||||
|
||||
// SVE2 Crypto Extensions
|
||||
// SVE2 crypto unary operations
|
||||
// XXX:
|
||||
void aesimc(ZRegister zdn, ZRegister zn) {
|
||||
SVE2CryptoUnaryOperation(1, zdn, zn);
|
||||
}
|
||||
void aesmc(ZRegister zdn, ZRegister zn) {
|
||||
SVE2CryptoUnaryOperation(0, zdn, zn);
|
||||
}
|
||||
|
||||
// SVE2 crypto destructive binary operations
|
||||
// XXX:
|
||||
void aese(ZRegister zdn, ZRegister zn, ZRegister zm) {
|
||||
SVE2CryptoDestructiveBinaryOperation(0, 0, zdn, zn, zm);
|
||||
}
|
||||
void aesd(ZRegister zdn, ZRegister zn, ZRegister zm) {
|
||||
SVE2CryptoDestructiveBinaryOperation(0, 1, zdn, zn, zm);
|
||||
}
|
||||
void sm4e(ZRegister zdn, ZRegister zn, ZRegister zm) {
|
||||
SVE2CryptoDestructiveBinaryOperation(1, 0, zdn, zn, zm);
|
||||
}
|
||||
|
||||
// SVE2 crypto constructive binary operations
|
||||
// XXX:
|
||||
void sm4ekey(ZRegister zd, ZRegister zn, ZRegister zm) {
|
||||
SVE2CryptoConstructiveBinaryOperation(0, zd, zn, zm);
|
||||
}
|
||||
void rax1(ZRegister zd, ZRegister zn, ZRegister zm) {
|
||||
SVE2CryptoConstructiveBinaryOperation(1, zd, zn, zm);
|
||||
}
|
||||
|
||||
// SVE Floating Point Widening Multiply-Add - Indexed
|
||||
// SVE BFloat16 floating-point dot product (indexed)
|
||||
@@ -2379,13 +2399,13 @@ public:
|
||||
} else if (srcsize == SubRegSize::i32Bit) {
|
||||
// Srcsize = fp32, opc1 encodes dst size
|
||||
LOGMAN_THROW_A_FMT(dstsize != SubRegSize::i16Bit, "Unsupported size in {}", __func__);
|
||||
opc1 = dstsize == SubRegSize::i64Bit ? 0b11 : 0b10;
|
||||
opc2 = 0b10;
|
||||
opc1 = dstsize == SubRegSize::i64Bit ? 0b11 : dstsize == SubRegSize::i32Bit ? 0b10 : 0b00;
|
||||
} else if (srcsize == SubRegSize::i64Bit) {
|
||||
LOGMAN_THROW_A_FMT(dstsize != SubRegSize::i16Bit, "Unsupported size in {}", __func__);
|
||||
// SrcSize = fp64, opc2 encodes dst size
|
||||
opc1 = 0b11;
|
||||
opc2 = dstsize == SubRegSize::i64Bit ? 0b11 : dstsize == SubRegSize::i32Bit ? 0b00 : 0b00;
|
||||
opc2 = dstsize == SubRegSize::i64Bit ? 0b11 : 0b00;
|
||||
} else {
|
||||
FEX_UNREACHABLE;
|
||||
}
|
||||
@@ -2400,13 +2420,13 @@ public:
|
||||
} else if (srcsize == SubRegSize::i32Bit) {
|
||||
// Srcsize = fp32, opc1 encodes dst size
|
||||
LOGMAN_THROW_A_FMT(dstsize != SubRegSize::i16Bit, "Unsupported size in {}", __func__);
|
||||
opc1 = dstsize == SubRegSize::i64Bit ? 0b11 : 0b10;
|
||||
opc2 = 0b10;
|
||||
opc1 = dstsize == SubRegSize::i64Bit ? 0b11 : dstsize == SubRegSize::i32Bit ? 0b10 : 0b00;
|
||||
} else if (srcsize == SubRegSize::i64Bit) {
|
||||
LOGMAN_THROW_A_FMT(dstsize != SubRegSize::i16Bit, "Unsupported size in {}", __func__);
|
||||
// SrcSize = fp64, opc2 encodes dst size
|
||||
opc1 = 0b11;
|
||||
opc2 = dstsize == SubRegSize::i64Bit ? 0b11 : dstsize == SubRegSize::i32Bit ? 0b00 : 0b00;
|
||||
opc2 = dstsize == SubRegSize::i64Bit ? 0b11 : 0b00;
|
||||
} else {
|
||||
FEX_UNREACHABLE;
|
||||
}
|
||||
@@ -3892,6 +3912,35 @@ private:
|
||||
dc32(Instr);
|
||||
}
|
||||
|
||||
void SVE2CryptoUnaryOperation(uint32_t op, ZRegister zdn, ZRegister zn) {
|
||||
LOGMAN_THROW_A_FMT(zdn == zn, "zdn and zn must be the same register");
|
||||
|
||||
uint32_t Instr = 0b0100'0101'0010'0000'1110'0000'0000'0000;
|
||||
Instr |= op << 10;
|
||||
Instr |= zdn.Idx();
|
||||
dc32(Instr);
|
||||
}
|
||||
|
||||
void SVE2CryptoDestructiveBinaryOperation(uint32_t op, uint32_t o2, ZRegister zdn, ZRegister zn, ZRegister zm) {
|
||||
LOGMAN_THROW_A_FMT(zdn == zn, "zdn and zn must be the same register");
|
||||
|
||||
uint32_t Instr = 0b0100'0101'0010'0010'1110'0000'0000'0000;
|
||||
Instr |= op << 16;
|
||||
Instr |= o2 << 10;
|
||||
Instr |= zm.Idx() << 5;
|
||||
Instr |= zdn.Idx();
|
||||
dc32(Instr);
|
||||
}
|
||||
|
||||
void SVE2CryptoConstructiveBinaryOperation(uint32_t op, ZRegister zd, ZRegister zn, ZRegister zm) {
|
||||
uint32_t Instr = 0b0100'0101'0010'0000'1111'0000'0000'0000;
|
||||
Instr |= zm.Idx() << 16;
|
||||
Instr |= op << 10;
|
||||
Instr |= zn.Idx() << 5;
|
||||
Instr |= zd.Idx();
|
||||
dc32(Instr);
|
||||
}
|
||||
|
||||
void SVE2BitwisePermute(SubRegSize size, uint32_t opc, ZRegister zd, ZRegister zn, ZRegister zm) {
|
||||
LOGMAN_THROW_A_FMT(size != SubRegSize::i128Bit, "Can't use 128-bit element size");
|
||||
|
||||
@@ -5029,7 +5078,7 @@ private:
|
||||
void SVE2IntegerMultiplyLong(uint32_t SUT, SubRegSize size, ZRegister zd, ZRegister zn, ZRegister zm) {
|
||||
// PMULLB and PMULLT support the use of 128-bit element sizes (with the SVE2PMULL128 extension)
|
||||
if (SUT == 0b010 || SUT == 0b011) {
|
||||
LOGMAN_THROW_A_FMT(size != SubRegSize::i8Bit, "Can't use 8-bit element size");
|
||||
LOGMAN_THROW_A_FMT(size != SubRegSize::i8Bit && size != SubRegSize::i32Bit, "Can't use 8-bit or 32-bit element size");
|
||||
|
||||
// 128-bit variant is encoded as if it were 8-bit (0b00)
|
||||
if (size == SubRegSize::i128Bit) {
|
||||
@@ -5051,7 +5100,7 @@ private:
|
||||
const uint32_t element_size = SubRegSizeInBits(size);
|
||||
|
||||
if (is_left_shift) {
|
||||
LOGMAN_THROW_A_FMT(shift >= 0 && shift < element_size, "Invalid left shift value ({}). Must be within [0, {}]", shift, element_size - 1);
|
||||
LOGMAN_THROW_A_FMT(shift < element_size, "Invalid left shift value ({}). Must be within [0, {}]", shift, element_size - 1);
|
||||
} else {
|
||||
LOGMAN_THROW_A_FMT(shift > 0 && shift <= element_size, "Invalid right shift value ({}). Must be within [1, {}]", shift, element_size);
|
||||
}
|
||||
|
||||
@@ -137,7 +137,15 @@ public:
|
||||
}
|
||||
|
||||
// Advanced SIMD scalar three same extra
|
||||
// XXX:
|
||||
void sqrdmlah(ScalarRegSize size, VRegister rd, VRegister rn, VRegister rm) {
|
||||
LOGMAN_THROW_A_FMT(size == ScalarRegSize::i16Bit || size == ScalarRegSize::i32Bit, "Only supports 16/32-bit");
|
||||
ASIMDScalarThreeSameExtra(1, size, 0b0000, rm, rn, rd);
|
||||
}
|
||||
void sqrdmlsh(ScalarRegSize size, VRegister rd, VRegister rn, VRegister rm) {
|
||||
LOGMAN_THROW_A_FMT(size == ScalarRegSize::i16Bit || size == ScalarRegSize::i32Bit, "Only supports 16/32-bit");
|
||||
ASIMDScalarThreeSameExtra(1, size, 0b0001, rm, rn, rd);
|
||||
}
|
||||
|
||||
// Advanced SIMD scalar two-register miscellaneous
|
||||
void suqadd(ScalarRegSize size, VRegister rd, VRegister rn) {
|
||||
ASIMDScalar2RegMisc(0, 0, size, 0b00011, rd, rn);
|
||||
@@ -744,10 +752,51 @@ public:
|
||||
const uint32_t immb = InvertedShift & 0b111;
|
||||
ASIMDScalarShiftByImm(1, immh, immb, 0b10011, rd, rn);
|
||||
}
|
||||
|
||||
// TODO: UCVTF, FCVTZU
|
||||
|
||||
// Advanced SIMD scalar x indexed element
|
||||
// XXX:
|
||||
//
|
||||
void sqdmlal(ScalarRegSize size, VRegister rd, VRegister rn, VRegister rm, uint32_t index) {
|
||||
LOGMAN_THROW_A_FMT(size != ScalarRegSize::i64Bit, "Scalar size must not be 64-bit");
|
||||
ASIMDScalarXIndexedElement(0, size, 0b0011, rm, rn, rd, index);
|
||||
}
|
||||
void sqdmlsl(ScalarRegSize size, VRegister rd, VRegister rn, VRegister rm, uint32_t index) {
|
||||
LOGMAN_THROW_A_FMT(size != ScalarRegSize::i64Bit, "Scalar size must not be 64-bit");
|
||||
ASIMDScalarXIndexedElement(0, size, 0b0111, rm, rn, rd, index);
|
||||
}
|
||||
void sqdmull(ScalarRegSize size, VRegister rd, VRegister rn, VRegister rm, uint32_t index) {
|
||||
LOGMAN_THROW_A_FMT(size != ScalarRegSize::i64Bit, "Scalar size must not be 64-bit");
|
||||
ASIMDScalarXIndexedElement(0, size, 0b1011, rm, rn, rd, index);
|
||||
}
|
||||
void sqdmulh(ScalarRegSize size, VRegister rd, VRegister rn, VRegister rm, uint32_t index) {
|
||||
LOGMAN_THROW_A_FMT(size != ScalarRegSize::i64Bit, "Scalar size must not be 64-bit");
|
||||
ASIMDScalarXIndexedElement(0, size, 0b1100, rm, rn, rd, index);
|
||||
}
|
||||
void sqrdmulh(ScalarRegSize size, VRegister rd, VRegister rn, VRegister rm, uint32_t index) {
|
||||
LOGMAN_THROW_A_FMT(size != ScalarRegSize::i64Bit, "Scalar size must not be 64-bit");
|
||||
ASIMDScalarXIndexedElement(0, size, 0b1101, rm, rn, rd, index);
|
||||
}
|
||||
void fmla(ScalarRegSize size, VRegister rd, VRegister rn, VRegister rm, uint32_t index) {
|
||||
ASIMDScalarXIndexedElement(0, size, 0b0001, rm, rn, rd, index);
|
||||
}
|
||||
void fmls(ScalarRegSize size, VRegister rd, VRegister rn, VRegister rm, uint32_t index) {
|
||||
ASIMDScalarXIndexedElement(0, size, 0b0101, rm, rn, rd, index);
|
||||
}
|
||||
void fmul(ScalarRegSize size, VRegister rd, VRegister rn, VRegister rm, uint32_t index) {
|
||||
ASIMDScalarXIndexedElement(0, size, 0b1001, rm, rn, rd, index);
|
||||
}
|
||||
void sqrdmlah(ScalarRegSize size, VRegister rd, VRegister rn, VRegister rm, uint32_t index) {
|
||||
LOGMAN_THROW_A_FMT(size != ScalarRegSize::i64Bit, "Scalar size must not be 64-bit");
|
||||
ASIMDScalarXIndexedElement(1, size, 0b1101, rm, rn, rd, index);
|
||||
}
|
||||
void sqrdmlsh(ScalarRegSize size, VRegister rd, VRegister rn, VRegister rm, uint32_t index) {
|
||||
LOGMAN_THROW_A_FMT(size != ScalarRegSize::i64Bit, "Scalar size must not be 64-bit");
|
||||
ASIMDScalarXIndexedElement(1, size, 0b1111, rm, rn, rd, index);
|
||||
}
|
||||
void fmulx(ScalarRegSize size, VRegister rd, VRegister rn, VRegister rm, uint32_t index) {
|
||||
ASIMDScalarXIndexedElement(1, size, 0b1001, rm, rn, rd, index);
|
||||
}
|
||||
|
||||
// Floating-point data-processing (1 source)
|
||||
void fmov(ScalarRegSize size, VRegister rd, VRegister rn) {
|
||||
Float1Source(size, 0, 0, 0b000000, rd, rn);
|
||||
@@ -1269,7 +1318,17 @@ private:
|
||||
}
|
||||
|
||||
// Advanced SIMD scalar three same extra
|
||||
// XXX:
|
||||
void ASIMDScalarThreeSameExtra(uint32_t U, ScalarRegSize size, uint32_t opcode, VRegister rm, VRegister rn, VRegister rd) {
|
||||
uint32_t Instr = 0b0101'1110'0000'0000'1000'0100'0000'0000;
|
||||
Instr |= U << 29;
|
||||
Instr |= FEXCore::ToUnderlying(size) << 22;
|
||||
Instr |= rm.Idx() << 16;
|
||||
Instr |= opcode << 11;
|
||||
Instr |= rn.Idx() << 5;
|
||||
Instr |= rd.Idx();
|
||||
dc32(Instr);
|
||||
}
|
||||
|
||||
// Advanced SIMD scalar two-register miscellaneous
|
||||
void ASIMDScalar2RegMisc(uint32_t b20, uint32_t U, ScalarRegSize size, uint32_t opcode, VRegister rd, VRegister rn) {
|
||||
uint32_t Instr = 0b0101'1110'0010'0000'0000'1000'0000'0000;
|
||||
@@ -1283,8 +1342,6 @@ private:
|
||||
dc32(Instr);
|
||||
}
|
||||
|
||||
// Advanced SIMD scalar pairwise
|
||||
// XXX:
|
||||
// Advanced SIMD scalar three different
|
||||
void ASIMD3RegDifferent(uint32_t U, ScalarRegSize size, uint32_t opcode, VRegister rd, VRegister rn, VRegister rm) {
|
||||
uint32_t Instr = 0b0101'1110'0010'0000'0000'0000'0000'0000;
|
||||
@@ -1321,8 +1378,50 @@ private:
|
||||
Instr |= Encode_rd(rd);
|
||||
dc32(Instr);
|
||||
}
|
||||
|
||||
// Advanced SIMD scalar x indexed element
|
||||
// XXX:
|
||||
void ASIMDScalarXIndexedElement(uint32_t U, ScalarRegSize size, uint32_t opcode, VRegister rm, VRegister rn, VRegister rd, uint32_t index) {
|
||||
LOGMAN_THROW_A_FMT(size != ScalarRegSize::i8Bit, "Scalar size must not be 8-bit");
|
||||
|
||||
[[maybe_unused]] const auto invalid_bound = 16U >> FEXCore::ToUnderlying(size);
|
||||
LOGMAN_THROW_A_FMT(index < invalid_bound, "Index ({}) must be within [0-{}]", index, invalid_bound - 1);
|
||||
|
||||
uint32_t Instr = 0b0101'1111'0000'0000'0000'0000'0000'0000;
|
||||
|
||||
// FMUL/FMLA/FMLS indexed variants deal with size differently.
|
||||
if (opcode == 0b0001 || opcode == 0b0101 || opcode == 0b1001) {
|
||||
// Unlike other instructions in the group, 16-bit is encoded as zero
|
||||
// and 32/64-bit are encoded with the top bit always set to one.
|
||||
if (size != ScalarRegSize::i16Bit) {
|
||||
Instr |= (0b10 | (FEXCore::ToUnderlying(size) & 1)) << 22;
|
||||
}
|
||||
} else {
|
||||
Instr |= FEXCore::ToUnderlying(size) << 22;
|
||||
}
|
||||
|
||||
uint32_t H = 0;
|
||||
uint32_t LM = 0;
|
||||
if (size == ScalarRegSize::i16Bit) {
|
||||
LOGMAN_THROW_A_FMT(rm <= VReg::v15, "rm ({}) must be within [v0-v15]", rm.Idx());
|
||||
H = (index >> 2) & 1;
|
||||
LM = index & 0b11;
|
||||
} else if (size == ScalarRegSize::i32Bit) {
|
||||
H = (index >> 1) & 1;
|
||||
LM = (index & 0b01) << 1;
|
||||
} else {
|
||||
H = index & 1;
|
||||
}
|
||||
|
||||
Instr |= U << 29;
|
||||
Instr |= LM << 20;
|
||||
Instr |= rm.Idx() << 16;
|
||||
Instr |= opcode << 12;
|
||||
Instr |= H << 11;
|
||||
Instr |= rn.Idx() << 5;
|
||||
Instr |= rd.Idx();
|
||||
dc32(Instr);
|
||||
}
|
||||
|
||||
// Floating-point data-processing (1 source)
|
||||
void Float1Source(uint32_t M, uint32_t S, uint32_t ptype, uint32_t opcode, VRegister rd, VRegister rn) {
|
||||
uint32_t Instr = 0b0001'1110'0010'0000'0100'0000'0000'0000;
|
||||
|
||||
@@ -13,6 +13,12 @@ struct EmitterOps : Emitter {
|
||||
#endif
|
||||
|
||||
public:
|
||||
// Reserved
|
||||
void udf(uint32_t Imm) {
|
||||
LOGMAN_THROW_A_FMT(Imm < 0x1'0000, "Immediate needs to be 16-bit");
|
||||
dc32(Imm);
|
||||
}
|
||||
|
||||
// System with result
|
||||
// TODO: SYSL
|
||||
// System Instruction
|
||||
|
||||
+1
-136
@@ -9,25 +9,6 @@
|
||||
"@PREFIX_LIB@/libGL.so.1.7.0"
|
||||
]
|
||||
},
|
||||
"GLESv2": {
|
||||
"Library": "libGLESv2-guest.so",
|
||||
"Depends": [
|
||||
"X11"
|
||||
],
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libGLESv2.so",
|
||||
"@PREFIX_LIB@/libGLESv2.so.2",
|
||||
"@PREFIX_LIB@/libGLESv2.so.2.0.0"
|
||||
]
|
||||
},
|
||||
"X11": {
|
||||
"Library": "libX11-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libX11.so",
|
||||
"@PREFIX_LIB@/libX11.so.6",
|
||||
"@PREFIX_LIB@/libX11.so.6.4.0"
|
||||
]
|
||||
},
|
||||
"Vulkan": {
|
||||
"Library": "libvulkan-guest.so",
|
||||
"Overlay": [
|
||||
@@ -36,89 +17,6 @@
|
||||
"@HOME@/.local/share/Steam/ubuntu12_32/steam-runtime/pinned_libs_64/libvulkan.so.1"
|
||||
]
|
||||
},
|
||||
"xcb": {
|
||||
"Depends": [
|
||||
"X11"
|
||||
],
|
||||
"Library": "libxcb-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libxcb.so",
|
||||
"@PREFIX_LIB@/libxcb.so.1",
|
||||
"@PREFIX_LIB@/libxcb.so.1.1.0"
|
||||
]
|
||||
},
|
||||
"xcb-dri2": {
|
||||
"Library": "libxcb-dri2-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libxcb-dri2.so",
|
||||
"@PREFIX_LIB@/libxcb-dri2.so.0",
|
||||
"@PREFIX_LIB@/libxcb-dri2.so.0.0.0"
|
||||
]
|
||||
},
|
||||
"xcb-dri3": {
|
||||
"Library": "libxcb-dri3-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libxcb-dri3.so",
|
||||
"@PREFIX_LIB@/libxcb-dri3.so.0",
|
||||
"@PREFIX_LIB@/libxcb-dri3.so.0.0.0"
|
||||
]
|
||||
},
|
||||
"xcb-xfixes": {
|
||||
"Library": "libxcb-xfixes-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libxcb-xfixes.so",
|
||||
"@PREFIX_LIB@/libxcb-xfixes.so.0",
|
||||
"@PREFIX_LIB@/libxcb-xfixes.so.0.0.0"
|
||||
]
|
||||
},
|
||||
"xcb-shm": {
|
||||
"Library": "libxcb-shm-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libxcb-shm.so",
|
||||
"@PREFIX_LIB@/libxcb-shm.so.0",
|
||||
"@PREFIX_LIB@/libxcb-shm.so.0.0.0"
|
||||
]
|
||||
},
|
||||
"xcb-sync": {
|
||||
"Library": "libxcb-sync-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libxcb-sync.so",
|
||||
"@PREFIX_LIB@/libxcb-sync.so.1",
|
||||
"@PREFIX_LIB@/libxcb-sync.so.1.0.0"
|
||||
]
|
||||
},
|
||||
"xcb-randr": {
|
||||
"Library": "libxcb-randr-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libxcb-randr.so",
|
||||
"@PREFIX_LIB@/libxcb-randr.so.0",
|
||||
"@PREFIX_LIB@/libxcb-randr.so.0.1.0"
|
||||
]
|
||||
},
|
||||
"xcb-present": {
|
||||
"Library": "libxcb-present-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libxcb-present.so",
|
||||
"@PREFIX_LIB@/libxcb-present.so.0",
|
||||
"@PREFIX_LIB@/libxcb-present.so.0.0.0"
|
||||
]
|
||||
},
|
||||
"xcb-glx": {
|
||||
"Library": "libxcb-glx-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libxcb-glx.so",
|
||||
"@PREFIX_LIB@/libxcb-glx.so.0",
|
||||
"@PREFIX_LIB@/libxcb-glx.so.0.0.0"
|
||||
]
|
||||
},
|
||||
"xshmfence": {
|
||||
"Library": "libxshmfence-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libxshmfence.so",
|
||||
"@PREFIX_LIB@/libxshmfence.so.1",
|
||||
"@PREFIX_LIB@/libxshmfence.so.1.0.0"
|
||||
]
|
||||
},
|
||||
"drm": {
|
||||
"Library": "libdrm-guest.so",
|
||||
"Overlay": [
|
||||
@@ -141,38 +39,6 @@
|
||||
"@PREFIX_LIB@/libfex_thunk_test.so"
|
||||
]
|
||||
},
|
||||
"Xrender": {
|
||||
"Library": "libXrender-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libXrender.so",
|
||||
"@PREFIX_LIB@/libXrender.so.1",
|
||||
"@PREFIX_LIB@/libXrender.so.1.3.0"
|
||||
]
|
||||
},
|
||||
"Xext": {
|
||||
"Library": "libXext-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libXext.so",
|
||||
"@PREFIX_LIB@/libXext.so.6",
|
||||
"@PREFIX_LIB@/libXext.so.6.4.0"
|
||||
]
|
||||
},
|
||||
"Xfixes": {
|
||||
"Library": "libXfixes-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libXfixes.so",
|
||||
"@PREFIX_LIB@/libXfixes.so.3",
|
||||
"@PREFIX_LIB@/libXfixes.so.3.1.0"
|
||||
]
|
||||
},
|
||||
"OpenCL": {
|
||||
"Library" : "libOpenCL-guest.so",
|
||||
"Overlay": [
|
||||
"@PREFIX_LIB@/libOpenCL.so",
|
||||
"@PREFIX_LIB@/libOpenCL.so.1",
|
||||
"@PREFIX_LIB@/libOpenCL.so.1.0.0"
|
||||
]
|
||||
},
|
||||
"WaylandClient": {
|
||||
"Library" : "libwayland-client-guest.so",
|
||||
"Overlay": [
|
||||
@@ -180,7 +46,6 @@
|
||||
"@PREFIX_LIB@/libwayland-client.so.0",
|
||||
"@PREFIX_LIB@/libwayland-client.so.0.20.0"
|
||||
]
|
||||
},
|
||||
"":{}
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
-14
@@ -1,31 +1,31 @@
|
||||
# --- Stage 1: Builder ---
|
||||
FROM ubuntu:20.04 as builder
|
||||
FROM ubuntu:22.04 as builder
|
||||
|
||||
RUN DEBIAN_FRONTEND="noninteractive" apt-get update
|
||||
RUN DEBIAN_FRONTEND="noninteractive" apt install -y cmake \
|
||||
clang-10 llvm-10 nasm ninja-build pkg-config \
|
||||
clang-13 llvm-13 nasm ninja-build pkg-config \
|
||||
libcap-dev libglfw3-dev libepoxy-dev python3-dev libsdl2-dev \
|
||||
python3 linux-headers-generic \
|
||||
git
|
||||
python3 linux-headers-generic \
|
||||
git qtbase5-dev qtdeclarative5-dev lld
|
||||
|
||||
RUN git clone --recurse-submodules https://github.com/FEX-Emu/FEX.git
|
||||
WORKDIR /FEX
|
||||
RUN mkdir build
|
||||
|
||||
CMD [ "mkdir /opt/FEX/build" ]
|
||||
|
||||
WORKDIR /opt/FEX/build
|
||||
|
||||
ARG CC=clang-10
|
||||
ARG CXX=clang++-10
|
||||
RUN cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release
|
||||
ARG CC=clang-13
|
||||
ARG CXX=clang++-13
|
||||
RUN cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DUSE_LINKER=lld -DENABLE_LTO=True -DBUILD_TESTS=False -DENABLE_ASSERTIONS=False -G Ninja .
|
||||
RUN ninja
|
||||
|
||||
WORKDIR /FEX/build
|
||||
|
||||
# --- Stage 2: Runner ---
|
||||
FROM ubuntu:20.04
|
||||
FROM builder as runner
|
||||
|
||||
RUN DEBIAN_FRONTEND="noninteractive" apt-get update
|
||||
RUN DEBIAN_FRONTEND="noninteractive" apt install -y \
|
||||
libcap-dev libglfw3-dev libepoxy-dev
|
||||
|
||||
COPY --from=builder /opt/FEX/build/Bin/* /usr/bin/
|
||||
COPY --from=builder /FEX/Bin/* /usr/bin/
|
||||
|
||||
WORKDIR /root
|
||||
WORKDIR /
|
||||
Vendored
+98
@@ -0,0 +1,98 @@
|
||||
|
||||
set (SRCS
|
||||
# F80 support
|
||||
src/extF80_add.c
|
||||
src/extF80_div.c
|
||||
src/extF80_sub.c
|
||||
src/extF80_mul.c
|
||||
src/extF80_rem.c
|
||||
src/extF80_sqrt.c
|
||||
src/extF80_le.c
|
||||
src/extF80_to_i32.c
|
||||
src/extF80_to_i64.c
|
||||
src/extF80_to_ui64.c
|
||||
src/extF80_to_f32.c
|
||||
src/extF80_to_f64.c
|
||||
src/i32_to_extF80.c
|
||||
src/ui64_to_extF80.c
|
||||
src/extF80_to_f128.c
|
||||
src/f128_to_extF80.c
|
||||
|
||||
# F128 support
|
||||
src/f128_add.c
|
||||
src/f128_div.c
|
||||
src/f128_eq.c
|
||||
src/f128_eq_signaling.c
|
||||
src/f128_isSignalingNaN.c
|
||||
src/f128_le.c
|
||||
src/f128_le_quiet.c
|
||||
src/f128_lt.c
|
||||
src/f128_lt_quiet.c
|
||||
src/f128_mulAdd.c
|
||||
src/f128_mul.c
|
||||
src/f128_rem.c
|
||||
src/f128_sqrt.c
|
||||
src/f128_sub.c
|
||||
src/f128_to_f16.c
|
||||
src/f128_to_f32.c
|
||||
src/f128_to_f64.c
|
||||
src/f128_to_i32.c
|
||||
src/f128_to_i64.c
|
||||
src/f128_to_ui32.c
|
||||
src/f128_to_ui64.c
|
||||
src/s_addMagsF128.c
|
||||
src/s_subMagsF128.c
|
||||
src/s_normRoundPackToF128.c
|
||||
src/s_roundPackToF128.c
|
||||
src/s_propagateNaNF128UI.c
|
||||
|
||||
# Conversion
|
||||
src/f32_to_f128.c
|
||||
src/i32_to_f128.c
|
||||
|
||||
src/s_roundToUI64.c
|
||||
src/s_f128UIToCommonNaN.c
|
||||
src/s_commonNaNToF128UI.c
|
||||
src/s_normSubnormalF128Sig.c
|
||||
src/s_roundToI32.c
|
||||
src/s_roundToI64.c
|
||||
src/s_roundPackToF32.c
|
||||
src/s_addMagsExtF80.c
|
||||
src/s_extF80UIToCommonNaN.c
|
||||
src/s_commonNaNToF32UI.c
|
||||
src/s_commonNaNToF64UI.c
|
||||
src/s_roundPackToF64.c
|
||||
src/s_propagateNaNExtF80UI.c
|
||||
src/s_roundPackToExtF80.c
|
||||
src/s_normSubnormalExtF80Sig.c
|
||||
src/s_subMagsExtF80.c
|
||||
src/s_shiftRightJam128.c
|
||||
src/s_shiftRightJam128Extra.c
|
||||
src/s_normRoundPackToExtF80.c
|
||||
src/s_approxRecip_1Ks.c
|
||||
src/s_approxRecipSqrt32_1.c
|
||||
src/s_approxRecipSqrt_1Ks.c
|
||||
src/softfloat_raiseFlags.c
|
||||
src/f64_to_extF80.c
|
||||
src/s_commonNaNToExtF80UI.c
|
||||
src/s_normSubnormalF64Sig.c
|
||||
src/s_f64UIToCommonNaN.c
|
||||
src/extF80_roundToInt.c
|
||||
src/extF80_eq.c
|
||||
src/extF80_lt.c
|
||||
src/f32_to_extF80.c
|
||||
src/s_normSubnormalF32Sig.c
|
||||
src/s_f32UIToCommonNaN.c)
|
||||
|
||||
if (_M_ARM_64 AND HAS_CLANG_PRESERVE_ALL)
|
||||
list(APPEND DEFINES "-DFEXCORE_PRESERVE_ALL_ATTR=__attribute__((preserve_all));-DFEXCORE_HAS_PRESERVE_ALL_ATTR=1")
|
||||
else()
|
||||
list(APPEND DEFINES "-DFEXCORE_PRESERVE_ALL_ATTR=;-DFEXCORE_HAS_PRESERVE_ALL_ATTR=0")
|
||||
endif()
|
||||
|
||||
list(APPEND DEFINES "-DSOFTFLOAT_BUILTIN_CLZ=1;-DINLINE=static inline;-DINLINE_LEVEL=4;-DSOFTFLOAT_FAST_INT64=1;-DSOFTFLOAT_FAST_DIV32TO16=1;-DSOFTFLOAT_FAST_DIV64TO32=1")
|
||||
|
||||
add_library(softfloat_3e STATIC ${SRCS})
|
||||
target_include_directories(softfloat_3e PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
||||
target_include_directories(softfloat_3e PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/SoftFloat-3e/)
|
||||
target_compile_definitions(softfloat_3e PUBLIC ${DEFINES})
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+30
-22
@@ -149,7 +149,7 @@ float64_t f32_to_f64( float32_t );
|
||||
#ifdef SOFTFLOAT_FAST_INT64
|
||||
FEXCORE_PRESERVE_ALL_ATTR
|
||||
extFloat80_t f32_to_extF80( struct softfloat_state *, float32_t );
|
||||
float128_t f32_to_f128( float32_t );
|
||||
float128_t f32_to_f128( struct softfloat_state *, float32_t );
|
||||
#endif
|
||||
void f32_to_extF80M( float32_t, extFloat80_t * );
|
||||
void f32_to_f128M( float32_t, float128_t * );
|
||||
@@ -243,13 +243,17 @@ FEXCORE_PRESERVE_ALL_ATTR
|
||||
extFloat80_t extF80_sqrt( struct softfloat_state *, extFloat80_t );
|
||||
FEXCORE_PRESERVE_ALL_ATTR
|
||||
bool extF80_eq( struct softfloat_state *, extFloat80_t, extFloat80_t );
|
||||
bool extF80_le( extFloat80_t, extFloat80_t );
|
||||
bool extF80_le( struct softfloat_state *, extFloat80_t, extFloat80_t );
|
||||
FEXCORE_PRESERVE_ALL_ATTR
|
||||
bool extF80_lt( struct softfloat_state *, extFloat80_t, extFloat80_t );
|
||||
bool extF80_eq_signaling( extFloat80_t, extFloat80_t );
|
||||
bool extF80_le_quiet( extFloat80_t, extFloat80_t );
|
||||
bool extF80_lt_quiet( extFloat80_t, extFloat80_t );
|
||||
bool extF80_isSignalingNaN( extFloat80_t );
|
||||
static inline extFloat80_t extF80_complement_sign(extFloat80_t a) {
|
||||
a.signExp ^= 1ULL << 15;
|
||||
return a;
|
||||
}
|
||||
#endif
|
||||
uint_fast32_t extF80M_to_ui32( const extFloat80_t *, uint_fast8_t, bool );
|
||||
uint_fast64_t extF80M_to_ui64( const extFloat80_t *, uint_fast8_t, bool );
|
||||
@@ -284,34 +288,38 @@ bool extF80M_isSignalingNaN( const extFloat80_t * );
|
||||
| 128-bit (quadruple-precision) floating-point operations.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#ifdef SOFTFLOAT_FAST_INT64
|
||||
uint_fast32_t f128_to_ui32( float128_t, uint_fast8_t, bool );
|
||||
uint_fast64_t f128_to_ui64( float128_t, uint_fast8_t, bool );
|
||||
int_fast32_t f128_to_i32( float128_t, uint_fast8_t, bool );
|
||||
int_fast64_t f128_to_i64( float128_t, uint_fast8_t, bool );
|
||||
uint_fast32_t f128_to_ui32( struct softfloat_state *, float128_t, uint_fast8_t, bool );
|
||||
uint_fast64_t f128_to_ui64( struct softfloat_state *, float128_t, uint_fast8_t, bool );
|
||||
int_fast32_t f128_to_i32( struct softfloat_state *, float128_t, uint_fast8_t, bool );
|
||||
int_fast64_t f128_to_i64( struct softfloat_state *, float128_t, uint_fast8_t, bool );
|
||||
uint_fast32_t f128_to_ui32_r_minMag( float128_t, bool );
|
||||
uint_fast64_t f128_to_ui64_r_minMag( float128_t, bool );
|
||||
int_fast32_t f128_to_i32_r_minMag( float128_t, bool );
|
||||
int_fast64_t f128_to_i64_r_minMag( float128_t, bool );
|
||||
float16_t f128_to_f16( float128_t );
|
||||
float32_t f128_to_f32( float128_t );
|
||||
float64_t f128_to_f64( float128_t );
|
||||
float16_t f128_to_f16( struct softfloat_state *, float128_t );
|
||||
float32_t f128_to_f32( struct softfloat_state *, float128_t );
|
||||
float64_t f128_to_f64( struct softfloat_state *, float128_t );
|
||||
FEXCORE_PRESERVE_ALL_ATTR
|
||||
extFloat80_t f128_to_extF80( struct softfloat_state *, float128_t );
|
||||
float128_t f128_roundToInt( float128_t, uint_fast8_t, bool );
|
||||
float128_t f128_add( float128_t, float128_t );
|
||||
float128_t f128_sub( float128_t, float128_t );
|
||||
float128_t f128_mul( float128_t, float128_t );
|
||||
float128_t f128_mulAdd( float128_t, float128_t, float128_t );
|
||||
float128_t f128_div( float128_t, float128_t );
|
||||
float128_t f128_rem( float128_t, float128_t );
|
||||
float128_t f128_sqrt( float128_t );
|
||||
bool f128_eq( float128_t, float128_t );
|
||||
bool f128_le( float128_t, float128_t );
|
||||
bool f128_lt( float128_t, float128_t );
|
||||
bool f128_eq_signaling( float128_t, float128_t );
|
||||
bool f128_le_quiet( float128_t, float128_t );
|
||||
bool f128_lt_quiet( float128_t, float128_t );
|
||||
float128_t f128_add( struct softfloat_state *, float128_t, float128_t );
|
||||
float128_t f128_sub( struct softfloat_state *, float128_t, float128_t );
|
||||
float128_t f128_mul( struct softfloat_state *, float128_t, float128_t );
|
||||
float128_t f128_mulAdd( struct softfloat_state *, float128_t, float128_t, float128_t );
|
||||
float128_t f128_div( struct softfloat_state *, float128_t, float128_t );
|
||||
float128_t f128_rem( struct softfloat_state *, float128_t, float128_t );
|
||||
float128_t f128_sqrt( struct softfloat_state *, float128_t );
|
||||
bool f128_eq( struct softfloat_state *, float128_t, float128_t );
|
||||
bool f128_le( struct softfloat_state *, float128_t, float128_t );
|
||||
bool f128_lt( struct softfloat_state *, float128_t, float128_t );
|
||||
bool f128_eq_signaling( struct softfloat_state *, float128_t, float128_t );
|
||||
bool f128_le_quiet( struct softfloat_state *, float128_t, float128_t );
|
||||
bool f128_lt_quiet( struct softfloat_state *, float128_t, float128_t );
|
||||
bool f128_isSignalingNaN( float128_t );
|
||||
static inline float128_t f128_complement_sign(float128_t a) {
|
||||
a.v[1] ^= 1ULL << 63;
|
||||
return a;
|
||||
}
|
||||
#endif
|
||||
uint_fast32_t f128M_to_ui32( const float128_t *, uint_fast8_t, bool );
|
||||
uint_fast64_t f128M_to_ui64( const float128_t *, uint_fast8_t, bool );
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+73
@@ -0,0 +1,73 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
bool extF80_le( struct softfloat_state *state, extFloat80_t a, extFloat80_t b )
|
||||
{
|
||||
union { struct extFloat80M s; extFloat80_t f; } uA;
|
||||
uint_fast16_t uiA64;
|
||||
uint_fast64_t uiA0;
|
||||
union { struct extFloat80M s; extFloat80_t f; } uB;
|
||||
uint_fast16_t uiB64;
|
||||
uint_fast64_t uiB0;
|
||||
bool signA, signB;
|
||||
|
||||
uA.f = a;
|
||||
uiA64 = uA.s.signExp;
|
||||
uiA0 = uA.s.signif;
|
||||
uB.f = b;
|
||||
uiB64 = uB.s.signExp;
|
||||
uiB0 = uB.s.signif;
|
||||
if ( isNaNExtF80UI( uiA64, uiA0 ) || isNaNExtF80UI( uiB64, uiB0 ) ) {
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
return false;
|
||||
}
|
||||
signA = signExtF80UI64( uiA64 );
|
||||
signB = signExtF80UI64( uiB64 );
|
||||
return
|
||||
(signA != signB)
|
||||
? signA || ! (((uiA64 | uiB64) & 0x7FFF) | uiA0 | uiB0)
|
||||
: ((uiA64 == uiB64) && (uiA0 == uiB0))
|
||||
|| (signA ^ softfloat_lt128( uiA64, uiA0, uiB64, uiB0 ));
|
||||
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
Vendored
File renamed without changes.
Vendored
File renamed without changes.
Vendored
File renamed without changes.
Vendored
File renamed without changes.
Vendored
File renamed without changes.
Vendored
+78
@@ -0,0 +1,78 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float128_t f128_add( struct softfloat_state *state, float128_t a, float128_t b )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
bool signA;
|
||||
union ui128_f128 uB;
|
||||
uint_fast64_t uiB64, uiB0;
|
||||
bool signB;
|
||||
#if ! defined INLINE_LEVEL || (INLINE_LEVEL < 2)
|
||||
float128_t
|
||||
(*magsFuncPtr)(
|
||||
uint_fast64_t, uint_fast64_t, uint_fast64_t, uint_fast64_t, bool );
|
||||
#endif
|
||||
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
signA = signF128UI64( uiA64 );
|
||||
uB.f = b;
|
||||
uiB64 = uB.ui.v64;
|
||||
uiB0 = uB.ui.v0;
|
||||
signB = signF128UI64( uiB64 );
|
||||
#if defined INLINE_LEVEL && (2 <= INLINE_LEVEL)
|
||||
if ( signA == signB ) {
|
||||
return softfloat_addMagsF128( state, uiA64, uiA0, uiB64, uiB0, signA );
|
||||
} else {
|
||||
return softfloat_subMagsF128( state, uiA64, uiA0, uiB64, uiB0, signA );
|
||||
}
|
||||
#else
|
||||
magsFuncPtr =
|
||||
(signA == signB) ? softfloat_addMagsF128 : softfloat_subMagsF128;
|
||||
return (*magsFuncPtr)( uiA64, uiA0, uiB64, uiB0, signA );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
Vendored
+199
@@ -0,0 +1,199 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float128_t f128_div( struct softfloat_state *state, float128_t a, float128_t b )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
bool signA;
|
||||
int_fast32_t expA;
|
||||
struct uint128 sigA;
|
||||
union ui128_f128 uB;
|
||||
uint_fast64_t uiB64, uiB0;
|
||||
bool signB;
|
||||
int_fast32_t expB;
|
||||
struct uint128 sigB;
|
||||
bool signZ;
|
||||
struct exp32_sig128 normExpSig;
|
||||
int_fast32_t expZ;
|
||||
struct uint128 rem;
|
||||
uint_fast32_t recip32;
|
||||
int ix;
|
||||
uint_fast64_t q64;
|
||||
uint_fast32_t q;
|
||||
struct uint128 term;
|
||||
uint_fast32_t qs[3];
|
||||
uint_fast64_t sigZExtra;
|
||||
struct uint128 sigZ, uiZ;
|
||||
union ui128_f128 uZ;
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
signA = signF128UI64( uiA64 );
|
||||
expA = expF128UI64( uiA64 );
|
||||
sigA.v64 = fracF128UI64( uiA64 );
|
||||
sigA.v0 = uiA0;
|
||||
uB.f = b;
|
||||
uiB64 = uB.ui.v64;
|
||||
uiB0 = uB.ui.v0;
|
||||
signB = signF128UI64( uiB64 );
|
||||
expB = expF128UI64( uiB64 );
|
||||
sigB.v64 = fracF128UI64( uiB64 );
|
||||
sigB.v0 = uiB0;
|
||||
signZ = signA ^ signB;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( expA == 0x7FFF ) {
|
||||
if ( sigA.v64 | sigA.v0 ) goto propagateNaN;
|
||||
if ( expB == 0x7FFF ) {
|
||||
if ( sigB.v64 | sigB.v0 ) goto propagateNaN;
|
||||
goto invalid;
|
||||
}
|
||||
goto infinity;
|
||||
}
|
||||
if ( expB == 0x7FFF ) {
|
||||
if ( sigB.v64 | sigB.v0 ) goto propagateNaN;
|
||||
goto zero;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( ! expB ) {
|
||||
if ( ! (sigB.v64 | sigB.v0) ) {
|
||||
if ( ! (expA | sigA.v64 | sigA.v0) ) goto invalid;
|
||||
softfloat_raiseFlags( state, softfloat_flag_infinite );
|
||||
goto infinity;
|
||||
}
|
||||
normExpSig = softfloat_normSubnormalF128Sig( sigB.v64, sigB.v0 );
|
||||
expB = normExpSig.exp;
|
||||
sigB = normExpSig.sig;
|
||||
}
|
||||
if ( ! expA ) {
|
||||
if ( ! (sigA.v64 | sigA.v0) ) goto zero;
|
||||
normExpSig = softfloat_normSubnormalF128Sig( sigA.v64, sigA.v0 );
|
||||
expA = normExpSig.exp;
|
||||
sigA = normExpSig.sig;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
expZ = expA - expB + 0x3FFE;
|
||||
sigA.v64 |= UINT64_C( 0x0001000000000000 );
|
||||
sigB.v64 |= UINT64_C( 0x0001000000000000 );
|
||||
rem = sigA;
|
||||
if ( softfloat_lt128( sigA.v64, sigA.v0, sigB.v64, sigB.v0 ) ) {
|
||||
--expZ;
|
||||
rem = softfloat_add128( sigA.v64, sigA.v0, sigA.v64, sigA.v0 );
|
||||
}
|
||||
recip32 = softfloat_approxRecip32_1( sigB.v64>>17 );
|
||||
ix = 3;
|
||||
for (;;) {
|
||||
q64 = (uint_fast64_t) (uint32_t) (rem.v64>>19) * recip32;
|
||||
q = (q64 + 0x80000000)>>32;
|
||||
--ix;
|
||||
if ( ix < 0 ) break;
|
||||
rem = softfloat_shortShiftLeft128( rem.v64, rem.v0, 29 );
|
||||
term = softfloat_mul128By32( sigB.v64, sigB.v0, q );
|
||||
rem = softfloat_sub128( rem.v64, rem.v0, term.v64, term.v0 );
|
||||
if ( rem.v64 & UINT64_C( 0x8000000000000000 ) ) {
|
||||
--q;
|
||||
rem = softfloat_add128( rem.v64, rem.v0, sigB.v64, sigB.v0 );
|
||||
}
|
||||
qs[ix] = q;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( ((q + 1) & 7) < 2 ) {
|
||||
rem = softfloat_shortShiftLeft128( rem.v64, rem.v0, 29 );
|
||||
term = softfloat_mul128By32( sigB.v64, sigB.v0, q );
|
||||
rem = softfloat_sub128( rem.v64, rem.v0, term.v64, term.v0 );
|
||||
if ( rem.v64 & UINT64_C( 0x8000000000000000 ) ) {
|
||||
--q;
|
||||
rem = softfloat_add128( rem.v64, rem.v0, sigB.v64, sigB.v0 );
|
||||
} else if ( softfloat_le128( sigB.v64, sigB.v0, rem.v64, rem.v0 ) ) {
|
||||
++q;
|
||||
rem = softfloat_sub128( rem.v64, rem.v0, sigB.v64, sigB.v0 );
|
||||
}
|
||||
if ( rem.v64 | rem.v0 ) q |= 1;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
sigZExtra = (uint64_t) ((uint_fast64_t) q<<60);
|
||||
term = softfloat_shortShiftLeft128( 0, qs[1], 54 );
|
||||
sigZ =
|
||||
softfloat_add128(
|
||||
(uint_fast64_t) qs[2]<<19, ((uint_fast64_t) qs[0]<<25) + (q>>4),
|
||||
term.v64, term.v0
|
||||
);
|
||||
return
|
||||
softfloat_roundPackToF128( state, signZ, expZ, sigZ.v64, sigZ.v0, sigZExtra );
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
propagateNaN:
|
||||
uiZ = softfloat_propagateNaNF128UI( state, uiA64, uiA0, uiB64, uiB0 );
|
||||
goto uiZ;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
invalid:
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
uiZ.v64 = defaultNaNF128UI64;
|
||||
uiZ.v0 = defaultNaNF128UI0;
|
||||
goto uiZ;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
infinity:
|
||||
uiZ.v64 = packToF128UI64( signZ, 0x7FFF, 0 );
|
||||
goto uiZ0;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
zero:
|
||||
uiZ.v64 = packToF128UI64( signZ, 0, 0 );
|
||||
uiZ0:
|
||||
uiZ.v0 = 0;
|
||||
uiZ:
|
||||
uZ.ui = uiZ;
|
||||
return uZ.f;
|
||||
|
||||
}
|
||||
|
||||
Vendored
+73
@@ -0,0 +1,73 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
bool f128_eq( struct softfloat_state *state, float128_t a, float128_t b )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
union ui128_f128 uB;
|
||||
uint_fast64_t uiB64, uiB0;
|
||||
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
uB.f = b;
|
||||
uiB64 = uB.ui.v64;
|
||||
uiB0 = uB.ui.v0;
|
||||
if ( isNaNF128UI( uiA64, uiA0 ) || isNaNF128UI( uiB64, uiB0 ) ) {
|
||||
if (
|
||||
softfloat_isSigNaNF128UI( uiA64, uiA0 )
|
||||
|| softfloat_isSigNaNF128UI( uiB64, uiB0 )
|
||||
) {
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return
|
||||
(uiA0 == uiB0)
|
||||
&& ( (uiA64 == uiB64)
|
||||
|| (! uiA0 && ! ((uiA64 | uiB64) & UINT64_C( 0x7FFFFFFFFFFFFFFF )))
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
bool f128_eq_signaling( struct softfloat_state *state, float128_t a, float128_t b )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
union ui128_f128 uB;
|
||||
uint_fast64_t uiB64, uiB0;
|
||||
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
uB.f = b;
|
||||
uiB64 = uB.ui.v64;
|
||||
uiB0 = uB.ui.v0;
|
||||
if ( isNaNF128UI( uiA64, uiA0 ) || isNaNF128UI( uiB64, uiB0 ) ) {
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
return false;
|
||||
}
|
||||
return
|
||||
(uiA0 == uiB0)
|
||||
&& ( (uiA64 == uiB64)
|
||||
|| (! uiA0 && ! ((uiA64 | uiB64) & UINT64_C( 0x7FFFFFFFFFFFFFFF )))
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
bool f128_isSignalingNaN( float128_t a )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
|
||||
uA.f = a;
|
||||
return softfloat_isSigNaNF128UI( uA.ui.v64, uA.ui.v0 );
|
||||
|
||||
}
|
||||
|
||||
Vendored
+72
@@ -0,0 +1,72 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
bool f128_le( struct softfloat_state *state, float128_t a, float128_t b )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
union ui128_f128 uB;
|
||||
uint_fast64_t uiB64, uiB0;
|
||||
bool signA, signB;
|
||||
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
uB.f = b;
|
||||
uiB64 = uB.ui.v64;
|
||||
uiB0 = uB.ui.v0;
|
||||
if ( isNaNF128UI( uiA64, uiA0 ) || isNaNF128UI( uiB64, uiB0 ) ) {
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
return false;
|
||||
}
|
||||
signA = signF128UI64( uiA64 );
|
||||
signB = signF128UI64( uiB64 );
|
||||
return
|
||||
(signA != signB)
|
||||
? signA
|
||||
|| ! (((uiA64 | uiB64) & UINT64_C( 0x7FFFFFFFFFFFFFFF ))
|
||||
| uiA0 | uiB0)
|
||||
: ((uiA64 == uiB64) && (uiA0 == uiB0))
|
||||
|| (signA ^ softfloat_lt128( uiA64, uiA0, uiB64, uiB0 ));
|
||||
|
||||
}
|
||||
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
bool f128_le_quiet( struct softfloat_state *state, float128_t a, float128_t b )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
union ui128_f128 uB;
|
||||
uint_fast64_t uiB64, uiB0;
|
||||
bool signA, signB;
|
||||
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
uB.f = b;
|
||||
uiB64 = uB.ui.v64;
|
||||
uiB0 = uB.ui.v0;
|
||||
if ( isNaNF128UI( uiA64, uiA0 ) || isNaNF128UI( uiB64, uiB0 ) ) {
|
||||
if (
|
||||
softfloat_isSigNaNF128UI( uiA64, uiA0 )
|
||||
|| softfloat_isSigNaNF128UI( uiB64, uiB0 )
|
||||
) {
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
signA = signF128UI64( uiA64 );
|
||||
signB = signF128UI64( uiB64 );
|
||||
return
|
||||
(signA != signB)
|
||||
? signA
|
||||
|| ! (((uiA64 | uiB64) & UINT64_C( 0x7FFFFFFFFFFFFFFF ))
|
||||
| uiA0 | uiB0)
|
||||
: ((uiA64 == uiB64) && (uiA0 == uiB0))
|
||||
|| (signA ^ softfloat_lt128( uiA64, uiA0, uiB64, uiB0 ));
|
||||
|
||||
}
|
||||
|
||||
Vendored
+72
@@ -0,0 +1,72 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
bool f128_lt( struct softfloat_state *state, float128_t a, float128_t b )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
union ui128_f128 uB;
|
||||
uint_fast64_t uiB64, uiB0;
|
||||
bool signA, signB;
|
||||
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
uB.f = b;
|
||||
uiB64 = uB.ui.v64;
|
||||
uiB0 = uB.ui.v0;
|
||||
if ( isNaNF128UI( uiA64, uiA0 ) || isNaNF128UI( uiB64, uiB0 ) ) {
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
return false;
|
||||
}
|
||||
signA = signF128UI64( uiA64 );
|
||||
signB = signF128UI64( uiB64 );
|
||||
return
|
||||
(signA != signB)
|
||||
? signA
|
||||
&& (((uiA64 | uiB64) & UINT64_C( 0x7FFFFFFFFFFFFFFF ))
|
||||
| uiA0 | uiB0)
|
||||
: ((uiA64 != uiB64) || (uiA0 != uiB0))
|
||||
&& (signA ^ softfloat_lt128( uiA64, uiA0, uiB64, uiB0 ));
|
||||
|
||||
}
|
||||
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
bool f128_lt_quiet( struct softfloat_state *state, float128_t a, float128_t b )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
union ui128_f128 uB;
|
||||
uint_fast64_t uiB64, uiB0;
|
||||
bool signA, signB;
|
||||
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
uB.f = b;
|
||||
uiB64 = uB.ui.v64;
|
||||
uiB0 = uB.ui.v0;
|
||||
if ( isNaNF128UI( uiA64, uiA0 ) || isNaNF128UI( uiB64, uiB0 ) ) {
|
||||
if (
|
||||
softfloat_isSigNaNF128UI( uiA64, uiA0 )
|
||||
|| softfloat_isSigNaNF128UI( uiB64, uiB0 )
|
||||
) {
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
signA = signF128UI64( uiA64 );
|
||||
signB = signF128UI64( uiB64 );
|
||||
return
|
||||
(signA != signB)
|
||||
? signA
|
||||
&& (((uiA64 | uiB64) & UINT64_C( 0x7FFFFFFFFFFFFFFF ))
|
||||
| uiA0 | uiB0)
|
||||
: ((uiA64 != uiB64) || (uiA0 != uiB0))
|
||||
&& (signA ^ softfloat_lt128( uiA64, uiA0, uiB64, uiB0 ));
|
||||
|
||||
}
|
||||
|
||||
Vendored
+163
@@ -0,0 +1,163 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float128_t f128_mul( struct softfloat_state *state, float128_t a, float128_t b )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
bool signA;
|
||||
int_fast32_t expA;
|
||||
struct uint128 sigA;
|
||||
union ui128_f128 uB;
|
||||
uint_fast64_t uiB64, uiB0;
|
||||
bool signB;
|
||||
int_fast32_t expB;
|
||||
struct uint128 sigB;
|
||||
bool signZ;
|
||||
uint_fast64_t magBits;
|
||||
struct exp32_sig128 normExpSig;
|
||||
int_fast32_t expZ;
|
||||
uint64_t sig256Z[4];
|
||||
uint_fast64_t sigZExtra;
|
||||
struct uint128 sigZ;
|
||||
struct uint128_extra sig128Extra;
|
||||
struct uint128 uiZ;
|
||||
union ui128_f128 uZ;
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
signA = signF128UI64( uiA64 );
|
||||
expA = expF128UI64( uiA64 );
|
||||
sigA.v64 = fracF128UI64( uiA64 );
|
||||
sigA.v0 = uiA0;
|
||||
uB.f = b;
|
||||
uiB64 = uB.ui.v64;
|
||||
uiB0 = uB.ui.v0;
|
||||
signB = signF128UI64( uiB64 );
|
||||
expB = expF128UI64( uiB64 );
|
||||
sigB.v64 = fracF128UI64( uiB64 );
|
||||
sigB.v0 = uiB0;
|
||||
signZ = signA ^ signB;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( expA == 0x7FFF ) {
|
||||
if (
|
||||
(sigA.v64 | sigA.v0) || ((expB == 0x7FFF) && (sigB.v64 | sigB.v0))
|
||||
) {
|
||||
goto propagateNaN;
|
||||
}
|
||||
magBits = expB | sigB.v64 | sigB.v0;
|
||||
goto infArg;
|
||||
}
|
||||
if ( expB == 0x7FFF ) {
|
||||
if ( sigB.v64 | sigB.v0 ) goto propagateNaN;
|
||||
magBits = expA | sigA.v64 | sigA.v0;
|
||||
goto infArg;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( ! expA ) {
|
||||
if ( ! (sigA.v64 | sigA.v0) ) goto zero;
|
||||
normExpSig = softfloat_normSubnormalF128Sig( sigA.v64, sigA.v0 );
|
||||
expA = normExpSig.exp;
|
||||
sigA = normExpSig.sig;
|
||||
}
|
||||
if ( ! expB ) {
|
||||
if ( ! (sigB.v64 | sigB.v0) ) goto zero;
|
||||
normExpSig = softfloat_normSubnormalF128Sig( sigB.v64, sigB.v0 );
|
||||
expB = normExpSig.exp;
|
||||
sigB = normExpSig.sig;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
expZ = expA + expB - 0x4000;
|
||||
sigA.v64 |= UINT64_C( 0x0001000000000000 );
|
||||
sigB = softfloat_shortShiftLeft128( sigB.v64, sigB.v0, 16 );
|
||||
softfloat_mul128To256M( sigA.v64, sigA.v0, sigB.v64, sigB.v0, sig256Z );
|
||||
sigZExtra = sig256Z[indexWord( 4, 1 )] | (sig256Z[indexWord( 4, 0 )] != 0);
|
||||
sigZ =
|
||||
softfloat_add128(
|
||||
sig256Z[indexWord( 4, 3 )], sig256Z[indexWord( 4, 2 )],
|
||||
sigA.v64, sigA.v0
|
||||
);
|
||||
if ( UINT64_C( 0x0002000000000000 ) <= sigZ.v64 ) {
|
||||
++expZ;
|
||||
sig128Extra =
|
||||
softfloat_shortShiftRightJam128Extra(
|
||||
sigZ.v64, sigZ.v0, sigZExtra, 1 );
|
||||
sigZ = sig128Extra.v;
|
||||
sigZExtra = sig128Extra.extra;
|
||||
}
|
||||
return
|
||||
softfloat_roundPackToF128( state, signZ, expZ, sigZ.v64, sigZ.v0, sigZExtra );
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
propagateNaN:
|
||||
uiZ = softfloat_propagateNaNF128UI( state, uiA64, uiA0, uiB64, uiB0 );
|
||||
goto uiZ;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
infArg:
|
||||
if ( ! magBits ) {
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
uiZ.v64 = defaultNaNF128UI64;
|
||||
uiZ.v0 = defaultNaNF128UI0;
|
||||
goto uiZ;
|
||||
}
|
||||
uiZ.v64 = packToF128UI64( signZ, 0x7FFF, 0 );
|
||||
goto uiZ0;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
zero:
|
||||
uiZ.v64 = packToF128UI64( signZ, 0, 0 );
|
||||
uiZ0:
|
||||
uiZ.v0 = 0;
|
||||
uiZ:
|
||||
uZ.ui = uiZ;
|
||||
return uZ.f;
|
||||
|
||||
}
|
||||
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float128_t f128_mulAdd( struct softfloat_state *state, float128_t a, float128_t b, float128_t c )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
union ui128_f128 uB;
|
||||
uint_fast64_t uiB64, uiB0;
|
||||
union ui128_f128 uC;
|
||||
uint_fast64_t uiC64, uiC0;
|
||||
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
uB.f = b;
|
||||
uiB64 = uB.ui.v64;
|
||||
uiB0 = uB.ui.v0;
|
||||
uC.f = c;
|
||||
uiC64 = uC.ui.v64;
|
||||
uiC0 = uC.ui.v0;
|
||||
return softfloat_mulAddF128( uiA64, uiA0, uiB64, uiB0, uiC64, uiC0, 0 );
|
||||
|
||||
}
|
||||
|
||||
Vendored
+190
@@ -0,0 +1,190 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float128_t f128_rem( struct softfloat_state *state, float128_t a, float128_t b )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
bool signA;
|
||||
int_fast32_t expA;
|
||||
struct uint128 sigA;
|
||||
union ui128_f128 uB;
|
||||
uint_fast64_t uiB64, uiB0;
|
||||
int_fast32_t expB;
|
||||
struct uint128 sigB;
|
||||
struct exp32_sig128 normExpSig;
|
||||
struct uint128 rem;
|
||||
int_fast32_t expDiff;
|
||||
uint_fast32_t q, recip32;
|
||||
uint_fast64_t q64;
|
||||
struct uint128 term, altRem, meanRem;
|
||||
bool signRem;
|
||||
struct uint128 uiZ;
|
||||
union ui128_f128 uZ;
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
signA = signF128UI64( uiA64 );
|
||||
expA = expF128UI64( uiA64 );
|
||||
sigA.v64 = fracF128UI64( uiA64 );
|
||||
sigA.v0 = uiA0;
|
||||
uB.f = b;
|
||||
uiB64 = uB.ui.v64;
|
||||
uiB0 = uB.ui.v0;
|
||||
expB = expF128UI64( uiB64 );
|
||||
sigB.v64 = fracF128UI64( uiB64 );
|
||||
sigB.v0 = uiB0;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( expA == 0x7FFF ) {
|
||||
if (
|
||||
(sigA.v64 | sigA.v0) || ((expB == 0x7FFF) && (sigB.v64 | sigB.v0))
|
||||
) {
|
||||
goto propagateNaN;
|
||||
}
|
||||
goto invalid;
|
||||
}
|
||||
if ( expB == 0x7FFF ) {
|
||||
if ( sigB.v64 | sigB.v0 ) goto propagateNaN;
|
||||
return a;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( ! expB ) {
|
||||
if ( ! (sigB.v64 | sigB.v0) ) goto invalid;
|
||||
normExpSig = softfloat_normSubnormalF128Sig( sigB.v64, sigB.v0 );
|
||||
expB = normExpSig.exp;
|
||||
sigB = normExpSig.sig;
|
||||
}
|
||||
if ( ! expA ) {
|
||||
if ( ! (sigA.v64 | sigA.v0) ) return a;
|
||||
normExpSig = softfloat_normSubnormalF128Sig( sigA.v64, sigA.v0 );
|
||||
expA = normExpSig.exp;
|
||||
sigA = normExpSig.sig;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
sigA.v64 |= UINT64_C( 0x0001000000000000 );
|
||||
sigB.v64 |= UINT64_C( 0x0001000000000000 );
|
||||
rem = sigA;
|
||||
expDiff = expA - expB;
|
||||
if ( expDiff < 1 ) {
|
||||
if ( expDiff < -1 ) return a;
|
||||
if ( expDiff ) {
|
||||
--expB;
|
||||
sigB = softfloat_add128( sigB.v64, sigB.v0, sigB.v64, sigB.v0 );
|
||||
q = 0;
|
||||
} else {
|
||||
q = softfloat_le128( sigB.v64, sigB.v0, rem.v64, rem.v0 );
|
||||
if ( q ) {
|
||||
rem = softfloat_sub128( rem.v64, rem.v0, sigB.v64, sigB.v0 );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
recip32 = softfloat_approxRecip32_1( sigB.v64>>17 );
|
||||
expDiff -= 30;
|
||||
for (;;) {
|
||||
q64 = (uint_fast64_t) (uint32_t) (rem.v64>>19) * recip32;
|
||||
if ( expDiff < 0 ) break;
|
||||
q = (q64 + 0x80000000)>>32;
|
||||
rem = softfloat_shortShiftLeft128( rem.v64, rem.v0, 29 );
|
||||
term = softfloat_mul128By32( sigB.v64, sigB.v0, q );
|
||||
rem = softfloat_sub128( rem.v64, rem.v0, term.v64, term.v0 );
|
||||
if ( rem.v64 & UINT64_C( 0x8000000000000000 ) ) {
|
||||
rem = softfloat_add128( rem.v64, rem.v0, sigB.v64, sigB.v0 );
|
||||
}
|
||||
expDiff -= 29;
|
||||
}
|
||||
/*--------------------------------------------------------------------
|
||||
| (`expDiff' cannot be less than -29 here.)
|
||||
*--------------------------------------------------------------------*/
|
||||
q = (uint32_t) (q64>>32)>>(~expDiff & 31);
|
||||
rem = softfloat_shortShiftLeft128( rem.v64, rem.v0, expDiff + 30 );
|
||||
term = softfloat_mul128By32( sigB.v64, sigB.v0, q );
|
||||
rem = softfloat_sub128( rem.v64, rem.v0, term.v64, term.v0 );
|
||||
if ( rem.v64 & UINT64_C( 0x8000000000000000 ) ) {
|
||||
altRem = softfloat_add128( rem.v64, rem.v0, sigB.v64, sigB.v0 );
|
||||
goto selectRem;
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
do {
|
||||
altRem = rem;
|
||||
++q;
|
||||
rem = softfloat_sub128( rem.v64, rem.v0, sigB.v64, sigB.v0 );
|
||||
} while ( ! (rem.v64 & UINT64_C( 0x8000000000000000 )) );
|
||||
selectRem:
|
||||
meanRem = softfloat_add128( rem.v64, rem.v0, altRem.v64, altRem.v0 );
|
||||
if (
|
||||
(meanRem.v64 & UINT64_C( 0x8000000000000000 ))
|
||||
|| (! (meanRem.v64 | meanRem.v0) && (q & 1))
|
||||
) {
|
||||
rem = altRem;
|
||||
}
|
||||
signRem = signA;
|
||||
if ( rem.v64 & UINT64_C( 0x8000000000000000 ) ) {
|
||||
signRem = ! signRem;
|
||||
rem = softfloat_sub128( 0, 0, rem.v64, rem.v0 );
|
||||
}
|
||||
return softfloat_normRoundPackToF128( state, signRem, expB - 1, rem.v64, rem.v0 );
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
propagateNaN:
|
||||
uiZ = softfloat_propagateNaNF128UI( state, uiA64, uiA0, uiB64, uiB0 );
|
||||
goto uiZ;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
invalid:
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
uiZ.v64 = defaultNaNF128UI64;
|
||||
uiZ.v0 = defaultNaNF128UI0;
|
||||
uiZ:
|
||||
uZ.ui = uiZ;
|
||||
return uZ.f;
|
||||
|
||||
}
|
||||
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the
|
||||
University of California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float128_t f128_sqrt( struct softfloat_state *state, float128_t a )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
bool signA;
|
||||
int_fast32_t expA;
|
||||
struct uint128 sigA, uiZ;
|
||||
struct exp32_sig128 normExpSig;
|
||||
int_fast32_t expZ;
|
||||
uint_fast32_t sig32A, recipSqrt32, sig32Z;
|
||||
struct uint128 rem;
|
||||
uint32_t qs[3];
|
||||
uint_fast32_t q;
|
||||
uint_fast64_t x64, sig64Z;
|
||||
struct uint128 y, term;
|
||||
uint_fast64_t sigZExtra;
|
||||
struct uint128 sigZ;
|
||||
union ui128_f128 uZ;
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
signA = signF128UI64( uiA64 );
|
||||
expA = expF128UI64( uiA64 );
|
||||
sigA.v64 = fracF128UI64( uiA64 );
|
||||
sigA.v0 = uiA0;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( expA == 0x7FFF ) {
|
||||
if ( sigA.v64 | sigA.v0 ) {
|
||||
uiZ = softfloat_propagateNaNF128UI( state, uiA64, uiA0, 0, 0 );
|
||||
goto uiZ;
|
||||
}
|
||||
if ( ! signA ) return a;
|
||||
goto invalid;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( signA ) {
|
||||
if ( ! (expA | sigA.v64 | sigA.v0) ) return a;
|
||||
goto invalid;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( ! expA ) {
|
||||
if ( ! (sigA.v64 | sigA.v0) ) return a;
|
||||
normExpSig = softfloat_normSubnormalF128Sig( sigA.v64, sigA.v0 );
|
||||
expA = normExpSig.exp;
|
||||
sigA = normExpSig.sig;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
| (`sig32Z' is guaranteed to be a lower bound on the square root of
|
||||
| `sig32A', which makes `sig32Z' also a lower bound on the square root of
|
||||
| `sigA'.)
|
||||
*------------------------------------------------------------------------*/
|
||||
expZ = ((expA - 0x3FFF)>>1) + 0x3FFE;
|
||||
expA &= 1;
|
||||
sigA.v64 |= UINT64_C( 0x0001000000000000 );
|
||||
sig32A = sigA.v64>>17;
|
||||
recipSqrt32 = softfloat_approxRecipSqrt32_1( expA, sig32A );
|
||||
sig32Z = ((uint_fast64_t) sig32A * recipSqrt32)>>32;
|
||||
if ( expA ) {
|
||||
sig32Z >>= 1;
|
||||
rem = softfloat_shortShiftLeft128( sigA.v64, sigA.v0, 12 );
|
||||
} else {
|
||||
rem = softfloat_shortShiftLeft128( sigA.v64, sigA.v0, 13 );
|
||||
}
|
||||
qs[2] = sig32Z;
|
||||
rem.v64 -= (uint_fast64_t) sig32Z * sig32Z;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
q = ((uint32_t) (rem.v64>>2) * (uint_fast64_t) recipSqrt32)>>32;
|
||||
x64 = (uint_fast64_t) sig32Z<<32;
|
||||
sig64Z = x64 + ((uint_fast64_t) q<<3);
|
||||
y = softfloat_shortShiftLeft128( rem.v64, rem.v0, 29 );
|
||||
/*------------------------------------------------------------------------
|
||||
| (Repeating this loop is a rare occurrence.)
|
||||
*------------------------------------------------------------------------*/
|
||||
for (;;) {
|
||||
term = softfloat_mul64ByShifted32To128( x64 + sig64Z, q );
|
||||
rem = softfloat_sub128( y.v64, y.v0, term.v64, term.v0 );
|
||||
if ( ! (rem.v64 & UINT64_C( 0x8000000000000000 )) ) break;
|
||||
--q;
|
||||
sig64Z -= 1<<3;
|
||||
}
|
||||
qs[1] = q;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
q = ((rem.v64>>2) * recipSqrt32)>>32;
|
||||
y = softfloat_shortShiftLeft128( rem.v64, rem.v0, 29 );
|
||||
sig64Z <<= 1;
|
||||
/*------------------------------------------------------------------------
|
||||
| (Repeating this loop is a rare occurrence.)
|
||||
*------------------------------------------------------------------------*/
|
||||
for (;;) {
|
||||
term = softfloat_shortShiftLeft128( 0, sig64Z, 32 );
|
||||
term = softfloat_add128( term.v64, term.v0, 0, (uint_fast64_t) q<<6 );
|
||||
term = softfloat_mul128By32( term.v64, term.v0, q );
|
||||
rem = softfloat_sub128( y.v64, y.v0, term.v64, term.v0 );
|
||||
if ( ! (rem.v64 & UINT64_C( 0x8000000000000000 )) ) break;
|
||||
--q;
|
||||
}
|
||||
qs[0] = q;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
q = (((rem.v64>>2) * recipSqrt32)>>32) + 2;
|
||||
sigZExtra = (uint64_t) ((uint_fast64_t) q<<59);
|
||||
term = softfloat_shortShiftLeft128( 0, qs[1], 53 );
|
||||
sigZ =
|
||||
softfloat_add128(
|
||||
(uint_fast64_t) qs[2]<<18, ((uint_fast64_t) qs[0]<<24) + (q>>5),
|
||||
term.v64, term.v0
|
||||
);
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( (q & 0xF) <= 2 ) {
|
||||
q &= ~3;
|
||||
sigZExtra = (uint64_t) ((uint_fast64_t) q<<59);
|
||||
y = softfloat_shortShiftLeft128( sigZ.v64, sigZ.v0, 6 );
|
||||
y.v0 |= sigZExtra>>58;
|
||||
term = softfloat_sub128( y.v64, y.v0, 0, q );
|
||||
y = softfloat_mul64ByShifted32To128( term.v0, q );
|
||||
term = softfloat_mul64ByShifted32To128( term.v64, q );
|
||||
term = softfloat_add128( term.v64, term.v0, 0, y.v64 );
|
||||
rem = softfloat_shortShiftLeft128( rem.v64, rem.v0, 20 );
|
||||
term = softfloat_sub128( term.v64, term.v0, rem.v64, rem.v0 );
|
||||
/*--------------------------------------------------------------------
|
||||
| The concatenation of `term' and `y.v0' is now the negative remainder
|
||||
| (3 words altogether).
|
||||
*--------------------------------------------------------------------*/
|
||||
if ( term.v64 & UINT64_C( 0x8000000000000000 ) ) {
|
||||
sigZExtra |= 1;
|
||||
} else {
|
||||
if ( term.v64 | term.v0 | y.v0 ) {
|
||||
if ( sigZExtra ) {
|
||||
--sigZExtra;
|
||||
} else {
|
||||
sigZ = softfloat_sub128( sigZ.v64, sigZ.v0, 0, 1 );
|
||||
sigZExtra = ~0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return softfloat_roundPackToF128( state, 0, expZ, sigZ.v64, sigZ.v0, sigZExtra );
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
invalid:
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
uiZ.v64 = defaultNaNF128UI64;
|
||||
uiZ.v0 = defaultNaNF128UI0;
|
||||
uiZ:
|
||||
uZ.ui = uiZ;
|
||||
return uZ.f;
|
||||
|
||||
}
|
||||
|
||||
Vendored
+78
@@ -0,0 +1,78 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float128_t f128_sub( struct softfloat_state *state, float128_t a, float128_t b )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
bool signA;
|
||||
union ui128_f128 uB;
|
||||
uint_fast64_t uiB64, uiB0;
|
||||
bool signB;
|
||||
#if ! defined INLINE_LEVEL || (INLINE_LEVEL < 2)
|
||||
float128_t
|
||||
(*magsFuncPtr)(
|
||||
uint_fast64_t, uint_fast64_t, uint_fast64_t, uint_fast64_t, bool );
|
||||
#endif
|
||||
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
signA = signF128UI64( uiA64 );
|
||||
uB.f = b;
|
||||
uiB64 = uB.ui.v64;
|
||||
uiB0 = uB.ui.v0;
|
||||
signB = signF128UI64( uiB64 );
|
||||
#if defined INLINE_LEVEL && (2 <= INLINE_LEVEL)
|
||||
if ( signA == signB ) {
|
||||
return softfloat_subMagsF128( state, uiA64, uiA0, uiB64, uiB0, signA );
|
||||
} else {
|
||||
return softfloat_addMagsF128( state, uiA64, uiA0, uiB64, uiB0, signA );
|
||||
}
|
||||
#else
|
||||
magsFuncPtr =
|
||||
(signA == signB) ? softfloat_subMagsF128 : softfloat_addMagsF128;
|
||||
return (*magsFuncPtr)( uiA64, uiA0, uiB64, uiB0, signA );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
Vendored
File renamed without changes.
+95
@@ -0,0 +1,95 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float16_t f128_to_f16( struct softfloat_state *state, float128_t a )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
bool sign;
|
||||
int_fast32_t exp;
|
||||
uint_fast64_t frac64;
|
||||
struct commonNaN commonNaN;
|
||||
uint_fast16_t uiZ, frac16;
|
||||
union ui16_f16 uZ;
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
sign = signF128UI64( uiA64 );
|
||||
exp = expF128UI64( uiA64 );
|
||||
frac64 = fracF128UI64( uiA64 ) | (uiA0 != 0);
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( exp == 0x7FFF ) {
|
||||
if ( frac64 ) {
|
||||
softfloat_f128UIToCommonNaN( state, uiA64, uiA0, &commonNaN );
|
||||
uiZ = softfloat_commonNaNToF16UI( &commonNaN );
|
||||
} else {
|
||||
uiZ = packToF16UI( sign, 0x1F, 0 );
|
||||
}
|
||||
goto uiZ;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
frac16 = softfloat_shortShiftRightJam64( frac64, 34 );
|
||||
if ( ! (exp | frac16) ) {
|
||||
uiZ = packToF16UI( sign, 0, 0 );
|
||||
goto uiZ;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
exp -= 0x3FF1;
|
||||
if ( sizeof (int_fast16_t) < sizeof (int_fast32_t) ) {
|
||||
if ( exp < -0x40 ) exp = -0x40;
|
||||
}
|
||||
return softfloat_roundPackToF16( sign, exp, frac16 | 0x4000 );
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uiZ:
|
||||
uZ.ui = uiZ;
|
||||
return uZ.f;
|
||||
|
||||
}
|
||||
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float32_t f128_to_f32( struct softfloat_state *state, float128_t a )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
bool sign;
|
||||
int_fast32_t exp;
|
||||
uint_fast64_t frac64;
|
||||
struct commonNaN commonNaN;
|
||||
uint_fast32_t uiZ, frac32;
|
||||
union ui32_f32 uZ;
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
sign = signF128UI64( uiA64 );
|
||||
exp = expF128UI64( uiA64 );
|
||||
frac64 = fracF128UI64( uiA64 ) | (uiA0 != 0);
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( exp == 0x7FFF ) {
|
||||
if ( frac64 ) {
|
||||
softfloat_f128UIToCommonNaN( state, uiA64, uiA0, &commonNaN );
|
||||
uiZ = softfloat_commonNaNToF32UI( &commonNaN );
|
||||
} else {
|
||||
uiZ = packToF32UI( sign, 0xFF, 0 );
|
||||
}
|
||||
goto uiZ;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
frac32 = softfloat_shortShiftRightJam64( frac64, 18 );
|
||||
if ( ! (exp | frac32) ) {
|
||||
uiZ = packToF32UI( sign, 0, 0 );
|
||||
goto uiZ;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
exp -= 0x3F81;
|
||||
if ( sizeof (int_fast16_t) < sizeof (int_fast32_t) ) {
|
||||
if ( exp < -0x1000 ) exp = -0x1000;
|
||||
}
|
||||
return softfloat_roundPackToF32( state, sign, exp, frac32 | 0x40000000 );
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uiZ:
|
||||
uZ.ui = uiZ;
|
||||
return uZ.f;
|
||||
|
||||
}
|
||||
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float64_t f128_to_f64( struct softfloat_state *state, float128_t a )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
bool sign;
|
||||
int_fast32_t exp;
|
||||
uint_fast64_t frac64, frac0;
|
||||
struct commonNaN commonNaN;
|
||||
uint_fast64_t uiZ;
|
||||
struct uint128 frac128;
|
||||
union ui64_f64 uZ;
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
sign = signF128UI64( uiA64 );
|
||||
exp = expF128UI64( uiA64 );
|
||||
frac64 = fracF128UI64( uiA64 );
|
||||
frac0 = uiA0;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( exp == 0x7FFF ) {
|
||||
if ( frac64 | frac0 ) {
|
||||
softfloat_f128UIToCommonNaN( state, uiA64, uiA0, &commonNaN );
|
||||
uiZ = softfloat_commonNaNToF64UI( &commonNaN );
|
||||
} else {
|
||||
uiZ = packToF64UI( sign, 0x7FF, 0 );
|
||||
}
|
||||
goto uiZ;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
frac128 = softfloat_shortShiftLeft128( frac64, frac0, 14 );
|
||||
frac64 = frac128.v64 | (frac128.v0 != 0);
|
||||
if ( ! (exp | frac64) ) {
|
||||
uiZ = packToF64UI( sign, 0, 0 );
|
||||
goto uiZ;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
exp -= 0x3C01;
|
||||
if ( sizeof (int_fast16_t) < sizeof (int_fast32_t) ) {
|
||||
if ( exp < -0x1000 ) exp = -0x1000;
|
||||
}
|
||||
return
|
||||
softfloat_roundPackToF64(
|
||||
state, sign, exp, frac64 | UINT64_C( 0x4000000000000000 ) );
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uiZ:
|
||||
uZ.ui = uiZ;
|
||||
return uZ.f;
|
||||
|
||||
}
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the
|
||||
University of California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int_fast32_t f128_to_i32( struct softfloat_state *state, float128_t a, uint_fast8_t roundingMode, bool exact )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
bool sign;
|
||||
int_fast32_t exp;
|
||||
uint_fast64_t sig64, sig0;
|
||||
int_fast32_t shiftDist;
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
sign = signF128UI64( uiA64 );
|
||||
exp = expF128UI64( uiA64 );
|
||||
sig64 = fracF128UI64( uiA64 );
|
||||
sig0 = uiA0;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
#if (i32_fromNaN != i32_fromPosOverflow) || (i32_fromNaN != i32_fromNegOverflow)
|
||||
if ( (exp == 0x7FFF) && (sig64 | sig0) ) {
|
||||
#if (i32_fromNaN == i32_fromPosOverflow)
|
||||
sign = 0;
|
||||
#elif (i32_fromNaN == i32_fromNegOverflow)
|
||||
sign = 1;
|
||||
#else
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
return i32_fromNaN;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( exp ) sig64 |= UINT64_C( 0x0001000000000000 );
|
||||
sig64 |= (sig0 != 0);
|
||||
shiftDist = 0x4023 - exp;
|
||||
if ( 0 < shiftDist ) sig64 = softfloat_shiftRightJam64( sig64, shiftDist );
|
||||
return softfloat_roundToI32( state, sign, sig64, roundingMode, exact );
|
||||
|
||||
}
|
||||
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the
|
||||
University of California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int_fast64_t f128_to_i64( struct softfloat_state *state, float128_t a, uint_fast8_t roundingMode, bool exact )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
bool sign;
|
||||
int_fast32_t exp;
|
||||
uint_fast64_t sig64, sig0;
|
||||
int_fast32_t shiftDist;
|
||||
struct uint128 sig128;
|
||||
struct uint64_extra sigExtra;
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
sign = signF128UI64( uiA64 );
|
||||
exp = expF128UI64( uiA64 );
|
||||
sig64 = fracF128UI64( uiA64 );
|
||||
sig0 = uiA0;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
shiftDist = 0x402F - exp;
|
||||
if ( shiftDist <= 0 ) {
|
||||
/*--------------------------------------------------------------------
|
||||
*--------------------------------------------------------------------*/
|
||||
if ( shiftDist < -15 ) {
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
return
|
||||
(exp == 0x7FFF) && (sig64 | sig0) ? i64_fromNaN
|
||||
: sign ? i64_fromNegOverflow : i64_fromPosOverflow;
|
||||
}
|
||||
/*--------------------------------------------------------------------
|
||||
*--------------------------------------------------------------------*/
|
||||
sig64 |= UINT64_C( 0x0001000000000000 );
|
||||
if ( shiftDist ) {
|
||||
sig128 = softfloat_shortShiftLeft128( sig64, sig0, -shiftDist );
|
||||
sig64 = sig128.v64;
|
||||
sig0 = sig128.v0;
|
||||
}
|
||||
} else {
|
||||
/*--------------------------------------------------------------------
|
||||
*--------------------------------------------------------------------*/
|
||||
if ( exp ) sig64 |= UINT64_C( 0x0001000000000000 );
|
||||
sigExtra = softfloat_shiftRightJam64Extra( sig64, sig0, shiftDist );
|
||||
sig64 = sigExtra.v;
|
||||
sig0 = sigExtra.extra;
|
||||
}
|
||||
return softfloat_roundToI64( state, sign, sig64, sig0, roundingMode, exact );
|
||||
|
||||
}
|
||||
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the
|
||||
University of California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint_fast32_t
|
||||
f128_to_ui32( struct softfloat_state *state, float128_t a, uint_fast8_t roundingMode, bool exact )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
bool sign;
|
||||
int_fast32_t exp;
|
||||
uint_fast64_t sig64;
|
||||
int_fast32_t shiftDist;
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
sign = signF128UI64( uiA64 );
|
||||
exp = expF128UI64( uiA64 );
|
||||
sig64 = fracF128UI64( uiA64 ) | (uiA0 != 0);
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
#if (ui32_fromNaN != ui32_fromPosOverflow) || (ui32_fromNaN != ui32_fromNegOverflow)
|
||||
if ( (exp == 0x7FFF) && sig64 ) {
|
||||
#if (ui32_fromNaN == ui32_fromPosOverflow)
|
||||
sign = 0;
|
||||
#elif (ui32_fromNaN == ui32_fromNegOverflow)
|
||||
sign = 1;
|
||||
#else
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
return ui32_fromNaN;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( exp ) sig64 |= UINT64_C( 0x0001000000000000 );
|
||||
shiftDist = 0x4023 - exp;
|
||||
if ( 0 < shiftDist ) {
|
||||
sig64 = softfloat_shiftRightJam64( sig64, shiftDist );
|
||||
}
|
||||
return softfloat_roundToUI32( sign, sig64, roundingMode, exact );
|
||||
|
||||
}
|
||||
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the
|
||||
University of California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint_fast64_t
|
||||
f128_to_ui64( struct softfloat_state *state, float128_t a, uint_fast8_t roundingMode, bool exact )
|
||||
{
|
||||
union ui128_f128 uA;
|
||||
uint_fast64_t uiA64, uiA0;
|
||||
bool sign;
|
||||
int_fast32_t exp;
|
||||
uint_fast64_t sig64, sig0;
|
||||
int_fast32_t shiftDist;
|
||||
struct uint128 sig128;
|
||||
struct uint64_extra sigExtra;
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uA.f = a;
|
||||
uiA64 = uA.ui.v64;
|
||||
uiA0 = uA.ui.v0;
|
||||
sign = signF128UI64( uiA64 );
|
||||
exp = expF128UI64( uiA64 );
|
||||
sig64 = fracF128UI64( uiA64 );
|
||||
sig0 = uiA0;
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
shiftDist = 0x402F - exp;
|
||||
if ( shiftDist <= 0 ) {
|
||||
/*--------------------------------------------------------------------
|
||||
*--------------------------------------------------------------------*/
|
||||
if ( shiftDist < -15 ) {
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
return
|
||||
(exp == 0x7FFF) && (sig64 | sig0) ? ui64_fromNaN
|
||||
: sign ? ui64_fromNegOverflow : ui64_fromPosOverflow;
|
||||
}
|
||||
/*--------------------------------------------------------------------
|
||||
*--------------------------------------------------------------------*/
|
||||
sig64 |= UINT64_C( 0x0001000000000000 );
|
||||
if ( shiftDist ) {
|
||||
sig128 = softfloat_shortShiftLeft128( sig64, sig0, -shiftDist );
|
||||
sig64 = sig128.v64;
|
||||
sig0 = sig128.v0;
|
||||
}
|
||||
} else {
|
||||
/*--------------------------------------------------------------------
|
||||
*--------------------------------------------------------------------*/
|
||||
if ( exp ) sig64 |= UINT64_C( 0x0001000000000000 );
|
||||
sigExtra = softfloat_shiftRightJam64Extra( sig64, sig0, shiftDist );
|
||||
sig64 = sigExtra.v;
|
||||
sig0 = sigExtra.extra;
|
||||
}
|
||||
return softfloat_roundToUI64( state, sign, sig64, sig0, roundingMode, exact );
|
||||
|
||||
}
|
||||
|
||||
Vendored
File renamed without changes.
+96
@@ -0,0 +1,96 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float128_t f32_to_f128( struct softfloat_state *state, float32_t a )
|
||||
{
|
||||
union ui32_f32 uA;
|
||||
uint_fast32_t uiA;
|
||||
bool sign;
|
||||
int_fast16_t exp;
|
||||
uint_fast32_t frac;
|
||||
struct commonNaN commonNaN;
|
||||
struct uint128 uiZ;
|
||||
struct exp16_sig32 normExpSig;
|
||||
union ui128_f128 uZ;
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uA.f = a;
|
||||
uiA = uA.ui;
|
||||
sign = signF32UI( uiA );
|
||||
exp = expF32UI( uiA );
|
||||
frac = fracF32UI( uiA );
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( exp == 0xFF ) {
|
||||
if ( frac ) {
|
||||
softfloat_f32UIToCommonNaN( state, uiA, &commonNaN );
|
||||
uiZ = softfloat_commonNaNToF128UI( &commonNaN );
|
||||
} else {
|
||||
uiZ.v64 = packToF128UI64( sign, 0x7FFF, 0 );
|
||||
uiZ.v0 = 0;
|
||||
}
|
||||
goto uiZ;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( ! exp ) {
|
||||
if ( ! frac ) {
|
||||
uiZ.v64 = packToF128UI64( sign, 0, 0 );
|
||||
uiZ.v0 = 0;
|
||||
goto uiZ;
|
||||
}
|
||||
normExpSig = softfloat_normSubnormalF32Sig( frac );
|
||||
exp = normExpSig.exp - 1;
|
||||
frac = normExpSig.sig;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uiZ.v64 = packToF128UI64( sign, exp + 0x3F80, (uint_fast64_t) frac<<25 );
|
||||
uiZ.v0 = 0;
|
||||
uiZ:
|
||||
uZ.ui = uiZ;
|
||||
return uZ.f;
|
||||
|
||||
}
|
||||
|
||||
Vendored
File renamed without changes.
Vendored
File renamed without changes.
+64
@@ -0,0 +1,64 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float128_t i32_to_f128( int32_t a )
|
||||
{
|
||||
uint_fast64_t uiZ64;
|
||||
bool sign;
|
||||
uint_fast32_t absA;
|
||||
int_fast8_t shiftDist;
|
||||
union ui128_f128 uZ;
|
||||
|
||||
uiZ64 = 0;
|
||||
if ( a ) {
|
||||
sign = (a < 0);
|
||||
absA = sign ? -(uint_fast32_t) a : (uint_fast32_t) a;
|
||||
shiftDist = softfloat_countLeadingZeros32( absA ) + 17;
|
||||
uiZ64 =
|
||||
packToF128UI64(
|
||||
sign, 0x402E - shiftDist, (uint_fast64_t) absA<<shiftDist );
|
||||
}
|
||||
uZ.ui.v64 = uiZ64;
|
||||
uZ.ui.v0 = 0;
|
||||
return uZ.f;
|
||||
|
||||
}
|
||||
|
||||
+4
@@ -196,16 +196,20 @@ struct exp32_sig128
|
||||
|
||||
float128_t
|
||||
softfloat_roundPackToF128(
|
||||
struct softfloat_state *,
|
||||
bool, int_fast32_t, uint_fast64_t, uint_fast64_t, uint_fast64_t );
|
||||
float128_t
|
||||
softfloat_normRoundPackToF128(
|
||||
struct softfloat_state *,
|
||||
bool, int_fast32_t, uint_fast64_t, uint_fast64_t );
|
||||
|
||||
float128_t
|
||||
softfloat_addMagsF128(
|
||||
struct softfloat_state *,
|
||||
uint_fast64_t, uint_fast64_t, uint_fast64_t, uint_fast64_t, bool );
|
||||
float128_t
|
||||
softfloat_subMagsF128(
|
||||
struct softfloat_state *,
|
||||
uint_fast64_t, uint_fast64_t, uint_fast64_t, uint_fast64_t, bool );
|
||||
float128_t
|
||||
softfloat_mulAddF128(
|
||||
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
+155
@@ -0,0 +1,155 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
|
||||
float128_t
|
||||
softfloat_addMagsF128(
|
||||
struct softfloat_state *state,
|
||||
uint_fast64_t uiA64,
|
||||
uint_fast64_t uiA0,
|
||||
uint_fast64_t uiB64,
|
||||
uint_fast64_t uiB0,
|
||||
bool signZ
|
||||
)
|
||||
{
|
||||
int_fast32_t expA;
|
||||
struct uint128 sigA;
|
||||
int_fast32_t expB;
|
||||
struct uint128 sigB;
|
||||
int_fast32_t expDiff;
|
||||
struct uint128 uiZ, sigZ;
|
||||
int_fast32_t expZ;
|
||||
uint_fast64_t sigZExtra;
|
||||
struct uint128_extra sig128Extra;
|
||||
union ui128_f128 uZ;
|
||||
|
||||
expA = expF128UI64( uiA64 );
|
||||
sigA.v64 = fracF128UI64( uiA64 );
|
||||
sigA.v0 = uiA0;
|
||||
expB = expF128UI64( uiB64 );
|
||||
sigB.v64 = fracF128UI64( uiB64 );
|
||||
sigB.v0 = uiB0;
|
||||
expDiff = expA - expB;
|
||||
if ( ! expDiff ) {
|
||||
if ( expA == 0x7FFF ) {
|
||||
if ( sigA.v64 | sigA.v0 | sigB.v64 | sigB.v0 ) goto propagateNaN;
|
||||
uiZ.v64 = uiA64;
|
||||
uiZ.v0 = uiA0;
|
||||
goto uiZ;
|
||||
}
|
||||
sigZ = softfloat_add128( sigA.v64, sigA.v0, sigB.v64, sigB.v0 );
|
||||
if ( ! expA ) {
|
||||
uiZ.v64 = packToF128UI64( signZ, 0, sigZ.v64 );
|
||||
uiZ.v0 = sigZ.v0;
|
||||
goto uiZ;
|
||||
}
|
||||
expZ = expA;
|
||||
sigZ.v64 |= UINT64_C( 0x0002000000000000 );
|
||||
sigZExtra = 0;
|
||||
goto shiftRight1;
|
||||
}
|
||||
if ( expDiff < 0 ) {
|
||||
if ( expB == 0x7FFF ) {
|
||||
if ( sigB.v64 | sigB.v0 ) goto propagateNaN;
|
||||
uiZ.v64 = packToF128UI64( signZ, 0x7FFF, 0 );
|
||||
uiZ.v0 = 0;
|
||||
goto uiZ;
|
||||
}
|
||||
expZ = expB;
|
||||
if ( expA ) {
|
||||
sigA.v64 |= UINT64_C( 0x0001000000000000 );
|
||||
} else {
|
||||
++expDiff;
|
||||
sigZExtra = 0;
|
||||
if ( ! expDiff ) goto newlyAligned;
|
||||
}
|
||||
sig128Extra =
|
||||
softfloat_shiftRightJam128Extra( sigA.v64, sigA.v0, 0, -expDiff );
|
||||
sigA = sig128Extra.v;
|
||||
sigZExtra = sig128Extra.extra;
|
||||
} else {
|
||||
if ( expA == 0x7FFF ) {
|
||||
if ( sigA.v64 | sigA.v0 ) goto propagateNaN;
|
||||
uiZ.v64 = uiA64;
|
||||
uiZ.v0 = uiA0;
|
||||
goto uiZ;
|
||||
}
|
||||
expZ = expA;
|
||||
if ( expB ) {
|
||||
sigB.v64 |= UINT64_C( 0x0001000000000000 );
|
||||
} else {
|
||||
--expDiff;
|
||||
sigZExtra = 0;
|
||||
if ( ! expDiff ) goto newlyAligned;
|
||||
}
|
||||
sig128Extra =
|
||||
softfloat_shiftRightJam128Extra( sigB.v64, sigB.v0, 0, expDiff );
|
||||
sigB = sig128Extra.v;
|
||||
sigZExtra = sig128Extra.extra;
|
||||
}
|
||||
newlyAligned:
|
||||
sigZ =
|
||||
softfloat_add128(
|
||||
sigA.v64 | UINT64_C( 0x0001000000000000 ),
|
||||
sigA.v0,
|
||||
sigB.v64,
|
||||
sigB.v0
|
||||
);
|
||||
--expZ;
|
||||
if ( sigZ.v64 < UINT64_C( 0x0002000000000000 ) ) goto roundAndPack;
|
||||
++expZ;
|
||||
shiftRight1:
|
||||
sig128Extra =
|
||||
softfloat_shortShiftRightJam128Extra(
|
||||
sigZ.v64, sigZ.v0, sigZExtra, 1 );
|
||||
sigZ = sig128Extra.v;
|
||||
sigZExtra = sig128Extra.extra;
|
||||
roundAndPack:
|
||||
return
|
||||
softfloat_roundPackToF128( state, signZ, expZ, sigZ.v64, sigZ.v0, sigZExtra );
|
||||
propagateNaN:
|
||||
uiZ = softfloat_propagateNaNF128UI( state, uiA64, uiA0, uiB64, uiB0 );
|
||||
uiZ:
|
||||
uZ.ui = uiZ;
|
||||
return uZ.f;
|
||||
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,82 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
|
||||
float128_t
|
||||
softfloat_normRoundPackToF128(
|
||||
struct softfloat_state *state,
|
||||
bool sign, int_fast32_t exp, uint_fast64_t sig64, uint_fast64_t sig0 )
|
||||
{
|
||||
int_fast8_t shiftDist;
|
||||
struct uint128 sig128;
|
||||
union ui128_f128 uZ;
|
||||
uint_fast64_t sigExtra;
|
||||
struct uint128_extra sig128Extra;
|
||||
|
||||
if ( ! sig64 ) {
|
||||
exp -= 64;
|
||||
sig64 = sig0;
|
||||
sig0 = 0;
|
||||
}
|
||||
shiftDist = softfloat_countLeadingZeros64( sig64 ) - 15;
|
||||
exp -= shiftDist;
|
||||
if ( 0 <= shiftDist ) {
|
||||
if ( shiftDist ) {
|
||||
sig128 = softfloat_shortShiftLeft128( sig64, sig0, shiftDist );
|
||||
sig64 = sig128.v64;
|
||||
sig0 = sig128.v0;
|
||||
}
|
||||
if ( (uint32_t) exp < 0x7FFD ) {
|
||||
uZ.ui.v64 = packToF128UI64( sign, sig64 | sig0 ? exp : 0, sig64 );
|
||||
uZ.ui.v0 = sig0;
|
||||
return uZ.f;
|
||||
}
|
||||
sigExtra = 0;
|
||||
} else {
|
||||
sig128Extra =
|
||||
softfloat_shortShiftRightJam128Extra( sig64, sig0, 0, -shiftDist );
|
||||
sig64 = sig128Extra.v.v64;
|
||||
sig0 = sig128Extra.v.v0;
|
||||
sigExtra = sig128Extra.extra;
|
||||
}
|
||||
return softfloat_roundPackToF128( state, sign, exp, sig64, sig0, sigExtra );
|
||||
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,82 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting the unsigned integer formed from concatenating `uiA64' and
|
||||
| `uiA0' as a 128-bit floating-point value, and likewise interpreting the
|
||||
| unsigned integer formed from concatenating `uiB64' and `uiB0' as another
|
||||
| 128-bit floating-point value, and assuming at least on of these floating-
|
||||
| point values is a NaN, returns the bit pattern of the combined NaN result.
|
||||
| If either original floating-point value is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct uint128
|
||||
softfloat_propagateNaNF128UI(
|
||||
struct softfloat_state *state,
|
||||
uint_fast64_t uiA64,
|
||||
uint_fast64_t uiA0,
|
||||
uint_fast64_t uiB64,
|
||||
uint_fast64_t uiB0
|
||||
)
|
||||
{
|
||||
bool isSigNaNA;
|
||||
struct uint128 uiZ;
|
||||
|
||||
isSigNaNA = softfloat_isSigNaNF128UI( uiA64, uiA0 );
|
||||
if ( isSigNaNA || softfloat_isSigNaNF128UI( uiB64, uiB0 ) ) {
|
||||
softfloat_raiseFlags( state, softfloat_flag_invalid );
|
||||
if ( isSigNaNA ) goto returnNonsigA;
|
||||
}
|
||||
if ( isNaNF128UI( uiA64, uiA0 ) ) {
|
||||
returnNonsigA:
|
||||
uiZ.v64 = uiA64;
|
||||
uiZ.v0 = uiA0;
|
||||
} else {
|
||||
uiZ.v64 = uiB64;
|
||||
uiZ.v0 = uiB0;
|
||||
}
|
||||
uiZ.v64 |= UINT64_C( 0x0000800000000000 );
|
||||
return uiZ;
|
||||
|
||||
}
|
||||
|
||||
File renamed without changes.
+171
@@ -0,0 +1,171 @@
|
||||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2017 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float128_t
|
||||
softfloat_roundPackToF128(
|
||||
struct softfloat_state *state,
|
||||
bool sign,
|
||||
int_fast32_t exp,
|
||||
uint_fast64_t sig64,
|
||||
uint_fast64_t sig0,
|
||||
uint_fast64_t sigExtra
|
||||
)
|
||||
{
|
||||
uint_fast8_t roundingMode;
|
||||
bool roundNearEven, doIncrement, isTiny;
|
||||
struct uint128_extra sig128Extra;
|
||||
uint_fast64_t uiZ64, uiZ0;
|
||||
struct uint128 sig128;
|
||||
union ui128_f128 uZ;
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
roundingMode = state->roundingMode;
|
||||
roundNearEven = (roundingMode == softfloat_round_near_even);
|
||||
doIncrement = (UINT64_C( 0x8000000000000000 ) <= sigExtra);
|
||||
if ( ! roundNearEven && (roundingMode != softfloat_round_near_maxMag) ) {
|
||||
doIncrement =
|
||||
(roundingMode
|
||||
== (sign ? softfloat_round_min : softfloat_round_max))
|
||||
&& sigExtra;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( 0x7FFD <= (uint32_t) exp ) {
|
||||
if ( exp < 0 ) {
|
||||
/*----------------------------------------------------------------
|
||||
*----------------------------------------------------------------*/
|
||||
isTiny =
|
||||
(state->detectTininess
|
||||
== softfloat_tininess_beforeRounding)
|
||||
|| (exp < -1)
|
||||
|| ! doIncrement
|
||||
|| softfloat_lt128(
|
||||
sig64,
|
||||
sig0,
|
||||
UINT64_C( 0x0001FFFFFFFFFFFF ),
|
||||
UINT64_C( 0xFFFFFFFFFFFFFFFF )
|
||||
);
|
||||
sig128Extra =
|
||||
softfloat_shiftRightJam128Extra( sig64, sig0, sigExtra, -exp );
|
||||
sig64 = sig128Extra.v.v64;
|
||||
sig0 = sig128Extra.v.v0;
|
||||
sigExtra = sig128Extra.extra;
|
||||
exp = 0;
|
||||
if ( isTiny && sigExtra ) {
|
||||
softfloat_raiseFlags( state, softfloat_flag_underflow );
|
||||
}
|
||||
doIncrement = (UINT64_C( 0x8000000000000000 ) <= sigExtra);
|
||||
if (
|
||||
! roundNearEven
|
||||
&& (roundingMode != softfloat_round_near_maxMag)
|
||||
) {
|
||||
doIncrement =
|
||||
(roundingMode
|
||||
== (sign ? softfloat_round_min : softfloat_round_max))
|
||||
&& sigExtra;
|
||||
}
|
||||
} else if (
|
||||
(0x7FFD < exp)
|
||||
|| ((exp == 0x7FFD)
|
||||
&& softfloat_eq128(
|
||||
sig64,
|
||||
sig0,
|
||||
UINT64_C( 0x0001FFFFFFFFFFFF ),
|
||||
UINT64_C( 0xFFFFFFFFFFFFFFFF )
|
||||
)
|
||||
&& doIncrement)
|
||||
) {
|
||||
/*----------------------------------------------------------------
|
||||
*----------------------------------------------------------------*/
|
||||
softfloat_raiseFlags(
|
||||
state, softfloat_flag_overflow | softfloat_flag_inexact );
|
||||
if (
|
||||
roundNearEven
|
||||
|| (roundingMode == softfloat_round_near_maxMag)
|
||||
|| (roundingMode
|
||||
== (sign ? softfloat_round_min : softfloat_round_max))
|
||||
) {
|
||||
uiZ64 = packToF128UI64( sign, 0x7FFF, 0 );
|
||||
uiZ0 = 0;
|
||||
} else {
|
||||
uiZ64 =
|
||||
packToF128UI64(
|
||||
sign, 0x7FFE, UINT64_C( 0x0000FFFFFFFFFFFF ) );
|
||||
uiZ0 = UINT64_C( 0xFFFFFFFFFFFFFFFF );
|
||||
}
|
||||
goto uiZ;
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
if ( sigExtra ) {
|
||||
state->exceptionFlags |= softfloat_flag_inexact;
|
||||
#ifdef SOFTFLOAT_ROUND_ODD
|
||||
if ( roundingMode == softfloat_round_odd ) {
|
||||
sig0 |= 1;
|
||||
goto packReturn;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if ( doIncrement ) {
|
||||
sig128 = softfloat_add128( sig64, sig0, 0, 1 );
|
||||
sig64 = sig128.v64;
|
||||
sig0 =
|
||||
sig128.v0
|
||||
& ~(uint64_t)
|
||||
(! (sigExtra & UINT64_C( 0x7FFFFFFFFFFFFFFF ))
|
||||
& roundNearEven);
|
||||
} else {
|
||||
if ( ! (sig64 | sig0) ) exp = 0;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
*------------------------------------------------------------------------*/
|
||||
uiZ64 = packToF128UI64( sign, exp, sig64 );
|
||||
uiZ0 = sig0;
|
||||
uiZ:
|
||||
uZ.ui.v64 = uiZ64;
|
||||
uZ.ui.v0 = uiZ0;
|
||||
return uZ.f;
|
||||
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
Loaded 100 of 569 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user