Search

KR-20260064740-A - Instructions with sign preservation control

KR20260064740AKR 20260064740 AKR20260064740 AKR 20260064740AKR-20260064740-A

Abstract

An instruction is executed to obtain a result including an output value and a result code. At least one operation is performed on at least a portion of a source value to provide an output value. The source value is located at a source position that includes a source position for containing the source value and a source code position for containing the code code of the source value. One or more controls of the instruction, including a code preservation control, are checked to determine the result code. At least, based on the value of the code preservation control being set to Enable, the result code is an unmodified code code at the source code position. The unmodified code code is provided as the result code. A result including an output value and a result code is provided.

Inventors

  • 레버 페트라
  • 슐름 케르스틴
  • 클라인 마이클
  • 바그너 안드레아스
  • 코플랜드 리드
  • 구오 신
  • 브래드버리 조나단
  • 슬리겔 티모시
  • 지아메이 브루스

Assignees

  • 인터내셔널 비지네스 머신즈 코포레이션

Dates

Publication Date
20260507
Application Date
20250407
Priority Date
20240422

Claims (20)

  1. In computer program products, A set of one or more computer-readable storage media; and Program instructions collectively stored in a set of one or more computer-readable storage media for enabling at least one computing device to perform computer operations ...including, and the computer operations include executing said instruction to obtain the result of said instruction, said result includes an output value and a result code, and executing said instruction is: Performing at least one operation on at least a portion of a source value to provide an output value of the above result - said source value is located at a source location, said source location includes a source position for containing said source value and a source code position for containing a code code of said source value - ; Checking one or more controls of the above instruction to be used to determine the above result sign code - one or more controls of the above instruction include a sign preservation control - ; Determining that the result code is a code code in the source code position of the source location that has not been modified, based on the fact that at least the value of the code preservation control is set to be enabled; Providing the unmodified code code at the source code position of the source location as the result code code; and Providing the result including the output value and the result code. A computer program product that includes
  2. In paragraph 1, A computer program product in which providing the unmodified code code at the source code position of the source location as the result code code includes copying a plurality of digits at the source code position of the source location as the result code code.
  3. In paragraph 1 or 2, A computer program product in which the plurality of digits above include a plurality of binary digits copied from the source code position of the source location, regardless of the code code and regardless of the validity of the code code.
  4. In any one of paragraphs 1 through 3, A computer program product wherein at least one operation comprises a shift operation in which a selected portion of the source value is placed in one portion of the output value of the result.
  5. In any one of paragraphs 1 through 4, A computer program product that, based on the above shift operation, is truncated in that other parts of the source value are missing from the output value.
  6. In any one of paragraphs 1 through 5, A computer program product wherein at least one operation further comprises a truncation operation in which another part of the source value is omitted from the output value and another part of the output value is set to a selected value.
  7. In any one of paragraphs 1 through 6, A computer program product wherein a selected portion of the source value is the rightmost digits of a specified number of the source value, the shift operation comprises placing the rightmost digits of a specified number of the source value into one portion of the output value, the truncation operation comprises setting the digits of another portion of the output value to zero, and the output value of the result comprises the rightmost digits of a specified number of the source value and the other digits set to zero.
  8. In any one of paragraphs 1 through 7, A computer program product, wherein providing the above result includes providing the above output value and the above result code at a target location, and the target location includes a target position for including the above output value and a target code position for including the above result code.
  9. In any one of paragraphs 1 through 8, A computer program product wherein the source location is at least one register and the target location is at least one other register.
  10. In any one of paragraphs 1 through 9, A computer program product wherein one or more controls of the above instructions further include a code operation control, and checking one or more controls of the above instructions includes checking the code operation value of the code preservation control and the code operation control to determine that the result code is the unmodified code at the source code position of the source location.
  11. In any one of paragraphs 1 through 10, A computer program product in which the above-mentioned sign operation value is a maintenance operation.
  12. In any one of paragraphs 1 through 11, A computer program product wherein the above computer operations further include executing another instance of the above instruction, and checking one or more controls of the above instruction based on the execution of another instance of the above instruction and the setting that the value of the sign preservation control is not enabled, includes checking a plurality of controls of the above instruction to be used to determine the result sign code.
  13. In any one of paragraphs 1 through 12, A computer program product wherein the plurality of controls of the above instructions include a code operation control used to indicate a code operation value to be used to determine a result code code, a positive code code control used to indicate a selected code code to be used to indicate a positive code, and a negative zero control used to indicate whether a negative zero result is allowed.
  14. In computer systems, At least one computing device; A set of one or more computer-readable storage media; and Program instructions collectively stored in a set of one or more computer-readable storage media for enabling the at least one computing device to perform computer operations ...including, and the computer operations include executing said instruction to obtain the result of said instruction, said result includes an output value and a result code, and executing said instruction is: Performing at least one operation on at least a portion of a source value to provide an output value of the above result - said source value is located at a source location, said source location includes a source position for containing said source value and a source code position for containing a code code of said source value - ; Checking one or more controls of the above instruction to be used to determine the above result sign code - one or more controls of the above instruction include a sign preservation control - ; Determining that the result code is a code code in the source code position of the source location that has not been modified, based on the fact that at least the value of the code preservation control is set to be enabled; Providing the unmodified code code at the source code position of the source location as the result code code; and Providing the result including the output value and the result code. A computer system that includes
  15. In Paragraph 14, A computer system wherein at least one operation comprises a shift operation in which a selected portion of the source value is placed in one portion of the output value of the result, and a truncation operation in which another portion of the source value is omitted from the output value and another portion of the output value is set to the selected value.
  16. In paragraph 14 or 15, A computer system wherein providing the above result includes providing the output value and the result code at a target location, wherein the target location includes a target position including the output value and a target code position including the result code, wherein the source location is at least one register and the target location is at least one other register.
  17. In any one of paragraphs 14 through 16, A computer system wherein one or more controls of the above instruction further include a code operation control, and checking one or more controls of the above instruction includes checking the code operation value of the code preservation control and the code operation control to determine that the result code is the unmodified code at the source code position of the source location.
  18. In terms of computer implementation methods, Step of executing the above command to obtain the result of the command The step of executing the command includes: the result including an output value and a result code, and the result including the result code. A step of performing at least one operation on at least a portion of a source value to provide an output value of the above result - said source value is located at a source location, said source location includes a source position for including said source value and a source code position for including a code code of said source value - ; A step of checking one or more controls of the above instruction to be used to determine the above result sign code - one or more controls of the above instruction include a sign preservation control - ; A step of determining that the result code is a code code in the source code position of the source location that has not been modified, based on the fact that at least the value of the code preservation control is set to be enabled; The step of providing the unmodified code code at the source code position of the source location as the result code code; and Step of providing the result including the output value and the result code A computer implementation method that includes
  19. In Paragraph 18, A computer-implemented method wherein at least one operation comprises a shift operation in which a selected portion of the source value is placed in one portion of the output value of the result, and a truncation operation in which another portion of the source value is omitted from the output value and another portion of the output value is set to the selected value.
  20. In paragraph 18 or 19, A computer implementation method wherein the step of providing the above result includes the step of providing the output value and the result code to a target location, wherein the target location includes a target position including the output value and a target code position including the result code, and wherein the source location is at least one register and the target location is at least one other register.

