Re: Modifying the CC in the PSW

2023-08-11 Thread Jon Perryman
> David Eisenberg wrote: > I want to generate baseless code using as few instructions as possible, > Can my macro modify the resulting condition code? I'm horrified this was your solution especially considering all the other options available. 1. Regardless of programming language or

Re: Modifying the CC in the PSW

2023-08-11 Thread David Eisenberg
Jonathan, Thank you for that information! It's very helpful. David

Re: Modifying the CC in the PSW

2023-08-11 Thread Jonathan Scott
Any sequence of multiple instructions is almost certain to be slower than the original CLC which I assume would be comparing with a literal, especially if the macro expansion required a branch. For baseless code, I normally still have a base register for a static area containing literals and

Re: Modifying the CC in the PSW

2023-08-11 Thread David Eisenberg
>Are the Set/Insert Program Mask instructions useful for this?< Yes, that's in the code snippet I posted at the start of this thread... I'm wondering if there's an even more efficient way to do it. Perhaps not!

Re: Modifying the CC in the PSW

2023-08-11 Thread Paul Gilmartin
On 8/11/23 06:08:44, David Eisenberg wrote: ... I know that I can always code the comparands in the correct order by loading them into the high-halves of R0 and R1, then use CLHHR. Or, of course, I can generate a CLC with a literal. But I figured I’d ask: if I use CLHHSI, then (if the

Re: Modifying the CC in the PSW

2023-08-11 Thread Steve Smith
So, your macro doesn't know the condition. I was thinking of something like an IF macro. OK, some more unsolicited free advice (as usual maybe worth what you pay for it). I doubt that loading the operands into registers and comparing them there is going to be any faster than a CLC. It will

Re: Modifying the CC in the PSW

2023-08-11 Thread David Eisenberg
>I think it would much more straightforward to adjust the condition< Steve, I understand what you mean. My issue is that the macro is intended to replace pre-existing CLC instructions within legacy applications (the macro will examine and potentially modify the comparands prior to the

Re: Modifying the CC in the PSW

2023-08-11 Thread Steve Smith
I think it would much more straightforward to adjust the condition, i.e. when you need to reverse the specified operand order, you change JL to JNL, H to NH, NL to L, NH to H. Might be messy in the macro, but the executable part would be clean. For the record, I wouldn't go down this road at