Re: Base-less macros
On Nov 25, 2021, at 12:49:20, Steve Smith wrote: > > My suggestion of using R14 for the base was because it's already set by the > call to the subroutine. > RR15? (BALR 14,15) -- gil
Re: Base-less macros
I typically encapsulate such things in macros with a sensitivity to the architectural level. The downside is that it makes the macro more cluttered. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Jeremy Schwartz [115e2ee20c83-dmarc-requ...@listserv.uga.edu] Sent: Thursday, November 25, 2021 2:11 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Base-less macros Nice job and thanks for correction on branch to table. One thing to point out especially with mainframe assembly is just to be sure when generating instructions that the proper instruction facilities are installed other wise S0C1. Best regards, Jeremy From: IBM Mainframe Assembler List on behalf of Seymour J Metz Sent: Thursday, November 25, 2021 8:31 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Base-less macros CAUTION: This message was sent from outside the company. Do not click links or open attachments unless you recognize the sender and know the content is safe. It could be shorter, and B BRTAB(R15) is not baseless. How about CIJL R15,0,RC_MINUS CIJH R15,MAXRC,RC_GT_MAX LARL R14,BRTAN B 0(R14,R15) How does the performance compare using BCTR R14,0 rather than the LARL? It's shorter, but is a suppressed branch. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Jeremy Schwartz [115e2ee20c83-dmarc-requ...@listserv.uga.edu] Sent: Wednesday, November 24, 2021 8:44 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Base-less macros Here's another form of branch table combining compare and branches. Just thought it was interesting and one reason why I love assembler. So many possibilities. XR R0,R0 INCREMENT = 0 LR R1,R0 BCTR R1,0SET COMPARE = -1 JXLE R15,R0,LBL_RC_MINUS Label taken if <= -1 LA R1,MAX_RC SET COMPARE = MAX_RC JXH R15,R0,LBL_RC_GT_MAXLabel taken if > MAX_RC B BRTAB(R15) BRTAB DS 0H JLABEL_RC0 JLABEL_RC4 JLABEL_RC8 JLABEL_RC12 --- NOTICE: This email and all attachments are confidential, may be proprietary, and may be privileged or otherwise protected from disclosure. They are intended solely for the individual or entity to whom the email is addressed. However, mistakes sometimes happen in addressing emails. If you believe that you are not an intended recipient, please stop reading immediately. Do not copy, forward, or rely on the contents in any way. Notify the sender and/or Imperva, Inc. by telephone at +1 (650) 832-6006 and then delete or destroy any copy of this email and its attachments. The sender reserves and asserts all rights to confidentiality, as well as any privileges that may apply. Any disclosure, copying, distribution or action taken or omitted to be taken by an unintended recipient in reliance on this message is prohibited and may be unlawful. Please consider the environment before printing this email.
Re: Base-less macros
My suggestion of using R14 for the base was because it's already set by the call to the subroutine. sas On Thu, Nov 25, 2021 at 2:32 PM Gary Weinhold wrote: > The performance consideration I think would be the loading of R14 > immediately before its use in the branch instruction. Moving it up a > couple instructions may help. > >
Re: Base-less macros
The performance consideration I think would be the loading of R14 immediately before its use in the branch instruction. Moving it up a couple instructions may help. On 2021-11-25 2:11 p.m., Jeremy Schwartz wrote: Nice job and thanks for correction on branch to table. One thing to point out especially with mainframe assembly is just to be sure when generating instructions that the proper instruction facilities are installed other wise S0C1. Best regards, Jeremy Gary Weinhold Senior Application Architect DATAKINETICS | Data Performance & Optimization Phone:+1.613.523.5500 x216 Email: weinh...@dkl.com Visit us online at www.DKL.com E-mail Notification: The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system. From: IBM Mainframe Assembler List on behalf of Seymour J Metz Sent: Thursday, November 25, 2021 8:31 AM To:ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Base-less macros CAUTION: This message was sent from outside the company. Do not click links or open attachments unless you recognize the sender and know the content is safe. It could be shorter, and B BRTAB(R15) is not baseless. How about CIJL R15,0,RC_MINUS CIJH R15,MAXRC,RC_GT_MAX LARL R14,BRTAN B 0(R14,R15) How does the performance compare using BCTR R14,0 rather than the LARL? It's shorter, but is a suppressed branch. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Jeremy Schwartz [115e2ee20c83-dmarc-requ...@listserv.uga.edu] Sent: Wednesday, November 24, 2021 8:44 PM To:ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Base-less macros Here's another form of branch table combining compare and branches. Just thought it was interesting and one reason why I love assembler. So many possibilities. XR R0,R0 INCREMENT = 0 LR R1,R0 BCTR R1,0SET COMPARE = -1 JXLE R15,R0,LBL_RC_MINUS Label taken if <= -1 LA R1,MAX_RC SET COMPARE = MAX_RC JXH R15,R0,LBL_RC_GT_MAXLabel taken if > MAX_RC B BRTAB(R15) BRTAB DS 0H JLABEL_RC0 JLABEL_RC4 JLABEL_RC8 JLABEL_RC12 --- NOTICE: This email and all attachments are confidential, may be proprietary, and may be privileged or otherwise protected from disclosure. They are intended solely for the individual or entity to whom the email is addressed. However, mistakes sometimes happen in addressing emails. If you believe that you are not an intended recipient, please stop reading immediately. Do not copy, forward, or rely on the contents in any way. Notify the sender and/or Imperva, Inc. by telephone at +1 (650) 832-6006 and then delete or destroy any copy of this email and its attachments. The sender reserves and asserts all rights to confidentiality, as well as any privileges that may apply. Any disclosure, copying, distribution or action taken or omitted to be taken by an unintended recipient in reliance on this message is prohibited and may be unlawful. Please consider the environment before printing this email.
Re: Base-less macros
Nice job and thanks for correction on branch to table. One thing to point out especially with mainframe assembly is just to be sure when generating instructions that the proper instruction facilities are installed other wise S0C1. Best regards, Jeremy From: IBM Mainframe Assembler List on behalf of Seymour J Metz Sent: Thursday, November 25, 2021 8:31 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Base-less macros CAUTION: This message was sent from outside the company. Do not click links or open attachments unless you recognize the sender and know the content is safe. It could be shorter, and B BRTAB(R15) is not baseless. How about CIJL R15,0,RC_MINUS CIJH R15,MAXRC,RC_GT_MAX LARL R14,BRTAN B 0(R14,R15) How does the performance compare using BCTR R14,0 rather than the LARL? It's shorter, but is a suppressed branch. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Jeremy Schwartz [115e2ee20c83-dmarc-requ...@listserv.uga.edu] Sent: Wednesday, November 24, 2021 8:44 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Base-less macros Here's another form of branch table combining compare and branches. Just thought it was interesting and one reason why I love assembler. So many possibilities. XR R0,R0 INCREMENT = 0 LR R1,R0 BCTR R1,0SET COMPARE = -1 JXLE R15,R0,LBL_RC_MINUS Label taken if <= -1 LA R1,MAX_RC SET COMPARE = MAX_RC JXH R15,R0,LBL_RC_GT_MAXLabel taken if > MAX_RC B BRTAB(R15) BRTAB DS 0H JLABEL_RC0 JLABEL_RC4 JLABEL_RC8 JLABEL_RC12 --- NOTICE: This email and all attachments are confidential, may be proprietary, and may be privileged or otherwise protected from disclosure. They are intended solely for the individual or entity to whom the email is addressed. However, mistakes sometimes happen in addressing emails. If you believe that you are not an intended recipient, please stop reading immediately. Do not copy, forward, or rely on the contents in any way. Notify the sender and/or Imperva, Inc. by telephone at +1 (650) 832-6006 and then delete or destroy any copy of this email and its attachments. The sender reserves and asserts all rights to confidentiality, as well as any privileges that may apply. Any disclosure, copying, distribution or action taken or omitted to be taken by an unintended recipient in reliance on this message is prohibited and may be unlawful. Please consider the environment before printing this email.
Re: Base-less macros
> using BCTR R14,0 rather than the LARL? It's shorter, but is a suppressed branch. I think modern Z chips are smart enough to "know" that those ,0 branch instructions are always instruction-sequence no-ops. Charles -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Seymour J Metz Sent: Thursday, November 25, 2021 6:32 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Base-less macros It could be shorter, and B BRTAB(R15) is not baseless. How about CIJL R15,0,RC_MINUS CIJH R15,MAXRC,RC_GT_MAX LARL R14,BRTAN B 0(R14,R15) How does the performance compare using BCTR R14,0 rather than the LARL? It's shorter, but is a suppressed branch. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Jeremy Schwartz [115e2ee20c83-dmarc-requ...@listserv.uga.edu] Sent: Wednesday, November 24, 2021 8:44 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Base-less macros Here's another form of branch table combining compare and branches. Just thought it was interesting and one reason why I love assembler. So many possibilities. XR R0,R0 INCREMENT = 0 LR R1,R0 BCTR R1,0SET COMPARE = -1 JXLE R15,R0,LBL_RC_MINUS Label taken if <= -1 LA R1,MAX_RC SET COMPARE = MAX_RC JXH R15,R0,LBL_RC_GT_MAXLabel taken if > MAX_RC B BRTAB(R15) BRTAB DS 0H JLABEL_RC0 JLABEL_RC4 JLABEL_RC8 JLABEL_RC12
Re: Base-less macros
It could be shorter, and B BRTAB(R15) is not baseless. How about CIJL R15,0,RC_MINUS CIJH R15,MAXRC,RC_GT_MAX LARL R14,BRTAN B 0(R14,R15) How does the performance compare using BCTR R14,0 rather than the LARL? It's shorter, but is a suppressed branch. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Jeremy Schwartz [115e2ee20c83-dmarc-requ...@listserv.uga.edu] Sent: Wednesday, November 24, 2021 8:44 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Base-less macros Here's another form of branch table combining compare and branches. Just thought it was interesting and one reason why I love assembler. So many possibilities. XR R0,R0 INCREMENT = 0 LR R1,R0 BCTR R1,0SET COMPARE = -1 JXLE R15,R0,LBL_RC_MINUS Label taken if <= -1 LA R1,MAX_RC SET COMPARE = MAX_RC JXH R15,R0,LBL_RC_GT_MAXLabel taken if > MAX_RC B BRTAB(R15) BRTAB DS 0H JLABEL_RC0 JLABEL_RC4 JLABEL_RC8 JLABEL_RC12
Re: Curious compiler optimization
>At a minimum, there should be an option to say "Leave the asm alone" As I had written previously, there is a standards proposal to do just that. Peter Relson z/OS Core Technology Design