Closed zhengxiaolinX closed 3 years ago
Fixed conflicts with #6 .
Rebased and fixed conflicts with #14 and #15.
Hello, I have some questions about this PR:
- Performence of
Assembler::emit()
: this function is called when each intruction is generated, , and instructions like "condition branch" are excuted frequently, but onlybeqz/bnez
have corresponding compressedc.beqz/c.bnez
, maybe part of the call is not needed .- The default value of argument
compressed
is confusing, sometime is true, sometime false.- Naming of compresseed instructions
c_xx
andxx_nc
is confusing, too .- Duplicate code in
Assembler::emit_compressed_ld_st
.- It seems no need to modify
instruction_size
->normale_instruction_size
.Thanks, Yanhong
Hi Yanhong,
Thanks for your reviews. Your points are undeniable. It is hard to make it an implicit phase base on the currently existing system. Code style is an annoying thing because I have to either hook instructions or fork a piece of code slice but only change one or two of them. Both are tiresome and I chose the former one. Also, especially because of the MachBranchNode
problem, branching instructions like beq
are handled differently from other instructions, hence causing some confusion.
I do not mind changing this patch so any suggestion is welcome. About the questions:
Assembler::emit()
to the previous one, with adding a function like Assembler::emit_may_compress()
to only transform instructions that are able to compress (explicitly)? This could solve this, yielding better performance. But as a trade-off, lots of macro definitions like INSN(add, 0b0110011, 0b000, 0b0000000);
may become INSN(add, 0b0110011, 0b000, 0b0000000, false);
like things because I need to explicitly determine which one is needed to transform. Also, branch instructions like beqz
are treated separately, I will consider a way to modify them. MachBranchNode
problem. They cannot be easily treated and currently, we cannot compress them. In this case, the compressed
is false. It is not easy to deal with because static conditional_branch_insn conditional_branches[]
is a function pointer set. They need to have the same method signature. Let me have a try to modify it.c_xx
are of course compressed instructions - but _nc
means we cannot compress them. I am okay with any suggestions of naming if you have.instruction_size
's semantics are changed. I will change it back if you insist - it is easy to change.Thanks again for your reviews - I know it is not easy to review this patch because it may break the current code style.
Regards, Xiaolin
Hello, I have some questions about this PR:
- Performence of
Assembler::emit()
: this function is called when each intruction is generated, , and instructions like "condition branch" are excuted frequently, but onlybeqz/bnez
have corresponding compressedc.beqz/c.bnez
, maybe part of the call is not needed .- The default value of argument
compressed
is confusing, sometime is true, sometime false.- Naming of compresseed instructions
c_xx
andxx_nc
is confusing, too .- Duplicate code in
Assembler::emit_compressed_ld_st
.- It seems no need to modify
instruction_size
->normale_instruction_size
.Thanks, Yanhong
Hi Yanhong,
I have force-pushed my patch.
About the questions:
blt
, bgt
etc. again.The code style seems better. Thanks for your advice.
Would you mind having another review when available? Thanks.
Regards, Xiaolin
Testing on full tiers and no more personal changes for this patch.
Thanks, Xiaolin
Gentle ping.
Could I get another review? Tests have passed. I can get to merge with JDK17 with this patch entering master.
Hi team,
Could I have a review of this patch of compressed instructions support based on current implementation? Thanks in advance.
This patch can introduce:
Having passed related tests based on the current code base.
There are things about this patch:
Assembler::emit()
and convert them as they can into compressed instructions - it should be because it is somewhat C-Ext's semantics and we cannot change instructions written by programmers explicitly one by one._nc
postfix of some of Assembler instructions: we know a bunch of places should be reserved for patching, where we cannot change them into compressed instructions._nc
is short fornot compressed
- with this, that instruction should keep its origin 4-byte form and remain uncompressed.MachBranchNode
s. Please see the comments in my code - but it seems no potential benefits for compressing theseMachBranchNode
s after we have done some work for this so we can directly disable compression of these instructions until we think of a better plan. We think it is not trivial to support this.This patch may not be a small one so it may take a while to get merged or something - but I was kind of hoping this could be done before the next merge, which contains the biased lock removal and stuff. Hope everything safe.
Thanks again for your great work. Xiaolin