Panther Search Documentation Tutorials Devlog Downloads Source Code

Arithmetic Intrinsics

Panther
Documentation


@add

func @add = <{T: Type, MAY_WRAP: Bool}> (lhs: T, rhs: T) -> T;

Integer addition. T must be integral or a vector of integral.

Wrapping when MAY_WRAP is false is undefined behavior.

@addWrap

func @addWrap = <{T: Type}> (lhs: T, rhs: T) -> (result: T, wrapped: Bool);

Integer addition where wrapped is true if wrapping occured. T must be integral or a vector of integral.

@addSat

func @addSat = <{T: Type}> (lhs: T, rhs: T) -> T;

Integer saturating addition. T must be integral or a vector of integral.

@fadd

func @fadd = <{T: Type}> (lhs: T, rhs: T) -> T;

Float addition. T must be floating-point or a vector of floating-point.

@sub

func @sub = <{T: Type, MAY_WRAP: Bool}> (lhs: T, rhs: T) -> T;

Integer subtraction. T must be integral or a vector of integral.

Wrapping when MAY_WRAP is false is undefined behavior.

@subWrap

func @subWrap = <{T: Type}> (lhs: T, rhs: T) -> (result: T, wrapped: Bool);

Integer subtraction where wrapped is true if wrapping occured. T must be integral or a vector of integral.

@subSat

func @subSat = <{T: Type}> (lhs: T, rhs: T) -> T;

Integer saturating subtraction. T must be integral or a vector of integral.

@fsub

func @fsub = <{T: Type}> (lhs: T, rhs: T) -> T;

Float subtraction. T must be floating-point or a vector of floating-point.

@mul

func @mul = <{T: Type, MAY_WRAP: Bool}> (lhs: T, rhs: T) -> T;

Integer multiplication. T must be integral or a vector of integral.

Wrapping when MAY_WRAP is false is undefined behavior.

@mulWrap

func @mulWrap = <{T: Type}> (lhs: T, rhs: T) -> (result: T, wrapped: Bool);

Integer multiplication where wrapped is true if wrapping occured. T must be integral or a vector of integral.

@mulSat

func @mulSat = <{T: Type}> (lhs: T, rhs: T) -> T;

Integer saturating multiplication. T must be integral or a vector of integral.

@fmul

func @fmul = <{T: Type}> (lhs: T, rhs: T) -> T;

Float multiplication. T must be floating-point or a vector of floating-point.

@div

func @div = <{T: Type, IS_EXACT: Bool}> (lhs: T, rhs: T) -> T;

Integer division. T must be integral or a vector of integral.

If IS_EXACT is true, it is undefined behavior if (@div<{TYPE, true}>(a, b) * b) != a.

@fdiv

func @fdiv = <{T: Type}> (lhs: T, rhs: T) -> T;

Float division. T must be floating-point or a vector of floating-point.

@rem

func @rem = <{T: Type}> (lhs: T, rhs: T) -> T;

Division remainder. T must be integral, a vector of integral, floating-point, or a vector of floating-point.

@fneg

func @fneg = <{T: Type}> (arg: T) -> T;

Float negation. T must be floating-point or a vector of floating-point.