SYSCALLS/VEC - vector arithmetic routines 84/03/09
Include files:
FORTRAN: /sys/ins/vec.ins.ftn
Pascal: /sys/ins/vec.ins.pas
C: /sys/ins/vec.ins.c
All calls come in single and double precision floating point, and in
16- and 32-bit integer versions with the exception of vec_$sp_dp,
vec_$sp_dp_i, vec_$dp_sp, and vec_$dp_sp_i.
In single-precision versions, all floating-point parameters
are single precision; in double-precision versions, all floating-point
parameters are double precision. In integer routines, all vectors
and matrices are of the appropriate integer size. Indices and
vector lengths are 4 byte integers everywhere.
Routine names come in 4 "flavors" depending on the data type.
Single-precision routines have a simple name. Double precision
routines add a 'd' after the 'vec_$' prefix. 32-bit integer
routines add an 'i' after the 'vec_$' prefix. 16-bit integer
routines add an 'i' after the 'vec_$' prefix and '16' at the
end of the name (but preceding the '_i' suffix for incremental
routines). For example:
vec_$add_constant - single precision floating point
vec_$dadd_constant - double precision floating point
vec_$iadd_constant - 32-bit integer
vec_$iadd_constant16 - 16-bit integer
vec_$iadd_constant16_i - 16-bit integer, incremental
Procedures and Functions:
vec_$[d,i]add_constant[16] (start_vec, length, constant, result_vec)
Adds a constant to a vector.
vec_$[d,i]add_constant[16]_i (start_vec, inc1, length, constant, result_vec,
inc2)
Same as preceding, but steps through the vector by increments
other than 1.
vec_$[d,i]add_vector[16] (start_vec, add_vec, length, result_vec)
Adds two vectors.
vec_$[d,i]add_vector[16]_i (start_vec, inc1, add_vec, inc2, length,
result_vec, inc3)
Same as preceding, but steps through the vectors by increments
other than 1.
vec_$[d,i]copy[16] (start_vec, result_vec, length)
Copies elements from one vector to another.
vec_$[d,i]copy[16]_i (start_vec, inc1, result_vec, inc2, length)
Same as preceding, but steps through the vectors by increments
other than 1.
dot_prod := vec_$[d,i]dot[16] (vec1, vec2, length)
Calculates the dot product of two vectors.
dot_prod := vec_$[d,i]dot[16]_i (vec1, inc1, vec2, inc2, length)
Same as preceding, but steps through the vectors by increments
other than 1.
vec_$dp_sp (vec1, vec2, length)
Copies a double precision vector to a single precision vector.
vec_$dp_sp_i (vec1, inc1, vec2, inc2, length)
Same as preceding, but steps through the vectors by increments
other than 1.
vec_$[d,i]init[16] (vector, length, constant)
Initializes a vector with a constant.
vec_$[d,i]mat_mult[16] (matrix1, matrix2, out_matrix)
Multiplies two 4x4 matrices and returns the result in a 4x4 matrix.
vec_$[d,i]mat_multn[16] (matrix1, matrix2, m,n,s,out_matrix)
Multiplies an mxn matrix by an nxs matrix and returns the result
in an mxs matrix.
vec_$[d,i]max[16] (start_vec, length, result, result_loc)
Finds the element with the greatest absolute value, and returns its
value and location.
vec_$[d,i]max[16]_i (start_vec, inc1, length, result, result_loc)
Same as preceding, but steps through the vector by increments other
than 1.
vec_$[d,i]mult_add[16] (add_vec, mult_vec, length, constant, result_vec)
Multiplies a vector by a constant and adds the result to a second
vector.
vec_$[d,i]mult_add[16]_i (add_vec, inc1, mult_vec, inc2, length, constant,
result_vec, inc3)
Same as preceding, but steps through the vectors by increments
other than 1.
vec_$[d,i]mult_constant[16] (start_vec, length, constant, result_vec)
Multiplies a vector by a scalar constant and returns the result in
a second vector.
vec_$[d,i]mult_constant[16]_i (start_vec, inc1, length, constant,
result_vec, inc2)
Same as preceding, but steps through the vectors by increments
other than 1.
vec_$[d,i]postmult[16] (matrix, col_vec, result_vec)
Postmultiplies a 4x4 matrix by a 4x1 vector and returns the result
in a second vector.
vec_$[d,i]postmultn[16] (matrix, col_vec, m,n, result_vec)
Postmultiples an mxn matrix by an nx1 vector and returns the result
in an mx1 vector.
vec_$[d,i]premult[16] (row_vec, matrix, result_vec)
Premultiplies a 4x4 matrix by a 1x4 vector and returns the result
in a second vector.
vec_$[d,i]premultn[16] (row_vec, matrix, m, n, result_vec)
Premultiplies an mxn matrix by a 1xm vector and returns the
result in a 1xn vector.
vec_$sp_dp (vec1, vec2, length)
Copies a single precision vector to a double precision vector.
vec_$sp_dp_i (vec1, inc1, vec2, inc2, length)
Same as preceding, but steps through the vectors by increments
other than 1.
vec_$[d,i]sub[16] (start_vec, sub_vec, length, result_vec)
Subtracts one vector from another.
vec_$[d,i]sub[16]_i (start_vec, inc1, sub_vec, inc2, length, result_vec,
inc3)
Same as preceding, but steps through the vectors by increments
other than 1.
sum := vec_$[d,i]sum[16] (vec, length)
Sums the elements of a vector.
sum := vec_$[d,i]sum[16]_i (vec, inc, length)
Same as preceding, but steps through the vector by increments
other than 1.
vec_$[d,i]swap[16] (vec1, vec2, length)
Swaps the elements of two vectors.
vec_$[d,i]swap[16]_i (vec1, inc1, vec2, inc2, length)
Same as preceding, but steps through the vectors by increments
other than 1.
vec_$[d,i]zero[16] (vec, length)
Zeroes a vector.
vec_$[d,i]zero[16]_i (vec, inc, length)
Same as preceding, but steps through the vectors by increments
other than 1.