-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8353500: [s390x] Intrinsify Unsafe::setMemory #24480
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back amitkumar! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@offamitkumar The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
with patch:
without patch:
|
__ z_risbg(tmp, size, 32, 128/* risbgz */ + 63, 64 - exact_log2(2 * elem_size), 0); // just do the right shift and set cc | ||
__ z_bre(L_Tail); | ||
|
||
__ align(16); // loop alignment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
align(32) would be more helpful:
- instruction engine fetches octoword (32 bytes) bundles.
- Tight loop is < 32 byes -> all in one bundle, does not cross cache line boundary.
// multiple of 2 | ||
do_setmemory_atomic_loop(2, dest, size, byteVal, _masm); | ||
|
||
__ align(16); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this alignment good for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Branch target alignment. There is no fallthrough path from before this point. Should it be 32?
__ z_ogrk(rScratch1, dest, size); | ||
|
||
__ z_nill(rScratch1, 7); | ||
__ z_bre(L_fill8Bytes); // branch if 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls use z_braz() to reflect check semantics
|
||
|
||
__ z_nill(rScratch1, 3); | ||
__ z_bre(L_fill4Bytes); // branch if 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
__ z_bre(L_fill4Bytes); // branch if 0 | ||
|
||
__ z_nill(rScratch1, 1); | ||
__ z_brne(L_fillBytes); // branch if not 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls use z_brnaz() to reflect check semantics
@@ -415,10 +415,13 @@ inline void Assembler::z_rosbg( Register r1, Register r2, int64_t spos3, int64_t | |||
} | |||
inline void Assembler::z_risbg( Register r1, Register r2, int64_t spos3, int64_t epos4, int64_t nrot5, bool zero_rest) { // Rotate then INS selected bits. -- z196 | |||
const int64_t len = 48; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes are not necessary if bool zero_rest
is used to control what happens to untouched destination bits.
// inc_counter_np(SharedRuntime::_unsafe_set_memory_ctr); | ||
|
||
{ | ||
NearLabel L_fill8Bytes, L_fill4Bytes, L_fillBytes, L_exit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused Label: L_exit
__ bind(L_Loop); | ||
__ store_sized_value(byteVal, Address(dest, 0), elem_size); | ||
__ store_sized_value(byteVal, Address(dest, elem_size), elem_size); | ||
__ z_agfi(dest, 2 * elem_size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not aghi?
Since this is taken from #24254: Maybe you can review that one, too? |
Register tmp = Z_R1; // R1 is free at this point | ||
|
||
if (elem_size > 1) { | ||
__ rotate_then_insert(byteVal, byteVal, 64 - 2 * 8 , 63 - 8, 8, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last argument seems to be a bool
. The value should better be false
.
|
||
__ z_nill(rScratch1, 7); | ||
__ z_braz(L_fill8Bytes); // branch if 0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra newline.
Unsafe::setMemory intrinsic implementation for s390x.
Stub Code:
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24480/head:pull/24480
$ git checkout pull/24480
Update a local copy of the PR:
$ git checkout pull/24480
$ git pull https://git.openjdk.org/jdk.git pull/24480/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24480
View PR using the GUI difftool:
$ git pr show -t 24480
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24480.diff
Using Webrev
Link to Webrev Comment