/* BEGIN INCLUDE FILE - dm_comp_vec_str_proc.incl.pl1 */ /****^ HISTORY COMMENTS: 1) change(87-05-06,Dupuis), approve(87-05-29,MCR7695), audit(87-06-02,Blair), install(87-07-17,MR12.1-1042): Added a check to determine if the values were aligned correctly before doing the comparisons. Although the calling program was supposed to take care of alignment, this wasn't always the case (phx20843). This check can be taken out in the future (for performance reasons) once we know we are bug free. END HISTORY COMMENTS */ /* DESCRIPTION: This internal routine is contained in an include file so that critical execution paths may save the time that would have been spent on the overhead of making an external call. The time to execute this routine is very small, much less than the time required in making an external call and setting up an argument list. Modules which include this routine must follow strict guidelines in the naming of certain variables, as this internal routine assumes the caller has global variables set up so as to simulate the calling sequence: call COMPARE_VALUES_INTERNAL_PROC (cv_p_descriptor_ptr, cv_p_vector_value_ptr, cv_p_field_value_ptr, cv_p_field_value_length, cv_p_vector_equal_to_key, cv_p_vector_less_than_key, cv_p_code); These variables must be declared in the calling routine as described under Parameters. This routine compares two values and returns information about whether the first is less than, equal to, or greater than, the second. Both values must be of the same data-type, however the storage conventions for varying string data for the second value are slightly different from the Multics standard format. This difference consists solely in that the length of the varying string is not stored as the initial piece of information in the string. The length of varying string values in fields is passed in as a parameter. The first value is referred to as the "vector" value, since it usually is the value of a dimension of a typed_vector. The second value is referred to as the "field" value, since it is usually the value of a field of a key. If cv_p_vector_value_is_in_field_format is OFF, the vector value is in the Multics standard format; if ON, the vector value is in same format as the field value. The field value format is the format described above. */ /* HISTORY: Written by Matthew Pierret, 04/18/84. (Extracted from dmu_compare_values.pl1) Modified: 05/14/84 by Matthew Pierret: Changed to assume that values in field format are properly aligned. 12/07/84 by M. Sharpe: to correct format and dcls. */ /* format: style2,ind3 */ %page; COMPARE_VALUES: proc (cv_p_vector_value_is_in_field_format); /* START OF DECLARATIONS */ /* Parameter */ dcl cv_p_vector_value_is_in_field_format bit (1) aligned; /* The following must be declared in the calling routine: dcl cv_p_descriptor_ptr /* points to the descriptor for ptr; /* the vector/field value dcl cv_p_vector_value_ptr ptr; /* points to the vector value dcl cv_p_vector_value_length fixed bin (35); /* length of vector value in bits dcl cv_p_field_value_ptr ptr; /* points to the field value dcl cv_p_field_value_length fixed bin (35); /* length of field value in bits dcl cv_p_vector_equal_to_key bit (1) aligned; /* is set by this routine to ON /* if the values are equal dcl cv_p_vector_less_than_key bit (1) aligned; /* is set by this routine to ON /* if the vector value is less /* than the field value. dcl cv_p_code fixed bin (35); */ /* Automatic */ dcl cv_local_vector_real_fix_bin_1 fixed bin (35) aligned; dcl cv_local_field_real_fix_bin_1 fixed bin (35) aligned; dcl cv_local_vector_real_fix_bin_2 fixed bin (71) aligned; dcl cv_local_field_real_fix_bin_2 fixed bin (71) aligned; dcl cv_local_vector_real_flt_bin_1 float bin (27) aligned; dcl cv_local_field_real_flt_bin_1 float bin (27) aligned; dcl cv_local_vector_real_flt_bin_2 float bin (63) aligned; dcl cv_local_field_real_flt_bin_2 float bin (63) aligned; dcl cv_local_vector_real_fix_bin_1_uns fixed bin (35) aligned unsigned; dcl cv_local_field_real_fix_bin_1_uns fixed bin (35) aligned unsigned; dcl cv_local_vector_real_fix_bin_2_uns fixed bin (71) aligned unsigned; dcl cv_local_field_real_fix_bin_2_uns fixed bin (71) aligned unsigned; dcl (cv_vector_real_part_value_ptr, cv_vector_imaginary_part_value_ptr, cv_field_real_part_value_ptr, cv_field_imaginary_part_value_ptr) ptr init (null); dcl 1 cv_local_arg_descriptor like arg_descriptor; dcl 1 cv_local_fixed_arg_descriptor like fixed_arg_descriptor; /* Based */ dcl cv_bit_string bit (sys_info$max_seg_size * 36) based; dcl cv_char_string char (sys_info$max_seg_size * 4) based; dcl cv_based_real_fix_bin_1a fixed bin (35) based aligned; dcl cv_based_real_fix_bin_2a fixed bin (71) based aligned; dcl cv_based_real_fix_bin_1u fixed bin (35) based unaligned; dcl cv_based_real_fix_bin_2u fixed bin (71) based unaligned; dcl cv_based_real_flt_bin_1a float bin (27) based aligned; dcl cv_based_real_flt_bin_2a float bin (63) based aligned; dcl cv_based_real_flt_bin_1u float bin (27) based unaligned; dcl cv_based_real_flt_bin_2u float bin (63) based unaligned; dcl cv_based_real_fix_bin_1_unsa fixed bin (35) based aligned unsigned; dcl cv_based_real_fix_bin_2_unsa fixed bin (71) based aligned unsigned; dcl cv_based_real_fix_bin_1_unsu fixed bin (35) based unaligned unsigned; dcl cv_based_real_fix_bin_2_unsu fixed bin (71) based unaligned unsigned; /* Builtin */ dcl (addbitno, addcharno, ceil, copy, substr, null, unspec) builtin; /* Constant */ dcl myname init ("dmu_compare_values") char (32) varying internal static options (constant); dcl ( BITS_PER_WORD init (36), BYTES_PER_WORD init (4), BITS_PER_EXPONENT init (8), BIT4_DECIMAL_EXPONENT init (2), BIT9_DECIMAL_EXPONENT init (1), SIGN init (1), DEFAULT_LENGTH init (-1), HIGHEST_SUPPORTED_DATA_TYPE init (44) ) fixed bin (17) internal static options (constant); dcl NEED_TO_CHECK_FOR_ALIGNMENT (46) bit (1) internal static options (constant) init ( "1"b, "1"b, "1"b, "1"b, "1"b, "1"b, "1"b, "1"b, "1"b, "1"b, "1"b, "1"b, /* 1 to 12 */ "0"b, "0"b, "0"b, "0"b, "0"b, "0"b, "0"b, /* 13 to 19 */ "0"b, "0"b, "0"b, "0"b, "0"b, "0"b, "0"b, "0"b, "0"b, "0"b, "0"b, "0"b, "0"b, /* 20 to 32 */ "1"b, "1"b, /* 33 to 34 */ "0"b, "0"b, "0"b, "0"b, "0"b, "0"b, "0"b, "0"b, /* 35 to 42 */ "1"b, "1"b, "1"b, "1"b /* 43 to 46 */); dcl REQUIRED_ALIGNMENT (46) fixed bin internal static options (constant) init ( 36, 72, 36, 72, 72, 72, 72, 72, 36, 36, 36, 36, /* 1 to 12 */ 0, 0, 0, 0, 0, 0, 0, /* 13 to 19 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 20 to 32 */ 36, 72, /* 33 to 34 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 35 to 42 */ 36, 36, 36, 36 ); /* 43 to 46 */ /* Entry */ dcl dmu_compare_values entry (ptr, ptr, ptr, fixed bin (35), bit (1) aligned, bit (1) aligned, fixed bin (35)); dcl dmu_compare_decimal_values$dmu_compare_dec9ls entry (fixed bin (17), ptr, ptr, bit (1) aligned, bit (1) aligned); dcl dmu_compare_decimal_values$dmu_compare_dec9fl entry (fixed bin (17), ptr, ptr, bit (1) aligned, bit (1) aligned); dcl dmu_compare_decimal_values$dmu_compare_dec4fl entry (fixed bin (17), ptr, ptr, bit (1) aligned, bit (1) aligned); dcl dmu_compare_decimal_values$dmu_compare_dec4ls entry (fixed bin (17), ptr, ptr, bit (1) aligned, bit (1) aligned); dcl sub_err_ entry () options (variable); /* External */ dcl sys_info$max_seg_size fixed bin (35) ext static; dcl error_table_$bad_arg fixed bin (35) ext; dcl dm_error_$unimplemented_data_type fixed bin (35) ext; /* END OF DECLARATIONS */ cv_p_code = 0; arg_descriptor_ptr = cv_p_descriptor_ptr; if arg_descriptor.type < 1 | arg_descriptor.type > HIGHEST_SUPPORTED_DATA_TYPE then call sub_err_ (error_table_$bad_arg, myname, ACTION_CANT_RESTART, null, 0, "^/The caller-provided descriptor has an invalid type, ^d. Valid types are between 1 and ^d.", arg_descriptor.type, HIGHEST_SUPPORTED_DATA_TYPE); if ^arg_descriptor.packed & NEED_TO_CHECK_FOR_ALIGNMENT (arg_descriptor.type) then if mod (bitno (cv_p_vector_value_ptr), REQUIRED_ALIGNMENT (arg_descriptor.type)) ^= 0 then call sub_err_ (error_table_$bad_arg, myname, ACTION_CANT_RESTART, null, 0, "^/The vector_value pointer (^p) has an invalid alignment.^/It's address should have been divisible by ^d.", cv_p_vector_value_ptr, REQUIRED_ALIGNMENT (arg_descriptor.type)); else if mod (bitno (cv_p_field_value_ptr), REQUIRED_ALIGNMENT (arg_descriptor.type)) ^= 0 then call sub_err_ (error_table_$bad_arg, myname, ACTION_CANT_RESTART, null, 0, "^/The field_value pointer (^p) has an invalid alignment.^/It's address should have been divisible by ^d.", cv_p_field_value_ptr, REQUIRED_ALIGNMENT (arg_descriptor.type)); goto CV_TYPE (arg_descriptor.type); CV_TYPE (1): /* real_fix_bin_1 (short) */ if arg_descriptor.packed then do; if substr (cv_p_vector_value_ptr -> cv_bit_string, 1, 1) then unspec (cv_local_vector_real_fix_bin_1) = copy ("1"b, BITS_PER_WORD - fixed_arg_descriptor.precision) || substr (cv_p_vector_value_ptr -> cv_bit_string, 2, fixed_arg_descriptor.precision); else unspec (cv_local_vector_real_fix_bin_1) = copy ("0"b, BITS_PER_WORD - fixed_arg_descriptor.precision) || substr (cv_p_vector_value_ptr -> cv_bit_string, 2, fixed_arg_descriptor.precision); if substr (cv_p_field_value_ptr -> cv_bit_string, 1, 1) then unspec (cv_local_field_real_fix_bin_1) = copy ("1"b, BITS_PER_WORD - fixed_arg_descriptor.precision) || substr (cv_p_field_value_ptr -> cv_bit_string, 2, fixed_arg_descriptor.precision); else unspec (cv_local_field_real_fix_bin_1) = copy ("0"b, BITS_PER_WORD - fixed_arg_descriptor.precision) || substr (cv_p_field_value_ptr -> cv_bit_string, 2, fixed_arg_descriptor.precision); if cv_local_vector_real_fix_bin_1 = cv_local_field_real_fix_bin_1 then goto CV_RETURN_EQUAL; else if cv_local_vector_real_fix_bin_1 < cv_local_field_real_fix_bin_1 then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; end; else if cv_p_vector_value_ptr -> cv_based_real_fix_bin_1a = cv_p_field_value_ptr -> cv_based_real_fix_bin_1a then goto CV_RETURN_EQUAL; else if cv_p_vector_value_ptr -> cv_based_real_fix_bin_1a < cv_p_field_value_ptr -> cv_based_real_fix_bin_1a then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; CV_TYPE (2): /* real_fix_bin_2 (long) */ if arg_descriptor.packed then do; if substr (cv_p_vector_value_ptr -> cv_bit_string, 1, 1) then unspec (cv_local_vector_real_fix_bin_2) = copy ("1"b, 2 * BITS_PER_WORD - fixed_arg_descriptor.precision) || substr (cv_p_vector_value_ptr -> cv_bit_string, 2, fixed_arg_descriptor.precision); else unspec (cv_local_vector_real_fix_bin_2) = copy ("0"b, 2 * BITS_PER_WORD - fixed_arg_descriptor.precision) || substr (cv_p_vector_value_ptr -> cv_bit_string, 2, fixed_arg_descriptor.precision); if substr (cv_p_field_value_ptr -> cv_bit_string, 1, 1) then unspec (cv_local_field_real_fix_bin_2) = copy ("1"b, 2 * BITS_PER_WORD - fixed_arg_descriptor.precision) || substr (cv_p_field_value_ptr -> cv_bit_string, 2, fixed_arg_descriptor.precision); else unspec (cv_local_field_real_fix_bin_2) = copy ("0"b, 2 * BITS_PER_WORD - fixed_arg_descriptor.precision) || substr (cv_p_field_value_ptr -> cv_bit_string, 2, fixed_arg_descriptor.precision); if cv_local_vector_real_fix_bin_2 = cv_local_field_real_fix_bin_2 then goto CV_RETURN_EQUAL; else if cv_local_vector_real_fix_bin_2 < cv_local_field_real_fix_bin_2 then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; end; else if cv_p_vector_value_ptr -> cv_based_real_fix_bin_2a = cv_p_field_value_ptr -> cv_based_real_fix_bin_2a then goto CV_RETURN_EQUAL; else if cv_p_vector_value_ptr -> cv_based_real_fix_bin_2a < cv_p_field_value_ptr -> cv_based_real_fix_bin_2a then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; CV_TYPE (3): /* real_flt_bin_1 (short) */ if arg_descriptor.packed then do; unspec (cv_local_vector_real_flt_bin_1) = substr (cv_p_vector_value_ptr -> cv_bit_string, 1, BITS_PER_EXPONENT + SIGN + arg_descriptor.size) || copy ("0"b, (BITS_PER_WORD - (BITS_PER_EXPONENT + arg_descriptor.size + SIGN))); unspec (cv_local_field_real_flt_bin_1) = substr (cv_p_field_value_ptr -> cv_bit_string, 1, BITS_PER_EXPONENT + SIGN + arg_descriptor.size) || copy ("0"b, (BITS_PER_WORD - (BITS_PER_EXPONENT + arg_descriptor.size + SIGN))); if cv_local_vector_real_flt_bin_1 = cv_local_field_real_flt_bin_1 then goto CV_RETURN_EQUAL; else if cv_local_vector_real_flt_bin_1 < cv_local_field_real_flt_bin_1 then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; end; else if cv_p_vector_value_ptr -> cv_based_real_flt_bin_1a = cv_p_field_value_ptr -> cv_based_real_flt_bin_1a then goto CV_RETURN_EQUAL; else if cv_p_vector_value_ptr -> cv_based_real_flt_bin_1a < cv_p_field_value_ptr -> cv_based_real_flt_bin_1a then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; CV_TYPE (4): /* real_flt_bin_2 (long) */ if arg_descriptor.packed then do; unspec (cv_local_vector_real_flt_bin_2) = substr (cv_p_vector_value_ptr -> cv_bit_string, 1, BITS_PER_EXPONENT + SIGN + arg_descriptor.size) || copy ("0"b, (BITS_PER_WORD - (BITS_PER_EXPONENT + arg_descriptor.size + SIGN))); unspec (cv_local_field_real_flt_bin_2) = substr (cv_p_field_value_ptr -> cv_bit_string, 1, BITS_PER_EXPONENT + SIGN + arg_descriptor.size) || copy ("0"b, (BITS_PER_WORD - (BITS_PER_EXPONENT + arg_descriptor.size + SIGN))); if cv_local_vector_real_flt_bin_2 = cv_local_field_real_flt_bin_2 then goto CV_RETURN_EQUAL; else if cv_local_vector_real_flt_bin_2 < cv_local_field_real_flt_bin_2 then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; end; else if cv_p_vector_value_ptr -> cv_based_real_flt_bin_2a = cv_p_field_value_ptr -> cv_based_real_flt_bin_2a then goto CV_RETURN_EQUAL; else if cv_p_vector_value_ptr -> cv_based_real_flt_bin_2a < cv_p_field_value_ptr -> cv_based_real_flt_bin_2a then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; CV_TYPE (5): /*cplx_fix_bin_1*/ cv_field_real_part_value_ptr = cv_p_field_value_ptr; cv_vector_real_part_value_ptr = cv_p_vector_value_ptr; if arg_descriptor.packed then do; cv_vector_imaginary_part_value_ptr = addbitno (cv_p_vector_value_ptr, fixed_arg_descriptor.precision + SIGN); cv_field_imaginary_part_value_ptr = addbitno (cv_p_field_value_ptr, fixed_arg_descriptor.precision + SIGN); end; else do; cv_vector_imaginary_part_value_ptr = addbitno (cv_p_vector_value_ptr, BITS_PER_WORD); cv_field_imaginary_part_value_ptr = addbitno (cv_p_field_value_ptr, BITS_PER_WORD); end; cv_local_fixed_arg_descriptor = fixed_arg_descriptor; cv_local_fixed_arg_descriptor.type = real_fix_bin_1_dtype; call dmu_compare_values (addr (cv_local_fixed_arg_descriptor), cv_vector_real_part_value_ptr, cv_field_real_part_value_ptr, (DEFAULT_LENGTH), cv_p_vector_equal_to_key, cv_p_vector_less_than_key, cv_p_code); if cv_p_code ^= 0 then return; if cv_p_vector_equal_to_key then call dmu_compare_values (addr (cv_local_fixed_arg_descriptor), cv_vector_imaginary_part_value_ptr, cv_field_imaginary_part_value_ptr, (DEFAULT_LENGTH), cv_p_vector_equal_to_key, cv_p_vector_less_than_key, cv_p_code); return; CV_TYPE (6): /*cplx_fix_bin_2*/ cv_field_real_part_value_ptr = cv_p_field_value_ptr; cv_vector_real_part_value_ptr = cv_p_vector_value_ptr; if arg_descriptor.packed then do; cv_vector_imaginary_part_value_ptr = addbitno (cv_p_vector_value_ptr, fixed_arg_descriptor.precision + SIGN); cv_field_imaginary_part_value_ptr = addbitno (cv_p_field_value_ptr, fixed_arg_descriptor.precision + SIGN); end; else do; cv_vector_imaginary_part_value_ptr = addbitno (cv_p_vector_value_ptr, 2 * BITS_PER_WORD); cv_field_imaginary_part_value_ptr = addbitno (cv_p_field_value_ptr, 2 * BITS_PER_WORD); end; cv_local_fixed_arg_descriptor = fixed_arg_descriptor; cv_local_fixed_arg_descriptor.type = real_fix_bin_2_dtype; call dmu_compare_values (addr (cv_local_fixed_arg_descriptor), cv_vector_real_part_value_ptr, cv_field_real_part_value_ptr, (DEFAULT_LENGTH), cv_p_vector_equal_to_key, cv_p_vector_less_than_key, cv_p_code); if cv_p_code ^= 0 then return; if cv_p_vector_equal_to_key then call dmu_compare_values (addr (cv_local_fixed_arg_descriptor), cv_vector_imaginary_part_value_ptr, cv_field_imaginary_part_value_ptr, (DEFAULT_LENGTH), cv_p_vector_equal_to_key, cv_p_vector_less_than_key, cv_p_code); return; CV_TYPE (7): /*cplx_flt_bin_1*/ cv_field_real_part_value_ptr = cv_p_field_value_ptr; cv_vector_real_part_value_ptr = cv_p_vector_value_ptr; if arg_descriptor.packed then do; cv_vector_imaginary_part_value_ptr = addbitno (cv_p_vector_value_ptr, BITS_PER_EXPONENT + SIGN + arg_descriptor.size); cv_field_imaginary_part_value_ptr = addbitno (cv_p_field_value_ptr, BITS_PER_EXPONENT + SIGN + arg_descriptor.size); end; else do; cv_vector_imaginary_part_value_ptr = addbitno (cv_p_vector_value_ptr, BITS_PER_WORD); cv_field_imaginary_part_value_ptr = addbitno (cv_p_field_value_ptr, BITS_PER_WORD); end; cv_local_arg_descriptor = arg_descriptor; cv_local_arg_descriptor.type = real_flt_bin_1_dtype; call dmu_compare_values (addr (cv_local_arg_descriptor), cv_vector_real_part_value_ptr, cv_field_real_part_value_ptr, (DEFAULT_LENGTH), cv_p_vector_equal_to_key, cv_p_vector_less_than_key, cv_p_code); if cv_p_code ^= 0 then return; if cv_p_vector_equal_to_key then call dmu_compare_values (addr (cv_local_arg_descriptor), cv_vector_imaginary_part_value_ptr, cv_field_imaginary_part_value_ptr, (DEFAULT_LENGTH), cv_p_vector_equal_to_key, cv_p_vector_less_than_key, cv_p_code); return; CV_TYPE (8): /*cplx_flt_bin_2*/ cv_field_real_part_value_ptr = cv_p_field_value_ptr; cv_vector_real_part_value_ptr = cv_p_vector_value_ptr; if arg_descriptor.packed then do; cv_vector_imaginary_part_value_ptr = addbitno (cv_p_vector_value_ptr, BITS_PER_EXPONENT + SIGN + arg_descriptor.size); cv_field_imaginary_part_value_ptr = addbitno (cv_p_field_value_ptr, BITS_PER_EXPONENT + SIGN + arg_descriptor.size); end; else do; cv_vector_imaginary_part_value_ptr = addbitno (cv_p_vector_value_ptr, 2 * BITS_PER_WORD); cv_field_imaginary_part_value_ptr = addbitno (cv_p_field_value_ptr, 2 * BITS_PER_WORD); end; cv_local_arg_descriptor = arg_descriptor; cv_local_arg_descriptor.type = real_flt_bin_2_dtype; call dmu_compare_values (addr (cv_local_arg_descriptor), cv_vector_real_part_value_ptr, cv_field_real_part_value_ptr, (DEFAULT_LENGTH), cv_p_vector_equal_to_key, cv_p_vector_less_than_key, cv_p_code); if cv_p_code ^= 0 then return; if cv_p_vector_equal_to_key then call dmu_compare_values (addr (cv_local_arg_descriptor), cv_vector_imaginary_part_value_ptr, cv_field_imaginary_part_value_ptr, (DEFAULT_LENGTH), cv_p_vector_equal_to_key, cv_p_vector_less_than_key, cv_p_code); return; CV_TYPE (9): /* real_fix_dec_9bit_ls */ call dmu_compare_decimal_values$dmu_compare_dec9ls ((fixed_arg_descriptor.precision + SIGN), cv_p_vector_value_ptr, cv_p_field_value_ptr, cv_p_vector_equal_to_key, cv_p_vector_less_than_key); return; CV_TYPE (10): /* real_flt_dec_9bit */ call dmu_compare_decimal_values$dmu_compare_dec9fl ((arg_descriptor.size + SIGN + BIT9_DECIMAL_EXPONENT), cv_p_vector_value_ptr, cv_p_field_value_ptr, cv_p_vector_equal_to_key, cv_p_vector_less_than_key); return; CV_TYPE (11): /* cplx_fix_dec_9bit_ls */ cv_vector_real_part_value_ptr = cv_p_vector_value_ptr; cv_field_real_part_value_ptr = cv_p_field_value_ptr; cv_vector_imaginary_part_value_ptr = addcharno (cv_p_vector_value_ptr, fixed_arg_descriptor.precision + SIGN); cv_field_imaginary_part_value_ptr = addcharno (cv_p_field_value_ptr, fixed_arg_descriptor.precision + SIGN); call dmu_compare_decimal_values$dmu_compare_dec9ls ((fixed_arg_descriptor.precision + SIGN), cv_vector_real_part_value_ptr, cv_field_real_part_value_ptr, cv_p_vector_equal_to_key, cv_p_vector_less_than_key) ; if cv_p_vector_equal_to_key then call dmu_compare_decimal_values$dmu_compare_dec9ls ((fixed_arg_descriptor.precision + SIGN), cv_vector_imaginary_part_value_ptr, cv_field_imaginary_part_value_ptr, cv_p_vector_equal_to_key, cv_p_vector_less_than_key); return; CV_TYPE (12): /* cplx_flt_dec_9bit */ cv_vector_real_part_value_ptr = cv_p_vector_value_ptr; cv_field_real_part_value_ptr = cv_p_field_value_ptr; cv_vector_imaginary_part_value_ptr = addcharno (cv_p_vector_value_ptr, arg_descriptor.size + SIGN + BIT9_DECIMAL_EXPONENT); cv_field_imaginary_part_value_ptr = addcharno (cv_p_field_value_ptr, arg_descriptor.size + SIGN + BIT9_DECIMAL_EXPONENT); call dmu_compare_decimal_values$dmu_compare_dec9fl ((arg_descriptor.size + SIGN + BIT9_DECIMAL_EXPONENT), cv_vector_real_part_value_ptr, cv_field_real_part_value_ptr, cv_p_vector_equal_to_key, cv_p_vector_less_than_key) ; if cv_p_vector_equal_to_key then call dmu_compare_decimal_values$dmu_compare_dec9fl ((arg_descriptor.size + SIGN + BIT9_DECIMAL_EXPONENT), cv_vector_imaginary_part_value_ptr, cv_field_imaginary_part_value_ptr, cv_p_vector_equal_to_key, cv_p_vector_less_than_key); return; CV_TYPE (19): /* bit (nonvarying) */ if substr (cv_p_vector_value_ptr -> cv_bit_string, 1, arg_descriptor.size) = substr (cv_p_field_value_ptr -> cv_bit_string, 1, arg_descriptor.size) then goto CV_RETURN_EQUAL; else if substr (cv_p_vector_value_ptr -> cv_bit_string, 1, arg_descriptor.size) < substr (cv_p_field_value_ptr -> cv_bit_string, 1, arg_descriptor.size) then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; CV_TYPE (20): /* varying_bit */ if cv_p_vector_value_is_in_field_format then if substr (cv_p_vector_value_ptr -> cv_bit_string, 1, cv_p_vector_value_length) = substr (cv_p_field_value_ptr -> cv_bit_string, 1, cv_p_field_value_length) then goto CV_RETURN_EQUAL; else if substr (cv_p_vector_value_ptr -> cv_bit_string, 1, cv_p_vector_value_length) < substr (cv_p_field_value_ptr -> cv_bit_string, 1, cv_p_field_value_length) then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; else if substr (cv_p_vector_value_ptr -> cv_bit_string, BITS_PER_WORD + 1, cv_p_vector_value_ptr -> cv_based_real_fix_bin_1u) = substr (cv_p_field_value_ptr -> cv_bit_string, 1, cv_p_field_value_length) then goto CV_RETURN_EQUAL; else if substr (cv_p_vector_value_ptr -> cv_bit_string, BITS_PER_WORD + 1, cv_p_vector_value_ptr -> cv_based_real_fix_bin_1u) < substr (cv_p_field_value_ptr -> cv_bit_string, 1, cv_p_field_value_length) then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; CV_TYPE (21): /* char (nonvarying) */ if substr (cv_p_vector_value_ptr -> cv_char_string, 1, arg_descriptor.size) = substr (cv_p_field_value_ptr -> cv_char_string, 1, arg_descriptor.size) then goto CV_RETURN_EQUAL; else if substr (cv_p_vector_value_ptr -> cv_char_string, 1, arg_descriptor.size) < substr (cv_p_field_value_ptr -> cv_char_string, 1, arg_descriptor.size) then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; CV_TYPE (22): /* varying_char */ if cv_p_vector_value_is_in_field_format then if substr (cv_p_vector_value_ptr -> cv_char_string, 1, cv_p_vector_value_length) = substr (cv_p_field_value_ptr -> cv_char_string, 1, cv_p_field_value_length) then goto CV_RETURN_EQUAL; else if substr (cv_p_vector_value_ptr -> cv_char_string, 1, cv_p_vector_value_length) < substr (cv_p_field_value_ptr -> cv_char_string, 1, cv_p_field_value_length) then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; else if substr (cv_p_vector_value_ptr -> cv_char_string, BYTES_PER_WORD + 1, cv_p_vector_value_ptr -> cv_based_real_fix_bin_1u) = substr (cv_p_field_value_ptr -> cv_char_string, 1, cv_p_field_value_length) then goto CV_RETURN_EQUAL; else if substr (cv_p_vector_value_ptr -> cv_char_string, BYTES_PER_WORD + 1, cv_p_vector_value_ptr -> cv_based_real_fix_bin_1u) < substr (cv_p_field_value_ptr -> cv_char_string, 1, cv_p_field_value_length) then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; CV_TYPE (33): /* real_fix_bin_1_uns */ if arg_descriptor.packed then do; unspec (cv_local_vector_real_fix_bin_1_uns) = copy ("0"b, BITS_PER_WORD - fixed_arg_descriptor.precision) || substr (cv_p_vector_value_ptr -> cv_bit_string, 1, fixed_arg_descriptor.precision); unspec (cv_local_field_real_fix_bin_1_uns) = copy ("0"b, BITS_PER_WORD - fixed_arg_descriptor.precision) || substr (cv_p_field_value_ptr -> cv_bit_string, 1, fixed_arg_descriptor.precision); if cv_local_vector_real_fix_bin_1_uns = cv_local_field_real_fix_bin_1_uns then goto CV_RETURN_EQUAL; else if cv_local_vector_real_fix_bin_1_uns < cv_local_field_real_fix_bin_1_uns then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; end; else if cv_p_vector_value_ptr -> cv_based_real_fix_bin_1_unsa = cv_p_field_value_ptr -> cv_based_real_fix_bin_1_unsa then goto CV_RETURN_EQUAL; else if cv_p_vector_value_ptr -> cv_based_real_fix_bin_1_unsa < cv_p_field_value_ptr -> cv_based_real_fix_bin_1_unsa then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; CV_TYPE (34): /* real_fix_bin_2_uns */ if arg_descriptor.packed then do; unspec (cv_local_vector_real_fix_bin_2_uns) = copy ("0"b, 2 * BITS_PER_WORD - fixed_arg_descriptor.precision) || substr (cv_p_vector_value_ptr -> cv_bit_string, 1, fixed_arg_descriptor.precision); unspec (cv_local_field_real_fix_bin_2_uns) = copy ("0"b, 2 * BITS_PER_WORD - fixed_arg_descriptor.precision) || substr (cv_p_field_value_ptr -> cv_bit_string, 1, fixed_arg_descriptor.precision); if cv_local_vector_real_fix_bin_2_uns = cv_local_field_real_fix_bin_2_uns then goto CV_RETURN_EQUAL; else if cv_local_vector_real_fix_bin_2_uns < cv_local_field_real_fix_bin_2_uns then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; end; else if cv_p_vector_value_ptr -> cv_based_real_fix_bin_2_unsa = cv_p_field_value_ptr -> cv_based_real_fix_bin_2_unsa then goto CV_RETURN_EQUAL; else if cv_p_vector_value_ptr -> cv_based_real_fix_bin_2_unsa < cv_p_field_value_ptr -> cv_based_real_fix_bin_2_unsa then goto CV_RETURN_LESS; else goto CV_RETURN_GREATER; CV_TYPE (43): /* real_fix_dec_4bit_bytealigned_ls */ call dmu_compare_decimal_values$dmu_compare_dec4ls (fixed_arg_descriptor.precision + SIGN, cv_p_vector_value_ptr, cv_p_field_value_ptr, cv_p_vector_equal_to_key, cv_p_vector_less_than_key); return; CV_TYPE (44): /* real_flt_dec_4bit_byte_alig ned_dtype */ call dmu_compare_decimal_values$dmu_compare_dec4fl (arg_descriptor.size + SIGN + BIT4_DECIMAL_EXPONENT, cv_p_vector_value_ptr, cv_p_field_value_ptr, cv_p_vector_equal_to_key, cv_p_vector_less_than_key); return; CV_TYPE (45): /* cplx_fix_dec_4bit_bytealigned_ls */ cv_vector_real_part_value_ptr = cv_p_vector_value_ptr; cv_field_real_part_value_ptr = cv_p_field_value_ptr; cv_vector_imaginary_part_value_ptr = addcharno (cv_p_vector_value_ptr, ceil (divide (fixed_arg_descriptor.precision + 2, 2, 35, 18))); cv_field_imaginary_part_value_ptr = addcharno (cv_p_field_value_ptr, ceil (divide (fixed_arg_descriptor.precision + 2, 2, 35, 18))); call dmu_compare_decimal_values$dmu_compare_dec4ls (fixed_arg_descriptor.precision + SIGN, cv_vector_real_part_value_ptr, cv_field_real_part_value_ptr, cv_p_vector_equal_to_key, cv_p_vector_less_than_key) ; if cv_p_vector_equal_to_key then call dmu_compare_decimal_values$dmu_compare_dec4ls (fixed_arg_descriptor.precision + SIGN, cv_vector_imaginary_part_value_ptr, cv_field_imaginary_part_value_ptr, cv_p_vector_equal_to_key, cv_p_vector_less_than_key); return; CV_TYPE (46): /* cplx_flt_dec_4bit_bytealigned */ cv_vector_real_part_value_ptr = cv_p_vector_value_ptr; cv_field_real_part_value_ptr = cv_p_field_value_ptr; cv_vector_imaginary_part_value_ptr = addcharno (cv_p_vector_value_ptr, ceil (divide (fixed_arg_descriptor.precision + 4, 2, 35, 18))); cv_field_imaginary_part_value_ptr = addcharno (cv_p_field_value_ptr, ceil (divide (fixed_arg_descriptor.precision + 4, 2, 35, 18))); call dmu_compare_decimal_values$dmu_compare_dec4fl (arg_descriptor.size + SIGN + BIT4_DECIMAL_EXPONENT, cv_vector_real_part_value_ptr, cv_field_real_part_value_ptr, cv_p_vector_equal_to_key, cv_p_vector_less_than_key) ; if cv_p_vector_equal_to_key then call dmu_compare_decimal_values$dmu_compare_dec4fl (arg_descriptor.size + SIGN + BIT4_DECIMAL_EXPONENT, cv_vector_imaginary_part_value_ptr, cv_field_imaginary_part_value_ptr, cv_p_vector_equal_to_key, cv_p_vector_less_than_key); return; CV_TYPE (13): CV_TYPE (14): CV_TYPE (15): CV_TYPE (16): CV_TYPE (17): CV_TYPE (18): CV_TYPE (23): CV_TYPE (24): CV_TYPE (25): CV_TYPE (26): CV_TYPE (27): CV_TYPE (28): CV_TYPE (29): CV_TYPE (30): CV_TYPE (31): CV_TYPE (32): CV_TYPE (35): CV_TYPE (36): CV_TYPE (37): CV_TYPE (38): CV_TYPE (39): CV_TYPE (40): CV_TYPE (41): CV_TYPE (42): cv_p_code = dm_error_$unimplemented_data_type; return; CV_RETURN_EQUAL: cv_p_vector_equal_to_key = "1"b; cv_p_vector_less_than_key = "0"b; return; CV_RETURN_LESS: cv_p_vector_equal_to_key = "0"b; cv_p_vector_less_than_key = "1"b; return; CV_RETURN_GREATER: cv_p_vector_equal_to_key = "0"b; cv_p_vector_less_than_key = "0"b; return; %include arg_descriptor; %page; %include std_descriptor_types; %page; %include sub_err_flags; end COMPARE_VALUES; /* END INCLUDE FILE - dm_comp_vec_str_proc.incl.pl1 */ */ ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group Bull including Bull HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell Bull Inc., Groupe Bull and Bull HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, Bull or Bull HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by Bull HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved */