Skip to content
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

Fix S390 opcode properties #6447

Merged
merged 1 commit into from
Jun 22, 2022
Merged

Conversation

Spencer-Comin
Copy link
Contributor

I found some s390 opcodes that had incorrect and/or missing properties when comparing with documentation.

Missing properties

IsRegCopy
  • LOAD (short) (LER)
  • LOAD (long) (LDR)
  • LOAD (extended) (LXR)
ImplicitlyUsesGPR0
  • PERFORM RANDOM NUMBER OPERATION (PRNO)
SetsOperand2
  • COMPARE DOUBLE AND SWAP (32) (CDS)
  • COMPARE AND SWAP (32) (CS)
  • STORE ACCESS MULTIPLE (STAM)
  • STORE CHARACTERS UNDER MASK (low) (STCM)
  • STORE CONTROL (32) (STCTL)
  • STORE MULTIPLE (32) (STM)
  • COMPARE DOUBLE AND SWAP (64) (CDSG)
  • COMPARE DOUBLE AND SWAP (32) (CDSY)
  • COMPARE AND SWAP (64) (CSG)
  • COMPARE AND SWAP (32) (CSY)
  • STORE ACCESS MULTIPLE (STAMY)
  • STORE CHARACTERS UNDER MASK (high) (STCMH)
  • STORE CHARACTERS UNDER MASK (low) (STCMY)
  • STORE CONTROL (64) (STCTG)
  • STORE MULTIPLE (64) (STMG)
  • STORE MULTIPLE HIGH (32) (STMH)
  • STORE MULTIPLE (32) (STMY)
UsesM3
  • LOAD ROUNDED (long to short DFP) (LEDTR)
  • LOAD ROUNDED (extended to long DFP) (LDXTR)
  • VECTOR LOAD (VL)
  • VECTOR STORE (VST)
  • CONVERT FROM LOGICAL (64 to short BFP) (CELGBR)
  • CONVERT FROM LOGICAL (32 to short BFP) (CELFBR)
  • CONVERT FROM LOGICAL (64 to long BFP) (CDLGBR)
  • CONVERT FROM LOGICAL (32 to long BFP) (CDLFBR)
SingleFP
  • CONVERT FROM LOGICAL (64 to short BFP) (CELGBR)
  • STORE (short) (STE)
  • STORE (short) (STEY)
UsesM4
  • CONVERT FROM LOGICAL (64 to short BFP) (CELGBR)
  • CONVERT FROM LOGICAL (32 to short BFP) (CELFBR)
  • CONVERT FROM LOGICAL (64 to long BFP) (CDLGBR)
  • CONVERT FROM LOGICAL (32 to long BFP) (CDLFBR)
UsesRegPairForSource
  • STORE PAIR TO QUADWORD (STPQ)
DoubleFP
  • STORE (long) (STD)
  • STORE (long) (STDY)

Incorrect properties

SetsOperand3
  • COMPARE DOUBLE AND SWAP (32) CDS
  • COMPARE AND SWAP (32) CS
  • STORE ACCESS MULTIPLE STAM
  • STORE CHARACTERS UNDER MASK (low) STCM
  • STORE CONTROL (32) STCTL
  • STORE MULTIPLE (32) STM
  • COMPARE DOUBLE AND SWAP (64) CDSG
  • COMPARE DOUBLE AND SWAP (32) CDSY
  • COMPARE AND SWAP (64) CSG
  • COMPARE AND SWAP (32) CSY
  • STORE ACCESS MULTIPLE STAMY
  • STORE CHARACTERS UNDER MASK (high) STCMH
  • STORE CHARACTERS UNDER MASK (low) STCMY
  • STORE CONTROL (64) STCTG
  • STORE MULTIPLE (64) STMG
  • STORE MULTIPLE HIGH (32) STMH
  • STORE MULTIPLE (32) STMY
UsesRegPairForTarget
  • STORE PAIR TO QUADWORD STPQ
SingleFP
  • STORE (long) STD
DoubleFP
  • STORE (short) STE

Closes: #6155
Signed-off-by: Spencer Comin spencer.comin@ibm.com

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for supporting the project, and congratulations on your first contribution! A project committer will shortly review your contribution. In the mean time, if you haven't had a chance please skim over the contribution guidelines which all pull requests must adhere to. If the ECA pull request check fails, have a look at the instructions for signing the ECA in the legal considerations section.

If you run into any problems our community will be happy to assist you in any way we can. There are a number of recommended ways to interact with the community. We encourage you to ask questions, or drop by to say hello.

@Spencer-Comin
Copy link
Contributor Author

A bit of context on how these properties are used, from what I've found looking through the codebase:

@0xdaryl
Copy link
Contributor

0xdaryl commented Jun 17, 2022

@r30shah : please review

@0xdaryl 0xdaryl self-assigned this Jun 17, 2022
@@ -5670,7 +5673,7 @@
/* .minimumALS = */ OMR_PROCESSOR_S390_Z900,
/* .properties = */ S390OpProp_IsStore |
S390OpProp_LongDispSupported |
S390OpProp_SetsOperand3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am bit curious how this flag is used in the binary encoding. As bunch of places, you replaced setsOperand3 does not even use that when instruction was constructed.
Looking at one of the constructor for RSInstruction [1], previously it was setting lreg as source register, but with this change, it will set it as target Register.

[1].

if (getOpCode().setsOperand2())
useTargetRegister(lreg);
else
useSourceRegister(lreg);

@r30shah
Copy link
Contributor

r30shah commented Jun 21, 2022

Jenkins build zos,zlinux

Closes: eclipse#6155
Signed-off-by: Spencer Comin <spencer.comin@ibm.com>
Copy link
Contributor

@r30shah r30shah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did have incorrectly tagged properties on some of the instructions. Thanks a lot @Spencer-Comin for taking time and correcting them. Changes looks good to me.
Given that jenkins build on the PR for zLinux and z/OS passed and knowing that Spencer has put his changes through sufficient internal testing through personal builds on z/OS and LoZ, @0xdaryl Can I request you to merge this changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix s390 opcode properties
3 participants