Skip to content

Implement assembly for non-vector z16 instructions #512

Draft
abekornelis wants to merge 5 commits into
z390development:mainfrom
abekornelis:Issue504
Draft

Implement assembly for non-vector z16 instructions #512
abekornelis wants to merge 5 commits into
z390development:mainfrom
abekornelis:Issue504

Conversation

@abekornelis

@abekornelis abekornelis commented Jul 11, 2023

Copy link
Copy Markdown
Collaborator

This is an intermediate version - for now it just contains the results of the merge. There was a conflict with John's changes for issue #451
I am sharing this version to allow you all to double-check on the fp constants I definded in tz390

Comment thread src/az390.java Outdated
Comment thread src/az390.java Outdated
Comment on lines +2641 to +2643
if (bal_op.equals("NNPA")){ // DSH #414 z16
get_hex_zero(2);
} else if (bal_op.equals("PALB") // RPI 277

@jyganci jyganci Jul 11, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Couldn't this be simplified to

if (bal_op.equals("NNPA")){ // DSH #414 z16
    ||  (bal_op.equals("PALB") // RPI 277```

That is, in pseudocode, "if ("NNPA" or "PALB" or "PCKMO" or "PCC") then get_gex_zero(2)"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. Changed as per your suggestion.

Comment thread src/az390.java
skip_comma();
get_hex_reg(); // M4
} else {
if ((tz390.op_code[bal_op_index].length() == 5)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might want to add a comment explaining what's being checked here. Not at all clear to me.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. Pretty convoluted code. PoP says masks are specified as M6,M5,M4 which is at odds with the comments.
It look like the program is testing the mask operands one by one, but M6 and M5 are obligatory. Or do they default to zero when omitted? I tried to understand in order to add comments - but I'm worried I'd get it wrong.

Comment thread src/az390.java Outdated
Comment on lines +11025 to +11032
} else if (fp_text.toUpperCase().equals("(INF)")){ // #423
switch (tz390.fp_type){ // gen (min) hex for tz390.fp_type
case 0: // tz390.fp_db_type s1,e11,m52 with assumed 1
dc_hex = "7FF0000000000000";
break;
case 1: // tz390.fp_dd_type s1,cf5,bxcf8,ccf50
dc_hex = "EEEEEEEEEEEEEEEE";
break;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Following comment copied from what I added back in August 2022 to Don's initial PR. Also, read my other comments in that PR.

  1. INF, NAN, QNAN, and SNAN only apply to binary and decimal floating point. See the HLASM Language Reference manual; p156 of the -9 version. It also shows that DMIN is another special value. MAX, MIN and DMIN apply to all 3 floating point types. The az390 code does NOT implement "(DMIN)". Should it?
  2. Why all the "EEE...EEE" values? Why not the correct values? John Ehrman's assembler text has tables that show the exact values. For example, the value for INF for DD is "7800000000000000". See Table 325 in Section 33.5 of the book for all the DFP values. See Table 276 of Section 34.2 for BFP values. See Table 238 in Section 33.4.2 for the MAX, MIN and DMIN values for HFP. Note there are no HFP INF, NAN, QNAN or SNAN values.
  3. Unrelated, but some of the MIN values for HFP are incorrect and the MIN values for DFP appear to be DMIN values. Please doublecheck all values against the tables mentioned above.
  4. Not sure why you added INF,NAN, QNAN and SNAN for HFP. Shouldn't these generate assembly errors?
  5. You should replace eachl "EEE...EEE" value with the corresponding correct value.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed on all 5 points.
I think I have addressed all of them.

@jyganci jyganci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

While I am approving this, I strongly disagree with the quantity of lines changed/added. Much too many for one PR. I only did a cursory look at your changes. Did not verify that you correctly copied FP constants from Ehrman's book or PofOp.

@abekornelis
abekornelis marked this pull request as draft April 1, 2025 10:18
@abekornelis abekornelis self-assigned this Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create assembly support for new non-vector z16 instructions Add missing BFP constants

2 participants