mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-10 19:39:39 +01:00
Compare commits
495 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85fedbf668 | ||
|
|
5a0899fc09 | ||
|
|
1ece4f9d93 | ||
|
|
ef8da28487 | ||
|
|
7513b1378d | ||
|
|
691e692149 | ||
|
|
97b8a09bda | ||
|
|
456c71d1ff | ||
|
|
308357cba7 | ||
|
|
84240cc8e0 | ||
|
|
92e9ac6dc7 | ||
|
|
b42d79eb6a | ||
|
|
7ee84d8f70 | ||
|
|
01307a7baf | ||
|
|
bcd1018585 | ||
|
|
f3807d6a84 | ||
|
|
3b7571d378 | ||
|
|
ca46c3a5ba | ||
|
|
e46d822aeb | ||
|
|
2331782cf7 | ||
|
|
7c8cec186a | ||
|
|
77cfcee8a1 | ||
|
|
67a7b0049d | ||
|
|
9c3d3b9540 | ||
|
|
fb95a53944 | ||
|
|
63d095169a | ||
|
|
7a0cc79668 | ||
|
|
bcebb0c53c | ||
|
|
ba158edd81 | ||
|
|
8a3c100c54 | ||
|
|
f904480a49 | ||
|
|
8d19a560d0 | ||
|
|
c113f82f78 | ||
|
|
ea73e05852 | ||
|
|
ee0f88c901 | ||
|
|
a72cab8c47 | ||
|
|
1a73c76d83 | ||
|
|
1d3dcdf2d6 | ||
|
|
9740c1df6f | ||
|
|
de3a218a28 | ||
|
|
faa109e8d4 | ||
|
|
6aa7667e9d | ||
|
|
e1695f6c40 | ||
|
|
baa6957b9b | ||
|
|
79eb77b782 | ||
|
|
f3b4350e0f | ||
|
|
16ef6e2a18 | ||
|
|
923321cfb1 | ||
|
|
6f30762356 | ||
|
|
6c1ed0bb69 | ||
|
|
bd6d911cbe | ||
|
|
39cdadfb6a | ||
|
|
6fa5cea984 | ||
|
|
e13206d3a1 | ||
|
|
4000e923e8 | ||
|
|
0c7451ae5a | ||
|
|
56d315da48 | ||
|
|
994504c3e1 | ||
|
|
3d49665b85 | ||
|
|
38927fc590 | ||
|
|
cf1eb58d67 | ||
|
|
943aa033ae | ||
|
|
9e2b66fb0f | ||
|
|
4c33caa185 | ||
|
|
4b92816743 | ||
|
|
e15912b804 | ||
|
|
521ed72b87 | ||
|
|
447f8d4996 | ||
|
|
43b337eb43 | ||
|
|
7ec36bb783 | ||
|
|
c143138a35 | ||
|
|
42378970e1 | ||
|
|
82e8aa62de | ||
|
|
05ee562a38 | ||
|
|
0664b51765 | ||
|
|
157a4341f7 | ||
|
|
a49f0776eb | ||
|
|
2be07b5f9d | ||
|
|
f37f64df8c | ||
|
|
73b8b34a8c | ||
|
|
9267dfa63b | ||
|
|
293323c3e2 | ||
|
|
76e874c08e | ||
|
|
e9f6ba0526 | ||
|
|
e1910f2d19 | ||
|
|
3c60f0b2bb | ||
|
|
3eaa7615cd | ||
|
|
60bd73a595 | ||
|
|
2be27e1545 | ||
|
|
ba5093935d | ||
|
|
caf053b3ad | ||
|
|
8647c00114 | ||
|
|
fcf185c8b4 | ||
|
|
eac00f6d11 | ||
|
|
dfa5620ff3 | ||
|
|
65b5a2e3e4 | ||
|
|
8cad0431ff | ||
|
|
63af2f42b7 | ||
|
|
077b8422bb | ||
|
|
ec93cc5098 | ||
|
|
c330b90b9f | ||
|
|
8dada7373f | ||
|
|
659f70b370 | ||
|
|
5c8cb2edcb | ||
|
|
3eb5461578 | ||
|
|
4ac2e477b9 | ||
|
|
a3b58ee5cd | ||
|
|
e023addf70 | ||
|
|
40ae469962 | ||
|
|
24983dd4c1 | ||
|
|
325366ee1d | ||
|
|
d88c7b365a | ||
|
|
3f6c04247f | ||
|
|
5958463cad | ||
|
|
68b1b94d1b | ||
|
|
1997e89ddf | ||
|
|
3a3bcd53d0 | ||
|
|
940aa7c4cf | ||
|
|
3d0d0e6290 | ||
|
|
525f33baae | ||
|
|
d6a5f1bafb | ||
|
|
7c944ee6f4 | ||
|
|
67f18cc9ce | ||
|
|
352201ddec | ||
|
|
29c57e8b34 | ||
|
|
30b8bbe255 | ||
|
|
1ca764454b | ||
|
|
d589bafee3 | ||
|
|
b8233989e7 | ||
|
|
9a48e4d9d2 | ||
|
|
e3b679a2f6 | ||
|
|
c7be41ee0c | ||
|
|
0b0f83c01e | ||
|
|
dfcbfb5a41 | ||
|
|
ac2fede165 | ||
|
|
1c4c653168 | ||
|
|
f5ebda4370 | ||
|
|
c40b570b71 | ||
|
|
50b4cbd8a4 | ||
|
|
28ae281b42 | ||
|
|
029ace0a1b | ||
|
|
2beb2b602b | ||
|
|
ed03f0d9d1 | ||
|
|
e9136b5e08 | ||
|
|
a80ccf2cd2 | ||
|
|
28b0f3eaa5 | ||
|
|
4da7c35484 | ||
|
|
6bea1b6cf1 | ||
|
|
8858de393a | ||
|
|
ece0401054 | ||
|
|
095e769f47 | ||
|
|
1a7a184e41 | ||
|
|
f2c0d186ff | ||
|
|
08d563ba15 | ||
|
|
959fa4a1a3 | ||
|
|
43000a34d5 | ||
|
|
fd742af0b7 | ||
|
|
3b21a298c2 | ||
|
|
7dc00d39b4 | ||
|
|
1e086b1d73 | ||
|
|
db535c86bc | ||
|
|
edfe28541a | ||
|
|
d33ad07c32 | ||
|
|
56f1e4ef05 | ||
|
|
d791f4b98d | ||
|
|
e096660a18 | ||
|
|
103338534f | ||
|
|
81c44e5eb4 | ||
|
|
ce9d543eb1 | ||
|
|
1a07d542ec | ||
|
|
a0df0a527f | ||
|
|
8485cb1ca1 | ||
|
|
f51363e027 | ||
|
|
cf5ee0bda2 | ||
|
|
8ad0b2afe3 | ||
|
|
f6d29909bb | ||
|
|
15378a7853 | ||
|
|
880f9a7b16 | ||
|
|
9527586923 | ||
|
|
1e3a0fdb5d | ||
|
|
0312694c46 | ||
|
|
75f3ec77e4 | ||
|
|
35bd2f354e | ||
|
|
a491564001 | ||
|
|
b89cba7517 | ||
|
|
0b704a2279 | ||
|
|
ac3bbf7ddc | ||
|
|
a1473ec302 | ||
|
|
4a22c1fefc | ||
|
|
494806286f | ||
|
|
461ffafeba | ||
|
|
eb0d1ce948 | ||
|
|
82137db24d | ||
|
|
b3986bdbdb | ||
|
|
96388be1b5 | ||
|
|
4ae6ce61ea | ||
|
|
57ee3ba7e1 | ||
|
|
1f6144ef26 | ||
|
|
08c1f44eef | ||
|
|
28c8729019 | ||
|
|
8c2b4f6271 | ||
|
|
8389e24d38 | ||
|
|
8da6435d4d | ||
|
|
7ae6069ee8 | ||
|
|
1d5587b887 | ||
|
|
5e15415cb9 | ||
|
|
3689f3909e | ||
|
|
9458a4355f | ||
|
|
c5de307284 | ||
|
|
65c98e577f | ||
|
|
246552674c | ||
|
|
d752f19611 | ||
|
|
f1b5a6e66e | ||
|
|
d8a23373c6 | ||
|
|
c329f97f32 | ||
|
|
86d527f987 | ||
|
|
f0b72f728d | ||
|
|
fc2da15bce | ||
|
|
3e509c8bd1 | ||
|
|
6da3ecd65d | ||
|
|
9291abc633 | ||
|
|
0054bbed7f | ||
|
|
3a625f38aa | ||
|
|
25dd51e4fc | ||
|
|
9793e73bc1 | ||
|
|
57d35f98f6 | ||
|
|
0105203575 | ||
|
|
4e68d665be | ||
|
|
ca81ab5ebc | ||
|
|
43603ac2f9 | ||
|
|
4d4cef800a | ||
|
|
1c7f34d3dd | ||
|
|
5e0d42b6a6 | ||
|
|
3326874f5f | ||
|
|
48e3b6511a | ||
|
|
16232578d9 | ||
|
|
027607968b | ||
|
|
8de158aefe | ||
|
|
df2d4c1575 | ||
|
|
4d898aa451 | ||
|
|
08dfc4a42e | ||
|
|
593a5898f9 | ||
|
|
15ae8d02ee | ||
|
|
a032de2904 | ||
|
|
4110d3925c | ||
|
|
133419177d | ||
|
|
e29b0edc97 | ||
|
|
cb1c73663e | ||
|
|
c6b14c62f6 | ||
|
|
ddc8a9d5da | ||
|
|
965aace297 | ||
|
|
811d08c0a4 | ||
|
|
519bb268a0 | ||
|
|
d112f35d92 | ||
|
|
da4b7a8c56 | ||
|
|
333a9973f1 | ||
|
|
9576546b9c | ||
|
|
68ba7ee5c8 | ||
|
|
6f622da7fb | ||
|
|
8f08020fa4 | ||
|
|
a83cfe2658 | ||
|
|
6711e1327a | ||
|
|
a6220fa903 | ||
|
|
7be94d043d | ||
|
|
822a1554cb | ||
|
|
d00f31156a | ||
|
|
effee122dd | ||
|
|
70c4e2c0cc | ||
|
|
11147046aa | ||
|
|
98b667834c | ||
|
|
1b2d9cad53 | ||
|
|
6aec2dcf76 | ||
|
|
079f503d96 | ||
|
|
51763b6700 | ||
|
|
4b1653056d | ||
|
|
5154b71637 | ||
|
|
8b98f958dc | ||
|
|
21e0fb8648 | ||
|
|
13987b4244 | ||
|
|
6d3becb486 | ||
|
|
15dbb6a380 | ||
|
|
9769ee8697 | ||
|
|
82c3612d77 | ||
|
|
64e4aa21a4 | ||
|
|
bf374c33f5 | ||
|
|
847f65c14a | ||
|
|
8903854e01 | ||
|
|
a07b72bfcf | ||
|
|
2ea0364b6e | ||
|
|
50c099d69e | ||
|
|
e21d06f488 | ||
|
|
db44e97c5d | ||
|
|
c199f5326b | ||
|
|
0f458e2c3e | ||
|
|
efeacfee01 | ||
|
|
2214906310 | ||
|
|
cee74f9e67 | ||
|
|
7709d435d0 | ||
|
|
e03b1506d3 | ||
|
|
d6b40d3033 | ||
|
|
93d4ad4dd4 | ||
|
|
dc9a6ef610 | ||
|
|
191b38e712 | ||
|
|
78e5008e91 | ||
|
|
4956a76621 | ||
|
|
6113fa7503 | ||
|
|
395e404666 | ||
|
|
dfa18fe6b3 | ||
|
|
87be63f85d | ||
|
|
aaf3df7bb8 | ||
|
|
eef156180c | ||
|
|
882d635807 | ||
|
|
8f22db23a5 | ||
|
|
a62279ca0a | ||
|
|
18df6fd5ba | ||
|
|
f2b10c6c22 | ||
|
|
5ccd5106e0 | ||
|
|
93aa7e2fcf | ||
|
|
10def484df | ||
|
|
7105bb98cf | ||
|
|
a01aa22026 | ||
|
|
4fbf272017 | ||
|
|
13439113c3 | ||
|
|
400eb9b10a | ||
|
|
a599c30171 | ||
|
|
b9bf447209 | ||
|
|
da2d7a09f9 | ||
|
|
22a39dc858 | ||
|
|
27fda0ea1f | ||
|
|
080f1cc8cd | ||
|
|
c4c6b1fe06 | ||
|
|
9be8ac6fbc | ||
|
|
7d4c3fd091 | ||
|
|
75420e9314 | ||
|
|
e11d126a8d | ||
|
|
21f0ed50a2 | ||
|
|
4bc826ac1e | ||
|
|
db7ee3dad1 | ||
|
|
6f4dfa6626 | ||
|
|
7bb4474d81 | ||
|
|
21b8749bfd | ||
|
|
ea7e722ca0 | ||
|
|
e2f8f1aded | ||
|
|
afee7405bd | ||
|
|
3a4a9b7af7 | ||
|
|
cf158bc6cd | ||
|
|
5b12a87dcb | ||
|
|
587f2b4b4d | ||
|
|
189fc8ddef | ||
|
|
8a1f9f0a32 | ||
|
|
4ddd3dec2d | ||
|
|
bc7eabd7e4 | ||
|
|
f525290000 | ||
|
|
acdbf83325 | ||
|
|
81e43114ec | ||
|
|
f6f73ce70d | ||
|
|
aac1f9af01 | ||
|
|
cd45ba32f0 | ||
|
|
69c9f2566e | ||
|
|
3328b4ecf2 | ||
|
|
6a5256ec04 | ||
|
|
0b1f57105d | ||
|
|
93e889b48c | ||
|
|
bb7a8403ba | ||
|
|
087a07b5ed | ||
|
|
02ec8ca2d6 | ||
|
|
47ebf8d868 | ||
|
|
78602be1fe | ||
|
|
7f672eb266 | ||
|
|
48223f7b9c | ||
|
|
d4cd27e875 | ||
|
|
dc940ec8af | ||
|
|
ded01e4316 | ||
|
|
59fcfae630 | ||
|
|
1717946c1b | ||
|
|
fea5f2b145 | ||
|
|
a28e4d839c | ||
|
|
0714114fe3 | ||
|
|
41436bb0e8 | ||
|
|
cc8bd63741 | ||
|
|
235973615f | ||
|
|
0d66689177 | ||
|
|
7540fa2147 | ||
|
|
9d60300fee | ||
|
|
8bd080bcc9 | ||
|
|
76a55c3cb6 | ||
|
|
499186be0f | ||
|
|
b12c5b4d18 | ||
|
|
d85dd77edf | ||
|
|
9e92a9e2ba | ||
|
|
37298844c9 | ||
|
|
dd8636908c | ||
|
|
5cb0d43823 | ||
|
|
8d43e0d664 | ||
|
|
f636674889 | ||
|
|
de6e013e0e | ||
|
|
92271af635 | ||
|
|
70eb95f848 | ||
|
|
922b12f30c | ||
|
|
2649406323 | ||
|
|
e9e4200a6a | ||
|
|
c59adf68d9 | ||
|
|
c4e7dc7ff2 | ||
|
|
d76b5b888e | ||
|
|
3e78ff16d3 | ||
|
|
207832952b | ||
|
|
162d66adac | ||
|
|
9b0ab92b16 | ||
|
|
d52d136486 | ||
|
|
dfddbcaab8 | ||
|
|
5eb0733f5f | ||
|
|
b8b70c8b4e | ||
|
|
5fc4322267 | ||
|
|
ea8f28980c | ||
|
|
b9c6ce900b | ||
|
|
00ff6a38ce | ||
|
|
475feb064b | ||
|
|
6c2ae44c05 | ||
|
|
4a7ce1d7c1 | ||
|
|
b6c2122efb | ||
|
|
543e355bd9 | ||
|
|
92b26317d4 | ||
|
|
a47d9ba98a | ||
|
|
80e37a96bb | ||
|
|
e1c4b4977e | ||
|
|
41a627b789 | ||
|
|
aa10ec7c96 | ||
|
|
fec0d1cf5b | ||
|
|
d0b770c938 | ||
|
|
a91d4c022f | ||
|
|
d2e4b51133 | ||
|
|
da40388736 | ||
|
|
2c509a158f | ||
|
|
41a2d49f0a | ||
|
|
276251c44a | ||
|
|
c388455d0a | ||
|
|
c5b6ed8ca0 | ||
|
|
59ffac84d3 | ||
|
|
f3168082b8 | ||
|
|
73fd8919f5 | ||
|
|
f62e05ee96 | ||
|
|
1bb0d3baaa | ||
|
|
fc8fb34f3d | ||
|
|
ff12ff534a | ||
|
|
1866c0c2ce | ||
|
|
0b9b82af03 | ||
|
|
3c38ed4128 | ||
|
|
40a055ebd2 | ||
|
|
84ffb64cd7 | ||
|
|
6cdebf0e4c | ||
|
|
a672138aa7 | ||
|
|
3245f56e53 | ||
|
|
5e2760856c | ||
|
|
ba39321902 | ||
|
|
75c651f859 | ||
|
|
3eece6e941 | ||
|
|
5b9932f8f3 | ||
|
|
0c191f6629 | ||
|
|
bfee766f03 | ||
|
|
857f68c60f | ||
|
|
21966942b6 | ||
|
|
0ae5748f74 | ||
|
|
99070658fd | ||
|
|
db56266ad1 | ||
|
|
7ef263307a | ||
|
|
d959c7ded7 | ||
|
|
ec148c1365 | ||
|
|
2cbce1f0f1 | ||
|
|
681a57f960 | ||
|
|
4d4951a442 | ||
|
|
697f27c5d5 | ||
|
|
002b985a46 | ||
|
|
e12f514120 | ||
|
|
7e9dfa4ae4 | ||
|
|
68164a4847 | ||
|
|
752e162955 | ||
|
|
4d1a51cb85 | ||
|
|
a73226b18e | ||
|
|
6e28cd3b79 | ||
|
|
6757994ad9 | ||
|
|
8ccc48c9c8 | ||
|
|
2145ace384 | ||
|
|
5731ab7fed | ||
|
|
81342acdae | ||
|
|
8523880f06 | ||
|
|
2b57f402c4 | ||
|
|
a8152bdb9a | ||
|
|
bd6152f596 | ||
|
|
c3776db498 | ||
|
|
b54bd824b5 | ||
|
|
abacece826 | ||
|
|
c977ef7b45 | ||
|
|
23a8c71d3b | ||
|
|
1e97c1c913 | ||
|
|
e7d90b941f |
22
.github/workflows/main.yml
vendored
22
.github/workflows/main.yml
vendored
@@ -36,7 +36,7 @@ on:
|
||||
platforms:
|
||||
description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")'
|
||||
required: true
|
||||
default: 'linux-x64, linux-x86-hs, linux-x64-variants, linux-cross-compile, alpine-linux-x64, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
|
||||
default: 'linux-x64, linux-x64-variants, linux-cross-compile, alpine-linux-x64, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
|
||||
configure-arguments:
|
||||
description: 'Additional configure arguments'
|
||||
required: false
|
||||
@@ -62,7 +62,6 @@ jobs:
|
||||
EXCLUDED_PLATFORMS: 'alpine-linux-x64'
|
||||
outputs:
|
||||
linux-x64: ${{ steps.include.outputs.linux-x64 }}
|
||||
linux-x86-hs: ${{ steps.include.outputs.linux-x86-hs }}
|
||||
linux-x64-variants: ${{ steps.include.outputs.linux-x64-variants }}
|
||||
linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }}
|
||||
alpine-linux-x64: ${{ steps.include.outputs.alpine-linux-x64 }}
|
||||
@@ -145,7 +144,6 @@ jobs:
|
||||
}
|
||||
|
||||
echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
|
||||
echo "linux-x86-hs=$(check_platform linux-x86-hs linux x86)" >> $GITHUB_OUTPUT
|
||||
echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
|
||||
echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
|
||||
echo "alpine-linux-x64=$(check_platform alpine-linux-x64 alpine-linux x64)" >> $GITHUB_OUTPUT
|
||||
@@ -170,24 +168,6 @@ jobs:
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.prepare.outputs.linux-x64 == 'true'
|
||||
|
||||
build-linux-x86-hs:
|
||||
name: linux-x86-hs
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x86
|
||||
make-target: 'hotspot'
|
||||
gcc-major-version: '10'
|
||||
gcc-package-suffix: '-multilib'
|
||||
apt-architecture: 'i386'
|
||||
# Some multilib libraries do not have proper inter-dependencies, so we have to
|
||||
# install their dependencies manually.
|
||||
apt-extra-packages: 'libfreetype-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libffi-dev:i386'
|
||||
extra-conf-options: '--with-target-bits=32 --enable-fallback-linker --enable-libffi-bundling'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.prepare.outputs.linux-x86-hs == 'true'
|
||||
|
||||
build-linux-x64-hs-nopch:
|
||||
name: linux-x64-hs-nopch
|
||||
needs: prepare
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -20,3 +20,5 @@ NashornProfile.txt
|
||||
/.settings/
|
||||
/compile_commands.json
|
||||
/.cache
|
||||
/.gdbinit
|
||||
/.lldbinit
|
||||
|
||||
@@ -329,8 +329,8 @@ GB of free disk space is required.</p>
|
||||
<p>Even for 32-bit builds, it is recommended to use a 64-bit build
|
||||
machine, and instead create a 32-bit target using
|
||||
<code>--with-target-bits=32</code>.</p>
|
||||
<p>Note: The Windows 32-bit x86 port is deprecated and may be removed in
|
||||
a future release.</p>
|
||||
<p>Note: The 32-bit x86 port is deprecated and may be removed in a
|
||||
future release.</p>
|
||||
<h3 id="building-on-aarch64">Building on aarch64</h3>
|
||||
<p>At a minimum, a machine with 8 cores is advisable, as well as 8 GB of
|
||||
RAM. (The more cores to use, the more memory you need.) At least 6 GB of
|
||||
@@ -393,8 +393,7 @@ Build Platforms</a>. From time to time, this is updated by contributors
|
||||
to list successes or failures of building on different platforms.</p>
|
||||
<h3 id="windows">Windows</h3>
|
||||
<p>Windows XP is not a supported platform, but all newer Windows should
|
||||
be able to build the JDK. (Note: The Windows 32-bit x86 port is
|
||||
deprecated and may be removed in a future release.)</p>
|
||||
be able to build the JDK.</p>
|
||||
<p>On Windows, it is important that you pay attention to the
|
||||
instructions in the <a href="#special-considerations">Special
|
||||
Considerations</a>.</p>
|
||||
|
||||
@@ -134,8 +134,7 @@ space is required.
|
||||
Even for 32-bit builds, it is recommended to use a 64-bit build machine, and
|
||||
instead create a 32-bit target using `--with-target-bits=32`.
|
||||
|
||||
Note: The Windows 32-bit x86 port is deprecated and may be removed in a future
|
||||
release.
|
||||
Note: The 32-bit x86 port is deprecated and may be removed in a future release.
|
||||
|
||||
### Building on aarch64
|
||||
|
||||
@@ -191,8 +190,7 @@ on different platforms.
|
||||
### Windows
|
||||
|
||||
Windows XP is not a supported platform, but all newer Windows should be able to
|
||||
build the JDK. (Note: The Windows 32-bit x86 port is deprecated and may be
|
||||
removed in a future release.)
|
||||
build the JDK.
|
||||
|
||||
On Windows, it is important that you pay attention to the instructions in the
|
||||
[Special Considerations](#special-considerations).
|
||||
|
||||
@@ -107,15 +107,13 @@ JAVA_WARNINGS_ARE_ERRORS ?= -Werror
|
||||
JAVADOC_OPTIONS := -use -keywords -notimestamp \
|
||||
-encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \
|
||||
-splitIndex --system none -javafx --expand-requires transitive \
|
||||
--override-methods=summary \
|
||||
--no-external-specs-page
|
||||
--override-methods=summary
|
||||
|
||||
# The reference options must stay stable to allow for comparisons across the
|
||||
# development cycle.
|
||||
REFERENCE_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
|
||||
-encoding ISO-8859-1 -breakiterator -splitIndex --system none \
|
||||
-html5 -javafx --expand-requires transitive \
|
||||
--no-external-specs-page
|
||||
-html5 -javafx --expand-requires transitive
|
||||
|
||||
# Should we add DRAFT stamps to the generated javadoc?
|
||||
ifeq ($(VERSION_IS_GA), true)
|
||||
|
||||
@@ -102,7 +102,7 @@ help:
|
||||
$(info $(_) # method is 'auto', 'ignore' or 'fail' (default))
|
||||
$(info $(_) TEST="test1 ..." # Use the given test descriptor(s) for testing, e.g.)
|
||||
$(info $(_) # make test TEST="jdk_lang gtest:all")
|
||||
$(info $(_) TEST_DEPS="dependency1 ..." # Specify additional dependencies for running tests, e.g docs-jdk
|
||||
$(info $(_) TEST_DEPS="dependency1 ..." # Specify additional dependencies for running tests, e.g docs-jdk)
|
||||
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness, use 'make test-only JTREG=help' to list)
|
||||
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness, use 'make test-only GTEST=help' to list)
|
||||
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'make test-only MICRO=help' to list)
|
||||
|
||||
@@ -281,27 +281,6 @@ else
|
||||
endif
|
||||
CMDS_TARGET_SUBDIR := bin
|
||||
|
||||
# Param 1 - dir to find debuginfo files in
|
||||
FindDebuginfoFiles = \
|
||||
$(wildcard $(addprefix $1/*, $(DEBUGINFO_SUFFIXES)) \
|
||||
$(addprefix $1/*/*, $(DEBUGINFO_SUFFIXES)) \
|
||||
$(addprefix $1/*/*/*, $(DEBUGINFO_SUFFIXES)))
|
||||
|
||||
# Pick the correct debug info files to copy, either zipped or not.
|
||||
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
|
||||
DEBUGINFO_SUFFIXES += .diz
|
||||
else
|
||||
DEBUGINFO_SUFFIXES := .debuginfo .pdb .map
|
||||
# On Macosx, if debug symbols have not been zipped, find all files inside *.dSYM
|
||||
# dirs.
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
$(call FillFindCache, \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_libs $(SUPPORT_OUTPUTDIR)/modules_cmds)
|
||||
FindDebuginfoFiles = \
|
||||
$(if $(wildcard $1), $(call containing, .dSYM/, $(call FindFiles, $1)))
|
||||
endif
|
||||
endif
|
||||
|
||||
# Param 1 - either JDK or JRE
|
||||
SetupCopyDebuginfo = \
|
||||
$(foreach m, $(ALL_$1_MODULES), \
|
||||
|
||||
@@ -454,6 +454,18 @@ $(eval $(call SetupTarget, symbols-image, \
|
||||
TARGET := symbols, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, static-launcher, \
|
||||
MAKEFILE := StaticLibs, \
|
||||
TARGET := static-launcher, \
|
||||
DEPS := hotspot-static-libs static-libs, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, static-jdk-image, \
|
||||
MAKEFILE := StaticLibs, \
|
||||
TARGET := static-jdk-image, \
|
||||
DEPS := static-exploded-image jdk-image, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, static-libs-image, \
|
||||
MAKEFILE := StaticLibsImage, \
|
||||
TARGET := static-libs-image, \
|
||||
@@ -1086,9 +1098,9 @@ else
|
||||
|
||||
symbols-image: $(LIBS_TARGETS) $(LAUNCHER_TARGETS)
|
||||
|
||||
static-libs-image: hotspot-static-libs $(STATIC_LIBS_TARGETS)
|
||||
static-libs-image: hotspot-static-libs static-libs
|
||||
|
||||
static-libs-graal-image: $(STATIC_LIBS_TARGETS)
|
||||
static-libs-graal-image: static-libs
|
||||
|
||||
bootcycle-images: jdk-image
|
||||
|
||||
@@ -1254,6 +1266,8 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
legacy-images: mac-legacy-jre-bundle
|
||||
endif
|
||||
|
||||
static-exploded-image: static-launcher exploded-image
|
||||
|
||||
# These targets build the various documentation images
|
||||
docs-jdk-image: docs-jdk
|
||||
docs-javase-image: docs-javase
|
||||
@@ -1296,7 +1310,7 @@ endif
|
||||
################################################################################
|
||||
|
||||
# all-images builds all our deliverables as images.
|
||||
all-images: product-images test-image all-docs-images
|
||||
all-images: product-images static-jdk-image test-image all-docs-images
|
||||
|
||||
# all-bundles packages all our deliverables as tar.gz bundles.
|
||||
all-bundles: product-bundles test-bundles docs-bundles static-libs-bundles
|
||||
@@ -1309,7 +1323,7 @@ ALL_TARGETS += buildtools hotspot hotspot-libs hotspot-static-libs \
|
||||
create-buildjdk docs-jdk-api docs-javase-api docs-reference-api docs-jdk \
|
||||
docs-javase docs-reference docs-javadoc mac-bundles product-images legacy-images \
|
||||
docs-image docs-javase-image docs-reference-image all-docs-images \
|
||||
docs-bundles all-docs-bundles test-image all-images \
|
||||
docs-bundles all-docs-bundles test-image all-images static-exploded-image \
|
||||
all-bundles
|
||||
|
||||
################################################################################
|
||||
@@ -1344,9 +1358,13 @@ test-hotspot-jtreg-native: test-hotspot_native_sanity
|
||||
test-hotspot-gtest: exploded-test-gtest
|
||||
test-jdk-jtreg-native: test-jdk_native_sanity
|
||||
|
||||
# Set dependencies for doc tests
|
||||
$(eval $(call AddTestDependency, docs_all, docs-jdk))
|
||||
test-docs: test-docs_all
|
||||
|
||||
ALL_TARGETS += $(RUN_TEST_TARGETS) run-test exploded-run-test check \
|
||||
test-hotspot-jtreg test-hotspot-jtreg-native test-hotspot-gtest \
|
||||
test-jdk-jtreg-native
|
||||
test-jdk-jtreg-native test-docs
|
||||
|
||||
################################################################################
|
||||
################################################################################
|
||||
|
||||
@@ -137,6 +137,15 @@ define CleanModule
|
||||
$(call Clean-include, $1)
|
||||
endef
|
||||
|
||||
define AddTestDependency
|
||||
test-$(strip $1): $2
|
||||
|
||||
exploded-test-$(strip $1): $2
|
||||
|
||||
ifneq ($(filter $(TEST), $1), )
|
||||
TEST_DEPS += $2
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -45,6 +45,23 @@ TARGETS :=
|
||||
# Include the file being wrapped.
|
||||
include $(MAKEFILE_PREFIX).gmk
|
||||
|
||||
ifeq ($(MAKEFILE_PREFIX), Lib)
|
||||
# We need to keep track of what libraries are generated/needed by this
|
||||
# module. This information is required when doing static linking, to know
|
||||
# which static library files to include. The variable $(MODULE)_INCLUDED_LIBS is
|
||||
# added to for each call to SetupJdkLibrary. The file module-included-libs.txt is then
|
||||
# read in StaticLibs.gmk.
|
||||
ifneq ($($(MODULE)_INCLUDED_LIBS), )
|
||||
LIBLIST := $(SUPPORT_OUTPUTDIR)/modules_static-libs/$(MODULE)/module-included-libs.txt
|
||||
|
||||
$(LIBLIST): $(TARGETS)
|
||||
$(call MakeDir, $(@D))
|
||||
$(ECHO) $($(MODULE)_INCLUDED_LIBS) > $@
|
||||
|
||||
TARGETS += $(LIBLIST)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Setup copy rules from the modules directories to the jdk image directory.
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
TO_BIN_FILTER := %$(SHARED_LIBRARY_SUFFIX) %.diz %.pdb %.map
|
||||
|
||||
@@ -45,7 +45,7 @@ ifneq ($(TEST_VM_OPTS), )
|
||||
endif
|
||||
|
||||
$(eval $(call ParseKeywordVariable, TEST_OPTS, \
|
||||
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR JCOV JCOV_DIFF_CHANGESET, \
|
||||
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR JCOV JCOV_DIFF_CHANGESET AOT_JDK, \
|
||||
STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS, \
|
||||
))
|
||||
|
||||
@@ -202,11 +202,12 @@ $(eval $(call SetTestOpt,JOBS,JTREG))
|
||||
$(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
|
||||
$(eval $(call SetTestOpt,FAILURE_HANDLER_TIMEOUT,JTREG))
|
||||
$(eval $(call SetTestOpt,REPORT,JTREG))
|
||||
$(eval $(call SetTestOpt,AOT_JDK,JTREG))
|
||||
|
||||
$(eval $(call ParseKeywordVariable, JTREG, \
|
||||
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \
|
||||
TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS \
|
||||
RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
|
||||
RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT AOT_JDK $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
|
||||
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
|
||||
EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS \
|
||||
$(CUSTOM_JTREG_STRING_KEYWORDS), \
|
||||
@@ -702,6 +703,58 @@ define SetJtregValue
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
# Parameter 1 is the name of the rule.
|
||||
#
|
||||
# Remaining parameters are named arguments.
|
||||
# VM_OPTIONS List of JVM arguments to use when creating AOT cache
|
||||
#
|
||||
# After calling this, the following variables are defined
|
||||
# $1_AOT_TARGETS List of all targets that the test rule will need to depend on
|
||||
# $1_AOT_JDK_CACHE The AOT cache file to be used to run the test with
|
||||
#
|
||||
SetupAot = $(NamedParamsMacroTemplate)
|
||||
define SetupAotBody
|
||||
$1_AOT_JDK_CONF := $$($1_TEST_SUPPORT_DIR)/aot/jdk.aotconf
|
||||
$1_AOT_JDK_CACHE := $$($1_TEST_SUPPORT_DIR)/aot/jdk.aotcache
|
||||
|
||||
$1_JAVA_TOOL_OPTS := $$(addprefix -J, $$($1_VM_OPTIONS))
|
||||
|
||||
$$($1_AOT_JDK_CACHE): $$(JDK_IMAGE_DIR)/release
|
||||
$$(call MakeDir, $$($1_TEST_SUPPORT_DIR)/aot)
|
||||
|
||||
$(foreach jtool, javac javap jlink jar, \
|
||||
$(info AOT: Create cache configuration for $(jtool)) \
|
||||
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/aot.$(jtool), ( \
|
||||
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/$(jtool) $$($1_JAVA_TOOL_OPTS) \
|
||||
-J-XX:AOTMode=record -J-XX:AOTConfiguration=$$($1_AOT_JDK_CONF).$(jtool) --help \
|
||||
))
|
||||
)
|
||||
|
||||
$$(info AOT: Copy $(JDK_UNDER_TEST)/lib/classlist to $$($1_AOT_JDK_CONF).jdk )
|
||||
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/aot, ( \
|
||||
$$(FIXPATH) $(CP) $(JDK_UNDER_TEST)/lib/classlist $$($1_AOT_JDK_CONF).jdk \
|
||||
))
|
||||
|
||||
$$(FIXPATH) $$(CAT) $$($1_AOT_JDK_CONF).* > $$($1_AOT_JDK_CONF).temp
|
||||
$$(FIXPATH) $$(CAT) $$($1_AOT_JDK_CONF).temp | $(GREP) -v '#' | $(GREP) -v '@' | $(SORT) | \
|
||||
$(SED) -e 's/id:.*//g' | uniq \
|
||||
> $$($1_AOT_JDK_CONF)
|
||||
$$(FIXPATH) $$(CAT) $$($1_AOT_JDK_CONF).temp | $(GREP) '@cp' | $(SORT) \
|
||||
>> $$($1_AOT_JDK_CONF)
|
||||
|
||||
$$(info AOT: Generate AOT cache $$($1_AOT_JDK_CACHE) with flags: $$($1_VM_OPTIONS))
|
||||
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/aot, ( \
|
||||
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java \
|
||||
$$($1_VM_OPTIONS) -Xlog:cds,cds+class=debug:file=$$($1_AOT_JDK_CACHE).log \
|
||||
-XX:AOTMode=create -XX:AOTConfiguration=$$($1_AOT_JDK_CONF) -XX:AOTCache=$$($1_AOT_JDK_CACHE) \
|
||||
))
|
||||
|
||||
$1_AOT_TARGETS += $$($1_AOT_JDK_CACHE)
|
||||
|
||||
endef
|
||||
|
||||
|
||||
SetupRunJtregTest = $(NamedParamsMacroTemplate)
|
||||
define SetupRunJtregTestBody
|
||||
$1_TEST_RESULTS_DIR := $$(TEST_RESULTS_DIR)/$1
|
||||
@@ -762,6 +815,7 @@ define SetupRunJtregTestBody
|
||||
JTREG_RETRY_COUNT ?= 0
|
||||
JTREG_REPEAT_COUNT ?= 0
|
||||
JTREG_REPORT ?= files
|
||||
JTREG_AOT_JDK ?= false
|
||||
|
||||
ifneq ($$(JTREG_RETRY_COUNT), 0)
|
||||
ifneq ($$(JTREG_REPEAT_COUNT), 0)
|
||||
@@ -891,6 +945,17 @@ define SetupRunJtregTestBody
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$(JTREG_AOT_JDK), true)
|
||||
$$(info Add AOT target for $1)
|
||||
$$(eval $$(call SetupAot, $1, VM_OPTIONS := $$(JTREG_ALL_OPTIONS) ))
|
||||
|
||||
$$(info AOT_TARGETS=$$($1_AOT_TARGETS))
|
||||
$$(info AOT_JDK_CACHE=$$($1_AOT_JDK_CACHE))
|
||||
|
||||
$1_JTREG_BASIC_OPTIONS += -vmoption:-XX:AOTCache="$$($1_AOT_JDK_CACHE)"
|
||||
endif
|
||||
|
||||
|
||||
$$(eval $$(call SetupRunJtregTestCustom, $1))
|
||||
|
||||
# SetupRunJtregTestCustom might also adjust JTREG_AUTO_ variables
|
||||
@@ -906,6 +971,7 @@ define SetupRunJtregTestBody
|
||||
JTREG_TIMEOUT_FACTOR ?= $$(JTREG_AUTO_TIMEOUT_FACTOR)
|
||||
|
||||
clean-outputdirs-$1:
|
||||
$$(call LogWarn, Clean up dirs for $1)
|
||||
$$(RM) -r $$($1_TEST_SUPPORT_DIR)
|
||||
$$(RM) -r $$($1_TEST_RESULTS_DIR)
|
||||
|
||||
@@ -953,7 +1019,7 @@ define SetupRunJtregTestBody
|
||||
done
|
||||
endif
|
||||
|
||||
run-test-$1: pre-run-test clean-outputdirs-$1
|
||||
run-test-$1: clean-outputdirs-$1 pre-run-test $$($1_AOT_TARGETS)
|
||||
$$(call LogWarn)
|
||||
$$(call LogWarn, Running test '$$($1_TEST)')
|
||||
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR) \
|
||||
|
||||
191
make/StaticLibs.gmk
Normal file
191
make/StaticLibs.gmk
Normal file
@@ -0,0 +1,191 @@
|
||||
#
|
||||
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Modules.gmk
|
||||
include modules/LauncherCommon.gmk
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Create the static java launcher
|
||||
#
|
||||
################################################################################
|
||||
|
||||
STATIC_JDK_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/static-jdk
|
||||
STATIC_LAUNCHER_OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/static-native/launcher
|
||||
HOTSPOT_STATIC_LIB_PATH := $(HOTSPOT_OUTPUTDIR)/*/libjvm/objs/static
|
||||
|
||||
ifneq ($(word 2, $(wildcard $(HOTSPOT_STATIC_LIB_PATH))), )
|
||||
$(error Cannot perform static linking when building more than one JVM library)
|
||||
endif
|
||||
|
||||
# Find all modules with static libraries
|
||||
STATIC_LIB_MODULES := $(patsubst $(SUPPORT_OUTPUTDIR)/modules_static-libs/%, \
|
||||
%, $(wildcard $(SUPPORT_OUTPUTDIR)/modules_static-libs/*))
|
||||
|
||||
# Filter out known broken libraries. This is a temporary measure until
|
||||
# proper support for these libraries can be provided.
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
# libsplashscreen has a name conflict with libawt in the function
|
||||
# BitmapToYXBandedRectangles, so we exclude it for now.
|
||||
BROKEN_STATIC_LIBS += splashscreen
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
# libosxsecurity has a name conflict with libosxapp in the function
|
||||
# JavaStringToNSString, so we exclude it for now.
|
||||
BROKEN_STATIC_LIBS += osxsecurity
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
# libsplashscreen has a name conflict with libawt in the function
|
||||
# BitmapToYXBandedRectangles, so we exclude it for now.
|
||||
BROKEN_STATIC_LIBS += splashscreen
|
||||
# libsspi_bridge has name conflicts with sunmscapi
|
||||
BROKEN_STATIC_LIBS += sspi_bridge
|
||||
# These libs define DllMain which conflict with Hotspot
|
||||
BROKEN_STATIC_LIBS += awt dt_shmem dt_socket
|
||||
# These libs are dependent on any of the above disabled libs
|
||||
BROKEN_STATIC_LIBS += fontmanager jawt lcms net nio
|
||||
endif
|
||||
|
||||
$(foreach module, $(STATIC_LIB_MODULES), \
|
||||
$(eval LIBS_$(module) := $(filter-out $(BROKEN_STATIC_LIBS), $(shell cat \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_static-libs/$(module)/module-included-libs.txt))) \
|
||||
)
|
||||
|
||||
STATIC_LIB_FILES := $(foreach module, $(STATIC_LIB_MODULES), \
|
||||
$(foreach lib, $(LIBS_$(module)), \
|
||||
$(SUPPORT_OUTPUTDIR)/native/$(module)/lib$(lib)/static/$(LIBRARY_PREFIX)$(lib)$(STATIC_LIBRARY_SUFFIX)))
|
||||
|
||||
# Add Hotspot
|
||||
STATIC_LIB_FILES += $(wildcard $(HOTSPOT_STATIC_LIB_PATH)/$(LIBRARY_PREFIX)jvm$(STATIC_LIBRARY_SUFFIX))
|
||||
|
||||
# Figure out what external libraries are required to link these static JDK
|
||||
# libraries.
|
||||
LIB_FLAGS_FILES := $(addsuffix .lib-flags.txt, $(STATIC_LIB_FILES))
|
||||
|
||||
# Gather the lib flags from all individual libraries. There are many duplicates,
|
||||
# so sort and just keep unique instances. On macOS, a common pattern is
|
||||
# "-framework FooFramework", so we must make sure we keep the two words together.
|
||||
EXTERNAL_LIBS := $(strip $(shell $(CAT) $(LIB_FLAGS_FILES) | \
|
||||
$(SED) -e 's/-framework /-framework_/g' | $(TR) ' ' '\n' | $(SORT) -u | \
|
||||
$(SED) -e 's/-framework_/-framework /g'))
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
STATIC_LIBS := $(addprefix -force_load$(SPACE), $(STATIC_LIB_FILES))
|
||||
STANDARD_LIBS += -lstdc++
|
||||
else ifeq ($(call isTargetOs, linux), true)
|
||||
STATIC_LIBS := -Wl,--export-dynamic -Wl,--whole-archive $(STATIC_LIB_FILES) -Wl,--no-whole-archive
|
||||
STANDARD_LIBS := -l:libstdc++.a
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
STATIC_LIBS := $(addprefix -wholearchive:, $(STATIC_LIB_FILES))
|
||||
else
|
||||
$(error Unsupported platform)
|
||||
endif
|
||||
|
||||
$(eval $(call SetupBuildLauncher, java, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES, \
|
||||
EXTRA_RCFLAGS := $(JAVA_RCFLAGS), \
|
||||
VERSION_INFO_RESOURCE := $(JAVA_VERSION_INFO_RESOURCE), \
|
||||
OPTIMIZATION := HIGH, \
|
||||
STATIC_LAUNCHER := true, \
|
||||
LDFLAGS := $(LDFLAGS_STATIC_JDK), \
|
||||
LIBS := $(STATIC_LIBS) $(EXTERNAL_LIBS) $(STANDARD_LIBS), \
|
||||
OUTPUT_DIR := $(STATIC_LAUNCHER_OUTPUT_DIR), \
|
||||
OBJECT_DIR := $(STATIC_LAUNCHER_OUTPUT_DIR), \
|
||||
))
|
||||
|
||||
$(java): $(STATIC_LIB_FILES)
|
||||
|
||||
TARGETS += $(java)
|
||||
|
||||
JAVA_LAUNCHER := $(BUILD_LAUNCHER_java_TARGET)
|
||||
|
||||
static-launcher: $(java)
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Create the static-jdk image with the statically built java launcher
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# Until we get proper support in jlink for generating an image with static
|
||||
# builds, we need to create the image ourselves. We base it on a normal
|
||||
# dynamically linked JDK image.
|
||||
|
||||
# All these files/dirs should be copied as-is
|
||||
JDK_IMAGE_COPY_FILES := $(addprefix $(JDK_IMAGE_DIR)/, conf demo include jmods \
|
||||
legal man/man1/java.1 release README)
|
||||
|
||||
# We need to copy some files from lib, but not the dynamic libraries themselves
|
||||
ALL_LIB_FILES := $(call FindFiles, $(JDK_IMAGE_DIR)/lib)
|
||||
|
||||
# Remove all dynamic libraries from the list
|
||||
JDK_IMAGE_COPY_LIB_FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(ALL_LIB_FILES))
|
||||
# Remove all debug files from the list
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
JDK_IMAGE_COPY_LIB_FILES := $(call not-containing, .dSYM, $(JDK_IMAGE_COPY_LIB_FILES))
|
||||
else
|
||||
JDK_IMAGE_COPY_LIB_FILES := $(filter-out %.debuginfo %.pdb %.map, $(JDK_IMAGE_COPY_LIB_FILES))
|
||||
endif
|
||||
|
||||
static-jdk-info:
|
||||
$(call LogWarn, Creating static-jdk image)
|
||||
|
||||
$(eval $(call SetupCopyFiles, copy-from-jdk-image, \
|
||||
SRC := $(JDK_IMAGE_DIR), \
|
||||
DEST := $(STATIC_JDK_IMAGE_DIR), \
|
||||
FILES := $(call FindFiles, $(JDK_IMAGE_COPY_FILES)) \
|
||||
$(JDK_IMAGE_COPY_LIB_FILES), \
|
||||
))
|
||||
|
||||
TARGETS += $(copy-from-jdk-image)
|
||||
|
||||
$(copy-from-jdk-image): | static-jdk-info
|
||||
|
||||
$(eval $(call SetupCopyFiles, copy-static-launcher, \
|
||||
FILES := $(JAVA_LAUNCHER), \
|
||||
DEST := $(STATIC_JDK_IMAGE_DIR)/bin, \
|
||||
))
|
||||
|
||||
TARGETS += $(copy-static-launcher)
|
||||
|
||||
$(eval $(call SetupCopyFiles, copy-static-launcher-debuginfo, \
|
||||
SRC := $(STATIC_LAUNCHER_OUTPUT_DIR), \
|
||||
DEST := $(STATIC_JDK_IMAGE_DIR)/bin, \
|
||||
FILES := $(call FindDebuginfoFiles, $(STATIC_LAUNCHER_OUTPUT_DIR)), \
|
||||
))
|
||||
|
||||
TARGETS += $(copy-static-launcher-debuginfo)
|
||||
|
||||
static-jdk-image: $(copy-from-jdk-image) $(copy-static-launcher) $(copy-static-launcher-debuginfo)
|
||||
|
||||
TARGETS += static-jdk-image
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: all static-launcher static-jdk-image
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -27,7 +27,7 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include ZipArchive.gmk
|
||||
|
||||
################################################################################
|
||||
#
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -27,8 +27,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include Modules.gmk
|
||||
include ZipArchive.gmk
|
||||
|
||||
SRC_ZIP_WORK_DIR := $(SUPPORT_OUTPUTDIR)/src
|
||||
$(if $(filter $(TOPDIR)/%, $(SUPPORT_OUTPUTDIR)), $(eval SRC_ZIP_BASE := $(TOPDIR)), $(eval SRC_ZIP_BASE := $(SUPPORT_OUTPUTDIR)))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -470,7 +470,7 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
|
||||
# Maximum amount of heap memory.
|
||||
JVM_HEAP_LIMIT_32="768"
|
||||
# Running a 64 bit JVM allows for and requires a bigger heap
|
||||
JVM_HEAP_LIMIT_64="1600"
|
||||
JVM_HEAP_LIMIT_64="2048"
|
||||
JVM_HEAP_LIMIT_GLOBAL=`expr $MEMORY_SIZE / 2`
|
||||
if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_32"; then
|
||||
JVM_HEAP_LIMIT_32=$JVM_HEAP_LIMIT_GLOBAL
|
||||
|
||||
@@ -192,18 +192,23 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
|
||||
# Export variables according to old definitions, prefix with $2 if present.
|
||||
LDFLAGS_JDK_COMMON="$BASIC_LDFLAGS $BASIC_LDFLAGS_JDK_ONLY \
|
||||
$OS_LDFLAGS $DEBUGLEVEL_LDFLAGS_JDK_ONLY ${$2EXTRA_LDFLAGS}"
|
||||
$2LDFLAGS_JDKLIB="$LDFLAGS_JDK_COMMON $BASIC_LDFLAGS_JDK_LIB_ONLY \
|
||||
$2LDFLAGS_JDKLIB="$LDFLAGS_JDK_COMMON \
|
||||
$SHARED_LIBRARY_FLAGS $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
$2LDFLAGS_JDKEXE="$LDFLAGS_JDK_COMMON $EXECUTABLE_LDFLAGS \
|
||||
${$1_CPU_EXECUTABLE_LDFLAGS} $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
|
||||
$2LDFLAGS_STATIC_JDK="$BASIC_LDFLAGS $BASIC_LDFLAGS_JVM_ONLY \
|
||||
$OS_LDFLAGS ${$2EXTRA_LDFLAGS} $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
|
||||
$2JVM_LDFLAGS="$BASIC_LDFLAGS $BASIC_LDFLAGS_JVM_ONLY $OS_LDFLAGS $OS_LDFLAGS_JVM_ONLY \
|
||||
$DEBUGLEVEL_LDFLAGS $DEBUGLEVEL_LDFLAGS_JVM_ONLY $BASIC_LDFLAGS_ONLYCXX \
|
||||
$DEBUGLEVEL_LDFLAGS $DEBUGLEVEL_LDFLAGS_JVM_ONLY \
|
||||
${$1_CPU_LDFLAGS} ${$1_CPU_LDFLAGS_JVM_ONLY} ${$2EXTRA_LDFLAGS} \
|
||||
$REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
|
||||
AC_SUBST($2LDFLAGS_JDKLIB)
|
||||
AC_SUBST($2LDFLAGS_JDKEXE)
|
||||
|
||||
AC_SUBST($2LDFLAGS_STATIC_JDK)
|
||||
|
||||
AC_SUBST($2JVM_LDFLAGS)
|
||||
])
|
||||
|
||||
@@ -369,6 +369,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
|
||||
CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
|
||||
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
|
||||
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
|
||||
LDFLAGS_STATIC_JDK="$LDFLAGS_STATIC_JDK $GCOV_LDFLAGS"
|
||||
])
|
||||
AC_SUBST(GCOV_ENABLED)
|
||||
|
||||
@@ -463,6 +464,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
|
||||
CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $ASAN_CFLAGS"
|
||||
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $ASAN_LDFLAGS"
|
||||
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $ASAN_LDFLAGS"
|
||||
LDFLAGS_STATIC_JDK="$LDFLAGS_STATIC_JDK $ASAN_LDFLAGS"
|
||||
])
|
||||
AC_SUBST(ASAN_ENABLED)
|
||||
])
|
||||
@@ -496,6 +498,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_LEAK_SANITIZER],
|
||||
CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $LSAN_CFLAGS"
|
||||
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $LSAN_LDFLAGS"
|
||||
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $LSAN_LDFLAGS"
|
||||
LDFLAGS_STATIC_JDK="$LDFLAGS_STATIC_JDK $LSAN_LDFLAGS"
|
||||
])
|
||||
AC_SUBST(LSAN_ENABLED)
|
||||
])
|
||||
@@ -538,6 +541,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER],
|
||||
CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $UBSAN_CFLAGS"
|
||||
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $UBSAN_LDFLAGS"
|
||||
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $UBSAN_LDFLAGS"
|
||||
LDFLAGS_STATIC_JDK="$LDFLAGS_STATIC_JDK $UBSAN_LDFLAGS"
|
||||
])
|
||||
if test "x$UBSAN_ENABLED" = xfalse; then
|
||||
UBSAN_CFLAGS=""
|
||||
|
||||
@@ -666,14 +666,17 @@ AC_DEFUN([PLATFORM_CHECK_DEPRECATION],
|
||||
[
|
||||
AC_ARG_ENABLE(deprecated-ports, [AS_HELP_STRING([--enable-deprecated-ports@<:@=yes/no@:>@],
|
||||
[Suppress the error when configuring for a deprecated port @<:@no@:>@])])
|
||||
# if test "x$OPENJDK_TARGET_CPU" = xx86; then
|
||||
# if test "x$enable_deprecated_ports" = "xyes"; then
|
||||
# AC_MSG_WARN([The x86 port is deprecated and may be removed in a future release.])
|
||||
# else
|
||||
# AC_MSG_ERROR(m4_normalize([The 32-bit x86 port is deprecated and may be removed in a future release.
|
||||
# Use --enable-deprecated-ports=yes to suppress this error.]))
|
||||
# fi
|
||||
# fi
|
||||
# Unfortunately, variants have not been parsed yet, so we have to check the configure option
|
||||
# directly. Allow only the directly specified Zero variant, treat any other mix as containing
|
||||
# something non-Zero.
|
||||
if test "x$OPENJDK_TARGET_CPU" = xx86 && test "x$with_jvm_variants" != xzero; then
|
||||
if test "x$enable_deprecated_ports" = "xyes"; then
|
||||
AC_MSG_WARN([The 32-bit x86 port is deprecated and may be removed in a future release.])
|
||||
else
|
||||
AC_MSG_ERROR(m4_normalize([The 32-bit x86 port is deprecated and may be removed in a future release.
|
||||
Use --enable-deprecated-ports=yes to suppress this error.]))
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION],
|
||||
|
||||
@@ -559,6 +559,9 @@ LDFLAGS_JDKLIB := @LDFLAGS_JDKLIB@
|
||||
# LDFLAGS used to link the jdk native launchers (C-code)
|
||||
LDFLAGS_JDKEXE := @LDFLAGS_JDKEXE@
|
||||
|
||||
# LDFLAGS used to link the static jdk library
|
||||
LDFLAGS_STATIC_JDK := @LDFLAGS_STATIC_JDK@
|
||||
|
||||
# LDFLAGS specific to C++ linking.
|
||||
LDFLAGS_CXX_JDK := @LDFLAGS_CXX_JDK@
|
||||
|
||||
|
||||
@@ -575,7 +575,7 @@ AC_DEFUN([UTIL_CHECK_TYPE_directory],
|
||||
|
||||
if test "[x]ARG_CHECK_FOR_FILES" != "x:"; then
|
||||
for file in ARG_CHECK_FOR_FILES; do
|
||||
found_files=$($ECHO $(ls $1/$file 2> /dev/null))
|
||||
found_files=$($ECHO $($LS -d $1/$file 2> /dev/null))
|
||||
if test "x$found_files" = x; then
|
||||
FAILURE="Directory $1 does not contain $file"
|
||||
break
|
||||
|
||||
@@ -307,3 +307,26 @@ ifeq ($(DISABLE_CACHE_FIND), true)
|
||||
else
|
||||
FindFiles = $(CacheFindFiles)
|
||||
endif
|
||||
|
||||
# Find native debuginfo files in a directory
|
||||
#
|
||||
# Param 1 - dir to find debuginfo files in
|
||||
FindDebuginfoFiles = \
|
||||
$(wildcard $(addprefix $1/*, $(DEBUGINFO_SUFFIXES)) \
|
||||
$(addprefix $1/*/*, $(DEBUGINFO_SUFFIXES)) \
|
||||
$(addprefix $1/*/*/*, $(DEBUGINFO_SUFFIXES)))
|
||||
|
||||
# Pick the correct debug info files to copy, either zipped or not.
|
||||
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
|
||||
DEBUGINFO_SUFFIXES += .diz
|
||||
else
|
||||
DEBUGINFO_SUFFIXES := .debuginfo .pdb .map
|
||||
# On Macosx, if debug symbols have not been zipped, find all files inside *.dSYM
|
||||
# dirs.
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
$(call FillFindCache, \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_libs $(SUPPORT_OUTPUTDIR)/modules_cmds)
|
||||
FindDebuginfoFiles = \
|
||||
$(if $(wildcard $1), $(call containing, .dSYM/, $(call FindFiles, $1)))
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -275,6 +275,8 @@ JDK_RCFLAGS=$(RCFLAGS) \
|
||||
# and EXTRA_HEADER_DIRS will be added.
|
||||
# JDK_LIBS_<os> or JDK_LIBS_<osType> -- additional JDK_LIBS for the given OS
|
||||
# or OS type only
|
||||
# ONLY_EXPORTED -- if true, this library will be flagged as not
|
||||
# to be included for this module when building static libs
|
||||
# EXTRA_RCFLAGS -- additional RCFLAGS to append.
|
||||
# RC_FILEDESC -- override the default FILEDESC for Windows version.rc
|
||||
# DEFAULT_LIBCXX -- if false, do not add LIBCXX to LIBS for C++ compilations
|
||||
@@ -303,6 +305,15 @@ define SetupJdkNativeCompilationBody
|
||||
$1_RC_FTYPE := 0x2L
|
||||
endif
|
||||
|
||||
ifneq ($$(MODULE), )
|
||||
# Record the fact that this native library is part of the current module
|
||||
# (unless told otherwise). This variable stores information about all
|
||||
# created libraries, and is read by ModuleWrapper.
|
||||
ifneq ($$($1_ONLY_EXPORTED), true)
|
||||
$$(MODULE)_INCLUDED_LIBS += $$($1_NAME)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_OUTPUT_DIR), )
|
||||
ifneq ($$(MODULE), )
|
||||
ifeq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
@@ -422,10 +433,10 @@ define SetupJdkNativeCompilationBody
|
||||
ifneq ($$($1_DEFAULT_LDFLAGS), false)
|
||||
ifeq ($$($1_TYPE), EXECUTABLE)
|
||||
# Set the default flags first to be able to override
|
||||
$1_LDFLAGS := $$(filter-out $$($1_LDFLAGS_FILTER_OUT), $$(LDFLAGS_JDKEXE)) $$($1_LDFLAGS)
|
||||
$1_LDFLAGS := $$(filter-out $$($1_LDFLAGS_FILTER_OUT), $$(LDFLAGS_JDKEXE) $$($1_LDFLAGS))
|
||||
else
|
||||
# Set the default flags first to be able to override
|
||||
$1_LDFLAGS := $$(filter-out $$($1_LDFLAGS_FILTER_OUT), $$(LDFLAGS_JDKLIB)) $$($1_LDFLAGS)
|
||||
$1_LDFLAGS := $$(filter-out $$($1_LDFLAGS_FILTER_OUT), $$(LDFLAGS_JDKLIB) $$($1_LDFLAGS))
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ JAVA_MANIFEST := $(TOPDIR)/src/java.base/windows/native/launcher/java.manifest
|
||||
# OPTIMIZATION Override default optimization level (LOW)
|
||||
# OUTPUT_DIR Override default output directory
|
||||
# VERSION_INFO_RESOURCE Override default Windows resource file
|
||||
# STATIC_LAUNCHER If true, will use settings for building a static launcher
|
||||
SetupBuildLauncher = $(NamedParamsMacroTemplate)
|
||||
define SetupBuildLauncherBody
|
||||
# Setup default values (unless overridden)
|
||||
@@ -120,6 +121,15 @@ define SetupBuildLauncherBody
|
||||
$1_EXTRA_FILES += $(TOPDIR)/make/data/lsan/lsan_default_options.c
|
||||
endif
|
||||
|
||||
ifneq ($$($1_STATIC_LAUNCHER), true)
|
||||
$1_JDK_LIBS := java.base:libjli
|
||||
$1_JDK_LIBS_windows := java.base:libjava
|
||||
else
|
||||
ifneq ($(findstring $(TOOLCHAIN_TYPE), gcc clang), )
|
||||
$1_LDFLAGS_FILTER_OUT := -Wl$(COMMA)--exclude-libs$(COMMA)ALL
|
||||
endif
|
||||
endif
|
||||
|
||||
##############################################################################
|
||||
## Build launcher "$1"
|
||||
##############################################################################
|
||||
@@ -140,8 +150,9 @@ define SetupBuildLauncherBody
|
||||
LDFLAGS := $$($1_LDFLAGS), \
|
||||
LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
|
||||
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
|
||||
JDK_LIBS := java.base:libjli, \
|
||||
JDK_LIBS_windows := java.base:libjava, \
|
||||
LDFLAGS_FILTER_OUT := $$($1_LDFLAGS_FILTER_OUT), \
|
||||
JDK_LIBS := $$($1_JDK_LIBS), \
|
||||
JDK_LIBS_windows := $$($1_JDK_LIBS_windows), \
|
||||
LIBS := $$($1_LIBS), \
|
||||
LIBS_unix := $(LIBZ_LIBS), \
|
||||
LIBS_linux := $(LIBDL) -lpthread, \
|
||||
@@ -150,6 +161,7 @@ define SetupBuildLauncherBody
|
||||
-framework Cocoa \
|
||||
-framework Security, \
|
||||
OUTPUT_DIR := $$($1_OUTPUT_DIR), \
|
||||
OBJECT_DIR := $$($1_OBJECT_DIR), \
|
||||
VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
|
||||
EXTRA_RCFLAGS := $$($1_EXTRA_RCFLAGS), \
|
||||
MANIFEST := $(JAVA_MANIFEST), \
|
||||
@@ -178,10 +190,8 @@ ifeq ($(call isTargetOsType, unix)+$(MAKEFILE_PREFIX), true+Launcher)
|
||||
# We assume all our man pages should reside in section 1.
|
||||
|
||||
MAN_FILES_MD := $(wildcard $(addsuffix /*.md, $(call FindModuleManDirs, $(MODULE))))
|
||||
MAN_FILES_TROFF := $(wildcard $(addsuffix /*.1, $(call FindModuleManDirs, $(MODULE))))
|
||||
|
||||
ifneq ($(MAN_FILES_MD), )
|
||||
# If we got markdown files, ignore the troff files
|
||||
ifeq ($(ENABLE_PANDOC), false)
|
||||
$(info Warning: pandoc not found. Not generating man pages)
|
||||
else
|
||||
@@ -226,13 +236,5 @@ ifeq ($(call isTargetOsType, unix)+$(MAKEFILE_PREFIX), true+Launcher)
|
||||
|
||||
TARGETS += $(BUILD_MAN_PAGES)
|
||||
endif
|
||||
else
|
||||
# No markdown man pages present
|
||||
$(eval $(call SetupCopyFiles, COPY_MAN_PAGES, \
|
||||
DEST := $(SUPPORT_OUTPUTDIR)/modules_man/$(MODULE)/man1, \
|
||||
FILES := $(MAN_FILES_TROFF), \
|
||||
))
|
||||
|
||||
TARGETS += $(COPY_MAN_PAGES)
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -119,6 +119,7 @@ define CreateStaticLibrary
|
||||
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
|
||||
$$($1_AR) $$(ARFLAGS) -r -cs $$($1_TARGET) \
|
||||
$$($1_AR_OBJ_ARG) $$($1_RES))
|
||||
$$(ECHO) $$(strip $$($1_LIBS) $$($1_EXTRA_LIBS)) > $$($1_TARGET).lib-flags.txt
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -54,7 +54,8 @@ define CreateStaticLibraryMicrosoft
|
||||
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_run_lib, \
|
||||
$$($1_LIB) -nologo $$(LIBFLAGS) -out:$$($1_TARGET) \
|
||||
$$($1_LD_OBJ_ARG) $$($1_RES))
|
||||
$$($1_LD_OBJ_ARG))
|
||||
$$(ECHO) $$(strip $$($1_LIBS) $$($1_EXTRA_LIBS)) > $$($1_TARGET).lib-flags.txt
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -241,7 +241,7 @@ var getJibProfilesCommon = function (input, data) {
|
||||
// List of the main profile names used for iteration
|
||||
common.main_profile_names = [
|
||||
"linux-x64", "linux-x86", "macosx-x64", "macosx-aarch64",
|
||||
"windows-x64", "windows-x86", "windows-aarch64",
|
||||
"windows-x64", "windows-aarch64",
|
||||
"linux-aarch64", "linux-arm32", "linux-ppc64le", "linux-s390x",
|
||||
"linux-riscv64"
|
||||
];
|
||||
@@ -253,6 +253,7 @@ var getJibProfilesCommon = function (input, data) {
|
||||
configure_args: concat(
|
||||
"--with-exclude-translations=es,fr,it,ko,pt_BR,sv,ca,tr,cs,sk,ja_JP_A,ja_JP_HA,ja_JP_HI,ja_JP_I,zh_TW,zh_HK",
|
||||
"--disable-jvm-feature-shenandoahgc",
|
||||
"--disable-cds-archive-coh",
|
||||
versionArgs(input, common))
|
||||
};
|
||||
|
||||
@@ -464,15 +465,6 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
configure_args: concat(common.configure_args_64bit),
|
||||
},
|
||||
|
||||
"windows-x86": {
|
||||
target_os: "windows",
|
||||
target_cpu: "x86",
|
||||
build_cpu: "x64",
|
||||
dependencies: ["devkit", "gtest"],
|
||||
configure_args: concat(common.configure_args_32bit,
|
||||
"--enable-deprecated-ports"),
|
||||
},
|
||||
|
||||
"windows-aarch64": {
|
||||
target_os: "windows",
|
||||
target_cpu: "aarch64",
|
||||
@@ -715,10 +707,6 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
platform: "windows-x64",
|
||||
jdk_suffix: "zip",
|
||||
},
|
||||
"windows-x86": {
|
||||
platform: "windows-x86",
|
||||
jdk_suffix: "zip",
|
||||
},
|
||||
"windows-aarch64": {
|
||||
platform: "windows-aarch64",
|
||||
jdk_suffix: "zip",
|
||||
|
||||
@@ -174,6 +174,12 @@ ifeq ($(call check-jvm-feature, link-time-opt), true)
|
||||
-fno-fat-lto-objects
|
||||
JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM) -flto=auto \
|
||||
-fuse-linker-plugin -fno-strict-aliasing
|
||||
else ifeq ($(call isCompiler, clang), true)
|
||||
JVM_CFLAGS_FEATURES += -flto -fno-strict-aliasing
|
||||
ifeq ($(call isBuildOs, aix), true)
|
||||
JVM_CFLAGS_FEATURES += -ffat-lto-objects
|
||||
endif
|
||||
JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM) -flto -fno-strict-aliasing
|
||||
else ifeq ($(call isCompiler, microsoft), true)
|
||||
JVM_CFLAGS_FEATURES += -GL
|
||||
JVM_LDFLAGS_FEATURES += -LTCG:INCREMENTAL
|
||||
|
||||
@@ -37,6 +37,10 @@ ifeq ($(TOOLCHAIN_TYPE), gcc)
|
||||
# Need extra inlining to collapse shared marking code into the hot marking loop
|
||||
BUILD_LIBJVM_shenandoahMark.cpp_CXXFLAGS := --param inline-unit-growth=1000
|
||||
endif
|
||||
# disable lto in g1ParScanThreadState because of special inlining/flattening used there
|
||||
ifeq ($(call check-jvm-feature, link-time-opt), true)
|
||||
BUILD_LIBJVM_g1ParScanThreadState.cpp_CXXFLAGS := -fno-lto
|
||||
endif
|
||||
endif
|
||||
|
||||
LIBJVM_FDLIBM_COPY_OPT_FLAG := $(CXX_O_FLAG_NONE)
|
||||
|
||||
@@ -33,6 +33,7 @@ import java.nio.file.*;
|
||||
import java.time.*;
|
||||
import java.util.*;
|
||||
import java.util.ResourceBundle.Control;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
import java.util.stream.Stream;
|
||||
@@ -1242,7 +1243,8 @@ public class CLDRConverter {
|
||||
private static Stream<String> tzDataLinkEntry() {
|
||||
try {
|
||||
return Files.walk(Paths.get(tzDataDir), 1)
|
||||
.filter(p -> !Files.isDirectory(p))
|
||||
.filter(p -> p.toFile().isFile())
|
||||
.filter(p -> p.getFileName().toString().matches("africa|antarctica|asia|australasia|backward|etcetera|europe|northamerica|southamerica"))
|
||||
.flatMap(CLDRConverter::extractLinks)
|
||||
.sorted();
|
||||
} catch (IOException e) {
|
||||
@@ -1273,8 +1275,27 @@ public class CLDRConverter {
|
||||
// Note: the entries are alphabetically sorted, *except* the "world" region
|
||||
// code, i.e., "001". It should be the last entry for the same windows time
|
||||
// zone name entries. (cf. TimeZone_md.c)
|
||||
//
|
||||
// The default entries from CLDR's windowsZones.xml file can be modified
|
||||
// with <tzDataDir>/tzmappings.override where mapping overrides
|
||||
// can be specified.
|
||||
private static Pattern OVERRIDE_PATTERN = Pattern.compile("(?<win>([^:]+:[^:]+)):(?<java>[^:]+):");
|
||||
private static void generateWindowsTZMappings() throws Exception {
|
||||
Files.createDirectories(Paths.get(DESTINATION_DIR, "windows", "conf"));
|
||||
var override = Path.of(tzDataDir, "tzmappings.override");
|
||||
if (override.toFile().exists()) {
|
||||
Files.readAllLines(override).stream()
|
||||
.map(String::trim)
|
||||
.filter(o -> !o.isBlank() && !o.startsWith("#"))
|
||||
.forEach(o -> {
|
||||
var m = OVERRIDE_PATTERN.matcher(o);
|
||||
if (m.matches()) {
|
||||
handlerWinZones.put(m.group("win"), m.group("java"));
|
||||
} else {
|
||||
System.out.printf("Unrecognized tzmappings override: %s. Ignored%n", o);
|
||||
}
|
||||
});
|
||||
}
|
||||
Files.write(Paths.get(DESTINATION_DIR, "windows", "conf", "tzmappings"),
|
||||
handlerWinZones.keySet().stream()
|
||||
.filter(k -> k.endsWith(":001") ||
|
||||
|
||||
@@ -1896,6 +1896,11 @@ public class CreateSymbols {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ed.packageName.equals("jdk/internal/javac")) {
|
||||
//keep jdk/internal/javac untouched. It is used to determine participates in preview:
|
||||
continue;
|
||||
}
|
||||
|
||||
Set<String> usingModules = package2ModulesUsingIt.getOrDefault(ed.packageName(), Set.of());
|
||||
|
||||
ed.to.retainAll(usingModules);
|
||||
|
||||
@@ -46,18 +46,6 @@ EXCLUDE_FILES += \
|
||||
javax/swing/plaf/nimbus/SpinnerPainter.java \
|
||||
javax/swing/plaf/nimbus/SplitPanePainter.java \
|
||||
javax/swing/plaf/nimbus/TabbedPanePainter.java \
|
||||
sun/awt/resources/security-icon-bw16.png \
|
||||
sun/awt/resources/security-icon-bw24.png \
|
||||
sun/awt/resources/security-icon-bw32.png \
|
||||
sun/awt/resources/security-icon-bw48.png \
|
||||
sun/awt/resources/security-icon-interim16.png \
|
||||
sun/awt/resources/security-icon-interim24.png \
|
||||
sun/awt/resources/security-icon-interim32.png \
|
||||
sun/awt/resources/security-icon-interim48.png \
|
||||
sun/awt/resources/security-icon-yellow16.png \
|
||||
sun/awt/resources/security-icon-yellow24.png \
|
||||
sun/awt/resources/security-icon-yellow32.png \
|
||||
sun/awt/resources/security-icon-yellow48.png \
|
||||
sun/awt/X11/java-icon16.png \
|
||||
sun/awt/X11/java-icon24.png \
|
||||
sun/awt/X11/java-icon32.png \
|
||||
|
||||
@@ -37,23 +37,6 @@ GENSRC_AWT_ICONS_SRC += \
|
||||
$(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \
|
||||
$(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
|
||||
|
||||
|
||||
AWT_ICONPATH := $(MODULE_SRC)/share/classes/sun/awt/resources
|
||||
|
||||
GENSRC_AWT_ICONS_SRC += \
|
||||
$(AWT_ICONPATH)/security-icon-bw16.png \
|
||||
$(AWT_ICONPATH)/security-icon-interim16.png \
|
||||
$(AWT_ICONPATH)/security-icon-yellow16.png \
|
||||
$(AWT_ICONPATH)/security-icon-bw24.png \
|
||||
$(AWT_ICONPATH)/security-icon-interim24.png \
|
||||
$(AWT_ICONPATH)/security-icon-yellow24.png \
|
||||
$(AWT_ICONPATH)/security-icon-bw32.png \
|
||||
$(AWT_ICONPATH)/security-icon-interim32.png \
|
||||
$(AWT_ICONPATH)/security-icon-yellow32.png \
|
||||
$(AWT_ICONPATH)/security-icon-bw48.png \
|
||||
$(AWT_ICONPATH)/security-icon-interim48.png \
|
||||
$(AWT_ICONPATH)/security-icon-yellow48.png
|
||||
|
||||
GENSRC_AWT_ICONS_FILES := $(notdir $(GENSRC_AWT_ICONS_SRC))
|
||||
|
||||
GENSRC_AWT_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1)))
|
||||
|
||||
@@ -168,10 +168,16 @@ ifeq ($(call isTargetOs, windows macosx), false)
|
||||
# static libraries cause linking errors due to duplicate symbols.
|
||||
LIBAWT_HEADLESS_STATIC_EXCLUDE_OBJS := systemScale.o
|
||||
|
||||
ifneq ($(ENABLE_HEADLESS_ONLY), true)
|
||||
# We cannot link with both awt_headless and awt_xawt at the same time
|
||||
LIBAWT_HEADLESS_ONLY_EXPORTED := true
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
|
||||
NAME := awt_headless, \
|
||||
EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
|
||||
EXCLUDES := medialib, \
|
||||
ONLY_EXPORTED := $(LIBAWT_HEADLESS_ONLY_EXPORTED), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := -DHEADLESS=true $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) \
|
||||
$(X_CFLAGS), \
|
||||
@@ -308,6 +314,8 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBAWT_LWAWT_EXCLUDE_FILES := fontpath.c awt_Font.c X11Color.c
|
||||
LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib
|
||||
|
||||
LIBAWT_LWAWT_STATIC_EXCLUDE_OBJS := systemScale.o
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_LWAWT, \
|
||||
NAME := awt_lwawt, \
|
||||
EXTRA_SRC := $(LIBAWT_LWAWT_EXTRA_SRC), \
|
||||
@@ -346,6 +354,7 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
-framework OpenGL \
|
||||
-framework QuartzCore \
|
||||
-framework Security, \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_LWAWT_STATIC_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_LWAWT)
|
||||
|
||||
@@ -155,6 +155,9 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBJPEG), false)
|
||||
LIBSPLASHSCREEN_EXTRA_SRC += libjavajpeg
|
||||
LIBJAVA_JPEG_OBJS := $(sort $(patsubst %.c,%.o, $(filter-out imageioJPEG.c, \
|
||||
$(notdir $(wildcard $(TOPDIR)/src/java.desktop/share/native/libjavajpeg/*.c)))))
|
||||
LIBSPLASHSCREEN_STATIC_LIB_EXCLUDE_OBJS += $(LIBJAVA_JPEG_OBJS)
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBPNG), false)
|
||||
@@ -165,6 +168,10 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBZ), false)
|
||||
LIBSPLASHSCREEN_EXTRA_SRC += java.base:libzip/zlib
|
||||
LIBZIP_SRC_PATH := $(TOPDIR)/src/java.base/share/native/libzip
|
||||
LIBZIP_OBJS := $(sort $(patsubst %.c,%.o, $(notdir \
|
||||
$(wildcard $(LIBZIP_SRC_PATH)/*.c $(LIBZIP_SRC_PATH)/zlib/*.c))))
|
||||
LIBSPLASHSCREEN_STATIC_LIB_EXCLUDE_OBJS += $(LIBZIP_OBJS)
|
||||
endif
|
||||
|
||||
LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
|
||||
@@ -207,6 +214,8 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
|
||||
endif
|
||||
|
||||
LIBSPLASHSCREEN_STATIC_LIB_EXCLUDE_OBJS += systemScale.o
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
|
||||
NAME := splashscreen, \
|
||||
EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC), \
|
||||
@@ -257,6 +266,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
-framework Security, \
|
||||
LIBS_aix := $(LIBDL) -liconv $(X_LIBS) -lX11 -lXext, \
|
||||
LIBS_windows := delayimp.lib gdi32.lib kernel32.lib user32.lib, \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBSPLASHSCREEN_STATIC_LIB_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBSPLASHSCREEN)
|
||||
|
||||
@@ -27,5 +27,5 @@ DISABLED_WARNINGS_java += dangling-doc-comments lossy-conversions this-escape
|
||||
DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:$(call CommaList, javax.xml.catalog javax.xml.datatype \
|
||||
javax.xml.transform javax.xml.validation javax.xml.xpath)'
|
||||
COPY += .dtd .xsd .xml
|
||||
COPY += .dtd .xsd .xml .ent .mod
|
||||
CLEAN += .properties
|
||||
|
||||
@@ -38,6 +38,7 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
NAME := javaaccessbridge, \
|
||||
EXTRA_SRC := common, \
|
||||
OPTIMIZATION := LOW, \
|
||||
ONLY_EXPORTED := true, \
|
||||
DISABLED_WARNINGS_microsoft := 4311 4302 4312, \
|
||||
CXXFLAGS_FILTER_OUT := -MD, \
|
||||
CXXFLAGS := -MT -DACCESSBRIDGE_ARCH_64, \
|
||||
@@ -67,6 +68,7 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
CXXFLAGS := -DACCESSBRIDGE_ARCH_64, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
include/bridge, \
|
||||
ONLY_EXPORTED := true, \
|
||||
LDFLAGS := \
|
||||
-def:$(ACCESSIBILITY_SRCDIR)/libwindowsaccessbridge/WinAccessBridge.DEF, \
|
||||
LIBS_windows := advapi32.lib comdlg32.lib gdi32.lib kernel32.lib \
|
||||
|
||||
@@ -49,6 +49,7 @@ $(eval $(call SetupJdkExecutable, BUILD_JPACKAGEAPPLAUNCHER, \
|
||||
LINK_TYPE := $(JPACKAGEAPPLAUNCHER_LINK_TYPE), \
|
||||
OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
|
||||
SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jpackageapplauncher, \
|
||||
ONLY_EXPORTED := true, \
|
||||
SRC := applauncher, \
|
||||
EXTRA_SRC := common, \
|
||||
INCLUDE_FILES := $(JPACKAGEAPPLAUNCHER_INCLUDE_FILES), \
|
||||
@@ -83,6 +84,7 @@ ifeq ($(call isTargetOs, linux), true)
|
||||
OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
|
||||
SYMBOLS_DIR := \
|
||||
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjpackageapplauncheraux, \
|
||||
ONLY_EXPORTED := true, \
|
||||
SRC := libapplauncher, \
|
||||
EXTRA_SRC := \
|
||||
applauncher \
|
||||
@@ -127,6 +129,7 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
NAME := wixhelper, \
|
||||
OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
|
||||
SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libwixhelper, \
|
||||
ONLY_EXPORTED := true, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_SRC := common, \
|
||||
CXXFLAGS_FILTER_OUT := -MD, \
|
||||
@@ -146,6 +149,7 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
NAME := msiwrapper, \
|
||||
OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
|
||||
SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/msiwrapper, \
|
||||
ONLY_EXPORTED := true, \
|
||||
EXTRA_SRC := common, \
|
||||
CXXFLAGS_FILTER_OUT := -MD, \
|
||||
CXXFLAGS_windows := -MT $(JPACKAGE_CXXFLAGS_windows), \
|
||||
@@ -164,6 +168,7 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
|
||||
SYMBOLS_DIR := \
|
||||
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jpackageapplauncherw, \
|
||||
ONLY_EXPORTED := true, \
|
||||
SRC := applauncher, \
|
||||
EXTRA_SRC := common, \
|
||||
OPTIMIZATION := LOW, \
|
||||
|
||||
@@ -30,6 +30,7 @@ include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JarArchive.gmk
|
||||
include JavaCompilation.gmk
|
||||
include TestFilesCompilation.gmk
|
||||
|
||||
@@ -88,6 +89,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
|
||||
SRC := $(MICROBENCHMARK_SRC), \
|
||||
BIN := $(MICROBENCHMARK_CLASSES), \
|
||||
JAVAC_FLAGS := \
|
||||
--add-exports java.base/jdk.internal.classfile.components=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.classfile.impl=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.event=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.foreign=ALL-UNNAMED \
|
||||
|
||||
@@ -1114,13 +1114,7 @@ public final class FontPanel extends JPanel implements AdjustmentListener {
|
||||
/// Position and set size of zoom window as needed
|
||||
zoomWindow.setLocation( canvasLoc.x + zoomAreaX, canvasLoc.y + zoomAreaY );
|
||||
if ( !nowZooming ) {
|
||||
if ( zoomWindow.getWarningString() != null )
|
||||
/// If this is not opened as a "secure" window,
|
||||
/// it has a banner below the zoom dialog which makes it look really BAD
|
||||
/// So enlarge it by a bit
|
||||
zoomWindow.setSize( zoomAreaWidth + 1, zoomAreaHeight + 20 );
|
||||
else
|
||||
zoomWindow.setSize( zoomAreaWidth + 1, zoomAreaHeight + 1 );
|
||||
zoomWindow.setSize( zoomAreaWidth + 1, zoomAreaHeight + 1 );
|
||||
}
|
||||
|
||||
/// Prepare zoomed image
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -142,7 +142,6 @@ public final class SampleTree {
|
||||
|
||||
/** Constructs a JPanel containing check boxes for the different
|
||||
* options that tree supports. */
|
||||
@SuppressWarnings("serial")
|
||||
private JPanel constructOptionsPanel() {
|
||||
JCheckBox aCheckbox;
|
||||
JPanel retPanel = new JPanel(false);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -97,7 +97,6 @@ public class TableExample3 {
|
||||
};
|
||||
|
||||
// Create a model of the data.
|
||||
@SuppressWarnings("serial")
|
||||
TableModel dataModel = new AbstractTableModel() {
|
||||
// These methods always need to be implemented.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -99,7 +99,6 @@ public class TableExample4 {
|
||||
};
|
||||
|
||||
// Create a model of the data.
|
||||
@SuppressWarnings("serial")
|
||||
TableModel dataModel = new AbstractTableModel() {
|
||||
// These methods always need to be implemented.
|
||||
|
||||
@@ -180,7 +179,6 @@ public class TableExample4 {
|
||||
|
||||
// Show the values in the "Favorite Number" column in different colors.
|
||||
TableColumn numbersColumn = tableView.getColumn("Favorite Number");
|
||||
@SuppressWarnings("serial")
|
||||
DefaultTableCellRenderer numberColumnRenderer
|
||||
= new DefaultTableCellRenderer() {
|
||||
|
||||
|
||||
@@ -2632,6 +2632,23 @@ bool Matcher::pd_clone_node(Node* n, Node* m, Matcher::MStack& mstack) {
|
||||
// to be subsumed into complex addressing expressions or compute them
|
||||
// into registers?
|
||||
bool Matcher::pd_clone_address_expressions(AddPNode* m, Matcher::MStack& mstack, VectorSet& address_visited) {
|
||||
|
||||
// Loads and stores with indirect memory input (e.g., volatile loads and
|
||||
// stores) do not subsume the input into complex addressing expressions. If
|
||||
// the addressing expression is input to at least one such load or store, do
|
||||
// not clone the addressing expression. Query needs_acquiring_load and
|
||||
// needs_releasing_store as a proxy for indirect memory input, as it is not
|
||||
// possible to directly query for indirect memory input at this stage.
|
||||
for (DUIterator_Fast imax, i = m->fast_outs(imax); i < imax; i++) {
|
||||
Node* n = m->fast_out(i);
|
||||
if (n->is_Load() && needs_acquiring_load(n)) {
|
||||
return false;
|
||||
}
|
||||
if (n->is_Store() && needs_releasing_store(n)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (clone_base_plus_offset_address(m, mstack, address_visited)) {
|
||||
return true;
|
||||
}
|
||||
@@ -5755,10 +5772,6 @@ opclass memory(indirect, indIndexScaled, indIndexScaledI2L, indIndexI2L, indInde
|
||||
indirectN, indIndexScaledN, indIndexScaledI2LN, indIndexI2LN, indIndexN, indOffIN, indOffLN, indirectX2P, indOffX2P);
|
||||
|
||||
|
||||
opclass memory_noindex(indirect,
|
||||
indOffI1, indOffL1,indOffI2, indOffL2, indOffI4, indOffL4, indOffI8, indOffL8,
|
||||
indirectN, indOffIN, indOffLN, indirectX2P, indOffX2P);
|
||||
|
||||
// iRegIorL2I is used for src inputs in rules for 32 bit int (I)
|
||||
// operations. it allows the src to be either an iRegI or a (ConvL2I
|
||||
// iRegL). in the latter case the l2i normally planted for a ConvL2I
|
||||
@@ -6695,16 +6708,21 @@ instruct loadNKlass(iRegNNoSp dst, memory4 mem)
|
||||
ins_pipe(iload_reg_mem);
|
||||
%}
|
||||
|
||||
instruct loadNKlassCompactHeaders(iRegNNoSp dst, memory_noindex mem)
|
||||
instruct loadNKlassCompactHeaders(iRegNNoSp dst, memory4 mem)
|
||||
%{
|
||||
match(Set dst (LoadNKlass mem));
|
||||
predicate(!needs_acquiring_load(n) && UseCompactObjectHeaders);
|
||||
|
||||
ins_cost(4 * INSN_COST);
|
||||
format %{ "load_narrow_klass_compact $dst, $mem\t# compressed class ptr" %}
|
||||
format %{
|
||||
"ldrw $dst, $mem\t# compressed class ptr, shifted\n\t"
|
||||
"lsrw $dst, $dst, markWord::klass_shift_at_offset"
|
||||
%}
|
||||
ins_encode %{
|
||||
assert($mem$$index$$Register == noreg, "must not have indexed address");
|
||||
__ load_narrow_klass_compact_c2($dst$$Register, $mem$$base$$Register, $mem$$disp);
|
||||
// inlined aarch64_enc_ldrw
|
||||
loadStore(masm, &MacroAssembler::ldrw, $dst$$Register, $mem->opcode(),
|
||||
as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp, 4);
|
||||
__ lsrw($dst$$Register, $dst$$Register, markWord::klass_shift_at_offset);
|
||||
%}
|
||||
ins_pipe(iload_reg_mem);
|
||||
%}
|
||||
|
||||
@@ -206,8 +206,8 @@ void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg, Register
|
||||
// Handle existing monitor.
|
||||
bind(object_has_monitor);
|
||||
|
||||
// Try to CAS owner (no owner => current thread's _lock_id).
|
||||
ldr(rscratch2, Address(rthread, JavaThread::lock_id_offset()));
|
||||
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
|
||||
ldr(rscratch2, Address(rthread, JavaThread::monitor_owner_id_offset()));
|
||||
add(tmp, disp_hdr, (in_bytes(ObjectMonitor::owner_offset())-markWord::monitor_value));
|
||||
cmpxchg(tmp, zr, rscratch2, Assembler::xword, /*acquire*/ true,
|
||||
/*release*/ true, /*weak*/ false, tmp3Reg); // Sets flags for result
|
||||
@@ -469,8 +469,8 @@ void C2_MacroAssembler::fast_lock_lightweight(Register obj, Register box, Regist
|
||||
// Compute owner address.
|
||||
lea(t2_owner_addr, owner_address);
|
||||
|
||||
// Try to CAS owner (no owner => current thread's _lock_id).
|
||||
ldr(rscratch2, Address(rthread, JavaThread::lock_id_offset()));
|
||||
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
|
||||
ldr(rscratch2, Address(rthread, JavaThread::monitor_owner_id_offset()));
|
||||
cmpxchg(t2_owner_addr, zr, rscratch2, Assembler::xword, /*acquire*/ true,
|
||||
/*release*/ false, /*weak*/ false, t3_owner);
|
||||
br(Assembler::EQ, monitor_locked);
|
||||
@@ -2690,12 +2690,3 @@ bool C2_MacroAssembler::in_scratch_emit_size() {
|
||||
}
|
||||
return MacroAssembler::in_scratch_emit_size();
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::load_narrow_klass_compact_c2(Register dst, Register obj, int disp) {
|
||||
// Note: Don't clobber obj anywhere in that method!
|
||||
|
||||
// The incoming address is pointing into obj-start + klass_offset_in_bytes. We need to extract
|
||||
// obj-start, so that we can load from the object's mark-word instead.
|
||||
ldr(dst, Address(obj, disp - oopDesc::klass_offset_in_bytes()));
|
||||
lsr(dst, dst, markWord::klass_shift);
|
||||
}
|
||||
|
||||
@@ -186,6 +186,4 @@
|
||||
void vector_signum_sve(FloatRegister dst, FloatRegister src, FloatRegister zero,
|
||||
FloatRegister one, FloatRegister vtmp, PRegister pgtmp, SIMD_RegVariant T);
|
||||
|
||||
void load_narrow_klass_compact_c2(Register dst, Register obj, int disp);
|
||||
|
||||
#endif // CPU_AARCH64_C2_MACROASSEMBLER_AARCH64_HPP
|
||||
|
||||
@@ -66,6 +66,7 @@ define_pd_global(bool, OptoScheduling, false);
|
||||
define_pd_global(bool, OptoBundling, false);
|
||||
define_pd_global(bool, OptoRegScheduling, false);
|
||||
define_pd_global(bool, SuperWordLoopUnrollAnalysis, true);
|
||||
define_pd_global(uint, SuperWordStoreToLoadForwardingFailureDetection, 8);
|
||||
define_pd_global(bool, IdealizeClearArrayNode, true);
|
||||
|
||||
define_pd_global(intx, ReservedCodeCacheSize, 48*M);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
|
||||
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -86,6 +87,10 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_cmpxchg_at_resolved(LIRAccess& access, LI
|
||||
LIR_Opr result = gen->new_register(T_INT);
|
||||
|
||||
__ append(new LIR_OpShenandoahCompareAndSwap(addr, cmp_value.result(), new_value.result(), t1, t2, result));
|
||||
|
||||
if (ShenandoahCardBarrier) {
|
||||
post_barrier(access, access.resolved_addr(), new_value.result());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -113,6 +118,9 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess& access, LIRIt
|
||||
pre_barrier(access.gen(), access.access_emit_info(), access.decorators(), LIR_OprFact::illegalOpr,
|
||||
result /* pre_val */);
|
||||
}
|
||||
if (ShenandoahCardBarrier) {
|
||||
post_barrier(access, access.resolved_addr(), result);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2022, Red Hat, Inc. All rights reserved.
|
||||
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -31,6 +32,7 @@
|
||||
#include "gc/shenandoah/shenandoahRuntime.hpp"
|
||||
#include "gc/shenandoah/shenandoahThreadLocalData.hpp"
|
||||
#include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
|
||||
#include "gc/shenandoah/mode/shenandoahMode.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "interpreter/interp_masm.hpp"
|
||||
#include "runtime/javaThread.hpp"
|
||||
@@ -77,6 +79,13 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, Dec
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
|
||||
Register start, Register count, Register tmp, RegSet saved_regs) {
|
||||
if (ShenandoahCardBarrier && is_oop) {
|
||||
gen_write_ref_array_post_barrier(masm, decorators, start, count, tmp, saved_regs);
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::shenandoah_write_barrier_pre(MacroAssembler* masm,
|
||||
Register obj,
|
||||
Register pre_val,
|
||||
@@ -362,6 +371,26 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet d
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::store_check(MacroAssembler* masm, Register obj) {
|
||||
assert(ShenandoahCardBarrier, "Should have been checked by caller");
|
||||
|
||||
__ lsr(obj, obj, CardTable::card_shift());
|
||||
|
||||
assert(CardTable::dirty_card_val() == 0, "must be");
|
||||
|
||||
__ load_byte_map_base(rscratch1);
|
||||
|
||||
if (UseCondCardMark) {
|
||||
Label L_already_dirty;
|
||||
__ ldrb(rscratch2, Address(obj, rscratch1));
|
||||
__ cbz(rscratch2, L_already_dirty);
|
||||
__ strb(zr, Address(obj, rscratch1));
|
||||
__ bind(L_already_dirty);
|
||||
} else {
|
||||
__ strb(zr, Address(obj, rscratch1));
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Address dst, Register val, Register tmp1, Register tmp2, Register tmp3) {
|
||||
bool on_oop = is_reference_type(type);
|
||||
@@ -387,18 +416,13 @@ void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet
|
||||
val != noreg /* tosca_live */,
|
||||
false /* expand_call */);
|
||||
|
||||
if (val == noreg) {
|
||||
BarrierSetAssembler::store_at(masm, decorators, type, Address(tmp3, 0), noreg, noreg, noreg, noreg);
|
||||
} else {
|
||||
// Barrier needs uncompressed oop for region cross check.
|
||||
Register new_val = val;
|
||||
if (UseCompressedOops) {
|
||||
new_val = rscratch2;
|
||||
__ mov(new_val, val);
|
||||
}
|
||||
BarrierSetAssembler::store_at(masm, decorators, type, Address(tmp3, 0), val, noreg, noreg, noreg);
|
||||
}
|
||||
BarrierSetAssembler::store_at(masm, decorators, type, Address(tmp3, 0), val, noreg, noreg, noreg);
|
||||
|
||||
bool in_heap = (decorators & IN_HEAP) != 0;
|
||||
bool needs_post_barrier = (val != noreg) && in_heap && ShenandoahCardBarrier;
|
||||
if (needs_post_barrier) {
|
||||
store_check(masm, tmp3);
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env,
|
||||
@@ -581,6 +605,35 @@ void ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler* masm,
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
|
||||
Register start, Register count, Register scratch, RegSet saved_regs) {
|
||||
assert(ShenandoahCardBarrier, "Should have been checked by caller");
|
||||
|
||||
Label L_loop, L_done;
|
||||
const Register end = count;
|
||||
|
||||
// Zero count? Nothing to do.
|
||||
__ cbz(count, L_done);
|
||||
|
||||
// end = start + count << LogBytesPerHeapOop
|
||||
// last element address to make inclusive
|
||||
__ lea(end, Address(start, count, Address::lsl(LogBytesPerHeapOop)));
|
||||
__ sub(end, end, BytesPerHeapOop);
|
||||
__ lsr(start, start, CardTable::card_shift());
|
||||
__ lsr(end, end, CardTable::card_shift());
|
||||
|
||||
// number of bytes to copy
|
||||
__ sub(count, end, start);
|
||||
|
||||
__ load_byte_map_base(scratch);
|
||||
__ add(start, start, scratch);
|
||||
__ bind(L_loop);
|
||||
__ strb(zr, Address(start, count));
|
||||
__ subs(count, count, 1);
|
||||
__ br(Assembler::GE, L_loop);
|
||||
__ bind(L_done);
|
||||
}
|
||||
|
||||
#undef __
|
||||
|
||||
#ifdef COMPILER1
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
|
||||
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -55,10 +56,16 @@ private:
|
||||
bool tosca_live,
|
||||
bool expand_call);
|
||||
|
||||
void store_check(MacroAssembler* masm, Register obj);
|
||||
|
||||
void resolve_forward_pointer(MacroAssembler* masm, Register dst, Register tmp = noreg);
|
||||
void resolve_forward_pointer_not_null(MacroAssembler* masm, Register dst, Register tmp = noreg);
|
||||
void load_reference_barrier(MacroAssembler* masm, Register dst, Address load_addr, DecoratorSet decorators);
|
||||
|
||||
void gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
|
||||
Register start, Register count,
|
||||
Register scratch, RegSet saved_regs);
|
||||
|
||||
public:
|
||||
virtual NMethodPatchingType nmethod_patching_type() { return NMethodPatchingType::conc_data_patch; }
|
||||
|
||||
@@ -71,6 +78,8 @@ public:
|
||||
|
||||
virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
|
||||
Register src, Register dst, Register count, RegSet saved_regs);
|
||||
virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
|
||||
Register start, Register count, Register tmp, RegSet saved_regs);
|
||||
virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Register dst, Address src, Register tmp1, Register tmp2);
|
||||
virtual void store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
|
||||
@@ -393,7 +393,13 @@ void InterpreterMacroAssembler::dispatch_base(TosState state,
|
||||
bool verifyoop,
|
||||
bool generate_poll) {
|
||||
if (VerifyActivationFrameSize) {
|
||||
Unimplemented();
|
||||
Label L;
|
||||
sub(rscratch2, rfp, esp);
|
||||
int min_frame_size = (frame::link_offset - frame::interpreter_frame_initial_sp_offset) * wordSize;
|
||||
subs(rscratch2, rscratch2, min_frame_size);
|
||||
br(Assembler::GE, L);
|
||||
stop("broken stack frame");
|
||||
bind(L);
|
||||
}
|
||||
if (verifyoop) {
|
||||
interp_verify_oop(r0, state);
|
||||
|
||||
@@ -5305,7 +5305,7 @@ MacroAssembler::KlassDecodeMode MacroAssembler::klass_decode_mode() {
|
||||
if (operand_valid_for_logical_immediate(
|
||||
/*is32*/false, (uint64_t)CompressedKlassPointers::base())) {
|
||||
const size_t range = CompressedKlassPointers::klass_range_end() - CompressedKlassPointers::base();
|
||||
const uint64_t range_mask = (1ULL << log2i(range)) - 1;
|
||||
const uint64_t range_mask = right_n_bits(log2i_ceil(range));
|
||||
if (((uint64_t)CompressedKlassPointers::base() & range_mask) == 0) {
|
||||
return (_klass_decode_mode = KlassDecodeXor);
|
||||
}
|
||||
|
||||
@@ -620,7 +620,7 @@ address TemplateInterpreterGenerator::generate_cont_resume_interpreter_adapter()
|
||||
// Restore Java expression stack pointer
|
||||
__ ldr(rscratch1, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
|
||||
__ lea(esp, Address(rfp, rscratch1, Address::lsl(Interpreter::logStackElementSize)));
|
||||
// and NULL it as marker that esp is now tos until next java call
|
||||
// and null it as marker that esp is now tos until next java call
|
||||
__ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
|
||||
|
||||
// Restore machine SP
|
||||
|
||||
@@ -444,7 +444,19 @@ void VM_Version::initialize() {
|
||||
}
|
||||
|
||||
if (UseSVE > 0) {
|
||||
_initial_sve_vector_length = get_current_sve_vector_length();
|
||||
int vl = get_current_sve_vector_length();
|
||||
if (vl < 0) {
|
||||
warning("Unable to get SVE vector length on this system. "
|
||||
"Disabling SVE. Specify -XX:UseSVE=0 to shun this warning.");
|
||||
FLAG_SET_DEFAULT(UseSVE, 0);
|
||||
} else if ((vl == 0) || ((vl % FloatRegister::sve_vl_min) != 0) || !is_power_of_2(vl)) {
|
||||
warning("Detected SVE vector length (%d) should be a power of two and a multiple of %d. "
|
||||
"Disabling SVE. Specify -XX:UseSVE=0 to shun this warning.",
|
||||
vl, FloatRegister::sve_vl_min);
|
||||
FLAG_SET_DEFAULT(UseSVE, 0);
|
||||
} else {
|
||||
_initial_sve_vector_length = vl;
|
||||
}
|
||||
}
|
||||
|
||||
// This machine allows unaligned memory accesses
|
||||
|
||||
@@ -64,6 +64,7 @@ define_pd_global(bool, OptoBundling, false);
|
||||
define_pd_global(bool, OptoScheduling, true);
|
||||
define_pd_global(bool, OptoRegScheduling, false);
|
||||
define_pd_global(bool, SuperWordLoopUnrollAnalysis, false);
|
||||
define_pd_global(uint, SuperWordStoreToLoadForwardingFailureDetection, 16);
|
||||
define_pd_global(bool, IdealizeClearArrayNode, true);
|
||||
|
||||
#ifdef _LP64
|
||||
|
||||
@@ -506,6 +506,9 @@ class Assembler : public AbstractAssembler {
|
||||
LFSU_OPCODE = (49u << OPCODE_SHIFT | 00u << 1),
|
||||
LFSX_OPCODE = (31u << OPCODE_SHIFT | 535u << 1),
|
||||
|
||||
LFIWAX_OPCODE = (31u << OPCODE_SHIFT | 855u << 1),
|
||||
LFIWZX_OPCODE = (31u << OPCODE_SHIFT | 887u << 1),
|
||||
|
||||
STFD_OPCODE = (54u << OPCODE_SHIFT | 00u << 1),
|
||||
STFDU_OPCODE = (55u << OPCODE_SHIFT | 00u << 1),
|
||||
STFDX_OPCODE = (31u << OPCODE_SHIFT | 727u << 1),
|
||||
@@ -513,6 +516,8 @@ class Assembler : public AbstractAssembler {
|
||||
STFSU_OPCODE = (53u << OPCODE_SHIFT | 00u << 1),
|
||||
STFSX_OPCODE = (31u << OPCODE_SHIFT | 663u << 1),
|
||||
|
||||
STFIWX_OPCODE = (31u << OPCODE_SHIFT | 983u << 1),
|
||||
|
||||
FSQRT_OPCODE = (63u << OPCODE_SHIFT | 22u << 1), // A-FORM
|
||||
FSQRTS_OPCODE = (59u << OPCODE_SHIFT | 22u << 1), // A-FORM
|
||||
|
||||
@@ -555,6 +560,10 @@ class Assembler : public AbstractAssembler {
|
||||
XVDIVSP_OPCODE = (60u << OPCODE_SHIFT | 88u << 3),
|
||||
XXBRD_OPCODE = (60u << OPCODE_SHIFT | 475u << 2 | 23u << 16), // XX2-FORM
|
||||
XXBRW_OPCODE = (60u << OPCODE_SHIFT | 475u << 2 | 15u << 16), // XX2-FORM
|
||||
XVCVHPSP_OPCODE= (60u << OPCODE_SHIFT | 475u << 2 | 24u << 16), // XX2-FORM
|
||||
XVCVSPHP_OPCODE= (60u << OPCODE_SHIFT | 475u << 2 | 25u << 16), // XX2-FORM
|
||||
XSCVHPDP_OPCODE= (60u << OPCODE_SHIFT | 347u << 2 | 16u << 16), // XX2-FORM
|
||||
XSCVDPHP_OPCODE= (60u << OPCODE_SHIFT | 347u << 2 | 17u << 16), // XX2-FORM
|
||||
XXPERM_OPCODE = (60u << OPCODE_SHIFT | 26u << 3),
|
||||
XXSEL_OPCODE = (60u << OPCODE_SHIFT | 3u << 4),
|
||||
XXSPLTIB_OPCODE= (60u << OPCODE_SHIFT | 360u << 1),
|
||||
@@ -2076,6 +2085,9 @@ class Assembler : public AbstractAssembler {
|
||||
inline void lfdu( FloatRegister d, int si16, Register a);
|
||||
inline void lfdx( FloatRegister d, Register a, Register b);
|
||||
|
||||
inline void lfiwax(FloatRegister d, Register a, Register b);
|
||||
inline void lfiwzx(FloatRegister d, Register a, Register b);
|
||||
|
||||
// PPC 1, section 4.6.3 Floating-Point Store Instructions
|
||||
inline void stfs( FloatRegister s, int si16, Register a);
|
||||
inline void stfsu( FloatRegister s, int si16, Register a);
|
||||
@@ -2084,6 +2096,8 @@ class Assembler : public AbstractAssembler {
|
||||
inline void stfdu( FloatRegister s, int si16, Register a);
|
||||
inline void stfdx( FloatRegister s, Register a, Register b);
|
||||
|
||||
inline void stfiwx(FloatRegister s, Register a, Register b);
|
||||
|
||||
// PPC 1, section 4.6.4 Floating-Point Move Instructions
|
||||
inline void fmr( FloatRegister d, FloatRegister b);
|
||||
inline void fmr_( FloatRegister d, FloatRegister b);
|
||||
@@ -2348,6 +2362,10 @@ class Assembler : public AbstractAssembler {
|
||||
inline void xxleqv( VectorSRegister d, VectorSRegister a, VectorSRegister b);
|
||||
inline void xxbrd( VectorSRegister d, VectorSRegister b);
|
||||
inline void xxbrw( VectorSRegister d, VectorSRegister b);
|
||||
inline void xvcvhpsp( VectorSRegister d, VectorSRegister b);
|
||||
inline void xvcvsphp( VectorSRegister d, VectorSRegister b);
|
||||
inline void xscvhpdp( VectorSRegister d, VectorSRegister b);
|
||||
inline void xscvdphp( VectorSRegister d, VectorSRegister b);
|
||||
inline void xxland( VectorSRegister d, VectorSRegister a, VectorSRegister b);
|
||||
inline void xxsel( VectorSRegister d, VectorSRegister a, VectorSRegister b, VectorSRegister c);
|
||||
inline void xxspltib( VectorSRegister d, int ui8);
|
||||
@@ -2474,10 +2492,13 @@ class Assembler : public AbstractAssembler {
|
||||
inline void lfsx( FloatRegister d, Register b);
|
||||
inline void lfd( FloatRegister d, int si16);
|
||||
inline void lfdx( FloatRegister d, Register b);
|
||||
inline void lfiwax(FloatRegister d, Register b);
|
||||
inline void lfiwzx(FloatRegister d, Register b);
|
||||
inline void stfs( FloatRegister s, int si16);
|
||||
inline void stfsx( FloatRegister s, Register b);
|
||||
inline void stfd( FloatRegister s, int si16);
|
||||
inline void stfdx( FloatRegister s, Register b);
|
||||
inline void stfiwx(FloatRegister s, Register b);
|
||||
inline void lvebx( VectorRegister d, Register s2);
|
||||
inline void lvehx( VectorRegister d, Register s2);
|
||||
inline void lvewx( VectorRegister d, Register s2);
|
||||
|
||||
@@ -741,6 +741,9 @@ inline void Assembler::lfd( FloatRegister d, int si16, Register a) { emit_int3
|
||||
inline void Assembler::lfdu(FloatRegister d, int si16, Register a) { emit_int32( LFDU_OPCODE | frt(d) | ra(a) | simm(si16,16)); }
|
||||
inline void Assembler::lfdx(FloatRegister d, Register a, Register b) { emit_int32( LFDX_OPCODE | frt(d) | ra0mem(a) | rb(b)); }
|
||||
|
||||
inline void Assembler::lfiwax(FloatRegister d, Register a, Register b) { emit_int32( LFIWAX_OPCODE | frt(d) | ra0mem(a) |rb(b)); }
|
||||
inline void Assembler::lfiwzx(FloatRegister d, Register a, Register b) { emit_int32( LFIWZX_OPCODE | frt(d) | ra0mem(a) |rb(b)); }
|
||||
|
||||
// PPC 1, section 4.6.3 Floating-Point Store Instructions
|
||||
// Use ra0mem instead of ra in some instructions below.
|
||||
inline void Assembler::stfs( FloatRegister s, int si16, Register a) { emit_int32( STFS_OPCODE | frs(s) | ra0mem(a) | simm(si16,16)); }
|
||||
@@ -750,6 +753,8 @@ inline void Assembler::stfd( FloatRegister s, int si16, Register a) { emit_int3
|
||||
inline void Assembler::stfdu(FloatRegister s, int si16, Register a) { emit_int32( STFDU_OPCODE | frs(s) | ra(a) | simm(si16,16)); }
|
||||
inline void Assembler::stfdx(FloatRegister s, Register a, Register b){ emit_int32( STFDX_OPCODE | frs(s) | ra0mem(a) | rb(b)); }
|
||||
|
||||
inline void Assembler::stfiwx(FloatRegister s, Register a, Register b) { emit_int32( STFIWX_OPCODE | frs(s) | ra0mem(a) |rb(b)); }
|
||||
|
||||
// PPC 1, section 4.6.4 Floating-Point Move Instructions
|
||||
inline void Assembler::fmr( FloatRegister d, FloatRegister b) { emit_int32( FMR_OPCODE | frt(d) | frb(b) | rc(0)); }
|
||||
inline void Assembler::fmr_(FloatRegister d, FloatRegister b) { emit_int32( FMR_OPCODE | frt(d) | frb(b) | rc(1)); }
|
||||
@@ -871,6 +876,10 @@ inline void Assembler::xxlxor( VectorSRegister d, VectorSRegister a, VectorSReg
|
||||
inline void Assembler::xxleqv( VectorSRegister d, VectorSRegister a, VectorSRegister b) { emit_int32( XXLEQV_OPCODE | vsrt(d) | vsra(a) | vsrb(b)); }
|
||||
inline void Assembler::xxbrd( VectorSRegister d, VectorSRegister b) { emit_int32( XXBRD_OPCODE | vsrt(d) | vsrb(b) ); }
|
||||
inline void Assembler::xxbrw( VectorSRegister d, VectorSRegister b) { emit_int32( XXBRW_OPCODE | vsrt(d) | vsrb(b) ); }
|
||||
inline void Assembler::xvcvhpsp(VectorSRegister d, VectorSRegister b) { emit_int32( XVCVHPSP_OPCODE | vsrt(d) | vsrb(b) ); }
|
||||
inline void Assembler::xvcvsphp(VectorSRegister d, VectorSRegister b) { emit_int32( XVCVSPHP_OPCODE | vsrt(d) | vsrb(b) ); }
|
||||
inline void Assembler::xscvhpdp(VectorSRegister d, VectorSRegister b) { emit_int32( XSCVHPDP_OPCODE | vsrt(d) | vsrb(b) ); }
|
||||
inline void Assembler::xscvdphp(VectorSRegister d, VectorSRegister b) { emit_int32( XSCVDPHP_OPCODE | vsrt(d) | vsrb(b) ); }
|
||||
inline void Assembler::xvdivsp( VectorSRegister d, VectorSRegister a, VectorSRegister b) { emit_int32( XVDIVSP_OPCODE | vsrt(d) | vsra(a) | vsrb(b)); }
|
||||
inline void Assembler::xvdivdp( VectorSRegister d, VectorSRegister a, VectorSRegister b) { emit_int32( XVDIVDP_OPCODE | vsrt(d) | vsra(a) | vsrb(b)); }
|
||||
inline void Assembler::xvabssp( VectorSRegister d, VectorSRegister b) { emit_int32( XVABSSP_OPCODE | vsrt(d) | vsrb(b)); }
|
||||
@@ -1150,12 +1159,17 @@ inline void Assembler::lfsx(FloatRegister d, Register b) { emit_int32( LFSX_OPCO
|
||||
inline void Assembler::lfd( FloatRegister d, int si16) { emit_int32( LFD_OPCODE | frt(d) | simm(si16,16)); }
|
||||
inline void Assembler::lfdx(FloatRegister d, Register b) { emit_int32( LFDX_OPCODE | frt(d) | rb(b)); }
|
||||
|
||||
inline void Assembler::lfiwax(FloatRegister d, Register b) { emit_int32( LFIWAX_OPCODE | frt(d) | rb(b)); }
|
||||
inline void Assembler::lfiwzx(FloatRegister d, Register b) { emit_int32( LFIWZX_OPCODE | frt(d) | rb(b)); }
|
||||
|
||||
// ra0 version
|
||||
inline void Assembler::stfs( FloatRegister s, int si16) { emit_int32( STFS_OPCODE | frs(s) | simm(si16, 16)); }
|
||||
inline void Assembler::stfsx(FloatRegister s, Register b) { emit_int32( STFSX_OPCODE | frs(s) | rb(b)); }
|
||||
inline void Assembler::stfd( FloatRegister s, int si16) { emit_int32( STFD_OPCODE | frs(s) | simm(si16, 16)); }
|
||||
inline void Assembler::stfdx(FloatRegister s, Register b) { emit_int32( STFDX_OPCODE | frs(s) | rb(b)); }
|
||||
|
||||
inline void Assembler::stfiwx(FloatRegister s, Register b) { emit_int32( STFIWX_OPCODE | frs(s) |rb(b)); }
|
||||
|
||||
// ra0 version
|
||||
inline void Assembler::lvebx( VectorRegister d, Register s2) { emit_int32( LVEBX_OPCODE | vrt(d) | rb(s2)); }
|
||||
inline void Assembler::lvehx( VectorRegister d, Register s2) { emit_int32( LVEHX_OPCODE | vrt(d) | rb(s2)); }
|
||||
|
||||
@@ -1713,7 +1713,7 @@ void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr
|
||||
}
|
||||
|
||||
|
||||
void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr thread, LIR_Opr dest, LIR_Op* op) {
|
||||
void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr tmp, LIR_Opr dest, LIR_Op* op) {
|
||||
switch (code) {
|
||||
case lir_sqrt: {
|
||||
__ fsqrt(dest->as_double_reg(), value->as_double_reg());
|
||||
@@ -1723,6 +1723,14 @@ void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr thread, L
|
||||
__ fabs(dest->as_double_reg(), value->as_double_reg());
|
||||
break;
|
||||
}
|
||||
case lir_f2hf: {
|
||||
__ f2hf(dest.as_register(), value.as_float_reg(), tmp.as_float_reg());
|
||||
break;
|
||||
}
|
||||
case lir_hf2f: {
|
||||
__ hf2f(dest->as_float_reg(), value.as_register());
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
ShouldNotReachHere();
|
||||
break;
|
||||
|
||||
@@ -690,6 +690,25 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
|
||||
__ abs(value.result(), dst, LIR_OprFact::illegalOpr);
|
||||
break;
|
||||
}
|
||||
case vmIntrinsics::_floatToFloat16: {
|
||||
assert(x->number_of_arguments() == 1, "wrong type");
|
||||
LIRItem value(x->argument_at(0), this);
|
||||
value.load_item();
|
||||
LIR_Opr dst = rlock_result(x);
|
||||
LIR_Opr tmp = new_register(T_FLOAT);
|
||||
// f2hf treats tmp as live_in. Workaround: initialize to some value.
|
||||
__ move(LIR_OprFact::floatConst(-0.0), tmp); // just to satisfy LinearScan
|
||||
__ f2hf(value.result(), dst, tmp);
|
||||
break;
|
||||
}
|
||||
case vmIntrinsics::_float16ToFloat: {
|
||||
assert(x->number_of_arguments() == 1, "wrong type");
|
||||
LIRItem value(x->argument_at(0), this);
|
||||
value.load_item();
|
||||
LIR_Opr dst = rlock_result(x);
|
||||
__ hf2f(value.result(), dst, LIR_OprFact::illegalOpr);
|
||||
break;
|
||||
}
|
||||
case vmIntrinsics::_dsqrt:
|
||||
case vmIntrinsics::_dsqrt_strict: {
|
||||
if (VM_Version::has_fsqrt()) {
|
||||
|
||||
@@ -59,6 +59,7 @@ define_pd_global(bool, UseCISCSpill, false);
|
||||
define_pd_global(bool, OptoBundling, false);
|
||||
define_pd_global(bool, OptoRegScheduling, false);
|
||||
define_pd_global(bool, SuperWordLoopUnrollAnalysis, true);
|
||||
define_pd_global(uint, SuperWordStoreToLoadForwardingFailureDetection, 16);
|
||||
// GL:
|
||||
// Detected a problem with unscaled compressed oops and
|
||||
// narrow_oop_use_complex_address() == false.
|
||||
|
||||
@@ -102,6 +102,10 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_cmpxchg_at_resolved(LIRAccess &access, LI
|
||||
|
||||
__ append(new LIR_OpShenandoahCompareAndSwap(addr, cmp_value.result(), new_value.result(), t1, t2, result));
|
||||
|
||||
if (ShenandoahCardBarrier) {
|
||||
post_barrier(access, access.resolved_addr(), new_value.result());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -132,6 +136,10 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess &access, LIRIt
|
||||
if (ShenandoahSATBBarrier) {
|
||||
pre_barrier(access.gen(), access.access_emit_info(), access.decorators(), LIR_OprFact::illegalOpr, result);
|
||||
}
|
||||
|
||||
if (ShenandoahCardBarrier) {
|
||||
post_barrier(access, access.resolved_addr(), result);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "gc/shenandoah/shenandoahRuntime.hpp"
|
||||
#include "gc/shenandoah/shenandoahThreadLocalData.hpp"
|
||||
#include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
|
||||
#include "gc/shenandoah/mode/shenandoahMode.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "macroAssembler_ppc.hpp"
|
||||
#include "runtime/javaThread.hpp"
|
||||
@@ -76,8 +77,6 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler *masm,
|
||||
void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler *masm, DecoratorSet decorators, BasicType type,
|
||||
Register src, Register dst, Register count,
|
||||
Register preserve1, Register preserve2) {
|
||||
__ block_comment("arraycopy_prologue (shenandoahgc) {");
|
||||
|
||||
Register R11_tmp = R11_scratch1;
|
||||
|
||||
assert_different_registers(src, dst, count, R11_tmp, noreg);
|
||||
@@ -100,6 +99,7 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler *masm, Dec
|
||||
return;
|
||||
}
|
||||
|
||||
__ block_comment("arraycopy_prologue (shenandoahgc) {");
|
||||
Label skip_prologue;
|
||||
|
||||
// Fast path: Array is of length zero.
|
||||
@@ -173,6 +173,16 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler *masm, Dec
|
||||
__ block_comment("} arraycopy_prologue (shenandoahgc)");
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Register dst, Register count,
|
||||
Register preserve) {
|
||||
if (ShenandoahCardBarrier && is_reference_type(type)) {
|
||||
__ block_comment("arraycopy_epilogue (shenandoahgc) {");
|
||||
gen_write_ref_array_post_barrier(masm, decorators, dst, count, preserve);
|
||||
__ block_comment("} arraycopy_epilogue (shenandoahgc)");
|
||||
}
|
||||
}
|
||||
|
||||
// The to-be-enqueued value can either be determined
|
||||
// - dynamically by passing the reference's address information (load mode) or
|
||||
// - statically by passing a register the value is stored in (preloaded mode)
|
||||
@@ -576,6 +586,25 @@ void ShenandoahBarrierSetAssembler::load_at(
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::store_check(MacroAssembler* masm, Register base, RegisterOrConstant ind_or_offs, Register tmp) {
|
||||
assert(ShenandoahCardBarrier, "Should have been checked by caller");
|
||||
|
||||
ShenandoahBarrierSet* ctbs = ShenandoahBarrierSet::barrier_set();
|
||||
CardTable* ct = ctbs->card_table();
|
||||
assert_different_registers(base, tmp, R0);
|
||||
|
||||
if (ind_or_offs.is_constant()) {
|
||||
__ add_const_optimized(base, base, ind_or_offs.as_constant(), tmp);
|
||||
} else {
|
||||
__ add(base, ind_or_offs.as_register(), base);
|
||||
}
|
||||
|
||||
__ load_const_optimized(tmp, (address)ct->byte_map_base(), R0);
|
||||
__ srdi(base, base, CardTable::card_shift());
|
||||
__ li(R0, CardTable::dirty_card_val());
|
||||
__ stbx(R0, tmp, base);
|
||||
}
|
||||
|
||||
// base: Base register of the reference's address.
|
||||
// ind_or_offs: Index or offset of the reference's address.
|
||||
// val: To-be-stored value/reference's new value.
|
||||
@@ -594,6 +623,11 @@ void ShenandoahBarrierSetAssembler::store_at(MacroAssembler *masm, DecoratorSet
|
||||
val,
|
||||
tmp1, tmp2, tmp3,
|
||||
preservation_level);
|
||||
|
||||
// No need for post barrier if storing NULL
|
||||
if (ShenandoahCardBarrier && is_reference_type(type) && val != noreg) {
|
||||
store_check(masm, base, ind_or_offs, tmp1);
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler *masm,
|
||||
@@ -743,6 +777,40 @@ void ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler *masm, Register b
|
||||
__ block_comment("} cmpxchg_oop (shenandoahgc)");
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
|
||||
Register addr, Register count, Register preserve) {
|
||||
assert(ShenandoahCardBarrier, "Should have been checked by caller");
|
||||
|
||||
ShenandoahBarrierSet* bs = ShenandoahBarrierSet::barrier_set();
|
||||
CardTable* ct = bs->card_table();
|
||||
assert_different_registers(addr, count, R0);
|
||||
|
||||
Label L_skip_loop, L_store_loop;
|
||||
|
||||
__ sldi_(count, count, LogBytesPerHeapOop);
|
||||
|
||||
// Zero length? Skip.
|
||||
__ beq(CCR0, L_skip_loop);
|
||||
|
||||
__ addi(count, count, -BytesPerHeapOop);
|
||||
__ add(count, addr, count);
|
||||
// Use two shifts to clear out those low order two bits! (Cannot opt. into 1.)
|
||||
__ srdi(addr, addr, CardTable::card_shift());
|
||||
__ srdi(count, count, CardTable::card_shift());
|
||||
__ subf(count, addr, count);
|
||||
__ add_const_optimized(addr, addr, (address)ct->byte_map_base(), R0);
|
||||
__ addi(count, count, 1);
|
||||
__ li(R0, 0);
|
||||
__ mtctr(count);
|
||||
|
||||
// Byte store loop
|
||||
__ bind(L_store_loop);
|
||||
__ stb(R0, 0, addr);
|
||||
__ addi(addr, addr, 1);
|
||||
__ bdnz(L_store_loop);
|
||||
__ bind(L_skip_loop);
|
||||
}
|
||||
|
||||
#undef __
|
||||
|
||||
#ifdef COMPILER1
|
||||
|
||||
@@ -51,6 +51,10 @@ private:
|
||||
Register tmp1, Register tmp2,
|
||||
MacroAssembler::PreservationLevel preservation_level);
|
||||
|
||||
void store_check(MacroAssembler* masm,
|
||||
Register base, RegisterOrConstant ind_or_offs,
|
||||
Register tmp);
|
||||
|
||||
void load_reference_barrier_impl(MacroAssembler* masm, DecoratorSet decorators,
|
||||
Register base, RegisterOrConstant ind_or_offs,
|
||||
Register dst,
|
||||
@@ -60,6 +64,10 @@ private:
|
||||
/* ==== Helper methods for barrier implementations ==== */
|
||||
void resolve_forward_pointer_not_null(MacroAssembler* masm, Register dst, Register tmp);
|
||||
|
||||
void gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
|
||||
Register addr, Register count,
|
||||
Register preserve);
|
||||
|
||||
public:
|
||||
virtual NMethodPatchingType nmethod_patching_type() { return NMethodPatchingType::conc_data_patch; }
|
||||
|
||||
@@ -95,7 +103,11 @@ public:
|
||||
|
||||
/* ==== Access api ==== */
|
||||
virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Register src, Register dst, Register count, Register preserve1, Register preserve2);
|
||||
Register src, Register dst, Register count,
|
||||
Register preserve1, Register preserve2);
|
||||
virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Register dst, Register count,
|
||||
Register preserve);
|
||||
|
||||
virtual void store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Register base, RegisterOrConstant ind_or_offs, Register val,
|
||||
|
||||
@@ -2664,10 +2664,10 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register
|
||||
// Handle existing monitor.
|
||||
bind(object_has_monitor);
|
||||
|
||||
// Try to CAS owner (no owner => current thread's _lock_id).
|
||||
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
|
||||
addi(temp, displaced_header, in_bytes(ObjectMonitor::owner_offset()) - markWord::monitor_value);
|
||||
Register thread_id = displaced_header;
|
||||
ld(thread_id, in_bytes(JavaThread::lock_id_offset()), R16_thread);
|
||||
ld(thread_id, in_bytes(JavaThread::monitor_owner_id_offset()), R16_thread);
|
||||
cmpxchgd(/*flag=*/flag,
|
||||
/*current_value=*/current_header,
|
||||
/*compare_value=*/(intptr_t)0,
|
||||
@@ -2944,9 +2944,9 @@ void MacroAssembler::compiler_fast_lock_lightweight_object(ConditionRegister fla
|
||||
addi(owner_addr, monitor, in_bytes(ObjectMonitor::owner_offset()));
|
||||
}
|
||||
|
||||
// Try to CAS owner (no owner => current thread's _lock_id).
|
||||
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
|
||||
assert_different_registers(thread_id, monitor, owner_addr, box, R0);
|
||||
ld(thread_id, in_bytes(JavaThread::lock_id_offset()), R16_thread);
|
||||
ld(thread_id, in_bytes(JavaThread::monitor_owner_id_offset()), R16_thread);
|
||||
cmpxchgd(/*flag=*/CCR0,
|
||||
/*current_value=*/R0,
|
||||
/*compare_value=*/(intptr_t)0,
|
||||
|
||||
@@ -186,6 +186,9 @@ class MacroAssembler: public Assembler {
|
||||
void inline set_cmpu3(Register dst, bool treat_unordered_like_less);
|
||||
// Branch-free implementation to convert !=0 to 1.
|
||||
void inline normalize_bool(Register dst, Register temp = R0, bool is_64bit = false);
|
||||
// Convert between half precision float encoded into a short and a float in a FloatRegister.
|
||||
void inline f2hf(Register dst, FloatRegister src, FloatRegister tmp);
|
||||
void inline hf2f(FloatRegister dst, Register src);
|
||||
|
||||
inline void pd_patch_instruction(address branch, address target, const char* file, int line);
|
||||
NOT_PRODUCT(static void pd_print_patched_instruction(address branch);)
|
||||
|
||||
@@ -297,6 +297,20 @@ inline void MacroAssembler::normalize_bool(Register dst, Register temp, bool is_
|
||||
}
|
||||
}
|
||||
|
||||
inline void MacroAssembler::f2hf(Register dst, FloatRegister src, FloatRegister tmp) {
|
||||
// Single precision values in FloatRegisters use double precision format on PPC64.
|
||||
xscvdphp(tmp->to_vsr(), src->to_vsr());
|
||||
mffprd(dst, tmp);
|
||||
// Make it a proper short (sign-extended).
|
||||
extsh(dst, dst);
|
||||
}
|
||||
|
||||
inline void MacroAssembler::hf2f(FloatRegister dst, Register src) {
|
||||
mtfprd(dst, src);
|
||||
// Single precision values in FloatRegisters use double precision format on PPC64.
|
||||
xscvhpdp(dst->to_vsr(), dst->to_vsr());
|
||||
}
|
||||
|
||||
// Convenience bc_far versions
|
||||
inline void MacroAssembler::blt_far(ConditionRegister crx, Label& L, int optimize) { MacroAssembler::bc_far(bcondCRbiIs1, bi0(crx, less), L, optimize); }
|
||||
inline void MacroAssembler::bgt_far(ConditionRegister crx, Label& L, int optimize) { MacroAssembler::bc_far(bcondCRbiIs1, bi0(crx, greater), L, optimize); }
|
||||
|
||||
@@ -2077,6 +2077,9 @@ bool Matcher::match_rule_supported(int opcode) {
|
||||
case Op_PopCountI:
|
||||
case Op_PopCountL:
|
||||
return (UsePopCountInstruction && VM_Version::has_popcntw());
|
||||
case Op_ConvF2HF:
|
||||
case Op_ConvHF2F:
|
||||
return VM_Version::supports_float16();
|
||||
|
||||
case Op_AddVB:
|
||||
case Op_AddVS:
|
||||
@@ -11245,6 +11248,34 @@ instruct convF2D_reg(regD dst, regF src) %{
|
||||
ins_pipe(pipe_class_default);
|
||||
%}
|
||||
|
||||
instruct convF2HF_reg_reg(iRegIdst dst, regF src, regF tmp) %{
|
||||
match(Set dst (ConvF2HF src));
|
||||
effect(TEMP tmp);
|
||||
ins_cost(3 * DEFAULT_COST);
|
||||
size(12);
|
||||
format %{ "xscvdphp $tmp, $src\t# convert to half precision\n\t"
|
||||
"mffprd $dst, $tmp\t# move result from $tmp to $dst\n\t"
|
||||
"extsh $dst, $dst\t# make it a proper short"
|
||||
%}
|
||||
ins_encode %{
|
||||
__ f2hf($dst$$Register, $src$$FloatRegister, $tmp$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_class_default);
|
||||
%}
|
||||
|
||||
instruct convHF2F_reg_reg(regF dst, iRegIsrc src) %{
|
||||
match(Set dst (ConvHF2F src));
|
||||
ins_cost(2 * DEFAULT_COST);
|
||||
size(8);
|
||||
format %{ "mtfprd $dst, $src\t# move source from $src to $dst\n\t"
|
||||
"xscvhpdp $dst, $dst\t# convert from half precision"
|
||||
%}
|
||||
ins_encode %{
|
||||
__ hf2f($dst$$FloatRegister, $src$$Register);
|
||||
%}
|
||||
ins_pipe(pipe_class_default);
|
||||
%}
|
||||
|
||||
//----------Control Flow Instructions------------------------------------------
|
||||
// Compare Instructions
|
||||
|
||||
|
||||
@@ -1602,7 +1602,6 @@ static void fill_continuation_entry(MacroAssembler* masm, Register reg_cont_obj,
|
||||
#ifdef ASSERT
|
||||
__ load_const_optimized(tmp2, ContinuationEntry::cookie_value());
|
||||
__ stw(tmp2, in_bytes(ContinuationEntry::cookie_offset()), R1_SP);
|
||||
__ std(tmp2, _abi0(cr), R1_SP);
|
||||
#endif //ASSERT
|
||||
|
||||
__ li(zero, 0);
|
||||
@@ -1646,10 +1645,6 @@ static void continuation_enter_cleanup(MacroAssembler* masm) {
|
||||
__ ld_ptr(tmp1, JavaThread::cont_entry_offset(), R16_thread);
|
||||
__ cmpd(CCR0, R1_SP, tmp1);
|
||||
__ asm_assert_eq(FILE_AND_LINE ": incorrect R1_SP");
|
||||
__ load_const_optimized(tmp1, ContinuationEntry::cookie_value());
|
||||
__ ld(tmp2, _abi0(cr), R1_SP);
|
||||
__ cmpd(CCR0, tmp1, tmp2);
|
||||
__ asm_assert_eq(FILE_AND_LINE ": cookie not found");
|
||||
#endif
|
||||
|
||||
__ ld_ptr(tmp1, ContinuationEntry::parent_cont_fastpath_offset(), R1_SP);
|
||||
|
||||
@@ -3451,6 +3451,24 @@ class StubGenerator: public StubCodeGenerator {
|
||||
return start;
|
||||
}
|
||||
|
||||
address generate_floatToFloat16() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubCodeMark mark(this, "StubRoutines", "floatToFloat16");
|
||||
address start = __ function_entry();
|
||||
__ f2hf(R3_RET, F1_ARG1, F0);
|
||||
__ blr();
|
||||
return start;
|
||||
}
|
||||
|
||||
address generate_float16ToFloat() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubCodeMark mark(this, "StubRoutines", "float16ToFloat");
|
||||
address start = __ function_entry();
|
||||
__ hf2f(F1_RET, R3_ARG1);
|
||||
__ blr();
|
||||
return start;
|
||||
}
|
||||
|
||||
address generate_method_entry_barrier() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubCodeMark mark(this, "StubRoutines", "nmethod_entry_barrier");
|
||||
@@ -4678,6 +4696,12 @@ address generate_lookup_secondary_supers_table_stub(u1 super_klass_index) {
|
||||
StubRoutines::_crc32c_table_addr = StubRoutines::ppc::generate_crc_constants(REVERSE_CRC32C_POLY);
|
||||
StubRoutines::_updateBytesCRC32C = generate_CRC32_updateBytes(true);
|
||||
}
|
||||
|
||||
if (VM_Version::supports_float16()) {
|
||||
// For results consistency both intrinsics should be enabled.
|
||||
StubRoutines::_hf2f = generate_float16ToFloat();
|
||||
StubRoutines::_f2hf = generate_floatToFloat16();
|
||||
}
|
||||
}
|
||||
|
||||
void generate_continuation_stubs() {
|
||||
|
||||
@@ -1155,6 +1155,44 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
|
||||
return entry;
|
||||
}
|
||||
|
||||
address TemplateInterpreterGenerator::generate_Float_floatToFloat16_entry() {
|
||||
if (!VM_Version::supports_float16()) return nullptr;
|
||||
|
||||
address entry = __ pc();
|
||||
|
||||
__ lfs(F1, Interpreter::stackElementSize, R15_esp);
|
||||
__ f2hf(R3_RET, F1, F0);
|
||||
|
||||
// Restore caller sp for c2i case (from compiled) and for resized sender frame (from interpreted).
|
||||
__ resize_frame_absolute(R21_sender_SP, R11_scratch1, R0);
|
||||
__ blr();
|
||||
|
||||
__ flush();
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
address TemplateInterpreterGenerator::generate_Float_float16ToFloat_entry() {
|
||||
if (!VM_Version::supports_float16()) return nullptr;
|
||||
|
||||
address entry = __ pc();
|
||||
|
||||
// Note: Could also use:
|
||||
//__ li(R3, Interpreter::stackElementSize);
|
||||
//__ lfiwax(F1_RET, R15_esp, R3); // short stored as 32 bit integer
|
||||
//__ xscvhpdp(F1_RET->to_vsr(), F1_RET->to_vsr());
|
||||
__ lwa(R3, Interpreter::stackElementSize, R15_esp);
|
||||
__ hf2f(F1_RET, R3);
|
||||
|
||||
// Restore caller sp for c2i case (from compiled) and for resized sender frame (from interpreted).
|
||||
__ resize_frame_absolute(R21_sender_SP, R11_scratch1, R0);
|
||||
__ blr();
|
||||
|
||||
__ flush();
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
|
||||
// Quick & dirty stack overflow checking: bang the stack & handle trap.
|
||||
// Note that we do the banging after the frame is setup, since the exception
|
||||
@@ -1965,8 +2003,6 @@ address TemplateInterpreterGenerator::generate_Float_intBitsToFloat_entry() { re
|
||||
address TemplateInterpreterGenerator::generate_Float_floatToRawIntBits_entry() { return nullptr; }
|
||||
address TemplateInterpreterGenerator::generate_Double_longBitsToDouble_entry() { return nullptr; }
|
||||
address TemplateInterpreterGenerator::generate_Double_doubleToRawLongBits_entry() { return nullptr; }
|
||||
address TemplateInterpreterGenerator::generate_Float_float16ToFloat_entry() { return nullptr; }
|
||||
address TemplateInterpreterGenerator::generate_Float_floatToFloat16_entry() { return nullptr; }
|
||||
|
||||
// =============================================================================
|
||||
// Exceptions
|
||||
|
||||
@@ -97,6 +97,8 @@ public:
|
||||
constexpr static bool supports_recursive_lightweight_locking() { return true; }
|
||||
constexpr static bool supports_secondary_supers_table() { return true; }
|
||||
|
||||
static bool supports_float16() { return PowerArchitecturePPC64 >= 9; }
|
||||
|
||||
static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
|
||||
// CPU instruction support
|
||||
static bool has_fsqrt() { return (_features & fsqrt_m) != 0; }
|
||||
|
||||
@@ -3107,6 +3107,38 @@ public:
|
||||
|
||||
#undef INSN
|
||||
|
||||
// -------------- Zicond Instruction Definitions --------------
|
||||
// Zicond conditional operations extension
|
||||
private:
|
||||
enum CZERO_OP : unsigned int {
|
||||
CZERO_NEZ = 0b111,
|
||||
CZERO_EQZ = 0b101
|
||||
};
|
||||
|
||||
template <CZERO_OP OP_VALUE>
|
||||
void czero(Register Rd, Register Rs1, Register Rs2) {
|
||||
assert_cond(UseZicond);
|
||||
uint32_t insn = 0;
|
||||
patch ((address)&insn, 6, 0, 0b0110011); // bits: 7, name: 0x33, attr: ['OP']
|
||||
patch_reg((address)&insn, 7, Rd); // bits: 5, name: 'rd'
|
||||
patch ((address)&insn, 14, 12, OP_VALUE); // bits: 3, name: 0x7, attr: ['CZERO.NEZ'] / 0x5, attr: ['CZERO.EQZ']}
|
||||
patch_reg((address)&insn, 15, Rs1); // bits: 5, name: 'rs1', attr: ['value']
|
||||
patch_reg((address)&insn, 20, Rs2); // bits: 5, name: 'rs2', attr: ['condition']
|
||||
patch ((address)&insn, 31, 25, 0b0000111); // bits: 7, name: 0x7, attr: ['CZERO']
|
||||
emit_int32(insn);
|
||||
}
|
||||
|
||||
public:
|
||||
// Moves zero to a register rd, if the condition rs2 is equal to zero, otherwise moves rs1 to rd.
|
||||
void czero_eqz(Register rd, Register rs1_value, Register rs2_condition) {
|
||||
czero<CZERO_EQZ>(rd, rs1_value, rs2_condition);
|
||||
}
|
||||
|
||||
// Moves zero to a register rd, if the condition rs2 is nonzero, otherwise moves rs1 to rd.
|
||||
void czero_nez(Register rd, Register rs1_value, Register rs2_condition) {
|
||||
czero<CZERO_NEZ>(rd, rs1_value, rs2_condition);
|
||||
}
|
||||
|
||||
// -------------- ZCB Instruction Definitions --------------
|
||||
// Zcb additional C instructions
|
||||
private:
|
||||
|
||||
@@ -870,6 +870,7 @@ void LIR_Assembler::emit_op3(LIR_Op3* op) {
|
||||
}
|
||||
}
|
||||
|
||||
// Consider using cmov (Zicond)
|
||||
void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type,
|
||||
LIR_Opr cmp_opr1, LIR_Opr cmp_opr2) {
|
||||
Label label;
|
||||
|
||||
@@ -116,10 +116,10 @@ void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg,
|
||||
// Handle existing monitor.
|
||||
bind(object_has_monitor);
|
||||
|
||||
// Try to CAS owner (no owner => current thread's _lock_id).
|
||||
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
|
||||
add(tmp, disp_hdr, (in_bytes(ObjectMonitor::owner_offset()) - markWord::monitor_value));
|
||||
Register tid = tmp4Reg;
|
||||
ld(tid, Address(xthread, JavaThread::lock_id_offset()));
|
||||
ld(tid, Address(xthread, JavaThread::monitor_owner_id_offset()));
|
||||
cmpxchg(/*memory address*/tmp, /*expected value*/zr, /*new value*/tid, Assembler::int64,
|
||||
Assembler::aq, Assembler::rl, /*result*/tmp3Reg); // cas succeeds if tmp3Reg == zr(expected)
|
||||
|
||||
@@ -400,9 +400,9 @@ void C2_MacroAssembler::fast_lock_lightweight(Register obj, Register box,
|
||||
// Compute owner address.
|
||||
la(tmp2_owner_addr, owner_address);
|
||||
|
||||
// Try to CAS owner (no owner => current thread's _lock_id).
|
||||
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
|
||||
Register tid = tmp4;
|
||||
ld(tid, Address(xthread, JavaThread::lock_id_offset()));
|
||||
ld(tid, Address(xthread, JavaThread::monitor_owner_id_offset()));
|
||||
cmpxchg(/*addr*/ tmp2_owner_addr, /*expected*/ zr, /*new*/ tid, Assembler::int64,
|
||||
/*acquire*/ Assembler::aq, /*release*/ Assembler::relaxed, /*result*/ tmp3_owner);
|
||||
beqz(tmp3_owner, monitor_locked);
|
||||
@@ -2003,10 +2003,48 @@ void C2_MacroAssembler::enc_cmpEqNe_imm0_branch(int cmpFlag, Register op1, Label
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::enc_cmove(int cmpFlag, Register op1, Register op2, Register dst, Register src) {
|
||||
Label L;
|
||||
cmp_branch(cmpFlag ^ (1 << neg_cond_bits), op1, op2, L);
|
||||
mv(dst, src);
|
||||
bind(L);
|
||||
bool is_unsigned = (cmpFlag & unsigned_branch_mask) == unsigned_branch_mask;
|
||||
int op_select = cmpFlag & (~unsigned_branch_mask);
|
||||
|
||||
switch (op_select) {
|
||||
case BoolTest::eq:
|
||||
cmov_eq(op1, op2, dst, src);
|
||||
break;
|
||||
case BoolTest::ne:
|
||||
cmov_ne(op1, op2, dst, src);
|
||||
break;
|
||||
case BoolTest::le:
|
||||
if (is_unsigned) {
|
||||
cmov_leu(op1, op2, dst, src);
|
||||
} else {
|
||||
cmov_le(op1, op2, dst, src);
|
||||
}
|
||||
break;
|
||||
case BoolTest::ge:
|
||||
if (is_unsigned) {
|
||||
cmov_geu(op1, op2, dst, src);
|
||||
} else {
|
||||
cmov_ge(op1, op2, dst, src);
|
||||
}
|
||||
break;
|
||||
case BoolTest::lt:
|
||||
if (is_unsigned) {
|
||||
cmov_ltu(op1, op2, dst, src);
|
||||
} else {
|
||||
cmov_lt(op1, op2, dst, src);
|
||||
}
|
||||
break;
|
||||
case BoolTest::gt:
|
||||
if (is_unsigned) {
|
||||
cmov_gtu(op1, op2, dst, src);
|
||||
} else {
|
||||
cmov_gt(op1, op2, dst, src);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(false, "unsupported compare condition");
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
|
||||
// Set dst to NaN if any NaN input.
|
||||
@@ -2339,83 +2377,6 @@ void C2_MacroAssembler::signum_fp_v(VectorRegister dst, VectorRegister one, Basi
|
||||
vfsgnj_vv(dst, one, dst, v0_t);
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::compress_bits_v(Register dst, Register src, Register mask, bool is_long) {
|
||||
Assembler::SEW sew = is_long ? Assembler::e64 : Assembler::e32;
|
||||
// intrinsic is enabled when MaxVectorSize >= 16
|
||||
Assembler::LMUL lmul = is_long ? Assembler::m4 : Assembler::m2;
|
||||
long len = is_long ? 64 : 32;
|
||||
|
||||
// load the src data(in bits) to be compressed.
|
||||
vsetivli(x0, 1, sew, Assembler::m1);
|
||||
vmv_s_x(v0, src);
|
||||
// reset the src data(in bytes) to zero.
|
||||
mv(t0, len);
|
||||
vsetvli(x0, t0, Assembler::e8, lmul);
|
||||
vmv_v_i(v4, 0);
|
||||
// convert the src data from bits to bytes.
|
||||
vmerge_vim(v4, v4, 1); // v0 as the implicit mask register
|
||||
// reset the dst data(in bytes) to zero.
|
||||
vmv_v_i(v8, 0);
|
||||
// load the mask data(in bits).
|
||||
vsetivli(x0, 1, sew, Assembler::m1);
|
||||
vmv_s_x(v0, mask);
|
||||
// compress the src data(in bytes) to dst(in bytes).
|
||||
vsetvli(x0, t0, Assembler::e8, lmul);
|
||||
vcompress_vm(v8, v4, v0);
|
||||
// convert the dst data from bytes to bits.
|
||||
vmseq_vi(v0, v8, 1);
|
||||
// store result back.
|
||||
vsetivli(x0, 1, sew, Assembler::m1);
|
||||
vmv_x_s(dst, v0);
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::compress_bits_i_v(Register dst, Register src, Register mask) {
|
||||
compress_bits_v(dst, src, mask, /* is_long */ false);
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::compress_bits_l_v(Register dst, Register src, Register mask) {
|
||||
compress_bits_v(dst, src, mask, /* is_long */ true);
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::expand_bits_v(Register dst, Register src, Register mask, bool is_long) {
|
||||
Assembler::SEW sew = is_long ? Assembler::e64 : Assembler::e32;
|
||||
// intrinsic is enabled when MaxVectorSize >= 16
|
||||
Assembler::LMUL lmul = is_long ? Assembler::m4 : Assembler::m2;
|
||||
long len = is_long ? 64 : 32;
|
||||
|
||||
// load the src data(in bits) to be expanded.
|
||||
vsetivli(x0, 1, sew, Assembler::m1);
|
||||
vmv_s_x(v0, src);
|
||||
// reset the src data(in bytes) to zero.
|
||||
mv(t0, len);
|
||||
vsetvli(x0, t0, Assembler::e8, lmul);
|
||||
vmv_v_i(v4, 0);
|
||||
// convert the src data from bits to bytes.
|
||||
vmerge_vim(v4, v4, 1); // v0 as implicit mask register
|
||||
// reset the dst data(in bytes) to zero.
|
||||
vmv_v_i(v12, 0);
|
||||
// load the mask data(in bits).
|
||||
vsetivli(x0, 1, sew, Assembler::m1);
|
||||
vmv_s_x(v0, mask);
|
||||
// expand the src data(in bytes) to dst(in bytes).
|
||||
vsetvli(x0, t0, Assembler::e8, lmul);
|
||||
viota_m(v8, v0);
|
||||
vrgather_vv(v12, v4, v8, VectorMask::v0_t); // v0 as implicit mask register
|
||||
// convert the dst data from bytes to bits.
|
||||
vmseq_vi(v0, v12, 1);
|
||||
// store result back.
|
||||
vsetivli(x0, 1, sew, Assembler::m1);
|
||||
vmv_x_s(dst, v0);
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::expand_bits_i_v(Register dst, Register src, Register mask) {
|
||||
expand_bits_v(dst, src, mask, /* is_long */ false);
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::expand_bits_l_v(Register dst, Register src, Register mask) {
|
||||
expand_bits_v(dst, src, mask, /* is_long */ true);
|
||||
}
|
||||
|
||||
// j.l.Math.round(float)
|
||||
// Returns the closest int to the argument, with ties rounding to positive infinity.
|
||||
// We need to handle 3 special cases defined by java api spec:
|
||||
@@ -3124,13 +3085,3 @@ void C2_MacroAssembler::extract_fp_v(FloatRegister dst, VectorRegister src, Basi
|
||||
vfmv_f_s(dst, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::load_narrow_klass_compact_c2(Register dst, Address src) {
|
||||
// The incoming address is pointing into obj-start + klass_offset_in_bytes. We need to extract
|
||||
// obj-start, so that we can load from the object's mark-word instead. Usually the address
|
||||
// comes as obj-start in obj and klass_offset_in_bytes in disp.
|
||||
assert(UseCompactObjectHeaders, "must");
|
||||
int offset = oopDesc::mark_offset_in_bytes() - oopDesc::klass_offset_in_bytes();
|
||||
ld(dst, Address(src.base(), src.offset() + offset));
|
||||
srli(dst, dst, markWord::klass_shift);
|
||||
}
|
||||
|
||||
@@ -39,9 +39,6 @@
|
||||
VectorRegister vrs,
|
||||
bool is_latin, Label& DONE, Assembler::LMUL lmul);
|
||||
|
||||
void compress_bits_v(Register dst, Register src, Register mask, bool is_long);
|
||||
void expand_bits_v(Register dst, Register src, Register mask, bool is_long);
|
||||
|
||||
public:
|
||||
// Code used by cmpFastLock and cmpFastUnlock mach instructions in .ad file.
|
||||
void fast_lock(Register object, Register box,
|
||||
@@ -101,7 +98,6 @@
|
||||
|
||||
// refer to conditional_branches and float_conditional_branches
|
||||
static const int bool_test_bits = 3;
|
||||
static const int neg_cond_bits = 2;
|
||||
static const int unsigned_branch_mask = 1 << bool_test_bits;
|
||||
static const int double_branch_mask = 1 << bool_test_bits;
|
||||
|
||||
@@ -184,13 +180,6 @@
|
||||
|
||||
// intrinsic methods implemented by rvv instructions
|
||||
|
||||
// compress bits, i.e. j.l.Integer/Long::compress.
|
||||
void compress_bits_i_v(Register dst, Register src, Register mask);
|
||||
void compress_bits_l_v(Register dst, Register src, Register mask);
|
||||
// expand bits, i.e. j.l.Integer/Long::expand.
|
||||
void expand_bits_i_v(Register dst, Register src, Register mask);
|
||||
void expand_bits_l_v(Register dst, Register src, Register mask);
|
||||
|
||||
void java_round_float_v(VectorRegister dst, VectorRegister src, FloatRegister ftmp, BasicType bt, uint vector_length);
|
||||
void java_round_double_v(VectorRegister dst, VectorRegister src, FloatRegister ftmp, BasicType bt, uint vector_length);
|
||||
|
||||
@@ -281,6 +270,4 @@
|
||||
void extract_v(Register dst, VectorRegister src, BasicType bt, int idx, VectorRegister tmp);
|
||||
void extract_fp_v(FloatRegister dst, VectorRegister src, BasicType bt, int idx, VectorRegister tmp);
|
||||
|
||||
void load_narrow_klass_compact_c2(Register dst, Address src);
|
||||
|
||||
#endif // CPU_RISCV_C2_MACROASSEMBLER_RISCV_HPP
|
||||
|
||||
@@ -66,6 +66,7 @@ define_pd_global(bool, OptoScheduling, true);
|
||||
define_pd_global(bool, OptoBundling, false);
|
||||
define_pd_global(bool, OptoRegScheduling, false);
|
||||
define_pd_global(bool, SuperWordLoopUnrollAnalysis, true);
|
||||
define_pd_global(uint, SuperWordStoreToLoadForwardingFailureDetection, 16);
|
||||
define_pd_global(bool, IdealizeClearArrayNode, true);
|
||||
|
||||
define_pd_global(intx, ReservedCodeCacheSize, 48*M);
|
||||
|
||||
@@ -78,9 +78,14 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_cmpxchg_at_resolved(LIRAccess& access, LI
|
||||
LIR_Opr result = gen->new_register(T_INT);
|
||||
|
||||
__ append(new LIR_OpShenandoahCompareAndSwap(addr, cmp_value.result(), new_value.result(), tmp1, tmp2, result));
|
||||
|
||||
if (ShenandoahCardBarrier) {
|
||||
post_barrier(access, access.resolved_addr(), new_value.result());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return BarrierSetC1::atomic_cmpxchg_at_resolved(access, cmp_value, new_value);
|
||||
}
|
||||
|
||||
@@ -105,6 +110,9 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess& access, LIRIt
|
||||
pre_barrier(access.gen(), access.access_emit_info(), access.decorators(), LIR_OprFact::illegalOpr,
|
||||
result /* pre_val */);
|
||||
}
|
||||
if (ShenandoahCardBarrier) {
|
||||
post_barrier(access, access.resolved_addr(), result);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "gc/shenandoah/shenandoahRuntime.hpp"
|
||||
#include "gc/shenandoah/shenandoahThreadLocalData.hpp"
|
||||
#include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
|
||||
#include "gc/shenandoah/mode/shenandoahMode.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "interpreter/interp_masm.hpp"
|
||||
#include "runtime/javaThread.hpp"
|
||||
@@ -81,6 +82,13 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, Dec
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
|
||||
Register start, Register count, Register tmp, RegSet saved_regs) {
|
||||
if (ShenandoahCardBarrier && is_oop) {
|
||||
gen_write_ref_array_post_barrier(masm, decorators, start, count, tmp, saved_regs);
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::shenandoah_write_barrier_pre(MacroAssembler* masm,
|
||||
Register obj,
|
||||
Register pre_val,
|
||||
@@ -382,6 +390,27 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm,
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::store_check(MacroAssembler* masm, Register obj) {
|
||||
assert(ShenandoahCardBarrier, "Did you mean to enable ShenandoahCardBarrier?");
|
||||
|
||||
__ srli(obj, obj, CardTable::card_shift());
|
||||
|
||||
assert(CardTable::dirty_card_val() == 0, "must be");
|
||||
|
||||
__ load_byte_map_base(t1);
|
||||
__ add(t1, obj, t1);
|
||||
|
||||
if (UseCondCardMark) {
|
||||
Label L_already_dirty;
|
||||
__ lbu(t0, Address(t1));
|
||||
__ beqz(t0, L_already_dirty);
|
||||
__ sb(zr, Address(t1));
|
||||
__ bind(L_already_dirty);
|
||||
} else {
|
||||
__ sb(zr, Address(t1));
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Address dst, Register val, Register tmp1, Register tmp2, Register tmp3) {
|
||||
bool on_oop = is_reference_type(type);
|
||||
@@ -407,16 +436,12 @@ void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet
|
||||
val != noreg /* tosca_live */,
|
||||
false /* expand_call */);
|
||||
|
||||
if (val == noreg) {
|
||||
BarrierSetAssembler::store_at(masm, decorators, type, Address(tmp3, 0), noreg, noreg, noreg, noreg);
|
||||
} else {
|
||||
// Barrier needs uncompressed oop for region cross check.
|
||||
Register new_val = val;
|
||||
if (UseCompressedOops) {
|
||||
new_val = t1;
|
||||
__ mv(new_val, val);
|
||||
}
|
||||
BarrierSetAssembler::store_at(masm, decorators, type, Address(tmp3, 0), val, noreg, noreg, noreg);
|
||||
BarrierSetAssembler::store_at(masm, decorators, type, Address(tmp3, 0), val, noreg, noreg, noreg);
|
||||
|
||||
bool in_heap = (decorators & IN_HEAP) != 0;
|
||||
bool needs_post_barrier = (val != noreg) && in_heap && ShenandoahCardBarrier;
|
||||
if (needs_post_barrier) {
|
||||
store_check(masm, tmp3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -524,6 +549,37 @@ void ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler* masm,
|
||||
__ bind(done);
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
|
||||
Register start, Register count, Register tmp, RegSet saved_regs) {
|
||||
assert(ShenandoahCardBarrier, "Did you mean to enable ShenandoahCardBarrier?");
|
||||
|
||||
Label L_loop, L_done;
|
||||
const Register end = count;
|
||||
|
||||
// Zero count? Nothing to do.
|
||||
__ beqz(count, L_done);
|
||||
|
||||
// end = start + count << LogBytesPerHeapOop
|
||||
// last element address to make inclusive
|
||||
__ shadd(end, count, start, tmp, LogBytesPerHeapOop);
|
||||
__ sub(end, end, BytesPerHeapOop);
|
||||
__ srli(start, start, CardTable::card_shift());
|
||||
__ srli(end, end, CardTable::card_shift());
|
||||
|
||||
// number of bytes to copy
|
||||
__ sub(count, end, start);
|
||||
|
||||
__ load_byte_map_base(tmp);
|
||||
__ add(start, start, tmp);
|
||||
|
||||
__ bind(L_loop);
|
||||
__ add(tmp, start, count);
|
||||
__ sb(zr, Address(tmp));
|
||||
__ sub(count, count, 1);
|
||||
__ bgez(count, L_loop);
|
||||
__ bind(L_done);
|
||||
}
|
||||
|
||||
#undef __
|
||||
|
||||
#ifdef COMPILER1
|
||||
|
||||
@@ -57,10 +57,16 @@ private:
|
||||
bool tosca_live,
|
||||
bool expand_call);
|
||||
|
||||
void store_check(MacroAssembler* masm, Register obj);
|
||||
|
||||
void resolve_forward_pointer(MacroAssembler* masm, Register dst, Register tmp = noreg);
|
||||
void resolve_forward_pointer_not_null(MacroAssembler* masm, Register dst, Register tmp = noreg);
|
||||
void load_reference_barrier(MacroAssembler* masm, Register dst, Address load_addr, DecoratorSet decorators);
|
||||
|
||||
void gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
|
||||
Register start, Register count,
|
||||
Register tmp, RegSet saved_regs);
|
||||
|
||||
public:
|
||||
|
||||
virtual NMethodPatchingType nmethod_patching_type() { return NMethodPatchingType::conc_data_patch; }
|
||||
@@ -75,6 +81,9 @@ public:
|
||||
virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
|
||||
Register src, Register dst, Register count, RegSet saved_regs);
|
||||
|
||||
virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
|
||||
Register start, Register count, Register tmp, RegSet saved_regs);
|
||||
|
||||
virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Register dst, Address src, Register tmp1, Register tmp2);
|
||||
virtual void store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
|
||||
@@ -286,7 +286,7 @@ void ZBarrierSetAssembler::store_barrier_medium(MacroAssembler* masm,
|
||||
__ relocate(barrier_Relocation::spec(), [&] {
|
||||
__ li16u(rtmp1, barrier_Relocation::unpatched);
|
||||
}, ZBarrierRelocationFormatStoreGoodBits);
|
||||
__ cmpxchg_weak(rtmp2, zr, rtmp1,
|
||||
__ weak_cmpxchg(rtmp2, zr, rtmp1,
|
||||
Assembler::int64,
|
||||
Assembler::relaxed /* acquire */, Assembler::relaxed /* release */,
|
||||
rtmp3);
|
||||
|
||||
@@ -110,6 +110,7 @@ define_pd_global(intx, InlineSmallCode, 1000);
|
||||
product(bool, UseZicbom, false, EXPERIMENTAL, "Use Zicbom instructions") \
|
||||
product(bool, UseZicbop, false, EXPERIMENTAL, "Use Zicbop instructions") \
|
||||
product(bool, UseZicboz, false, EXPERIMENTAL, "Use Zicboz instructions") \
|
||||
product(bool, UseZicond, false, DIAGNOSTIC, "Use Zicond instructions") \
|
||||
product(bool, UseZihintpause, false, EXPERIMENTAL, \
|
||||
"Use Zihintpause instructions") \
|
||||
product(bool, UseZtso, false, EXPERIMENTAL, "Assume Ztso memory model") \
|
||||
@@ -117,8 +118,6 @@ define_pd_global(intx, InlineSmallCode, 1000);
|
||||
product(bool, UseZvfh, false, DIAGNOSTIC, "Use Zvfh instructions") \
|
||||
product(bool, UseZvkn, false, EXPERIMENTAL, \
|
||||
"Use Zvkn group extension, Zvkned, Zvknhb, Zvkb, Zvkt") \
|
||||
product(bool, UseRVVForBigIntegerShiftIntrinsics, true, \
|
||||
"Use RVV instructions for left/right shift of BigInteger") \
|
||||
product(bool, UseCtxFencei, false, EXPERIMENTAL, \
|
||||
"Use PR_RISCV_CTX_SW_FENCEI_ON to avoid explicit icache flush")
|
||||
|
||||
|
||||
@@ -179,15 +179,10 @@ void InterpreterMacroAssembler::check_and_handle_earlyret(Register java_thread)
|
||||
|
||||
void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset) {
|
||||
assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode");
|
||||
if (AvoidUnalignedAccesses && (bcp_offset % 2)) {
|
||||
lbu(t1, Address(xbcp, bcp_offset));
|
||||
lbu(reg, Address(xbcp, bcp_offset + 1));
|
||||
slli(t1, t1, 8);
|
||||
add(reg, reg, t1);
|
||||
} else {
|
||||
lhu(reg, Address(xbcp, bcp_offset));
|
||||
revb_h_h_u(reg, reg);
|
||||
}
|
||||
lbu(t1, Address(xbcp, bcp_offset));
|
||||
lbu(reg, Address(xbcp, bcp_offset + 1));
|
||||
slli(t1, t1, 8);
|
||||
add(reg, reg, t1);
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::get_dispatch() {
|
||||
@@ -200,15 +195,7 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register index,
|
||||
size_t index_size) {
|
||||
assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
|
||||
if (index_size == sizeof(u2)) {
|
||||
if (AvoidUnalignedAccesses) {
|
||||
assert_different_registers(index, tmp);
|
||||
load_unsigned_byte(index, Address(xbcp, bcp_offset));
|
||||
load_unsigned_byte(tmp, Address(xbcp, bcp_offset + 1));
|
||||
slli(tmp, tmp, 8);
|
||||
add(index, index, tmp);
|
||||
} else {
|
||||
load_unsigned_short(index, Address(xbcp, bcp_offset));
|
||||
}
|
||||
load_short_misaligned(index, Address(xbcp, bcp_offset), tmp, false);
|
||||
} else if (index_size == sizeof(u4)) {
|
||||
load_int_misaligned(index, Address(xbcp, bcp_offset), tmp, false);
|
||||
} else if (index_size == sizeof(u1)) {
|
||||
@@ -441,7 +428,14 @@ void InterpreterMacroAssembler::dispatch_base(TosState state,
|
||||
Register Rs) {
|
||||
// Pay attention to the argument Rs, which is acquiesce in t0.
|
||||
if (VerifyActivationFrameSize) {
|
||||
Unimplemented();
|
||||
Label L;
|
||||
sub(t1, fp, esp);
|
||||
int min_frame_size =
|
||||
(frame::link_offset - frame::interpreter_frame_initial_sp_offset + frame::metadata_words) * wordSize;
|
||||
sub(t1, t1, min_frame_size);
|
||||
bgez(t1, L);
|
||||
stop("broken stack frame");
|
||||
bind(L);
|
||||
}
|
||||
if (verifyoop && state == atos) {
|
||||
verify_oop(x10);
|
||||
|
||||
@@ -1128,6 +1128,147 @@ void MacroAssembler::wrap_label(Register r1, Register r2, Label &L,
|
||||
|
||||
#undef INSN
|
||||
|
||||
// cmov
|
||||
void MacroAssembler::cmov_eq(Register cmp1, Register cmp2, Register dst, Register src) {
|
||||
if (UseZicond) {
|
||||
xorr(t0, cmp1, cmp2);
|
||||
czero_eqz(dst, dst, t0);
|
||||
czero_nez(t0 , src, t0);
|
||||
orr(dst, dst, t0);
|
||||
return;
|
||||
}
|
||||
Label no_set;
|
||||
bne(cmp1, cmp2, no_set);
|
||||
mv(dst, src);
|
||||
bind(no_set);
|
||||
}
|
||||
|
||||
void MacroAssembler::cmov_ne(Register cmp1, Register cmp2, Register dst, Register src) {
|
||||
if (UseZicond) {
|
||||
xorr(t0, cmp1, cmp2);
|
||||
czero_nez(dst, dst, t0);
|
||||
czero_eqz(t0 , src, t0);
|
||||
orr(dst, dst, t0);
|
||||
return;
|
||||
}
|
||||
Label no_set;
|
||||
beq(cmp1, cmp2, no_set);
|
||||
mv(dst, src);
|
||||
bind(no_set);
|
||||
}
|
||||
|
||||
void MacroAssembler::cmov_le(Register cmp1, Register cmp2, Register dst, Register src) {
|
||||
if (UseZicond) {
|
||||
slt(t0, cmp2, cmp1);
|
||||
czero_eqz(dst, dst, t0);
|
||||
czero_nez(t0, src, t0);
|
||||
orr(dst, dst, t0);
|
||||
return;
|
||||
}
|
||||
Label no_set;
|
||||
bgt(cmp1, cmp2, no_set);
|
||||
mv(dst, src);
|
||||
bind(no_set);
|
||||
}
|
||||
|
||||
void MacroAssembler::cmov_leu(Register cmp1, Register cmp2, Register dst, Register src) {
|
||||
if (UseZicond) {
|
||||
sltu(t0, cmp2, cmp1);
|
||||
czero_eqz(dst, dst, t0);
|
||||
czero_nez(t0, src, t0);
|
||||
orr(dst, dst, t0);
|
||||
return;
|
||||
}
|
||||
Label no_set;
|
||||
bgtu(cmp1, cmp2, no_set);
|
||||
mv(dst, src);
|
||||
bind(no_set);
|
||||
}
|
||||
|
||||
void MacroAssembler::cmov_ge(Register cmp1, Register cmp2, Register dst, Register src) {
|
||||
if (UseZicond) {
|
||||
slt(t0, cmp1, cmp2);
|
||||
czero_eqz(dst, dst, t0);
|
||||
czero_nez(t0, src, t0);
|
||||
orr(dst, dst, t0);
|
||||
return;
|
||||
}
|
||||
Label no_set;
|
||||
blt(cmp1, cmp2, no_set);
|
||||
mv(dst, src);
|
||||
bind(no_set);
|
||||
}
|
||||
|
||||
void MacroAssembler::cmov_geu(Register cmp1, Register cmp2, Register dst, Register src) {
|
||||
if (UseZicond) {
|
||||
sltu(t0, cmp1, cmp2);
|
||||
czero_eqz(dst, dst, t0);
|
||||
czero_nez(t0, src, t0);
|
||||
orr(dst, dst, t0);
|
||||
return;
|
||||
}
|
||||
Label no_set;
|
||||
bltu(cmp1, cmp2, no_set);
|
||||
mv(dst, src);
|
||||
bind(no_set);
|
||||
}
|
||||
|
||||
void MacroAssembler::cmov_lt(Register cmp1, Register cmp2, Register dst, Register src) {
|
||||
if (UseZicond) {
|
||||
slt(t0, cmp1, cmp2);
|
||||
czero_nez(dst, dst, t0);
|
||||
czero_eqz(t0, src, t0);
|
||||
orr(dst, dst, t0);
|
||||
return;
|
||||
}
|
||||
Label no_set;
|
||||
bge(cmp1, cmp2, no_set);
|
||||
mv(dst, src);
|
||||
bind(no_set);
|
||||
}
|
||||
|
||||
void MacroAssembler::cmov_ltu(Register cmp1, Register cmp2, Register dst, Register src) {
|
||||
if (UseZicond) {
|
||||
sltu(t0, cmp1, cmp2);
|
||||
czero_nez(dst, dst, t0);
|
||||
czero_eqz(t0, src, t0);
|
||||
orr(dst, dst, t0);
|
||||
return;
|
||||
}
|
||||
Label no_set;
|
||||
bgeu(cmp1, cmp2, no_set);
|
||||
mv(dst, src);
|
||||
bind(no_set);
|
||||
}
|
||||
|
||||
void MacroAssembler::cmov_gt(Register cmp1, Register cmp2, Register dst, Register src) {
|
||||
if (UseZicond) {
|
||||
slt(t0, cmp2, cmp1);
|
||||
czero_nez(dst, dst, t0);
|
||||
czero_eqz(t0, src, t0);
|
||||
orr(dst, dst, t0);
|
||||
return;
|
||||
}
|
||||
Label no_set;
|
||||
ble(cmp1, cmp2, no_set);
|
||||
mv(dst, src);
|
||||
bind(no_set);
|
||||
}
|
||||
|
||||
void MacroAssembler::cmov_gtu(Register cmp1, Register cmp2, Register dst, Register src) {
|
||||
if (UseZicond) {
|
||||
sltu(t0, cmp2, cmp1);
|
||||
czero_nez(dst, dst, t0);
|
||||
czero_eqz(t0, src, t0);
|
||||
orr(dst, dst, t0);
|
||||
return;
|
||||
}
|
||||
Label no_set;
|
||||
bleu(cmp1, cmp2, no_set);
|
||||
mv(dst, src);
|
||||
bind(no_set);
|
||||
}
|
||||
|
||||
// Float compare branch instructions
|
||||
|
||||
#define INSN(NAME, FLOATCMP, BRANCH) \
|
||||
@@ -2320,27 +2461,9 @@ void MacroAssembler::load_long_misaligned(Register dst, Address src, Register tm
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// reverse bytes in halfword in lower 16 bits and sign-extend
|
||||
// Rd[15:0] = Rs[7:0] Rs[15:8] (sign-extend to 64 bits)
|
||||
void MacroAssembler::revb_h_h(Register Rd, Register Rs, Register tmp) {
|
||||
if (UseZbb) {
|
||||
rev8(Rd, Rs);
|
||||
srai(Rd, Rd, 48);
|
||||
return;
|
||||
}
|
||||
assert_different_registers(Rs, tmp);
|
||||
assert_different_registers(Rd, tmp);
|
||||
srli(tmp, Rs, 8);
|
||||
andi(tmp, tmp, 0xFF);
|
||||
slli(Rd, Rs, 56);
|
||||
srai(Rd, Rd, 48); // sign-extend
|
||||
orr(Rd, Rd, tmp);
|
||||
}
|
||||
|
||||
// reverse bytes in lower word and sign-extend
|
||||
// Rd[31:0] = Rs[7:0] Rs[15:8] Rs[23:16] Rs[31:24] (sign-extend to 64 bits)
|
||||
void MacroAssembler::revb_w_w(Register Rd, Register Rs, Register tmp1, Register tmp2) {
|
||||
// reverse bytes in lower word, sign-extend
|
||||
// Rd[32:0] = Rs[7:0] Rs[15:8] Rs[23:16] Rs[31:24]
|
||||
void MacroAssembler::revbw(Register Rd, Register Rs, Register tmp1, Register tmp2) {
|
||||
if (UseZbb) {
|
||||
rev8(Rd, Rs);
|
||||
srai(Rd, Rd, 32);
|
||||
@@ -2348,99 +2471,18 @@ void MacroAssembler::revb_w_w(Register Rd, Register Rs, Register tmp1, Register
|
||||
}
|
||||
assert_different_registers(Rs, tmp1, tmp2);
|
||||
assert_different_registers(Rd, tmp1, tmp2);
|
||||
revb_h_w_u(Rd, Rs, tmp1, tmp2);
|
||||
slli(tmp2, Rd, 48);
|
||||
srai(tmp2, tmp2, 32); // sign-extend
|
||||
srli(Rd, Rd, 16);
|
||||
orr(Rd, Rd, tmp2);
|
||||
}
|
||||
|
||||
// reverse bytes in halfword in lower 16 bits and zero-extend
|
||||
// Rd[15:0] = Rs[7:0] Rs[15:8] (zero-extend to 64 bits)
|
||||
void MacroAssembler::revb_h_h_u(Register Rd, Register Rs, Register tmp) {
|
||||
if (UseZbb) {
|
||||
rev8(Rd, Rs);
|
||||
srli(Rd, Rd, 48);
|
||||
return;
|
||||
andi(tmp1, Rs, 0xFF);
|
||||
slli(tmp1, tmp1, 8);
|
||||
for (int step = 8; step < 24; step += 8) {
|
||||
srli(tmp2, Rs, step);
|
||||
andi(tmp2, tmp2, 0xFF);
|
||||
orr(tmp1, tmp1, tmp2);
|
||||
slli(tmp1, tmp1, 8);
|
||||
}
|
||||
assert_different_registers(Rs, tmp);
|
||||
assert_different_registers(Rd, tmp);
|
||||
srli(tmp, Rs, 8);
|
||||
andi(tmp, tmp, 0xFF);
|
||||
andi(Rd, Rs, 0xFF);
|
||||
slli(Rd, Rd, 8);
|
||||
orr(Rd, Rd, tmp);
|
||||
}
|
||||
|
||||
// reverse bytes in halfwords in lower 32 bits and zero-extend
|
||||
// Rd[31:0] = Rs[23:16] Rs[31:24] Rs[7:0] Rs[15:8] (zero-extend to 64 bits)
|
||||
void MacroAssembler::revb_h_w_u(Register Rd, Register Rs, Register tmp1, Register tmp2) {
|
||||
if (UseZbb) {
|
||||
rev8(Rd, Rs);
|
||||
rori(Rd, Rd, 32);
|
||||
roriw(Rd, Rd, 16);
|
||||
zero_extend(Rd, Rd, 32);
|
||||
return;
|
||||
}
|
||||
assert_different_registers(Rs, tmp1, tmp2);
|
||||
assert_different_registers(Rd, tmp1, tmp2);
|
||||
srli(tmp2, Rs, 16);
|
||||
revb_h_h_u(tmp2, tmp2, tmp1);
|
||||
revb_h_h_u(Rd, Rs, tmp1);
|
||||
slli(tmp2, tmp2, 16);
|
||||
orr(Rd, Rd, tmp2);
|
||||
}
|
||||
|
||||
// This method is only used for revb_h
|
||||
// Rd = Rs[47:0] Rs[55:48] Rs[63:56]
|
||||
void MacroAssembler::revb_h_helper(Register Rd, Register Rs, Register tmp1, Register tmp2) {
|
||||
assert_different_registers(Rs, tmp1, tmp2);
|
||||
assert_different_registers(Rd, tmp1);
|
||||
srli(tmp1, Rs, 48);
|
||||
andi(tmp2, tmp1, 0xFF);
|
||||
slli(tmp2, tmp2, 8);
|
||||
srli(tmp1, tmp1, 8);
|
||||
orr(tmp1, tmp1, tmp2);
|
||||
slli(Rd, Rs, 16);
|
||||
orr(Rd, Rd, tmp1);
|
||||
}
|
||||
|
||||
// reverse bytes in each halfword
|
||||
// Rd[63:0] = Rs[55:48] Rs[63:56] Rs[39:32] Rs[47:40] Rs[23:16] Rs[31:24] Rs[7:0] Rs[15:8]
|
||||
void MacroAssembler::revb_h(Register Rd, Register Rs, Register tmp1, Register tmp2) {
|
||||
if (UseZbb) {
|
||||
assert_different_registers(Rs, tmp1);
|
||||
assert_different_registers(Rd, tmp1);
|
||||
rev8(Rd, Rs);
|
||||
zero_extend(tmp1, Rd, 32);
|
||||
roriw(tmp1, tmp1, 16);
|
||||
slli(tmp1, tmp1, 32);
|
||||
srli(Rd, Rd, 32);
|
||||
roriw(Rd, Rd, 16);
|
||||
zero_extend(Rd, Rd, 32);
|
||||
orr(Rd, Rd, tmp1);
|
||||
return;
|
||||
}
|
||||
assert_different_registers(Rs, tmp1, tmp2);
|
||||
assert_different_registers(Rd, tmp1, tmp2);
|
||||
revb_h_helper(Rd, Rs, tmp1, tmp2);
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
revb_h_helper(Rd, Rd, tmp1, tmp2);
|
||||
}
|
||||
}
|
||||
|
||||
// reverse bytes in each word
|
||||
// Rd[63:0] = Rs[39:32] Rs[47:40] Rs[55:48] Rs[63:56] Rs[7:0] Rs[15:8] Rs[23:16] Rs[31:24]
|
||||
void MacroAssembler::revb_w(Register Rd, Register Rs, Register tmp1, Register tmp2) {
|
||||
if (UseZbb) {
|
||||
rev8(Rd, Rs);
|
||||
rori(Rd, Rd, 32);
|
||||
return;
|
||||
}
|
||||
assert_different_registers(Rs, tmp1, tmp2);
|
||||
assert_different_registers(Rd, tmp1, tmp2);
|
||||
revb(Rd, Rs, tmp1, tmp2);
|
||||
ror_imm(Rd, Rd, 32);
|
||||
srli(Rd, Rs, 24);
|
||||
andi(Rd, Rd, 0xFF);
|
||||
orr(Rd, tmp1, Rd);
|
||||
sign_extend(Rd, Rd, 32);
|
||||
}
|
||||
|
||||
// reverse bytes in doubleword
|
||||
@@ -3313,14 +3355,11 @@ void MacroAssembler::store_conditional(Register dst,
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::cmpxchg_narrow_value_helper(Register addr, Register expected,
|
||||
Register new_val,
|
||||
void MacroAssembler::cmpxchg_narrow_value_helper(Register addr, Register expected, Register new_val,
|
||||
enum operand_size size,
|
||||
Register tmp1, Register tmp2, Register tmp3) {
|
||||
Register shift, Register mask, Register aligned_addr) {
|
||||
assert(size == int8 || size == int16, "unsupported operand size");
|
||||
|
||||
Register aligned_addr = t1, shift = tmp1, mask = tmp2, not_mask = tmp3;
|
||||
|
||||
andi(shift, addr, 3);
|
||||
slli(shift, shift, 3);
|
||||
|
||||
@@ -3335,8 +3374,6 @@ void MacroAssembler::cmpxchg_narrow_value_helper(Register addr, Register expecte
|
||||
}
|
||||
sll(mask, mask, shift);
|
||||
|
||||
notr(not_mask, mask);
|
||||
|
||||
sll(expected, expected, shift);
|
||||
andr(expected, expected, mask);
|
||||
|
||||
@@ -3353,35 +3390,46 @@ void MacroAssembler::cmpxchg_narrow_value(Register addr, Register expected,
|
||||
Assembler::Aqrl acquire, Assembler::Aqrl release,
|
||||
Register result, bool result_as_bool,
|
||||
Register tmp1, Register tmp2, Register tmp3) {
|
||||
Register aligned_addr = t1, shift = tmp1, mask = tmp2, not_mask = tmp3, old = result, tmp = t0;
|
||||
assert_different_registers(addr, old, mask, not_mask, new_val, expected, shift, tmp);
|
||||
cmpxchg_narrow_value_helper(addr, expected, new_val, size, tmp1, tmp2, tmp3);
|
||||
assert_different_registers(addr, expected, new_val, result, tmp1, tmp2, tmp3, t0, t1);
|
||||
|
||||
Register scratch0 = t0, aligned_addr = t1;
|
||||
Register shift = tmp1, mask = tmp2, scratch1 = tmp3;
|
||||
|
||||
cmpxchg_narrow_value_helper(addr, expected, new_val, size, shift, mask, aligned_addr);
|
||||
|
||||
Label retry, fail, done;
|
||||
|
||||
bind(retry);
|
||||
|
||||
if (UseZacas) {
|
||||
lw(old, aligned_addr);
|
||||
lw(result, aligned_addr);
|
||||
|
||||
// if old & mask != expected
|
||||
andr(tmp, old, mask);
|
||||
bne(tmp, expected, fail);
|
||||
bind(retry); // amocas loads the current value into result
|
||||
notr(scratch1, mask);
|
||||
|
||||
andr(tmp, old, not_mask);
|
||||
orr(tmp, tmp, new_val);
|
||||
andr(scratch0, result, scratch1); // scratch0 = word - cas bits
|
||||
orr(scratch1, expected, scratch0); // scratch1 = non-cas bits + cas bits
|
||||
bne(result, scratch1, fail); // cas bits differ, cas failed
|
||||
|
||||
atomic_cas(old, tmp, aligned_addr, operand_size::int32, acquire, release);
|
||||
bne(tmp, old, retry);
|
||||
// result is the same as expected, use as expected value.
|
||||
|
||||
// scratch0 is still = word - cas bits
|
||||
// Or in the new value to create complete new value.
|
||||
orr(scratch0, scratch0, new_val);
|
||||
|
||||
mv(scratch1, result); // save our expected value
|
||||
atomic_cas(result, scratch0, aligned_addr, operand_size::int32, acquire, release);
|
||||
bne(scratch1, result, retry);
|
||||
} else {
|
||||
lr_w(old, aligned_addr, acquire);
|
||||
andr(tmp, old, mask);
|
||||
bne(tmp, expected, fail);
|
||||
notr(scratch1, mask);
|
||||
bind(retry);
|
||||
|
||||
andr(tmp, old, not_mask);
|
||||
orr(tmp, tmp, new_val);
|
||||
sc_w(tmp, tmp, aligned_addr, release);
|
||||
bnez(tmp, retry);
|
||||
lr_w(result, aligned_addr, acquire);
|
||||
andr(scratch0, result, mask);
|
||||
bne(scratch0, expected, fail);
|
||||
|
||||
andr(scratch0, result, scratch1); // scratch1 is ~mask
|
||||
orr(scratch0, scratch0, new_val);
|
||||
sc_w(scratch0, scratch0, aligned_addr, release);
|
||||
bnez(scratch0, retry);
|
||||
}
|
||||
|
||||
if (result_as_bool) {
|
||||
@@ -3393,10 +3441,10 @@ void MacroAssembler::cmpxchg_narrow_value(Register addr, Register expected,
|
||||
|
||||
bind(done);
|
||||
} else {
|
||||
andr(tmp, old, mask);
|
||||
|
||||
bind(fail);
|
||||
srl(result, tmp, shift);
|
||||
|
||||
andr(scratch0, result, mask);
|
||||
srl(result, scratch0, shift);
|
||||
|
||||
if (size == int8) {
|
||||
sign_extend(result, result, 8);
|
||||
@@ -3416,33 +3464,44 @@ void MacroAssembler::weak_cmpxchg_narrow_value(Register addr, Register expected,
|
||||
Assembler::Aqrl acquire, Assembler::Aqrl release,
|
||||
Register result,
|
||||
Register tmp1, Register tmp2, Register tmp3) {
|
||||
Register aligned_addr = t1, shift = tmp1, mask = tmp2, not_mask = tmp3, old = result, tmp = t0;
|
||||
assert_different_registers(addr, old, mask, not_mask, new_val, expected, shift, tmp);
|
||||
cmpxchg_narrow_value_helper(addr, expected, new_val, size, tmp1, tmp2, tmp3);
|
||||
assert_different_registers(addr, expected, new_val, result, tmp1, tmp2, tmp3, t0, t1);
|
||||
|
||||
Register scratch0 = t0, aligned_addr = t1;
|
||||
Register shift = tmp1, mask = tmp2, scratch1 = tmp3;
|
||||
|
||||
cmpxchg_narrow_value_helper(addr, expected, new_val, size, shift, mask, aligned_addr);
|
||||
|
||||
Label fail, done;
|
||||
|
||||
if (UseZacas) {
|
||||
lw(old, aligned_addr);
|
||||
lw(result, aligned_addr);
|
||||
|
||||
// if old & mask != expected
|
||||
andr(tmp, old, mask);
|
||||
bne(tmp, expected, fail);
|
||||
notr(scratch1, mask);
|
||||
|
||||
andr(tmp, old, not_mask);
|
||||
orr(tmp, tmp, new_val);
|
||||
andr(scratch0, result, scratch1); // scratch0 = word - cas bits
|
||||
orr(scratch1, expected, scratch0); // scratch1 = non-cas bits + cas bits
|
||||
bne(result, scratch1, fail); // cas bits differ, cas failed
|
||||
|
||||
atomic_cas(tmp, new_val, addr, operand_size::int32, acquire, release);
|
||||
bne(tmp, old, fail);
|
||||
// result is the same as expected, use as expected value.
|
||||
|
||||
// scratch0 is still = word - cas bits
|
||||
// Or in the new value to create complete new value.
|
||||
orr(scratch0, scratch0, new_val);
|
||||
|
||||
mv(scratch1, result); // save our expected value
|
||||
atomic_cas(result, scratch0, aligned_addr, operand_size::int32, acquire, release);
|
||||
bne(scratch1, result, fail); // This weak, so just bail-out.
|
||||
} else {
|
||||
lr_w(old, aligned_addr, acquire);
|
||||
andr(tmp, old, mask);
|
||||
bne(tmp, expected, fail);
|
||||
notr(scratch1, mask);
|
||||
|
||||
andr(tmp, old, not_mask);
|
||||
orr(tmp, tmp, new_val);
|
||||
sc_w(tmp, tmp, aligned_addr, release);
|
||||
bnez(tmp, fail);
|
||||
lr_w(result, aligned_addr, acquire);
|
||||
andr(scratch0, result, mask);
|
||||
bne(scratch0, expected, fail);
|
||||
|
||||
andr(scratch0, result, scratch1); // scratch1 is ~mask
|
||||
orr(scratch0, scratch0, new_val);
|
||||
sc_w(scratch0, scratch0, aligned_addr, release);
|
||||
bnez(scratch0, fail);
|
||||
}
|
||||
|
||||
// Success
|
||||
@@ -3466,6 +3525,17 @@ void MacroAssembler::cmpxchg(Register addr, Register expected,
|
||||
assert_different_registers(expected, t0);
|
||||
assert_different_registers(new_val, t0);
|
||||
|
||||
// NOTE:
|
||||
// Register _result_ may be the same register as _new_val_ or _expected_.
|
||||
// Hence do NOT use _result_ until after 'cas'.
|
||||
//
|
||||
// Register _expected_ may be the same register as _new_val_ and is assumed to be preserved.
|
||||
// Hence do NOT change _expected_ or _new_val_.
|
||||
//
|
||||
// Having _expected_ and _new_val_ being the same register is a very puzzling cas.
|
||||
//
|
||||
// TODO: Address these issues.
|
||||
|
||||
if (UseZacas) {
|
||||
if (result_as_bool) {
|
||||
mv(t0, expected);
|
||||
@@ -3473,8 +3543,9 @@ void MacroAssembler::cmpxchg(Register addr, Register expected,
|
||||
xorr(t0, t0, expected);
|
||||
seqz(result, t0);
|
||||
} else {
|
||||
mv(result, expected);
|
||||
atomic_cas(result, new_val, addr, size, acquire, release);
|
||||
mv(t0, expected);
|
||||
atomic_cas(t0, new_val, addr, size, acquire, release);
|
||||
mv(result, t0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -3505,20 +3576,21 @@ void MacroAssembler::cmpxchg(Register addr, Register expected,
|
||||
bind(done);
|
||||
}
|
||||
|
||||
void MacroAssembler::cmpxchg_weak(Register addr, Register expected,
|
||||
void MacroAssembler::weak_cmpxchg(Register addr, Register expected,
|
||||
Register new_val,
|
||||
enum operand_size size,
|
||||
Assembler::Aqrl acquire, Assembler::Aqrl release,
|
||||
Register result) {
|
||||
if (UseZacas) {
|
||||
cmpxchg(addr, expected, new_val, size, acquire, release, result, true);
|
||||
return;
|
||||
}
|
||||
|
||||
assert_different_registers(addr, t0);
|
||||
assert_different_registers(expected, t0);
|
||||
assert_different_registers(new_val, t0);
|
||||
|
||||
if (UseZacas) {
|
||||
cmpxchg(addr, expected, new_val, size, acquire, release, result, true);
|
||||
return;
|
||||
}
|
||||
|
||||
Label fail, done;
|
||||
load_reserved(t0, addr, size, acquire);
|
||||
bne(t0, expected, fail);
|
||||
@@ -3581,83 +3653,18 @@ ATOMIC_XCHGU(xchgalwu, xchgalw)
|
||||
|
||||
#undef ATOMIC_XCHGU
|
||||
|
||||
#define ATOMIC_CAS(OP, AOP, ACQUIRE, RELEASE) \
|
||||
void MacroAssembler::atomic_##OP(Register prev, Register newv, Register addr) { \
|
||||
assert(UseZacas, "invariant"); \
|
||||
prev = prev->is_valid() ? prev : zr; \
|
||||
AOP(prev, addr, newv, (Assembler::Aqrl)(ACQUIRE | RELEASE)); \
|
||||
return; \
|
||||
}
|
||||
|
||||
ATOMIC_CAS(cas, amocas_d, Assembler::relaxed, Assembler::relaxed)
|
||||
ATOMIC_CAS(casw, amocas_w, Assembler::relaxed, Assembler::relaxed)
|
||||
ATOMIC_CAS(casl, amocas_d, Assembler::relaxed, Assembler::rl)
|
||||
ATOMIC_CAS(caslw, amocas_w, Assembler::relaxed, Assembler::rl)
|
||||
ATOMIC_CAS(casal, amocas_d, Assembler::aq, Assembler::rl)
|
||||
ATOMIC_CAS(casalw, amocas_w, Assembler::aq, Assembler::rl)
|
||||
|
||||
#undef ATOMIC_CAS
|
||||
|
||||
#define ATOMIC_CASU(OP1, OP2) \
|
||||
void MacroAssembler::atomic_##OP1(Register prev, Register newv, Register addr) { \
|
||||
atomic_##OP2(prev, newv, addr); \
|
||||
zero_extend(prev, prev, 32); \
|
||||
return; \
|
||||
}
|
||||
|
||||
ATOMIC_CASU(caswu, casw)
|
||||
ATOMIC_CASU(caslwu, caslw)
|
||||
ATOMIC_CASU(casalwu, casalw)
|
||||
|
||||
#undef ATOMIC_CASU
|
||||
|
||||
void MacroAssembler::atomic_cas(
|
||||
Register prev, Register newv, Register addr, enum operand_size size, Assembler::Aqrl acquire, Assembler::Aqrl release) {
|
||||
void MacroAssembler::atomic_cas(Register prev, Register newv, Register addr,
|
||||
enum operand_size size, Assembler::Aqrl acquire, Assembler::Aqrl release) {
|
||||
switch (size) {
|
||||
case int64:
|
||||
switch ((Assembler::Aqrl)(acquire | release)) {
|
||||
case Assembler::relaxed:
|
||||
atomic_cas(prev, newv, addr);
|
||||
break;
|
||||
case Assembler::rl:
|
||||
atomic_casl(prev, newv, addr);
|
||||
break;
|
||||
case Assembler::aqrl:
|
||||
atomic_casal(prev, newv, addr);
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
amocas_d(prev, addr, newv, (Assembler::Aqrl)(acquire | release));
|
||||
break;
|
||||
case int32:
|
||||
switch ((Assembler::Aqrl)(acquire | release)) {
|
||||
case Assembler::relaxed:
|
||||
atomic_casw(prev, newv, addr);
|
||||
break;
|
||||
case Assembler::rl:
|
||||
atomic_caslw(prev, newv, addr);
|
||||
break;
|
||||
case Assembler::aqrl:
|
||||
atomic_casalw(prev, newv, addr);
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
amocas_w(prev, addr, newv, (Assembler::Aqrl)(acquire | release));
|
||||
break;
|
||||
case uint32:
|
||||
switch ((Assembler::Aqrl)(acquire | release)) {
|
||||
case Assembler::relaxed:
|
||||
atomic_caswu(prev, newv, addr);
|
||||
break;
|
||||
case Assembler::rl:
|
||||
atomic_caslwu(prev, newv, addr);
|
||||
break;
|
||||
case Assembler::aqrl:
|
||||
atomic_casalwu(prev, newv, addr);
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
amocas_w(prev, addr, newv, (Assembler::Aqrl)(acquire | release));
|
||||
zero_extend(prev, prev, 32);
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
|
||||
@@ -626,6 +626,17 @@ class MacroAssembler: public Assembler {
|
||||
void bltz(Register Rs, const address dest);
|
||||
void bgtz(Register Rs, const address dest);
|
||||
|
||||
void cmov_eq(Register cmp1, Register cmp2, Register dst, Register src);
|
||||
void cmov_ne(Register cmp1, Register cmp2, Register dst, Register src);
|
||||
void cmov_le(Register cmp1, Register cmp2, Register dst, Register src);
|
||||
void cmov_leu(Register cmp1, Register cmp2, Register dst, Register src);
|
||||
void cmov_ge(Register cmp1, Register cmp2, Register dst, Register src);
|
||||
void cmov_geu(Register cmp1, Register cmp2, Register dst, Register src);
|
||||
void cmov_lt(Register cmp1, Register cmp2, Register dst, Register src);
|
||||
void cmov_ltu(Register cmp1, Register cmp2, Register dst, Register src);
|
||||
void cmov_gt(Register cmp1, Register cmp2, Register dst, Register src);
|
||||
void cmov_gtu(Register cmp1, Register cmp2, Register dst, Register src);
|
||||
|
||||
public:
|
||||
// We try to follow risc-v asm menomics.
|
||||
// But as we don't layout a reachable GOT,
|
||||
@@ -901,15 +912,9 @@ public:
|
||||
void andn(Register Rd, Register Rs1, Register Rs2);
|
||||
void orn(Register Rd, Register Rs1, Register Rs2);
|
||||
|
||||
// revb
|
||||
void revb_h_h(Register Rd, Register Rs, Register tmp = t0); // reverse bytes in halfword in lower 16 bits, sign-extend
|
||||
void revb_w_w(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2 = t1); // reverse bytes in lower word, sign-extend
|
||||
void revb_h_h_u(Register Rd, Register Rs, Register tmp = t0); // reverse bytes in halfword in lower 16 bits, zero-extend
|
||||
void revb_h_w_u(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2 = t1); // reverse bytes in halfwords in lower 32 bits, zero-extend
|
||||
void revb_h_helper(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2= t1); // reverse bytes in upper 16 bits (48:63) and move to lower
|
||||
void revb_h(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2= t1); // reverse bytes in each halfword
|
||||
void revb_w(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2= t1); // reverse bytes in each word
|
||||
void revb(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2 = t1); // reverse bytes in doubleword
|
||||
// reverse bytes
|
||||
void revbw(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2= t1); // reverse bytes in lower word, sign-extend
|
||||
void revb(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2 = t1); // reverse bytes in doubleword
|
||||
|
||||
void ror_imm(Register dst, Register src, uint32_t shift, Register tmp = t0);
|
||||
void rolw_imm(Register dst, Register src, uint32_t, Register tmp = t0);
|
||||
@@ -1141,15 +1146,14 @@ public:
|
||||
enum operand_size size,
|
||||
Assembler::Aqrl acquire, Assembler::Aqrl release,
|
||||
Register result, bool result_as_bool = false);
|
||||
void cmpxchg_weak(Register addr, Register expected,
|
||||
void weak_cmpxchg(Register addr, Register expected,
|
||||
Register new_val,
|
||||
enum operand_size size,
|
||||
Assembler::Aqrl acquire, Assembler::Aqrl release,
|
||||
Register result);
|
||||
void cmpxchg_narrow_value_helper(Register addr, Register expected,
|
||||
Register new_val,
|
||||
void cmpxchg_narrow_value_helper(Register addr, Register expected, Register new_val,
|
||||
enum operand_size size,
|
||||
Register tmp1, Register tmp2, Register tmp3);
|
||||
Register shift, Register mask, Register aligned_addr);
|
||||
void cmpxchg_narrow_value(Register addr, Register expected,
|
||||
Register new_val,
|
||||
enum operand_size size,
|
||||
@@ -1175,16 +1179,6 @@ public:
|
||||
void atomic_xchgwu(Register prev, Register newv, Register addr);
|
||||
void atomic_xchgalwu(Register prev, Register newv, Register addr);
|
||||
|
||||
void atomic_cas(Register prev, Register newv, Register addr);
|
||||
void atomic_casw(Register prev, Register newv, Register addr);
|
||||
void atomic_casl(Register prev, Register newv, Register addr);
|
||||
void atomic_caslw(Register prev, Register newv, Register addr);
|
||||
void atomic_casal(Register prev, Register newv, Register addr);
|
||||
void atomic_casalw(Register prev, Register newv, Register addr);
|
||||
void atomic_caswu(Register prev, Register newv, Register addr);
|
||||
void atomic_caslwu(Register prev, Register newv, Register addr);
|
||||
void atomic_casalwu(Register prev, Register newv, Register addr);
|
||||
|
||||
void atomic_cas(Register prev, Register newv, Register addr, enum operand_size size,
|
||||
Assembler::Aqrl acquire = Assembler::relaxed, Assembler::Aqrl release = Assembler::relaxed);
|
||||
|
||||
|
||||
@@ -942,26 +942,6 @@ reg_class v11_reg(
|
||||
V11, V11_H, V11_J, V11_K
|
||||
);
|
||||
|
||||
// class for vector register v12
|
||||
reg_class v12_reg(
|
||||
V12, V12_H, V12_J, V12_K
|
||||
);
|
||||
|
||||
// class for vector register v13
|
||||
reg_class v13_reg(
|
||||
V13, V13_H, V13_J, V13_K
|
||||
);
|
||||
|
||||
// class for vector register v14
|
||||
reg_class v14_reg(
|
||||
V14, V14_H, V14_J, V14_K
|
||||
);
|
||||
|
||||
// class for vector register v15
|
||||
reg_class v15_reg(
|
||||
V15, V15_H, V15_J, V15_K
|
||||
);
|
||||
|
||||
// class for condition codes
|
||||
reg_class reg_flags(RFLAGS);
|
||||
|
||||
@@ -1896,9 +1876,6 @@ bool Matcher::match_rule_supported(int opcode) {
|
||||
}
|
||||
break;
|
||||
|
||||
case Op_ExpandBits: // fall through
|
||||
case Op_CompressBits: // fall through
|
||||
guarantee(UseRVV == (MaxVectorSize >= 16), "UseRVV and MaxVectorSize not matched");
|
||||
case Op_StrCompressedCopy: // fall through
|
||||
case Op_StrInflatedCopy: // fall through
|
||||
case Op_CountPositives: // fall through
|
||||
@@ -3541,46 +3518,6 @@ operand vReg_V11()
|
||||
interface(REG_INTER);
|
||||
%}
|
||||
|
||||
operand vReg_V12()
|
||||
%{
|
||||
constraint(ALLOC_IN_RC(v12_reg));
|
||||
match(VecA);
|
||||
match(vReg);
|
||||
op_cost(0);
|
||||
format %{ %}
|
||||
interface(REG_INTER);
|
||||
%}
|
||||
|
||||
operand vReg_V13()
|
||||
%{
|
||||
constraint(ALLOC_IN_RC(v13_reg));
|
||||
match(VecA);
|
||||
match(vReg);
|
||||
op_cost(0);
|
||||
format %{ %}
|
||||
interface(REG_INTER);
|
||||
%}
|
||||
|
||||
operand vReg_V14()
|
||||
%{
|
||||
constraint(ALLOC_IN_RC(v14_reg));
|
||||
match(VecA);
|
||||
match(vReg);
|
||||
op_cost(0);
|
||||
format %{ %}
|
||||
interface(REG_INTER);
|
||||
%}
|
||||
|
||||
operand vReg_V15()
|
||||
%{
|
||||
constraint(ALLOC_IN_RC(v15_reg));
|
||||
match(VecA);
|
||||
match(vReg);
|
||||
op_cost(0);
|
||||
format %{ %}
|
||||
interface(REG_INTER);
|
||||
%}
|
||||
|
||||
operand vRegMask()
|
||||
%{
|
||||
constraint(ALLOC_IN_RC(vmask_reg));
|
||||
@@ -4814,10 +4751,14 @@ instruct loadNKlassCompactHeaders(iRegNNoSp dst, memory mem)
|
||||
match(Set dst (LoadNKlass mem));
|
||||
|
||||
ins_cost(LOAD_COST);
|
||||
format %{ "load_narrow_klass_compact $dst, $mem\t# compressed class ptr, #@loadNKlassCompactHeaders" %}
|
||||
format %{
|
||||
"lwu $dst, $mem\t# compressed klass ptr, shifted\n\t"
|
||||
"srli $dst, $dst, markWord::klass_shift_at_offset"
|
||||
%}
|
||||
|
||||
ins_encode %{
|
||||
__ load_narrow_klass_compact_c2(as_Register($dst$$reg), Address(as_Register($mem$$base), $mem$$disp));
|
||||
__ lwu(as_Register($dst$$reg), Address(as_Register($mem$$base), $mem$$disp));
|
||||
__ srli(as_Register($dst$$reg), as_Register($dst$$reg), (unsigned) markWord::klass_shift_at_offset);
|
||||
%}
|
||||
|
||||
ins_pipe(iload_reg_mem);
|
||||
@@ -5803,7 +5744,7 @@ instruct weakCompareAndSwapB(iRegINoSp res, indirect mem, iRegI_R12 oldval, iReg
|
||||
effect(TEMP_DEF res, KILL cr, USE_KILL oldval, USE_KILL newval, TEMP tmp1, TEMP tmp2, TEMP tmp3);
|
||||
|
||||
format %{
|
||||
"cmpxchg_weak $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"weak_cmpxchg $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"# $res == 1 when success, #@weakCompareAndSwapB"
|
||||
%}
|
||||
|
||||
@@ -5826,7 +5767,7 @@ instruct weakCompareAndSwapS(iRegINoSp res, indirect mem, iRegI_R12 oldval, iReg
|
||||
effect(TEMP_DEF res, KILL cr, USE_KILL oldval, USE_KILL newval, TEMP tmp1, TEMP tmp2, TEMP tmp3);
|
||||
|
||||
format %{
|
||||
"cmpxchg_weak $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"weak_cmpxchg $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"# $res == 1 when success, #@weakCompareAndSwapS"
|
||||
%}
|
||||
|
||||
@@ -5846,12 +5787,12 @@ instruct weakCompareAndSwapI(iRegINoSp res, indirect mem, iRegI oldval, iRegI ne
|
||||
ins_cost(LOAD_COST + STORE_COST + BRANCH_COST * 2 + ALU_COST * 2);
|
||||
|
||||
format %{
|
||||
"cmpxchg_weak $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"weak_cmpxchg $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"# $res == 1 when success, #@weakCompareAndSwapI"
|
||||
%}
|
||||
|
||||
ins_encode %{
|
||||
__ cmpxchg_weak(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int32,
|
||||
__ weak_cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int32,
|
||||
/*acquire*/ Assembler::relaxed, /*release*/ Assembler::rl, $res$$Register);
|
||||
%}
|
||||
|
||||
@@ -5865,12 +5806,12 @@ instruct weakCompareAndSwapL(iRegINoSp res, indirect mem, iRegL oldval, iRegL ne
|
||||
ins_cost(LOAD_COST + STORE_COST + BRANCH_COST * 2 + ALU_COST * 2);
|
||||
|
||||
format %{
|
||||
"cmpxchg_weak $mem, $oldval, $newval\t# (long, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"weak_cmpxchg $mem, $oldval, $newval\t# (long, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"# $res == 1 when success, #@weakCompareAndSwapL"
|
||||
%}
|
||||
|
||||
ins_encode %{
|
||||
__ cmpxchg_weak(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int64,
|
||||
__ weak_cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int64,
|
||||
/*acquire*/ Assembler::relaxed, /*release*/ Assembler::rl, $res$$Register);
|
||||
%}
|
||||
|
||||
@@ -5885,12 +5826,12 @@ instruct weakCompareAndSwapN(iRegINoSp res, indirect mem, iRegN oldval, iRegN ne
|
||||
ins_cost(LOAD_COST + STORE_COST + BRANCH_COST * 2 + ALU_COST * 4);
|
||||
|
||||
format %{
|
||||
"cmpxchg_weak $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"weak_cmpxchg $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"# $res == 1 when success, #@weakCompareAndSwapN"
|
||||
%}
|
||||
|
||||
ins_encode %{
|
||||
__ cmpxchg_weak(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::uint32,
|
||||
__ weak_cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::uint32,
|
||||
/*acquire*/ Assembler::relaxed, /*release*/ Assembler::rl, $res$$Register);
|
||||
%}
|
||||
|
||||
@@ -5905,12 +5846,12 @@ instruct weakCompareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP ne
|
||||
ins_cost(LOAD_COST + STORE_COST + BRANCH_COST * 2 + ALU_COST * 2);
|
||||
|
||||
format %{
|
||||
"cmpxchg_weak $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"weak_cmpxchg $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"# $res == 1 when success, #@weakCompareAndSwapP"
|
||||
%}
|
||||
|
||||
ins_encode %{
|
||||
__ cmpxchg_weak(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int64,
|
||||
__ weak_cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int64,
|
||||
/*acquire*/ Assembler::relaxed, /*release*/ Assembler::rl, $res$$Register);
|
||||
%}
|
||||
|
||||
@@ -5929,7 +5870,7 @@ instruct weakCompareAndSwapBAcq(iRegINoSp res, indirect mem, iRegI_R12 oldval, i
|
||||
effect(TEMP_DEF res, KILL cr, USE_KILL oldval, USE_KILL newval, TEMP tmp1, TEMP tmp2, TEMP tmp3);
|
||||
|
||||
format %{
|
||||
"cmpxchg_weak_acq $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"weak_cmpxchg_acq $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"# $res == 1 when success, #@weakCompareAndSwapBAcq"
|
||||
%}
|
||||
|
||||
@@ -5954,7 +5895,7 @@ instruct weakCompareAndSwapSAcq(iRegINoSp res, indirect mem, iRegI_R12 oldval, i
|
||||
effect(TEMP_DEF res, KILL cr, USE_KILL oldval, USE_KILL newval, TEMP tmp1, TEMP tmp2, TEMP tmp3);
|
||||
|
||||
format %{
|
||||
"cmpxchg_weak_acq $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"weak_cmpxchg_acq $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"# $res == 1 when success, #@weakCompareAndSwapSAcq"
|
||||
%}
|
||||
|
||||
@@ -5976,12 +5917,12 @@ instruct weakCompareAndSwapIAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI
|
||||
ins_cost(LOAD_COST + STORE_COST + BRANCH_COST * 2 + ALU_COST * 2);
|
||||
|
||||
format %{
|
||||
"cmpxchg_weak_acq $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"weak_cmpxchg_acq $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"# $res == 1 when success, #@weakCompareAndSwapIAcq"
|
||||
%}
|
||||
|
||||
ins_encode %{
|
||||
__ cmpxchg_weak(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int32,
|
||||
__ weak_cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int32,
|
||||
/*acquire*/ Assembler::aq, /*release*/ Assembler::rl, $res$$Register);
|
||||
%}
|
||||
|
||||
@@ -5997,12 +5938,12 @@ instruct weakCompareAndSwapLAcq(iRegINoSp res, indirect mem, iRegL oldval, iRegL
|
||||
ins_cost(LOAD_COST + STORE_COST + BRANCH_COST * 2 + ALU_COST * 2);
|
||||
|
||||
format %{
|
||||
"cmpxchg_weak_acq $mem, $oldval, $newval\t# (long, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"weak_cmpxchg_acq $mem, $oldval, $newval\t# (long, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"# $res == 1 when success, #@weakCompareAndSwapLAcq"
|
||||
%}
|
||||
|
||||
ins_encode %{
|
||||
__ cmpxchg_weak(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int64,
|
||||
__ weak_cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int64,
|
||||
/*acquire*/ Assembler::aq, /*release*/ Assembler::rl, $res$$Register);
|
||||
%}
|
||||
|
||||
@@ -6018,12 +5959,12 @@ instruct weakCompareAndSwapNAcq(iRegINoSp res, indirect mem, iRegN oldval, iRegN
|
||||
ins_cost(LOAD_COST + STORE_COST + BRANCH_COST * 2 + ALU_COST * 4);
|
||||
|
||||
format %{
|
||||
"cmpxchg_weak_acq $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"weak_cmpxchg_acq $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"# $res == 1 when success, #@weakCompareAndSwapNAcq"
|
||||
%}
|
||||
|
||||
ins_encode %{
|
||||
__ cmpxchg_weak(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::uint32,
|
||||
__ weak_cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::uint32,
|
||||
/*acquire*/ Assembler::aq, /*release*/ Assembler::rl, $res$$Register);
|
||||
%}
|
||||
|
||||
@@ -6039,12 +5980,12 @@ instruct weakCompareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP
|
||||
ins_cost(LOAD_COST + STORE_COST + BRANCH_COST * 2 + ALU_COST * 2);
|
||||
|
||||
format %{
|
||||
"cmpxchg_weak_acq $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"weak_cmpxchg_acq $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval\n\t"
|
||||
"\t# $res == 1 when success, #@weakCompareAndSwapPAcq"
|
||||
%}
|
||||
|
||||
ins_encode %{
|
||||
__ cmpxchg_weak(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int64,
|
||||
__ weak_cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int64,
|
||||
/*acquire*/ Assembler::aq, /*release*/ Assembler::rl, $res$$Register);
|
||||
%}
|
||||
|
||||
|
||||
@@ -181,11 +181,15 @@ instruct bytes_reverse_int_b(iRegINoSp dst, iRegIorL2I src) %{
|
||||
match(Set dst (ReverseBytesI src));
|
||||
|
||||
ins_cost(ALU_COST * 2);
|
||||
format %{ "revb_w_w $dst, $src\t#@bytes_reverse_int_b" %}
|
||||
format %{
|
||||
"rev8 $dst, $src\t#@bytes_reverse_int_b\t\n"
|
||||
"srai $dst, $dst, 32\t\n"
|
||||
%}
|
||||
|
||||
ins_encode %{
|
||||
assert(UseZbb, "must be");
|
||||
__ revb_w_w(as_Register($dst$$reg), as_Register($src$$reg));
|
||||
__ rev8(as_Register($dst$$reg), as_Register($src$$reg));
|
||||
__ srai(as_Register($dst$$reg), as_Register($dst$$reg), 32);
|
||||
%}
|
||||
|
||||
ins_pipe(ialu_reg);
|
||||
@@ -209,11 +213,15 @@ instruct bytes_reverse_unsigned_short_b(iRegINoSp dst, iRegIorL2I src) %{
|
||||
match(Set dst (ReverseBytesUS src));
|
||||
|
||||
ins_cost(ALU_COST * 2);
|
||||
format %{ "revb_h_h_u $dst, $src\t#@bytes_reverse_unsigned_short_b" %}
|
||||
format %{
|
||||
"rev8 $dst, $src\t#@bytes_reverse_unsigned_short_b\t\n"
|
||||
"srli $dst, $dst, 48\t\n"
|
||||
%}
|
||||
|
||||
ins_encode %{
|
||||
assert(UseZbb, "must be");
|
||||
__ revb_h_h_u(as_Register($dst$$reg), as_Register($src$$reg));
|
||||
__ rev8(as_Register($dst$$reg), as_Register($src$$reg));
|
||||
__ srli(as_Register($dst$$reg), as_Register($dst$$reg), 48);
|
||||
%}
|
||||
|
||||
ins_pipe(ialu_reg);
|
||||
@@ -223,11 +231,15 @@ instruct bytes_reverse_short_b(iRegINoSp dst, iRegIorL2I src) %{
|
||||
match(Set dst (ReverseBytesS src));
|
||||
|
||||
ins_cost(ALU_COST * 2);
|
||||
format %{ "revb_h_h $dst, $src\t#@bytes_reverse_short_b" %}
|
||||
format %{
|
||||
"rev8 $dst, $src\t#@bytes_reverse_short_b\t\n"
|
||||
"srai $dst, $dst, 48\t\n"
|
||||
%}
|
||||
|
||||
ins_encode %{
|
||||
assert(UseZbb, "must be");
|
||||
__ revb_h_h(as_Register($dst$$reg), as_Register($src$$reg));
|
||||
__ rev8(as_Register($dst$$reg), as_Register($src$$reg));
|
||||
__ srai(as_Register($dst$$reg), as_Register($dst$$reg), 48);
|
||||
%}
|
||||
|
||||
ins_pipe(ialu_reg);
|
||||
|
||||
@@ -3843,116 +3843,6 @@ instruct vclearArray_reg_reg(iRegL_R29 cnt, iRegP_R28 base, Universe dummy,
|
||||
ins_pipe(pipe_class_memory);
|
||||
%}
|
||||
|
||||
// CompressBits of Long & Integer
|
||||
|
||||
instruct compressBitsI(iRegINoSp dst, iRegIorL2I src, iRegIorL2I mask, vRegMask_V0 v0,
|
||||
vReg_V4 v4, vReg_V5 v5, vReg_V8 v8, vReg_V9 v9) %{
|
||||
match(Set dst (CompressBits src mask));
|
||||
effect(TEMP v0, TEMP v4, TEMP v5, TEMP v8, TEMP v9);
|
||||
format %{ "vsetivli x0, 1, e32, m1, tu, mu\t#@compressBitsI\n\t"
|
||||
"vmv.s.x $v0, $src\n\t"
|
||||
"mv t0, 32\n\t"
|
||||
"vsetvli x0, t0, e8, m2, tu, mu\n\t"
|
||||
"vmv.v.i $v4, 0\n\t"
|
||||
"vmerge.vim $v4, $v4, 1, $v0\n\t"
|
||||
"vmv.v.i $v8, 0\n\t"
|
||||
"vsetivli x0, 1, e32, m1, tu, mu\n\t"
|
||||
"vmv.s.x $v0, $mask\n\t"
|
||||
"vsetvli x0, t0, e8, m2, tu, mu\n\t"
|
||||
"vcompress.vm $v8, $v4, $v0\n\t"
|
||||
"vmseq.vi $v0, $v8, 1\n\t"
|
||||
"vsetivli x0, 1, e32, m1, tu, mu\n\t"
|
||||
"vmv.x.s $dst, $v0\t#@compressBitsI\n\t"
|
||||
%}
|
||||
ins_encode %{
|
||||
__ compress_bits_i_v(as_Register($dst$$reg), as_Register($src$$reg), as_Register($mask$$reg));
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct compressBitsL(iRegLNoSp dst, iRegL src, iRegL mask, vRegMask_V0 v0,
|
||||
vReg_V4 v4, vReg_V5 v5, vReg_V6 v6, vReg_V7 v7,
|
||||
vReg_V8 v8, vReg_V9 v9, vReg_V10 v10, vReg_V11 v11) %{
|
||||
match(Set dst (CompressBits src mask));
|
||||
effect(TEMP v0, TEMP v4, TEMP v5, TEMP v6, TEMP v7, TEMP v8, TEMP v9, TEMP v10, TEMP v11);
|
||||
format %{ "vsetivli x0, 1, e64, m1, tu, mu\t#@compressBitsL\n\t"
|
||||
"vmv.s.x $v0, $src\n\t"
|
||||
"mv t0, 64\n\t"
|
||||
"vsetvli x0, t0, e8, m4, tu, mu\n\t"
|
||||
"vmv.v.i $v4, 0\n\t"
|
||||
"vmerge.vim $v4, $v4, 1, $v0\n\t"
|
||||
"vmv.v.i $v8, 0\n\t"
|
||||
"vsetivli x0, 1, e64, m1, tu, mu\n\t"
|
||||
"vmv.s.x $v0, $mask\n\t"
|
||||
"vsetvli x0, t0, e8, m4, tu, mu\n\t"
|
||||
"vcompress.vm $v8, $v4, $v0\n\t"
|
||||
"vmseq.vi $v0, $v8, 1\n\t"
|
||||
"vsetivli x0, 1, e64, m1, tu, mu\n\t"
|
||||
"vmv.x.s $dst, $v0\t#@compressBitsL\n\t"
|
||||
%}
|
||||
ins_encode %{
|
||||
__ compress_bits_l_v(as_Register($dst$$reg), as_Register($src$$reg), as_Register($mask$$reg));
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
// ExpandBits of Long & Integer
|
||||
|
||||
instruct expandBitsI(iRegINoSp dst, iRegIorL2I src, iRegIorL2I mask, vRegMask_V0 v0,
|
||||
vReg_V4 v4, vReg_V5 v5, vReg_V8 v8, vReg_V9 v9, vReg_V12 v12, vReg_V13 v13) %{
|
||||
match(Set dst (ExpandBits src mask));
|
||||
effect(TEMP v0, TEMP v4, TEMP v5, TEMP v8, TEMP v9, TEMP v12, TEMP v13);
|
||||
format %{ "vsetivli x0, 1, e32, m1, tu, mu\t#@expandBitsI\n\t"
|
||||
"vmv.s.x $v0, $src\n\t"
|
||||
"mv t0, 32\n\t"
|
||||
"vsetvli x0, t0, e8, m2, tu, mu\n\t"
|
||||
"vmv.v.i $v4, 0\n\t"
|
||||
"vmerge.vim $v4, $v4, 1, $v0\n\t"
|
||||
"vmv.v.i $v12, 0\n\t"
|
||||
"vsetivli x0, 1, e32, m1, tu, mu\n\t"
|
||||
"vmv.s.x $v0, $mask\n\t"
|
||||
"vsetvli x0, t0, e8, m2, tu, mu\n\t"
|
||||
"viota.m $v8, $v0\n\t"
|
||||
"vrgather.vv $v12, $v4, $v8, $v0.t\n\t"
|
||||
"vmseq.vi $v0, $v12, 1\n\t"
|
||||
"vsetivli x0, 1, e32, m1, tu, mu\n\t"
|
||||
"vmv.x.s $dst, $v0\t#@expandBitsI\n\t"
|
||||
%}
|
||||
ins_encode %{
|
||||
__ expand_bits_i_v(as_Register($dst$$reg), as_Register($src$$reg), as_Register($mask$$reg));
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct expandBitsL(iRegLNoSp dst, iRegL src, iRegL mask, vRegMask_V0 v0,
|
||||
vReg_V4 v4, vReg_V5 v5, vReg_V6 v6, vReg_V7 v7,
|
||||
vReg_V8 v8, vReg_V9 v9, vReg_V10 v10, vReg_V11 v11,
|
||||
vReg_V12 v12, vReg_V13 v13, vReg_V14 v14, vReg_V15 v15) %{
|
||||
match(Set dst (ExpandBits src mask));
|
||||
effect(TEMP v0, TEMP v4, TEMP v5, TEMP v6, TEMP v7, TEMP v8, TEMP v9, TEMP v10, TEMP v11,
|
||||
TEMP v12, TEMP v13, TEMP v14, TEMP v15);
|
||||
format %{ "vsetivli x0, 1, e64, m1, tu, mu\t#@expandBitsL\n\t"
|
||||
"vmv.s.x $v0, $src\n\t"
|
||||
"mv t0, 64\n\t"
|
||||
"vsetvli x0, t0, e8, m4, tu, mu\n\t"
|
||||
"vmv.v.i $v4, 0\n\t"
|
||||
"vmerge.vim $v4, $v4, 1, $v0\n\t"
|
||||
"vmv.v.i $v12, 0\n\t"
|
||||
"vsetivli x0, 1, e64, m1, tu, mu\n\t"
|
||||
"vmv.s.x $v0, $mask\n\t"
|
||||
"vsetvli x0, t0, e8, m4, tu, mu\n\t"
|
||||
"viota.m $v8, $v0\n\t"
|
||||
"vrgather.vv $v12, $v4, $v8, $v0.t\n\t"
|
||||
"vmseq.vi $v0, $v12, 1\n\t"
|
||||
"vsetivli x0, 1, e64, m1, tu, mu\n\t"
|
||||
"vmv.x.s $dst, $v0\t#@expandBitsL\n\t"
|
||||
%}
|
||||
ins_encode %{
|
||||
__ expand_bits_l_v(as_Register($dst$$reg), as_Register($src$$reg), as_Register($mask$$reg));
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
// Vector Load Const
|
||||
instruct vloadcon(vReg dst, immI0 src) %{
|
||||
match(Set dst (VectorLoadConst src));
|
||||
|
||||
@@ -2112,7 +2112,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
// Remaining count is less than 8 bytes. Fill it by a single store.
|
||||
// Note that the total length is no less than 8 bytes.
|
||||
if (t == T_BYTE || t == T_SHORT) {
|
||||
if (!AvoidUnalignedAccesses && (t == T_BYTE || t == T_SHORT)) {
|
||||
__ beqz(count, L_exit1);
|
||||
__ shadd(to, count, to, tmp_reg, shift); // points to the end
|
||||
__ sd(value, Address(to, -8)); // overwrite some elements
|
||||
@@ -6502,7 +6502,7 @@ static const int64_t right_3_bits = right_n_bits(3);
|
||||
StubRoutines::_poly1305_processBlocks = generate_poly1305_processBlocks();
|
||||
}
|
||||
|
||||
if (UseRVVForBigIntegerShiftIntrinsics) {
|
||||
if (UseRVV) {
|
||||
StubRoutines::_bigIntegerLeftShiftWorker = generate_bigIntegerLeftShift();
|
||||
StubRoutines::_bigIntegerRightShiftWorker = generate_bigIntegerRightShift();
|
||||
}
|
||||
|
||||
@@ -34,16 +34,6 @@
|
||||
// Implementation of the platform-specific part of StubRoutines - for
|
||||
// a description of how to extend it, see the stubRoutines.hpp file.
|
||||
|
||||
address StubRoutines::riscv::_get_previous_sp_entry = nullptr;
|
||||
|
||||
address StubRoutines::riscv::_f2i_fixup = nullptr;
|
||||
address StubRoutines::riscv::_f2l_fixup = nullptr;
|
||||
address StubRoutines::riscv::_d2i_fixup = nullptr;
|
||||
address StubRoutines::riscv::_d2l_fixup = nullptr;
|
||||
address StubRoutines::riscv::_float_sign_mask = nullptr;
|
||||
address StubRoutines::riscv::_float_sign_flip = nullptr;
|
||||
address StubRoutines::riscv::_double_sign_mask = nullptr;
|
||||
address StubRoutines::riscv::_double_sign_flip = nullptr;
|
||||
address StubRoutines::riscv::_zero_blocks = nullptr;
|
||||
address StubRoutines::riscv::_compare_long_string_LL = nullptr;
|
||||
address StubRoutines::riscv::_compare_long_string_UU = nullptr;
|
||||
@@ -52,7 +42,6 @@ address StubRoutines::riscv::_compare_long_string_UL = nullptr;
|
||||
address StubRoutines::riscv::_string_indexof_linear_ll = nullptr;
|
||||
address StubRoutines::riscv::_string_indexof_linear_uu = nullptr;
|
||||
address StubRoutines::riscv::_string_indexof_linear_ul = nullptr;
|
||||
address StubRoutines::riscv::_large_byte_array_inflate = nullptr;
|
||||
|
||||
bool StubRoutines::riscv::_completed = false;
|
||||
|
||||
|
||||
@@ -47,18 +47,6 @@ class riscv {
|
||||
friend class StubGenerator;
|
||||
|
||||
private:
|
||||
static address _get_previous_sp_entry;
|
||||
|
||||
static address _f2i_fixup;
|
||||
static address _f2l_fixup;
|
||||
static address _d2i_fixup;
|
||||
static address _d2l_fixup;
|
||||
|
||||
static address _float_sign_mask;
|
||||
static address _float_sign_flip;
|
||||
static address _double_sign_mask;
|
||||
static address _double_sign_flip;
|
||||
|
||||
static address _zero_blocks;
|
||||
|
||||
static address _compare_long_string_LL;
|
||||
@@ -68,48 +56,11 @@ class riscv {
|
||||
static address _string_indexof_linear_ll;
|
||||
static address _string_indexof_linear_uu;
|
||||
static address _string_indexof_linear_ul;
|
||||
static address _large_byte_array_inflate;
|
||||
|
||||
static bool _completed;
|
||||
|
||||
public:
|
||||
|
||||
static address get_previous_sp_entry() {
|
||||
return _get_previous_sp_entry;
|
||||
}
|
||||
|
||||
static address f2i_fixup() {
|
||||
return _f2i_fixup;
|
||||
}
|
||||
|
||||
static address f2l_fixup() {
|
||||
return _f2l_fixup;
|
||||
}
|
||||
|
||||
static address d2i_fixup() {
|
||||
return _d2i_fixup;
|
||||
}
|
||||
|
||||
static address d2l_fixup() {
|
||||
return _d2l_fixup;
|
||||
}
|
||||
|
||||
static address float_sign_mask() {
|
||||
return _float_sign_mask;
|
||||
}
|
||||
|
||||
static address float_sign_flip() {
|
||||
return _float_sign_flip;
|
||||
}
|
||||
|
||||
static address double_sign_mask() {
|
||||
return _double_sign_mask;
|
||||
}
|
||||
|
||||
static address double_sign_flip() {
|
||||
return _double_sign_flip;
|
||||
}
|
||||
|
||||
static address zero_blocks() {
|
||||
return _zero_blocks;
|
||||
}
|
||||
@@ -142,10 +93,6 @@ class riscv {
|
||||
return _string_indexof_linear_uu;
|
||||
}
|
||||
|
||||
static address large_byte_array_inflate() {
|
||||
return _large_byte_array_inflate;
|
||||
}
|
||||
|
||||
static bool complete() {
|
||||
return _completed;
|
||||
}
|
||||
|
||||
@@ -552,7 +552,7 @@ address TemplateInterpreterGenerator::generate_cont_resume_interpreter_adapter()
|
||||
// Restore Java expression stack pointer
|
||||
__ ld(t0, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize));
|
||||
__ shadd(esp, t0, fp, t0, Interpreter::logStackElementSize);
|
||||
// and NULL it as marker that esp is now tos until next java call
|
||||
// and null it as marker that esp is now tos until next java call
|
||||
__ sd(zr, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize));
|
||||
|
||||
// Restore machine SP
|
||||
|
||||
@@ -292,15 +292,10 @@ void TemplateTable::bipush() {
|
||||
|
||||
void TemplateTable::sipush() {
|
||||
transition(vtos, itos);
|
||||
if (AvoidUnalignedAccesses) {
|
||||
__ load_signed_byte(x10, at_bcp(1));
|
||||
__ load_unsigned_byte(t1, at_bcp(2));
|
||||
__ slli(x10, x10, 8);
|
||||
__ add(x10, x10, t1);
|
||||
} else {
|
||||
__ load_unsigned_short(x10, at_bcp(1));
|
||||
__ revb_h_h(x10, x10); // reverse bytes in half-word and sign-extend
|
||||
}
|
||||
__ load_signed_byte(x10, at_bcp(1));
|
||||
__ load_unsigned_byte(t1, at_bcp(2));
|
||||
__ slli(x10, x10, 8);
|
||||
__ add(x10, x10, t1);
|
||||
}
|
||||
|
||||
void TemplateTable::ldc(LdcType type) {
|
||||
@@ -663,8 +658,12 @@ void TemplateTable::aload() {
|
||||
}
|
||||
|
||||
void TemplateTable::locals_index_wide(Register reg) {
|
||||
__ lhu(reg, at_bcp(2));
|
||||
__ revb_h_h_u(reg, reg); // reverse bytes in half-word and zero-extend
|
||||
assert_different_registers(reg, t1);
|
||||
// Convert the 16-bit value into native byte-ordering and zero-extend
|
||||
__ lbu(reg, at_bcp(2));
|
||||
__ lbu(t1, at_bcp(3));
|
||||
__ slli(reg, reg, 8);
|
||||
__ orr(reg, reg, t1);
|
||||
__ neg(reg, reg);
|
||||
}
|
||||
|
||||
@@ -676,8 +675,12 @@ void TemplateTable::wide_iload() {
|
||||
|
||||
void TemplateTable::wide_lload() {
|
||||
transition(vtos, ltos);
|
||||
__ lhu(x11, at_bcp(2));
|
||||
__ revb_h_h_u(x11, x11); // reverse bytes in half-word and zero-extend
|
||||
// Convert the 16-bit value into native byte-ordering and zero-extend
|
||||
__ lbu(x11, at_bcp(2));
|
||||
__ lbu(t1, at_bcp(3));
|
||||
__ slli(x11, x11, 8);
|
||||
__ orr(x11, x11, t1);
|
||||
|
||||
__ slli(x11, x11, LogBytesPerWord);
|
||||
__ sub(x11, xlocals, x11);
|
||||
__ ld(x10, Address(x11, Interpreter::local_offset_in_bytes(1)));
|
||||
@@ -691,8 +694,12 @@ void TemplateTable::wide_fload() {
|
||||
|
||||
void TemplateTable::wide_dload() {
|
||||
transition(vtos, dtos);
|
||||
__ lhu(x11, at_bcp(2));
|
||||
__ revb_h_h_u(x11, x11); // reverse bytes in half-word and zero-extend
|
||||
// Convert the 16-bit value into native byte-ordering and zero-extend
|
||||
__ lbu(x11, at_bcp(2));
|
||||
__ lbu(t1, at_bcp(3));
|
||||
__ slli(x11, x11, 8);
|
||||
__ orr(x11, x11, t1);
|
||||
|
||||
__ slli(x11, x11, LogBytesPerWord);
|
||||
__ sub(x11, xlocals, x11);
|
||||
__ fld(f10, Address(x11, Interpreter::local_offset_in_bytes(1)));
|
||||
@@ -1476,12 +1483,14 @@ void TemplateTable::iinc() {
|
||||
|
||||
void TemplateTable::wide_iinc() {
|
||||
transition(vtos, vtos);
|
||||
__ lwu(x11, at_bcp(2)); // get constant and index
|
||||
__ revb_h_w_u(x11, x11); // reverse bytes in half-word (32bit) and zero-extend
|
||||
__ zero_extend(x12, x11, 16);
|
||||
__ neg(x12, x12);
|
||||
__ slli(x11, x11, 32);
|
||||
__ srai(x11, x11, 48);
|
||||
// get constant
|
||||
// Convert the 16-bit value into native byte-ordering and sign-extend
|
||||
__ lb(x11, at_bcp(4));
|
||||
__ lbu(t1, at_bcp(5));
|
||||
__ slli(x11, x11, 8);
|
||||
__ orr(x11, x11, t1);
|
||||
|
||||
locals_index_wide(x12);
|
||||
__ ld(x10, iaddress(x12, t0, _masm));
|
||||
__ addw(x10, x10, x11);
|
||||
__ sd(x10, iaddress(x12, t0, _masm));
|
||||
@@ -1626,18 +1635,14 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
|
||||
|
||||
// load branch displacement
|
||||
if (!is_wide) {
|
||||
if (AvoidUnalignedAccesses) {
|
||||
__ lb(x12, at_bcp(1));
|
||||
__ lbu(t1, at_bcp(2));
|
||||
__ slli(x12, x12, 8);
|
||||
__ add(x12, x12, t1);
|
||||
} else {
|
||||
__ lhu(x12, at_bcp(1));
|
||||
__ revb_h_h(x12, x12); // reverse bytes in half-word and sign-extend
|
||||
}
|
||||
// Convert the 16-bit value into native byte-ordering and sign-extend
|
||||
__ lb(x12, at_bcp(1));
|
||||
__ lbu(t1, at_bcp(2));
|
||||
__ slli(x12, x12, 8);
|
||||
__ orr(x12, x12, t1);
|
||||
} else {
|
||||
__ lwu(x12, at_bcp(1));
|
||||
__ revb_w_w(x12, x12); // reverse bytes in word and sign-extend
|
||||
__ revbw(x12, x12);
|
||||
}
|
||||
|
||||
// Handle all the JSR stuff here, then exit.
|
||||
@@ -1902,8 +1907,8 @@ void TemplateTable::tableswitch() {
|
||||
// load lo & hi
|
||||
__ lwu(x12, Address(x11, BytesPerInt));
|
||||
__ lwu(x13, Address(x11, 2 * BytesPerInt));
|
||||
__ revb_w_w(x12, x12); // reverse bytes in word (32bit) and sign-extend
|
||||
__ revb_w_w(x13, x13); // reverse bytes in word (32bit) and sign-extend
|
||||
__ revbw(x12, x12);
|
||||
__ revbw(x13, x13);
|
||||
// check against lo & hi
|
||||
__ blt(x10, x12, default_case);
|
||||
__ bgt(x10, x13, default_case);
|
||||
@@ -1914,7 +1919,7 @@ void TemplateTable::tableswitch() {
|
||||
__ profile_switch_case(x10, x11, x12);
|
||||
// continue execution
|
||||
__ bind(continue_execution);
|
||||
__ revb_w_w(x13, x13); // reverse bytes in word (32bit) and sign-extend
|
||||
__ revbw(x13, x13);
|
||||
__ add(xbcp, xbcp, x13);
|
||||
__ load_unsigned_byte(t0, Address(xbcp));
|
||||
__ dispatch_only(vtos, /*generate_poll*/true);
|
||||
@@ -1934,7 +1939,7 @@ void TemplateTable::fast_linearswitch() {
|
||||
transition(itos, vtos);
|
||||
Label loop_entry, loop, found, continue_execution;
|
||||
// bswap x10 so we can avoid bswapping the table entries
|
||||
__ revb_w_w(x10, x10); // reverse bytes in word (32bit) and sign-extend
|
||||
__ revbw(x10, x10);
|
||||
// align xbcp
|
||||
__ la(x9, at_bcp(BytesPerInt)); // btw: should be able to get rid of
|
||||
// this instruction (change offsets
|
||||
@@ -1942,7 +1947,10 @@ void TemplateTable::fast_linearswitch() {
|
||||
__ andi(x9, x9, -BytesPerInt);
|
||||
// set counter
|
||||
__ lwu(x11, Address(x9, BytesPerInt));
|
||||
__ revb_w(x11, x11);
|
||||
// Convert the 32-bit npairs (number of pairs) into native byte-ordering
|
||||
// We can use sign-extension here because npairs must be greater than or
|
||||
// equal to 0 per JVM spec on 'lookupswitch' bytecode.
|
||||
__ revbw(x11, x11);
|
||||
__ j(loop_entry);
|
||||
// table search
|
||||
__ bind(loop);
|
||||
@@ -1963,7 +1971,7 @@ void TemplateTable::fast_linearswitch() {
|
||||
__ profile_switch_case(x11, x10, x9);
|
||||
// continue execution
|
||||
__ bind(continue_execution);
|
||||
__ revb_w_w(x13, x13); // reverse bytes in word (32bit) and sign-extend
|
||||
__ revbw(x13, x13);
|
||||
__ add(xbcp, xbcp, x13);
|
||||
__ lbu(t0, Address(xbcp, 0));
|
||||
__ dispatch_only(vtos, /*generate_poll*/true);
|
||||
@@ -2015,8 +2023,10 @@ void TemplateTable::fast_binaryswitch() {
|
||||
__ mv(i, zr); // i = 0
|
||||
__ lwu(j, Address(array, -BytesPerInt)); // j = length(array)
|
||||
|
||||
// Convert j into native byteordering
|
||||
__ revb_w(j, j);
|
||||
// Convert the 32-bit npairs (number of pairs) into native byte-ordering
|
||||
// We can use sign-extension here because npairs must be greater than or
|
||||
// equal to 0 per JVM spec on 'lookupswitch' bytecode.
|
||||
__ revbw(j, j);
|
||||
|
||||
// And start
|
||||
Label entry;
|
||||
@@ -2034,7 +2044,7 @@ void TemplateTable::fast_binaryswitch() {
|
||||
// Convert array[h].match to native byte-ordering before compare
|
||||
__ shadd(temp, h, array, temp, 3);
|
||||
__ lwu(temp, Address(temp, 0));
|
||||
__ revb_w_w(temp, temp); // reverse bytes in word (32bit) and sign-extend
|
||||
__ revbw(temp, temp);
|
||||
|
||||
Label L_done, L_greater;
|
||||
__ bge(key, temp, L_greater);
|
||||
@@ -2057,14 +2067,14 @@ void TemplateTable::fast_binaryswitch() {
|
||||
// Convert array[i].match to native byte-ordering before compare
|
||||
__ shadd(temp, i, array, temp, 3);
|
||||
__ lwu(temp, Address(temp, 0));
|
||||
__ revb_w_w(temp, temp); // reverse bytes in word (32bit) and sign-extend
|
||||
__ revbw(temp, temp);
|
||||
__ bne(key, temp, default_case);
|
||||
|
||||
// entry found -> j = offset
|
||||
__ shadd(temp, i, array, temp, 3);
|
||||
__ lwu(j, Address(temp, BytesPerInt));
|
||||
__ profile_switch_case(i, key, array);
|
||||
__ revb_w_w(j, j); // reverse bytes in word (32bit) and sign-extend
|
||||
__ revbw(j, j);
|
||||
|
||||
__ add(temp, xbcp, j);
|
||||
__ load_unsigned_byte(t0, Address(temp, 0));
|
||||
@@ -2077,7 +2087,7 @@ void TemplateTable::fast_binaryswitch() {
|
||||
__ bind(default_case);
|
||||
__ profile_switch_default(i);
|
||||
__ lwu(j, Address(array, -2 * BytesPerInt));
|
||||
__ revb_w_w(j, j); // reverse bytes in word (32bit) and sign-extend
|
||||
__ revbw(j, j);
|
||||
|
||||
__ add(temp, xbcp, j);
|
||||
__ load_unsigned_byte(t0, Address(temp, 0));
|
||||
|
||||
@@ -150,11 +150,12 @@ void VM_Version::common_initialize() {
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(AvoidUnalignedAccesses)) {
|
||||
if (unaligned_access.value() != MISALIGNED_FAST) {
|
||||
FLAG_SET_DEFAULT(AvoidUnalignedAccesses, true);
|
||||
} else {
|
||||
FLAG_SET_DEFAULT(AvoidUnalignedAccesses, false);
|
||||
}
|
||||
FLAG_SET_DEFAULT(AvoidUnalignedAccesses,
|
||||
unaligned_access.value() != MISALIGNED_FAST);
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(AlignVector)) {
|
||||
FLAG_SET_DEFAULT(AlignVector, AvoidUnalignedAccesses);
|
||||
}
|
||||
|
||||
// See JDK-8026049
|
||||
@@ -233,7 +234,6 @@ void VM_Version::c2_initialize() {
|
||||
|
||||
if (!UseRVV) {
|
||||
FLAG_SET_DEFAULT(MaxVectorSize, 0);
|
||||
FLAG_SET_DEFAULT(UseRVVForBigIntegerShiftIntrinsics, false);
|
||||
} else {
|
||||
if (!FLAG_IS_DEFAULT(MaxVectorSize) && MaxVectorSize != _initial_vector_length) {
|
||||
warning("Current system does not support RVV vector length for MaxVectorSize %d. Set MaxVectorSize to %d",
|
||||
|
||||
@@ -116,6 +116,8 @@ class VM_Version : public Abstract_VM_Version {
|
||||
//
|
||||
// Zfh Half-Precision Floating-Point instructions
|
||||
//
|
||||
// Zicond Conditional operations
|
||||
//
|
||||
// Zicsr Control and Status Register (CSR) Instructions
|
||||
// Zifencei Instruction-Fetch Fence
|
||||
// Zic64b Cache blocks must be 64 bytes in size, naturally aligned in the address space.
|
||||
@@ -164,6 +166,7 @@ class VM_Version : public Abstract_VM_Version {
|
||||
decl(ext_Zvbb , "Zvbb" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZvbb)) \
|
||||
decl(ext_Zvfh , "Zvfh" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZvfh)) \
|
||||
decl(ext_Zvkn , "Zvkn" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZvkn)) \
|
||||
decl(ext_Zicond , "Zicond" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicond)) \
|
||||
decl(mvendorid , "VendorId" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(marchid , "ArchId" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(mimpid , "ImpId" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
@@ -223,6 +226,7 @@ class VM_Version : public Abstract_VM_Version {
|
||||
RV_ENABLE_EXTENSION(UseZicbom) \
|
||||
RV_ENABLE_EXTENSION(UseZicbop) \
|
||||
RV_ENABLE_EXTENSION(UseZicboz) \
|
||||
RV_ENABLE_EXTENSION(UseZicond) \
|
||||
RV_ENABLE_EXTENSION(UseZihintpause) \
|
||||
|
||||
static void useRVA23U64Profile();
|
||||
|
||||
@@ -1236,6 +1236,9 @@ class Assembler : public AbstractAssembler {
|
||||
// NOR
|
||||
#define VNO_ZOPC (unsigned long)(0xe7L << 40 | 0x6bL << 0) // V1 := !(V2 | V3), element size = 2**m
|
||||
|
||||
//NOT-XOR
|
||||
#define VNX_ZOPC (unsigned long)(0xe7L << 40 | 0x6cL << 0) // V1 := !(V2 | V3), element size = 2**m
|
||||
|
||||
// OR
|
||||
#define VO_ZOPC (unsigned long)(0xe7L << 40 | 0x6aL << 0) // V1 := V2 | V3, element size = 2**m
|
||||
|
||||
@@ -1287,6 +1290,13 @@ class Assembler : public AbstractAssembler {
|
||||
#define VSTRC_ZOPC (unsigned long)(0xe7L << 40 | 0x8aL << 0) // String range compare
|
||||
#define VISTR_ZOPC (unsigned long)(0xe7L << 40 | 0x5cL << 0) // Isolate String
|
||||
|
||||
#define VFA_ZOPC (unsigned long)(0xe7L << 40 | 0xE3L << 0) // V1 := V2 + V3, element size = 2**m
|
||||
#define VFS_ZOPC (unsigned long)(0xe7L << 40 | 0xE2L << 0) // V1 := V2 - V3, element size = 2**m
|
||||
#define VFM_ZOPC (unsigned long)(0xe7L << 40 | 0xE7L << 0) // V1 := V2 * V3, element size = 2**m
|
||||
#define VFD_ZOPC (unsigned long)(0xe7L << 40 | 0xE5L << 0) // V1 := V2 / V3, element size = 2**m
|
||||
#define VFSQ_ZOPC (unsigned long)(0xe7L << 40 | 0xCEL << 0) // V1 := sqrt of V2, element size = 2**m
|
||||
#define VFLR_ZOPC (unsigned long)(0xe7L << 40 | 0xC5L << 0) // vector fp load rounded, element size = 2**m
|
||||
|
||||
|
||||
//--------------------------------
|
||||
//-- Miscellaneous Operations --
|
||||
@@ -2322,22 +2332,22 @@ class Assembler : public AbstractAssembler {
|
||||
inline void z_xilf(Register r1, int64_t i2); // xor r1 = r1 ^ i2_imm32 ; or only for bits 32-63
|
||||
|
||||
// shift
|
||||
inline void z_sla( Register r1, int64_t d2, Register b2=Z_R0); // shift left r1 = r1 << ((d2+b2)&0x3f) ; int32, only 31 bits shifted, sign preserved!
|
||||
inline void z_slak(Register r1, Register r3, int64_t d2, Register b2=Z_R0); // shift left r1 = r3 << ((d2+b2)&0x3f) ; int32, only 31 bits shifted, sign preserved!
|
||||
inline void z_slag(Register r1, Register r3, int64_t d2, Register b2=Z_R0); // shift left r1 = r3 << ((d2+b2)&0x3f) ; int64, only 63 bits shifted, sign preserved!
|
||||
inline void z_sra( Register r1, int64_t d2, Register b2=Z_R0); // shift right r1 = r1 >> ((d2+b2)&0x3f) ; int32, sign extended
|
||||
inline void z_srak(Register r1, Register r3, int64_t d2, Register b2=Z_R0); // shift right r1 = r3 >> ((d2+b2)&0x3f) ; int32, sign extended
|
||||
inline void z_srag(Register r1, Register r3, int64_t d2, Register b2=Z_R0); // shift right r1 = r3 >> ((d2+b2)&0x3f) ; int64, sign extended
|
||||
inline void z_sll( Register r1, int64_t d2, Register b2=Z_R0); // shift left r1 = r1 << ((d2+b2)&0x3f) ; int32, zeros added
|
||||
inline void z_sllk(Register r1, Register r3, int64_t d2, Register b2=Z_R0); // shift left r1 = r3 << ((d2+b2)&0x3f) ; int32, zeros added
|
||||
inline void z_sllg(Register r1, Register r3, int64_t d2, Register b2=Z_R0); // shift left r1 = r3 << ((d2+b2)&0x3f) ; int64, zeros added
|
||||
inline void z_srl( Register r1, int64_t d2, Register b2=Z_R0); // shift right r1 = r1 >> ((d2+b2)&0x3f) ; int32, zero extended
|
||||
inline void z_srlk(Register r1, Register r3, int64_t d2, Register b2=Z_R0); // shift right r1 = r3 >> ((d2+b2)&0x3f) ; int32, zero extended
|
||||
inline void z_srlg(Register r1, Register r3, int64_t d2, Register b2=Z_R0); // shift right r1 = r3 >> ((d2+b2)&0x3f) ; int64, zero extended
|
||||
inline void z_sla( Register r1, int64_t d2, Register b2 = Z_R0); // shift left r1 = r1 << ((d2+b2)&0x3f) ; int32, only 31 bits shifted, sign preserved!
|
||||
inline void z_slak(Register r1, Register r3, int64_t d2, Register b2 = Z_R0); // shift left r1 = r3 << ((d2+b2)&0x3f) ; int32, only 31 bits shifted, sign preserved!
|
||||
inline void z_slag(Register r1, Register r3, int64_t d2, Register b2 = Z_R0); // shift left r1 = r3 << ((d2+b2)&0x3f) ; int64, only 63 bits shifted, sign preserved!
|
||||
inline void z_sra( Register r1, int64_t d2, Register b2 = Z_R0); // shift right r1 = r1 >> ((d2+b2)&0x3f) ; int32, sign extended
|
||||
inline void z_srak(Register r1, Register r3, int64_t d2, Register b2 = Z_R0); // shift right r1 = r3 >> ((d2+b2)&0x3f) ; int32, sign extended
|
||||
inline void z_srag(Register r1, Register r3, int64_t d2, Register b2 = Z_R0); // shift right r1 = r3 >> ((d2+b2)&0x3f) ; int64, sign extended
|
||||
inline void z_sll( Register r1, int64_t d2, Register b2 = Z_R0); // shift left r1 = r1 << ((d2+b2)&0x3f) ; int32, zeros added
|
||||
inline void z_sllk(Register r1, Register r3, int64_t d2, Register b2 = Z_R0); // shift left r1 = r3 << ((d2+b2)&0x3f) ; int32, zeros added
|
||||
inline void z_sllg(Register r1, Register r3, int64_t d2, Register b2 = Z_R0); // shift left r1 = r3 << ((d2+b2)&0x3f) ; int64, zeros added
|
||||
inline void z_srl( Register r1, int64_t d2, Register b2 = Z_R0); // shift right r1 = r1 >> ((d2+b2)&0x3f) ; int32, zero extended
|
||||
inline void z_srlk(Register r1, Register r3, int64_t d2, Register b2 = Z_R0); // shift right r1 = r3 >> ((d2+b2)&0x3f) ; int32, zero extended
|
||||
inline void z_srlg(Register r1, Register r3, int64_t d2, Register b2 = Z_R0); // shift right r1 = r3 >> ((d2+b2)&0x3f) ; int64, zero extended
|
||||
|
||||
// rotate
|
||||
inline void z_rll( Register r1, Register r3, int64_t d2, Register b2=Z_R0); // rot r1 = r3 << (d2+b2 & 0x3f) ; int32 -- z10
|
||||
inline void z_rllg(Register r1, Register r3, int64_t d2, Register b2=Z_R0); // rot r1 = r3 << (d2+b2 & 0x3f) ; int64 -- z10
|
||||
inline void z_rll( Register r1, Register r3, int64_t d2, Register b2 = Z_R0); // rot r1 = r3 << (d2+b2 & 0x3f) ; int32 -- z10
|
||||
inline void z_rllg(Register r1, Register r3, int64_t d2, Register b2 = Z_R0); // rot r1 = r3 << (d2+b2 & 0x3f) ; int64 -- z10
|
||||
|
||||
// rotate the AND/XOR/OR/insert
|
||||
inline void z_rnsbg( Register r1, Register r2, int64_t spos3, int64_t epos4, int64_t nrot5, bool test_only = false); // rotate then AND selected bits -- z196
|
||||
@@ -2459,7 +2469,7 @@ class Assembler : public AbstractAssembler {
|
||||
inline void z_mvc(const Address& d, const Address& s, int64_t l); // move l bytes
|
||||
inline void z_mvc(int64_t d1, int64_t l, Register b1, int64_t d2, Register b2); // move l+1 bytes
|
||||
inline void z_mvcin(int64_t d1, int64_t l, Register b1, int64_t d2, Register b2); // move l+1 bytes
|
||||
inline void z_mvcle(Register r1, Register r3, int64_t d2, Register b2=Z_R0); // move region of memory
|
||||
inline void z_mvcle(Register r1, Register r3, int64_t d2, Register b2 = Z_R0); // move region of memory
|
||||
|
||||
inline void z_stfle(int64_t d2, Register b2); // store facility list extended
|
||||
|
||||
@@ -2491,6 +2501,7 @@ class Assembler : public AbstractAssembler {
|
||||
// Load (transfer from memory)
|
||||
inline void z_vlm( VectorRegister v1, VectorRegister v3, int64_t d2, Register b2);
|
||||
inline void z_vl( VectorRegister v1, int64_t d2, Register x2, Register b2);
|
||||
inline void z_vl( VectorRegister v1, const Address& a);
|
||||
inline void z_vleb( VectorRegister v1, int64_t d2, Register x2, Register b2, int64_t m3);
|
||||
inline void z_vleh( VectorRegister v1, int64_t d2, Register x2, Register b2, int64_t m3);
|
||||
inline void z_vlef( VectorRegister v1, int64_t d2, Register x2, Register b2, int64_t m3);
|
||||
@@ -2529,10 +2540,10 @@ class Assembler : public AbstractAssembler {
|
||||
inline void z_vlgvg( Register r1, VectorRegister v3, int64_t d2, Register b2);
|
||||
|
||||
inline void z_vlvg( VectorRegister v1, Register r3, int64_t d2, Register b2, int64_t m4);
|
||||
inline void z_vlvgb( VectorRegister v1, Register r3, int64_t d2, Register b2);
|
||||
inline void z_vlvgh( VectorRegister v1, Register r3, int64_t d2, Register b2);
|
||||
inline void z_vlvgf( VectorRegister v1, Register r3, int64_t d2, Register b2);
|
||||
inline void z_vlvgg( VectorRegister v1, Register r3, int64_t d2, Register b2);
|
||||
inline void z_vlvgb( VectorRegister v1, Register r3, int64_t d2, Register b2 = Z_R0);
|
||||
inline void z_vlvgh( VectorRegister v1, Register r3, int64_t d2, Register b2 = Z_R0);
|
||||
inline void z_vlvgf( VectorRegister v1, Register r3, int64_t d2, Register b2 = Z_R0);
|
||||
inline void z_vlvgg( VectorRegister v1, Register r3, int64_t d2, Register b2 = Z_R0);
|
||||
|
||||
inline void z_vlvgp( VectorRegister v1, Register r2, Register r3);
|
||||
|
||||
@@ -2619,6 +2630,7 @@ class Assembler : public AbstractAssembler {
|
||||
// Store
|
||||
inline void z_vstm( VectorRegister v1, VectorRegister v3, int64_t d2, Register b2);
|
||||
inline void z_vst( VectorRegister v1, int64_t d2, Register x2, Register b2);
|
||||
inline void z_vst( VectorRegister v1, const Address& a);
|
||||
inline void z_vsteb( VectorRegister v1, int64_t d2, Register x2, Register b2, int64_t m3);
|
||||
inline void z_vsteh( VectorRegister v1, int64_t d2, Register x2, Register b2, int64_t m3);
|
||||
inline void z_vstef( VectorRegister v1, int64_t d2, Register x2, Register b2, int64_t m3);
|
||||
@@ -2679,13 +2691,16 @@ class Assembler : public AbstractAssembler {
|
||||
inline void z_vscbiq( VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
|
||||
// MULTIPLY
|
||||
inline void z_vml( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vmh( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vmlh( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vme( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vmle( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vmo( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vmlo( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vml( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vmlb( VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
inline void z_vmlhw(VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
inline void z_vmlf( VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
inline void z_vmh( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vmlh( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vme( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vmle( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vmo( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vmlo( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
|
||||
// MULTIPLY & ADD
|
||||
inline void z_vmal( VectorRegister v1, VectorRegister v2, VectorRegister v3, VectorRegister v4, int64_t m5);
|
||||
@@ -2744,6 +2759,9 @@ class Assembler : public AbstractAssembler {
|
||||
// NOR
|
||||
inline void z_vno( VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
|
||||
//NOT-XOR
|
||||
inline void z_vnx( VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
|
||||
// OR
|
||||
inline void z_vo( VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
|
||||
@@ -2810,6 +2828,10 @@ class Assembler : public AbstractAssembler {
|
||||
inline void z_vctzf( VectorRegister v1, VectorRegister v2);
|
||||
inline void z_vctzg( VectorRegister v1, VectorRegister v2);
|
||||
inline void z_vpopct( VectorRegister v1, VectorRegister v2, int64_t m3);
|
||||
inline void z_vpopctb(VectorRegister v1, VectorRegister v2);
|
||||
inline void z_vpopcth(VectorRegister v1, VectorRegister v2);
|
||||
inline void z_vpopctf(VectorRegister v1, VectorRegister v2);
|
||||
inline void z_vpopctg(VectorRegister v1, VectorRegister v2);
|
||||
|
||||
// Rotate/Shift
|
||||
inline void z_verllv( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
@@ -2898,9 +2920,39 @@ class Assembler : public AbstractAssembler {
|
||||
inline void z_vistrfs(VectorRegister v1, VectorRegister v2);
|
||||
|
||||
|
||||
// Vector Floatingpoint instructions
|
||||
// ==========================
|
||||
// Add
|
||||
inline void z_vfa( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vfasb(VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
inline void z_vfadb(VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
|
||||
//SUB
|
||||
inline void z_vfs( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vfssb(VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
inline void z_vfsdb(VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
|
||||
//MUL
|
||||
inline void z_vfm( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vfmsb(VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
inline void z_vfmdb(VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
|
||||
//DIV
|
||||
inline void z_vfd( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4);
|
||||
inline void z_vfdsb(VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
inline void z_vfddb(VectorRegister v1, VectorRegister v2, VectorRegister v3);
|
||||
|
||||
//square root
|
||||
inline void z_vfsq( VectorRegister v1, VectorRegister v2, int64_t m3);
|
||||
inline void z_vfsqsb(VectorRegister v1, VectorRegister v2);
|
||||
inline void z_vfsqdb(VectorRegister v1, VectorRegister v2);
|
||||
|
||||
//vector fp load rounded
|
||||
inline void z_vflr( VectorRegister v1, VectorRegister v2, int64_t m3, int64_t m5);
|
||||
inline void z_vflrd( VectorRegister v1, VectorRegister v2, int64_t m5);
|
||||
|
||||
// Floatingpoint instructions
|
||||
// ==========================
|
||||
|
||||
// compare instructions
|
||||
inline void z_cebr(FloatRegister r1, FloatRegister r2); // compare (r1, r2) ; float
|
||||
inline void z_ceb(FloatRegister r1, int64_t d2, Register x2, Register b2); // compare (r1, *(d2_imm12+x2+b2)) ; float
|
||||
|
||||
@@ -787,6 +787,7 @@ inline void Assembler::z_vleb( VectorRegister v1, int64_t d2, Register x2, Reg
|
||||
inline void Assembler::z_vleh( VectorRegister v1, int64_t d2, Register x2, Register b2, int64_t ix3){emit_48(VLEH_ZOPC | vreg(v1, 8) | rxmask_48(d2, x2, b2) | uimm4(ix3, 32, 48)); }
|
||||
inline void Assembler::z_vlef( VectorRegister v1, int64_t d2, Register x2, Register b2, int64_t ix3){emit_48(VLEF_ZOPC | vreg(v1, 8) | rxmask_48(d2, x2, b2) | uimm4(ix3, 32, 48)); }
|
||||
inline void Assembler::z_vleg( VectorRegister v1, int64_t d2, Register x2, Register b2, int64_t ix3){emit_48(VLEG_ZOPC | vreg(v1, 8) | rxmask_48(d2, x2, b2) | uimm4(ix3, 32, 48)); }
|
||||
inline void Assembler::z_vl(VectorRegister v1, const Address& a) { z_vl(v1, a.disp(), a.indexOrR0(), a.baseOrR0()); }
|
||||
|
||||
// Gather/Scatter
|
||||
inline void Assembler::z_vgef( VectorRegister v1, int64_t d2, VectorRegister vx2, Register b2, int64_t ix3) {emit_48(VGEF_ZOPC | vreg(v1, 8) | rvmask_48(d2, vx2, b2) | uimm4(ix3, 32, 48)); }
|
||||
@@ -820,7 +821,7 @@ inline void Assembler::z_vlgvh( Register r1, VectorRegister v3, int64_t d2, Reg
|
||||
inline void Assembler::z_vlgvf( Register r1, VectorRegister v3, int64_t d2, Register b2) {z_vlgv(r1, v3, d2, b2, VRET_FW); } // load FW from VR element (index d2(b2)) into GR (logical)
|
||||
inline void Assembler::z_vlgvg( Register r1, VectorRegister v3, int64_t d2, Register b2) {z_vlgv(r1, v3, d2, b2, VRET_DW); } // load DW from VR element (index d2(b2)) into GR.
|
||||
|
||||
inline void Assembler::z_vlvg( VectorRegister v1, Register r3, int64_t d2, Register b2, int64_t m4) {emit_48(VLVG_ZOPC | vreg(v1, 8) | reg(r3, 12, 48) | rsmask_48(d2, b2) | vesc_mask(m4, VRET_BYTE, VRET_DW, 32)); }
|
||||
inline void Assembler::z_vlvg( VectorRegister v1, Register r3, int64_t d2, Register b2, int64_t m4) {emit_48(VLVG_ZOPC | vreg(v1, 8) | reg(r3, 12, 48) | rsmaskt_48(d2, b2) | vesc_mask(m4, VRET_BYTE, VRET_DW, 32)); }
|
||||
inline void Assembler::z_vlvgb( VectorRegister v1, Register r3, int64_t d2, Register b2) {z_vlvg(v1, r3, d2, b2, VRET_BYTE); }
|
||||
inline void Assembler::z_vlvgh( VectorRegister v1, Register r3, int64_t d2, Register b2) {z_vlvg(v1, r3, d2, b2, VRET_HW); }
|
||||
inline void Assembler::z_vlvgf( VectorRegister v1, Register r3, int64_t d2, Register b2) {z_vlvg(v1, r3, d2, b2, VRET_FW); }
|
||||
@@ -916,6 +917,7 @@ inline void Assembler::z_vsteh( VectorRegister v1, int64_t d2, Register x2, Reg
|
||||
inline void Assembler::z_vstef( VectorRegister v1, int64_t d2, Register x2, Register b2, int64_t ix3){emit_48(VSTEF_ZOPC | vreg(v1, 8) | rxmask_48(d2, x2, b2) | uimm4(ix3, 32, 48)); }
|
||||
inline void Assembler::z_vsteg( VectorRegister v1, int64_t d2, Register x2, Register b2, int64_t ix3){emit_48(VSTEG_ZOPC | vreg(v1, 8) | rxmask_48(d2, x2, b2) | uimm4(ix3, 32, 48)); }
|
||||
inline void Assembler::z_vstl( VectorRegister v1, Register r3, int64_t d2, Register b2) {emit_48(VSTL_ZOPC | vreg(v1, 8) | reg(r3, 12, 48) | rsmask_48(d2, b2)); }
|
||||
inline void Assembler::z_vst(VectorRegister v1, const Address& a) { z_vst(v1, a.disp(), a.indexOrR0(), a.baseOrR0()); }
|
||||
|
||||
// Misc
|
||||
inline void Assembler::z_vgm( VectorRegister v1, int64_t imm2, int64_t imm3, int64_t m4) {emit_48(VGM_ZOPC | vreg(v1, 8) | uimm8( imm2, 16, 48) | uimm8(imm3, 24, 48) | vesc_mask(m4, VRET_BYTE, VRET_DW, 32)); }
|
||||
@@ -973,6 +975,9 @@ inline void Assembler::z_vscbiq( VectorRegister v1, VectorRegister v2, VectorReg
|
||||
// MULTIPLY
|
||||
inline void Assembler::z_vml( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4) {emit_48(VML_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vreg(v3, 16) | vesc_mask(m4, VRET_BYTE, VRET_FW, 32)); }
|
||||
inline void Assembler::z_vmh( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4) {emit_48(VMH_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vreg(v3, 16) | vesc_mask(m4, VRET_BYTE, VRET_FW, 32)); }
|
||||
inline void Assembler::z_vmlb( VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_vml(v1, v2, v3, VRET_BYTE);} // vector element type 'B'
|
||||
inline void Assembler::z_vmlhw( VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_vml(v1, v2, v3, VRET_HW);} // vector element type 'H'
|
||||
inline void Assembler::z_vmlf( VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_vml(v1, v2, v3, VRET_FW);} // vector element type 'F'
|
||||
inline void Assembler::z_vmlh( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4) {emit_48(VMLH_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vreg(v3, 16) | vesc_mask(m4, VRET_BYTE, VRET_FW, 32)); }
|
||||
inline void Assembler::z_vme( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4) {emit_48(VME_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vreg(v3, 16) | vesc_mask(m4, VRET_BYTE, VRET_FW, 32)); }
|
||||
inline void Assembler::z_vmle( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4) {emit_48(VMLE_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vreg(v3, 16) | vesc_mask(m4, VRET_BYTE, VRET_FW, 32)); }
|
||||
@@ -1035,6 +1040,9 @@ inline void Assembler::z_vx( VectorRegister v1, VectorRegister v2, VectorReg
|
||||
// NOR
|
||||
inline void Assembler::z_vno( VectorRegister v1, VectorRegister v2, VectorRegister v3) {emit_48(VNO_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vreg(v3, 16)); }
|
||||
|
||||
//NOT-XOR
|
||||
inline void Assembler::z_vnx( VectorRegister v1, VectorRegister v2, VectorRegister v3) {emit_48(VNX_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vreg(v3, 16)); }
|
||||
|
||||
// OR
|
||||
inline void Assembler::z_vo( VectorRegister v1, VectorRegister v2, VectorRegister v3) {emit_48(VO_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vreg(v3, 16)); }
|
||||
|
||||
@@ -1101,6 +1109,10 @@ inline void Assembler::z_vctzh( VectorRegister v1, VectorRegister v2)
|
||||
inline void Assembler::z_vctzf( VectorRegister v1, VectorRegister v2) {z_vctz(v1, v2, VRET_FW); } // vector element type 'F'
|
||||
inline void Assembler::z_vctzg( VectorRegister v1, VectorRegister v2) {z_vctz(v1, v2, VRET_DW); } // vector element type 'G'
|
||||
inline void Assembler::z_vpopct( VectorRegister v1, VectorRegister v2, int64_t m3) {emit_48(VPOPCT_ZOPC| vreg(v1, 8) | vreg(v2, 12) | vesc_mask(m3, VRET_BYTE, VRET_DW, 32)); }
|
||||
inline void Assembler::z_vpopctb( VectorRegister v1, VectorRegister v2) {z_vpopct(v1, v2, VRET_BYTE); }
|
||||
inline void Assembler::z_vpopcth( VectorRegister v1, VectorRegister v2) {z_vpopct(v1, v2, VRET_HW); }
|
||||
inline void Assembler::z_vpopctf( VectorRegister v1, VectorRegister v2) {z_vpopct(v1, v2, VRET_FW); }
|
||||
inline void Assembler::z_vpopctg( VectorRegister v1, VectorRegister v2) {z_vpopct(v1, v2, VRET_DW); }
|
||||
|
||||
// Rotate/Shift
|
||||
inline void Assembler::z_verllv( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4) {emit_48(VERLLV_ZOPC| vreg(v1, 8) | vreg(v2, 12) | vreg(v3, 16) | vesc_mask(m4, VRET_BYTE, VRET_DW, 32)); }
|
||||
@@ -1108,7 +1120,7 @@ inline void Assembler::z_verllvb(VectorRegister v1, VectorRegister v2, VectorReg
|
||||
inline void Assembler::z_verllvh(VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_verllv(v1, v2, v3, VRET_HW); } // vector element type 'H'
|
||||
inline void Assembler::z_verllvf(VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_verllv(v1, v2, v3, VRET_FW); } // vector element type 'F'
|
||||
inline void Assembler::z_verllvg(VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_verllv(v1, v2, v3, VRET_DW); } // vector element type 'G'
|
||||
inline void Assembler::z_verll( VectorRegister v1, VectorRegister v3, int64_t d2, Register b2, int64_t m4) {emit_48(VERLL_ZOPC | vreg(v1, 8) | vreg(v3, 12) | rsmask_48(d2, b2) | vesc_mask(m4, VRET_BYTE, VRET_DW, 32)); }
|
||||
inline void Assembler::z_verll( VectorRegister v1, VectorRegister v3, int64_t d2, Register b2, int64_t m4) {emit_48(VERLL_ZOPC | vreg(v1, 8) | vreg(v3, 12) | rsmask_48(d2, b2) | vesc_mask(m4, VRET_BYTE, VRET_DW, 32)); }
|
||||
inline void Assembler::z_verllb( VectorRegister v1, VectorRegister v3, int64_t d2, Register b2) {z_verll(v1, v3, d2, b2, VRET_BYTE);}// vector element type 'B'
|
||||
inline void Assembler::z_verllh( VectorRegister v1, VectorRegister v3, int64_t d2, Register b2) {z_verll(v1, v3, d2, b2, VRET_HW);} // vector element type 'H'
|
||||
inline void Assembler::z_verllf( VectorRegister v1, VectorRegister v3, int64_t d2, Register b2) {z_verll(v1, v3, d2, b2, VRET_FW);} // vector element type 'F'
|
||||
@@ -1188,12 +1200,41 @@ inline void Assembler::z_vistrbs(VectorRegister v1, VectorRegister v2)
|
||||
inline void Assembler::z_vistrhs(VectorRegister v1, VectorRegister v2) {z_vistr(v1, v2, VRET_HW, VOPRC_CCSET); }
|
||||
inline void Assembler::z_vistrfs(VectorRegister v1, VectorRegister v2) {z_vistr(v1, v2, VRET_FW, VOPRC_CCSET); }
|
||||
|
||||
//-------------------------------
|
||||
// Vector FLOAT INSTRUCTIONS
|
||||
//-------------------------------
|
||||
// ADD
|
||||
inline void Assembler::z_vfa( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4) {emit_48(VFA_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vreg(v3, 16) | vesc_mask(m4, VRET_FW, VRET_QW, 32)); }
|
||||
inline void Assembler::z_vfasb( VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_vfa(v1, v2, v3, VRET_FW); } // vector element type 'F'
|
||||
inline void Assembler::z_vfadb( VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_vfa(v1, v2, v3, VRET_DW); } // vector element type 'G'
|
||||
|
||||
// SUB
|
||||
inline void Assembler::z_vfs( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4) {emit_48(VFS_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vreg(v3, 16) | vesc_mask(m4, VRET_FW, VRET_QW, 32)); }
|
||||
inline void Assembler::z_vfssb( VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_vfs(v1, v2, v3, VRET_FW); } // vector element type 'F'
|
||||
inline void Assembler::z_vfsdb( VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_vfs(v1, v2, v3, VRET_DW); } // vector element type 'G'
|
||||
|
||||
// MUL
|
||||
inline void Assembler::z_vfm( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4) {emit_48(VFM_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vreg(v3, 16) | vesc_mask(m4, VRET_FW, VRET_QW, 32)); }
|
||||
inline void Assembler::z_vfmsb( VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_vfm(v1, v2, v3, VRET_FW); } // vector element type 'F'
|
||||
inline void Assembler::z_vfmdb( VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_vfm(v1, v2, v3, VRET_DW); } // vector element type 'G'
|
||||
|
||||
// DIV
|
||||
inline void Assembler::z_vfd( VectorRegister v1, VectorRegister v2, VectorRegister v3, int64_t m4) {emit_48(VFD_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vreg(v3, 16) | vesc_mask(m4, VRET_FW, VRET_QW, 32)); }
|
||||
inline void Assembler::z_vfdsb( VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_vfd(v1, v2, v3, VRET_FW); } // vector element type 'F'
|
||||
inline void Assembler::z_vfddb( VectorRegister v1, VectorRegister v2, VectorRegister v3) {z_vfd(v1, v2, v3, VRET_DW); } // vector element type 'G'
|
||||
|
||||
// square root
|
||||
inline void Assembler::z_vfsq( VectorRegister v1, VectorRegister v2, int64_t m3) {emit_48(VFSQ_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vesc_mask(m3, VRET_FW, VRET_QW, 32)); }
|
||||
inline void Assembler::z_vfsqsb( VectorRegister v1, VectorRegister v2) {z_vfsq(v1, v2, VRET_FW); }
|
||||
inline void Assembler::z_vfsqdb( VectorRegister v1, VectorRegister v2) {z_vfsq(v1, v2, VRET_DW); }
|
||||
|
||||
// vector fp load rounded
|
||||
inline void Assembler::z_vflr( VectorRegister v1, VectorRegister v2, int64_t m5, int64_t m3) {emit_48(VFLR_ZOPC | vreg(v1, 8) | vreg(v2, 12) | vesc_mask(m5, VRET_FW, 7, 24) | vesc_mask(m3, VRET_FW, VRET_QW, 32)); }
|
||||
inline void Assembler::z_vflrd( VectorRegister v1, VectorRegister v2, int64_t m5) {z_vflr(v1, v2, m5, VRET_DW); }
|
||||
|
||||
//-------------------------------
|
||||
// FLOAT INSTRUCTIONS
|
||||
//-------------------------------
|
||||
|
||||
//----------------
|
||||
// LOAD
|
||||
//----------------
|
||||
inline void Assembler::z_ler( FloatRegister r1, FloatRegister r2) { emit_16( LER_ZOPC | fregt(r1,8,16) | freg(r2,12,16)); }
|
||||
|
||||
@@ -1532,8 +1532,12 @@ void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr
|
||||
// cpu register - constant
|
||||
jint c = right->as_constant_ptr()->as_jint();
|
||||
switch (code) {
|
||||
case lir_add: __ z_agfi(lreg, c); break;
|
||||
case lir_sub: __ z_agfi(lreg, -c); break; // note: -min_jint == min_jint
|
||||
case lir_add:
|
||||
__ add2reg_32(lreg, c);
|
||||
break;
|
||||
case lir_sub:
|
||||
__ add2reg_32(lreg, java_negate(c));
|
||||
break;
|
||||
case lir_mul: __ z_msfi(lreg, c); break;
|
||||
default: ShouldNotReachHere();
|
||||
}
|
||||
@@ -2539,13 +2543,11 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
|
||||
} else {
|
||||
bool need_slow_path = !k->is_loaded() ||
|
||||
((int) k->super_check_offset() == in_bytes(Klass::secondary_super_cache_offset()));
|
||||
intptr_t super_check_offset = k->is_loaded() ? k->super_check_offset() : -1L;
|
||||
__ load_klass(klass_RInfo, obj);
|
||||
// Perform the fast part of the checking logic.
|
||||
__ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1,
|
||||
(need_slow_path ? success_target : nullptr),
|
||||
failure_target, nullptr,
|
||||
RegisterOrConstant(super_check_offset));
|
||||
failure_target, nullptr);
|
||||
if (need_slow_path) {
|
||||
// Call out-of-line instance of __ check_klass_subtype_slow_path(...):
|
||||
address a = Runtime1::entry_for (C1StubId::slow_subtype_check_id);
|
||||
|
||||
@@ -557,7 +557,12 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
__ z_lg(Rsubklass, 0*BytesPerWord + FrameMap::first_available_sp_in_frame + frame_size, Z_SP);
|
||||
__ z_lg(Rsuperklass, 1*BytesPerWord + FrameMap::first_available_sp_in_frame + frame_size, Z_SP);
|
||||
|
||||
__ check_klass_subtype_slow_path(Rsubklass, Rsuperklass, Rarray_ptr, Rlength, nullptr, &miss);
|
||||
__ check_klass_subtype_slow_path(Rsubklass,
|
||||
Rsuperklass,
|
||||
Rarray_ptr /* temp_reg */,
|
||||
Rlength /* temp2_reg */,
|
||||
nullptr /* L_success */,
|
||||
&miss /* L_failure */);
|
||||
|
||||
// Match falls through here.
|
||||
i = 0;
|
||||
|
||||
@@ -169,6 +169,7 @@ unsigned int C2_MacroAssembler::string_compress(Register result, Register src, R
|
||||
#endif
|
||||
clear_reg(Z_R0); // make sure register is properly initialized.
|
||||
|
||||
#if 0
|
||||
if (VM_Version::has_VectorFacility()) {
|
||||
const int min_vcnt = 32; // Minimum #characters required to use vector instructions.
|
||||
// Otherwise just do nothing in vector mode.
|
||||
@@ -223,6 +224,7 @@ unsigned int C2_MacroAssembler::string_compress(Register result, Register src, R
|
||||
|
||||
bind(VectorDone);
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
const int min_cnt = 8; // Minimum #characters required to use unrolled loop.
|
||||
@@ -461,6 +463,7 @@ unsigned int C2_MacroAssembler::string_inflate(Register src, Register dst, Regis
|
||||
#endif
|
||||
clear_reg(Z_R0); // make sure register is properly initialized.
|
||||
|
||||
#if 0
|
||||
if (VM_Version::has_VectorFacility()) {
|
||||
const int min_vcnt = 32; // Minimum #characters required to use vector instructions.
|
||||
// Otherwise just do nothing in vector mode.
|
||||
@@ -489,6 +492,7 @@ unsigned int C2_MacroAssembler::string_inflate(Register src, Register dst, Regis
|
||||
|
||||
bind(VectorDone);
|
||||
}
|
||||
#endif
|
||||
|
||||
const int min_cnt = 8; // Minimum #characters required to use unrolled scalar loop.
|
||||
// Otherwise just do nothing in unrolled scalar mode.
|
||||
@@ -623,6 +627,7 @@ unsigned int C2_MacroAssembler::string_inflate_const(Register src, Register dst,
|
||||
bool restore_inputs = false;
|
||||
bool workreg_clear = false;
|
||||
|
||||
#if 0
|
||||
if ((len >= 32) && VM_Version::has_VectorFacility()) {
|
||||
const int min_vcnt = 32; // Minimum #characters required to use vector instructions.
|
||||
// Otherwise just do nothing in vector mode.
|
||||
@@ -678,6 +683,7 @@ unsigned int C2_MacroAssembler::string_inflate_const(Register src, Register dst,
|
||||
src_off += min_vcnt;
|
||||
dst_off += min_vcnt*2;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((len-nprocessed) > 8) {
|
||||
const int min_cnt = 8; // Minimum #characters required to use unrolled scalar loop.
|
||||
|
||||
@@ -60,7 +60,8 @@ define_pd_global(bool, UseCISCSpill, true);
|
||||
define_pd_global(bool, OptoBundling, false);
|
||||
define_pd_global(bool, OptoScheduling, false);
|
||||
define_pd_global(bool, OptoRegScheduling, false);
|
||||
define_pd_global(bool, SuperWordLoopUnrollAnalysis, false);
|
||||
define_pd_global(bool, SuperWordLoopUnrollAnalysis, true);
|
||||
define_pd_global(uint, SuperWordStoreToLoadForwardingFailureDetection, 16);
|
||||
// On s390x, we can clear the array with a single instruction,
|
||||
// so don't idealize it.
|
||||
define_pd_global(bool, IdealizeClearArrayNode, false);
|
||||
|
||||
@@ -218,10 +218,10 @@ SaveLiveRegisters::SaveLiveRegisters(MacroAssembler *masm, BarrierStubC2 *stub)
|
||||
|
||||
const int register_save_size = iterate_over_register_mask(ACTION_COUNT_ONLY) * BytesPerWord;
|
||||
|
||||
_frame_size = align_up(register_save_size, frame::alignment_in_bytes) + frame::z_abi_160_size; // FIXME: this could be restricted to argument only
|
||||
_frame_size = align_up(register_save_size, frame::alignment_in_bytes) + frame::z_abi_160_size;
|
||||
|
||||
__ save_return_pc();
|
||||
__ push_frame(_frame_size, Z_R14); // FIXME: check if Z_R1_scaratch can do a job here;
|
||||
__ push_frame(_frame_size, Z_R14);
|
||||
|
||||
__ z_lg(Z_R14, _z_common_abi(return_pc) + _frame_size, Z_SP);
|
||||
|
||||
@@ -240,6 +240,7 @@ int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int of
|
||||
int reg_save_index = 0;
|
||||
RegMaskIterator live_regs_iterator(_reg_mask);
|
||||
|
||||
// Going to preserve the volatile registers which can be used by Register Allocator.
|
||||
while(live_regs_iterator.has_next()) {
|
||||
const OptoReg::Name opto_reg = live_regs_iterator.next();
|
||||
|
||||
@@ -251,8 +252,11 @@ int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int of
|
||||
const VMReg vm_reg = OptoReg::as_VMReg(opto_reg);
|
||||
if (vm_reg->is_Register()) {
|
||||
Register std_reg = vm_reg->as_Register();
|
||||
|
||||
if (std_reg->encoding() >= Z_R2->encoding() && std_reg->encoding() <= Z_R15->encoding()) {
|
||||
// Z_R0 and Z_R1 will not be allocated by the register allocator, see s390.ad (Integer Register Classes)
|
||||
// Z_R6 to Z_R15 are saved registers, except Z_R14 (see Z-Abi)
|
||||
if (std_reg->encoding() == Z_R14->encoding() ||
|
||||
(std_reg->encoding() >= Z_R2->encoding() &&
|
||||
std_reg->encoding() <= Z_R5->encoding())) {
|
||||
reg_save_index++;
|
||||
|
||||
if (action == ACTION_SAVE) {
|
||||
@@ -265,8 +269,10 @@ int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int of
|
||||
}
|
||||
} else if (vm_reg->is_FloatRegister()) {
|
||||
FloatRegister fp_reg = vm_reg->as_FloatRegister();
|
||||
if (fp_reg->encoding() >= Z_F0->encoding() && fp_reg->encoding() <= Z_F15->encoding()
|
||||
&& fp_reg->encoding() != Z_F1->encoding()) {
|
||||
// Z_R1 will not be allocated by the register allocator, see s390.ad (Float Register Classes)
|
||||
if (fp_reg->encoding() >= Z_F0->encoding() &&
|
||||
fp_reg->encoding() <= Z_F7->encoding() &&
|
||||
fp_reg->encoding() != Z_F1->encoding()) {
|
||||
reg_save_index++;
|
||||
|
||||
if (action == ACTION_SAVE) {
|
||||
@@ -277,8 +283,20 @@ int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int of
|
||||
assert(action == ACTION_COUNT_ONLY, "Sanity");
|
||||
}
|
||||
}
|
||||
} else if (false /* vm_reg->is_VectorRegister() */){
|
||||
fatal("Vector register support is not there yet!");
|
||||
} else if (vm_reg->is_VectorRegister()) {
|
||||
VectorRegister vs_reg = vm_reg->as_VectorRegister();
|
||||
// Z_V0 to Z_V15 will not be allocated by the register allocator, see s390.ad (reg class z_v_reg)
|
||||
if (vs_reg->encoding() >= Z_V16->encoding() &&
|
||||
vs_reg->encoding() <= Z_V31->encoding()) {
|
||||
reg_save_index += 2;
|
||||
if (action == ACTION_SAVE) {
|
||||
__ z_vst(vs_reg, Address(Z_SP, offset - reg_save_index * BytesPerWord));
|
||||
} else if (action == ACTION_RESTORE) {
|
||||
__ z_vl(vs_reg, Address(Z_SP, offset - reg_save_index * BytesPerWord));
|
||||
} else {
|
||||
assert(action == ACTION_COUNT_ONLY, "Sanity");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fatal("Register type is not known");
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user