-
Notifications
You must be signed in to change notification settings - Fork 0
Implement hashst(p) and hashchk(p) instructions #61
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
base: master
Are you sure you want to change the base?
Conversation
91060d0
to
5d6b078
Compare
02e5b07
to
5b556e4
Compare
5b556e4
to
c7d76f6
Compare
Implementation for instructions hashst, hashchk, and its privileged versions. Signed-off-by: Víctor Colombo <[email protected]>
c7d76f6
to
c5b25fa
Compare
for (int i = 3; i >= 0; i--) { | ||
k[i] = key & 0xffff; | ||
key >>= 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.
Hum... it's hard to tell if the pseudo-code is using PowerISA-indexing or everybody-else-indexing. The original paper uses "k[m-1]..k[0] = key words," so I'd expect k[0]
to be the least significant halfword.
target/ppc/excp_helper.c
Outdated
xright[0] = (x >> 16) & 0xffff; | ||
|
||
for (int i = 0; i < 28; i++) { | ||
z |= ((z0 >> (63 - i)) & 1) << 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.
It seems that z
is set in each iteration, so I think it's not a |=
. Also, why << 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.
<< 48
was because it's setting 15th bit and I assumed it was a 64 bit variable, but it's uint16. Fixed by removing it for now, but I have yet to take a look into the bit ordering issue
return 0; | ||
} | ||
|
||
tcg_gen_addi_tl(ea, cpu_gpr[a->ra], a->rt); |
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.
"If RA=0, the instruction form is invalid."
Also, if NARROW_MODE(ctx)
, we need a tcg_gen_ext32u_tl(ea, ea)
.
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.
Fixed in 7c4ee64
Add a method equivalent to CHK_SV that works with decodetree. Use it in hash instructions to optimize when CONFIG_USER_ONLY is defined. Suggested-by: Matheus Ferst <[email protected]> Signed-off-by: Víctor Colombo <[email protected]>
5c8f09a
to
449b18b
Compare
No description provided.