This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).
We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:
Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,
Post an idea.
Get feedback from the IBM team and other customers to refine your idea.
Follow the idea through the IBM Ideas process.
Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.
IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.
ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.
IBM does not intend to provide a solution to this request at this time, so it is being closed.
While the suggested RPG built-in functions might be useful for some applications, it is unlikely that they would have broad appeal to RPG programmers in general. And as indicated in the comments, it is possible to write procedures to handle these shift operations.
The CEAC has reviewed this requirement and recommends that IBM view this as a MEDIUM priority requirement that should be addressed.
Background: The COMMON Europe Advisory Council (CEAC) members have a broad range of experience in working with small and medium-sized IBM i customers. CEAC has a crucial role in working with IBM i development to help assess the value and impact of individual RFEs on the broader IBM i community and has therefore reviewed your RFE.
To find out how CEAC help to shape the future of IBM i, see CEAC @ ibm.biz/BdYSYj and the article "The Five Hottest IBM i RFEs Of The Quarter" at ibm.biz/BdYSZT
Therese Eaton – CEAC Programme Manager, IBM
I agree that adding the prefix "BIT" would make the naming consistent with the bit operations we have now.
Good point.
Of course I know that it can be coded using power of two. One of the reasons I set priority to low.
But this is more ineffective compared to using an MI instruction for the same purpose.
Your shift operations can be implemented by multiply and divide with a power of two. However it will be more clear to have it in RPG as directly build in, so I support your RFE.
Perhaps it would be even more clear if your functions was prefixed by BIT as i.e BITXOR, BITAND, BITAND so it will be
%BITSHL()
%BITSHR()
%BITSHLA()
%BITSHRA()
%BITROL()
%BITROR()
to complete the list of bitwise operations.
As stated in your links... this is nothing more that multiplying/dividing by a power of 2.
Shift left 3 bits.... uint2 = uint1 * (2 ** bitstoshiftleft);
If you wish a procedure... unit2 = ShiftLeft(uint1: 3);
Dcl-Proc ShiftLeft;
Dcl-Pi *N Uns(20);
uInt Uns(20) Const;
bits Uns(10) Const;
End-Pi;
Return uInt * (2 ** bits);
End-Proc;
... and your MI code will even be better/faster.