Description

Instructions with sign preservation control One or more aspects generally relate to facilitating processing within a computing environment, particularly improving processing within a computing environment. Computer programs running within a computing environment perform operations on data. Data may be one of several formats. For example, data may be a signed packed decimal format. In this format, each digit of a decimal number (e.g., 0-9) is encoded as a binary value and stored in a nibble (e.g., 4 bits) of a byte (e.g., 8 bits). The sign of the decimal number, if present, is stored, for example, in the rightmost nibble of the rightmost byte of the representation. The sign may be encoded as a binary representation of A-F, and multiple codes may be used to represent positive or negative. For example, positive may be represented as A, C, F, and negative may be represented as B, D; other examples are possible. Additionally, there may be default encodings for positive and/or negative. Operations that may be performed on data such as signed packed decimal numbers or other data include computational operations as well as operations to move or copy data from a source to a target location. In the case of move or copy operations, the target location may be the same size as the source location, smaller than the source location (truncating move/copy), or larger than the source location (widening move/copy). Move and truncate (or copy and truncate) operations may be performed to ignore/remove unnecessary digits of the decimal value that provides the result, which may have a sign. To perform move or copy (and truncation) operations, computer programming languages such as COBOL use general-purpose instructions, such as move characters and logical AND instructions, to move or copy digits and truncate unnecessary digits. These general-purpose instructions are in-memory instructions that require the use of memory when performing operations. Improvements to instructions for operating on data, including instructions for operating on signed data, are sought to improve processing within a computing environment. The disadvantages of the prior art are overcome, and additional advantages are provided through the provision of a computer program product. The computer program product comprises a set of one or more computer-readable storage media and program instructions collectively stored in the set of one or more computer-readable storage media to enable at least one computing device to perform computer operations, including executing an instruction to obtain a result of an instruction including an output value and a result code. The step of executing an instruction includes the step of performing at least one operation on at least a portion of a source value to provide an output value of the result. The source value is located at a source location, and the source location includes a source location containing the source value and a source code location containing the code of the source value. One or more controls of the instruction are checked to be used to determine the result code. One or more controls of the instruction include a preserve sign control. At least, based on the value of the preserve sign control being set to enable, the result code is determined to be the code at the source code position of the unmodified source location. The unmodified code at the source code position of the source location is provided as the result code. A result including an output value and a result code is provided. In one aspect, a computer program product is provided. The computer program product includes a set of one or more computer-readable storage media and program instructions collectively stored in the set of one or more computer-readable storage media to enable at least one computing device to perform computer operations, including executing an instruction to perform one or more operations on a source value contained in at least one source register using one or more fields of the instruction. The source value includes a plurality of digits in the source digit position of at least one source register and a code in the source code position of at least one source register. The step of executing the instruction includes placing a specified number of digits among the plurality of digits in the source digit position of at least one source register into the target digit position of at least one target register, and setting one or more other digits within the target digit position to a selected value. A result code to be placed in the target code position of at least one target register is determined. The step of determining includes checking one or more controls of the instruction to be used to determine the result code. One or more controls of the instruction include a sign preservation control, and based on the fact that the value of at least one sign preservation control is set to be enabled, the resulting sign code placed at the target