Beaver.MLIR.Dialect.WasmSSA (beaver v0.4.8)

Copy Markdown

Summary

Functions

Return op name wasmssa.abs as a bitstring.

wasmssa.abs - Floating point absolute value

Return op name wasmssa.add as a bitstring.

wasmssa.add - Sum two values

Return op name wasmssa.and as a bitstring.

wasmssa.and - Compute the bitwise AND between two values

Return op name wasmssa.block as a bitstring.

wasmssa.block - Create a nesting level with a label at its exit.

Return op name wasmssa.block_return as a bitstring.

wasmssa.block_return - Return from the current block

Return op name wasmssa.branch_if as a bitstring.

wasmssa.branch_if - Jump to target level if condition has non-zero value

Return op name wasmssa.call as a bitstring.

wasmssa.call - Calling a Wasm function

Return op name wasmssa.ceil as a bitstring.

wasmssa.ceil - Ceil rounding of floating point value

Return op name wasmssa.clz as a bitstring.

wasmssa.clz - Count leading zeroes of an integer

Return op name wasmssa.const as a bitstring.

wasmssa.const - Operator that represents a constant value

Return op name wasmssa.convert_s as a bitstring.

wasmssa.convert_s - Convert integer interpreted as 2's complement signed value to floating-point value.

Return op name wasmssa.convert_u as a bitstring.

wasmssa.convert_u - Convert integer, interpreted as binary encoded positive value, to floating-point value.

Return op name wasmssa.copysign as a bitstring.

wasmssa.copysign - Copy sign from one floating point value to the other.

Return op name wasmssa.ctz as a bitstring.

wasmssa.ctz - Count trailing zeroes of an integer

Return op name wasmssa.demote as a bitstring.

wasmssa.demote - Convert a f64 value to f32

Return op name wasmssa.div as a bitstring.

wasmssa.div - Division between floating point values

Return op name wasmssa.div_si as a bitstring.

wasmssa.div_si - Divide values interpreted as signed int

Return op name wasmssa.div_ui as a bitstring.

wasmssa.div_ui - Divide values interpreted as unsigned int

Return op name wasmssa.eq as a bitstring.

wasmssa.eq - Check if two values are equal

Return op name wasmssa.eqz as a bitstring.

wasmssa.eqz - Check if the given value is equal to zero

Return op name wasmssa.extend as a bitstring.

wasmssa.extend

Return op name wasmssa.extend_i32_s as a bitstring.

wasmssa.extend_i32_s - Sign extend i32 to i64.

Return op name wasmssa.extend_i32_u as a bitstring.

wasmssa.extend_i32_u - Zero extend i32 to i64.

Return op name wasmssa.floor as a bitstring.

wasmssa.floor - Floor rounding of floating point value

Return op name wasmssa.func as a bitstring.

wasmssa.func

Return op name wasmssa.ge as a bitstring.

wasmssa.ge - Check if a float value is greater or equal to another

Return op name wasmssa.ge_si as a bitstring.

wasmssa.ge_si - Check if a signed integer value is greater or equal to another

Return op name wasmssa.ge_ui as a bitstring.

wasmssa.ge_ui - Check if an unsigned integer value is greater or equal to another

Return op name wasmssa.global as a bitstring.

wasmssa.global - WebAssembly global value

Return op name wasmssa.global_get as a bitstring.

wasmssa.global_get - Returns the value of the global passed as argument.

Return op name wasmssa.global_set as a bitstring.

wasmssa.global_set - Sets the value of the mutable global passed as argument.

Return op name wasmssa.gt as a bitstring.

wasmssa.gt - Check if a float value is greater than another

Return op name wasmssa.gt_si as a bitstring.

wasmssa.gt_si - Check if a signed integer value is greater than another

Return op name wasmssa.gt_ui as a bitstring.

wasmssa.gt_ui - Check if an unsigned integer value is greater than another

Return op name wasmssa.if as a bitstring.

wasmssa.if - Execute the if region if condition value is non-zero, the else region otherwise.

Return op name wasmssa.import_func as a bitstring.

wasmssa.import_func - Importing a function variable

Return op name wasmssa.import_global as a bitstring.

wasmssa.import_global - Importing a global variable

Return op name wasmssa.import_mem as a bitstring.

wasmssa.import_mem - Importing a memory

Return op name wasmssa.import_table as a bitstring.

wasmssa.import_table - Importing a table

Return op name wasmssa.le as a bitstring.

wasmssa.le - Check if a float value is less or equal to another

Return op name wasmssa.le_si as a bitstring.

wasmssa.le_si - Check if a signed integer value is less or equal to another

Return op name wasmssa.le_ui as a bitstring.

wasmssa.le_ui - Check if an unsigned integer value is less or equal to another

Return op name wasmssa.local as a bitstring.

wasmssa.local - Declaration of local variable

Return op name wasmssa.local_get as a bitstring.

wasmssa.local_get - Set local to value and return the operand.

Return op name wasmssa.local_set as a bitstring.

wasmssa.local_set - Set local to given value

Return op name wasmssa.local_tee as a bitstring.

wasmssa.local_tee - Set local to value and return the operand.

Return op name wasmssa.loop as a bitstring.

wasmssa.loop - Create a nesting level that define its entry as jump target.

Return op name wasmssa.lt as a bitstring.

wasmssa.lt - Check if a float value is less than another

Return op name wasmssa.lt_si as a bitstring.

wasmssa.lt_si - Check if a signed integer value is less than another

Return op name wasmssa.lt_ui as a bitstring.

wasmssa.lt_ui - Check if an unsigned integer value is less than another

Return op name wasmssa.max as a bitstring.

wasmssa.max - Compute the minimum of two floating point values.

Return op name wasmssa.memory as a bitstring.

wasmssa.memory - WebAssembly memory definition

Return op name wasmssa.min as a bitstring.

wasmssa.min - Compute the minimum of two floating point values.

Return op name wasmssa.mul as a bitstring.

wasmssa.mul - Multiply two values

Return op name wasmssa.ne as a bitstring.

wasmssa.ne - Check if two values are different

Return op name wasmssa.nearest as a bitstring.

wasmssa.nearest - Round floating point value to the nearest integer, ties to even

Return op name wasmssa.neg as a bitstring.

wasmssa.neg - Floating point negation

Return op name wasmssa.or as a bitstring.

wasmssa.or - Compute the bitwise OR of two values

Return op name wasmssa.popcnt as a bitstring.

wasmssa.popcnt - Population count of an integer.

Return op name wasmssa.promote as a bitstring.

wasmssa.promote - Get f64 representation of a f32 value.

Return op name wasmssa.reinterpret as a bitstring.

wasmssa.reinterpret - Reinterpret the value represented by a bit vector by

Return op name wasmssa.rem_si as a bitstring.

wasmssa.rem_si - Calculate the remainder of dividing two integer values as signed integer

Return op name wasmssa.rem_ui as a bitstring.

wasmssa.rem_ui - Calculate the remainder of dividing two integer values as an unsigned integer

Return op name wasmssa.return as a bitstring.

wasmssa.return - Return from the current function frame

Return op name wasmssa.rotl as a bitstring.

wasmssa.rotl - Rotate left.

Return op name wasmssa.rotr as a bitstring.

wasmssa.rotr - Rotate right.

Return op name wasmssa.select as a bitstring.

wasmssa.select - Select between two values based on a condition.

Return op name wasmssa.shl as a bitstring.

wasmssa.shl - Consume an integer and an integer shift amount. The first

Return op name wasmssa.shr_s as a bitstring.

wasmssa.shr_s - Arithmetic right shift.

Return op name wasmssa.shr_u as a bitstring.

wasmssa.shr_u - Logical right shift.

Return op name wasmssa.sqrt as a bitstring.

wasmssa.sqrt - Floating point square root

Return op name wasmssa.sub as a bitstring.

wasmssa.sub - Subtract two values

Return op name wasmssa.table as a bitstring.

wasmssa.table - WebAssembly table value

Return op name wasmssa.trunc as a bitstring.

wasmssa.trunc - Trunc of floating point value

Return op name wasmssa.trunc_si as a bitstring.

wasmssa.trunc_si - Truncate floating point value to signed integer.

Return op name wasmssa.trunc_ui as a bitstring.

wasmssa.trunc_ui - Truncate floating point value to unsigned integer.

Return op name wasmssa.wrap as a bitstring.

wasmssa.wrap - Cast an i64 to i32 by using a wrapping mechanism: y = x mod 2^32

Return op name wasmssa.xor as a bitstring.

wasmssa.xor - Compute the bitwise XOR of two values

Functions

abs()

Return op name wasmssa.abs as a bitstring.

abs(ssa)

wasmssa.abs - Floating point absolute value

This op has support for result type inference.

Operands

  • src - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Description

Example:

                                     ```mlir
                                     %a = wasmssa.abs %b : f32
                                     ```

add()

Return op name wasmssa.add as a bitstring.

add(ssa)

wasmssa.add - Sum two values

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Description

Example:

 ```mlir
 %a = wasmssa.add %b %c : i32
 ```

and()

Return op name wasmssa.and as a bitstring.

and(ssa)

wasmssa.and - Compute the bitwise AND between two values

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Description

Example:

 ```mlir
 %a = wasmssa.and %b %c : i32
 ```

block()

Return op name wasmssa.block as a bitstring.

block(ssa)

wasmssa.block - Create a nesting level with a label at its exit.

Operands

  • inputs - Variadic, WasmSSA_ValType, variadic of 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Description

Defines a Wasm block, creating a new nested scope. A block contains a body region and an optional list of input values. Control can enter the block and later branch out to the block target. Example:

wasmssa.block {

  // instructions

} > ^successor

block_return()

Return op name wasmssa.block_return as a bitstring.

block_return(ssa)

wasmssa.block_return - Return from the current block

Operands

  • inputs - Variadic, WasmSSA_ValType, variadic of 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Description

Escape from the current nesting level and return the control flow to its successor. Optionally, mark the arguments that should be transfered to the successor block.

This shouldn't be confused with branch operations that targets the label defined by the nesting level operation.

For instance, a wasmssa.block_return in a loop will give back control to the successor of the loop, where a branch targeting the loop will flow back to the entry block of the loop.

Example:

wasmssa.block_return

branch_if()

Return op name wasmssa.branch_if as a bitstring.

branch_if(ssa)

wasmssa.branch_if - Jump to target level if condition has non-zero value

Attributes

  • exitLevel - Single, UI32Attr, 32-bit unsigned integer attribute

Operands

  • condition - Single, I32, 32-bit signless integer
  • inputs - Variadic, WasmSSA_ValType, variadic of 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Description

Jump to target level if the condition is has a non-zero value.

Example:

wasmssa.branch_if %a to level 0 with args(%b : i32) else ^bb1

call()

Return op name wasmssa.call as a bitstring.

call(ssa)

wasmssa.call - Calling a Wasm function

Attributes

  • callee - Single, FlatSymbolRefAttr, flat symbol reference attribute

Operands

  • operands - Variadic, WasmSSA_ValType, variadic of 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Results

  • results - Variadic, WasmSSA_ValType, variadic of 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Description

Emits a call to a defined function

Example:

%a = wasmssa.call @func_0 : () -> i32

ceil()

Return op name wasmssa.ceil as a bitstring.

ceil(ssa)

wasmssa.ceil - Ceil rounding of floating point value

This op has support for result type inference.

Operands

  • src - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Description

Example:

                                     ```mlir
                                     %a = wasmssa.ceil %b : f32
                                     ```

clz()

Return op name wasmssa.clz as a bitstring.

clz(ssa)

wasmssa.clz - Count leading zeroes of an integer

This op has support for result type inference.

Operands

  • src - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Description

Example:

                                     ```mlir
                                     %a = wasmssa.clz %b : i32
                                     ```

const()

Return op name wasmssa.const as a bitstring.

const(ssa)

wasmssa.const - Operator that represents a constant value

This op has support for result type inference.

Attributes

  • value - Single, TypedAttrInterface, TypedAttr instance

Results

  • result - Single, WasmSSA_NumericType, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Description

Defines a constant value.

Example:

// Example of integer constant
%a = wasmssa.const 1 : i32

// Example of floating point constant
%b = wasmssa.const 9.000000e+00 : f64

convert_s()

Return op name wasmssa.convert_s as a bitstring.

convert_s(ssa)

wasmssa.convert_s - Convert integer interpreted as 2's complement signed value to floating-point value.

Consume an integer and produces a floating point value containing the rounded value of the original operand. Rounding is round to nearest, tie to even.

Operands

  • input - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Description

Example:

 ```mlir
 %a = wasmssa.convert_s %b : i32 to f64
 ```

convert_u()

Return op name wasmssa.convert_u as a bitstring.

convert_u(ssa)

wasmssa.convert_u - Convert integer, interpreted as binary encoded positive value, to floating-point value.

Consume an integer and produces a floating point value containing the rounded value of the original operand. Rounding is round to nearest, tie to even.

Operands

  • input - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Description

Example:

 ```mlir
 %a = wasmssa.convert_u %b : i32 to f64
 ```

copysign()

Return op name wasmssa.copysign as a bitstring.

copysign(ssa)

wasmssa.copysign - Copy sign from one floating point value to the other.

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Description

Example:

 ```mlir
 %a = wasmssa.copysign %b %c : f32
 ```

ctz()

Return op name wasmssa.ctz as a bitstring.

ctz(ssa)

wasmssa.ctz - Count trailing zeroes of an integer

This op has support for result type inference.

Operands

  • src - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Description

Example:

                                     ```mlir
                                     %a = wasmssa.ctz %b : i32
                                     ```

demote()

Return op name wasmssa.demote as a bitstring.

demote(ssa)

wasmssa.demote - Convert a f64 value to f32

Operands

  • input - Single, anonymous/composite constraint, 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit float

Description

Example:

 ```mlir
 %a = wasmssa.demote %b : f64 to f32
 ```

div()

Return op name wasmssa.div as a bitstring.

div(ssa)

wasmssa.div - Division between floating point values

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Description

Example:

 ```mlir
 %a = wasmssa.div %b %c : f32
 ```

div_si()

Return op name wasmssa.div_si as a bitstring.

div_si(ssa)

wasmssa.div_si - Divide values interpreted as signed int

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.div_si %b %c : i32
 ```

div_ui()

Return op name wasmssa.div_ui as a bitstring.

div_ui(ssa)

wasmssa.div_ui - Divide values interpreted as unsigned int

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.div_ui %b %c : i32
 ```

eq()

Return op name wasmssa.eq as a bitstring.

eq(ssa)

wasmssa.eq - Check if two values are equal

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.eq %b %c : i32
 ```

eqz()

Return op name wasmssa.eqz as a bitstring.

eqz(ssa)

wasmssa.eqz - Check if the given value is equal to zero

This op has support for result type inference.

Operands

  • input - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.eqz %b : i64 -> i32
 ```

extend()

Return op name wasmssa.extend as a bitstring.

extend(ssa)

wasmssa.extend

This op has support for result type inference.

Attributes

  • bitsToTake - Single, Builtin_IntegerAttr, An Attribute containing a integer value

Operands

  • input - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer

Description

Extend low bytes of a value to fit a given width. For instance, signed extension from 8 low bits of the 32-bits integer value 254 (0x000000FE) would produce the value -2 (0xFFFFFFFE).

This corresponds to the extendnn instruction of Wasm, which shouldn't be confused with the extend_inn Wasm instruction, for which all input bits are used and widened to wider output type. In this operation, input and output types are the same.

Example:

%a = wasmssa.extend 16 low bits from %[[VAL_0]]: i64

extend_i32_s()

Return op name wasmssa.extend_i32_s as a bitstring.

extend_i32_s(ssa)

wasmssa.extend_i32_s - Sign extend i32 to i64.

This op has support for result type inference.

Operands

  • input - Single, I32, 32-bit signless integer

Results

  • result - Single, I64, 64-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.extend_i32_s %b to i64
 ```

extend_i32_u()

Return op name wasmssa.extend_i32_u as a bitstring.

extend_i32_u(ssa)

wasmssa.extend_i32_u - Zero extend i32 to i64.

This op has support for result type inference.

Operands

  • input - Single, I32, 32-bit signless integer

Results

  • result - Single, I64, 64-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.extend_i32_s %b to i64
 ```

floor()

Return op name wasmssa.floor as a bitstring.

floor(ssa)

wasmssa.floor - Floor rounding of floating point value

This op has support for result type inference.

Operands

  • src - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Description

Example:

                                     ```mlir
                                     %a = wasmssa.floor %b : f32
                                     ```

func()

Return op name wasmssa.func as a bitstring.

func(ssa)

wasmssa.func

Attributes

  • sym_name - Single, SymbolNameAttr, string attribute
  • functionType - Single, WasmSSA_FuncTypeAttr, type attribute of function type
  • arg_attrs - Optional, DictArrayAttr, Array of dictionary attributes
  • res_attrs - Optional, DictArrayAttr, Array of dictionary attributes
  • exported - Optional, UnitAttr, unit attribute

Description

Represents a Wasm function definition.

In Wasm function, locals and function arguments are interchangeable. They are for instance both accessed using local.get instruction.

On the other hand, a function type is defined as a pair of tuples of Wasm value types. To model this, the wasm.func operation has:

  • A function type that represents the corresponding Wasm type (tuples of value types)

  • Arguments of the entry block of type !wasm<local T>, with T the corresponding type in the function type.

By default, wasmssa.func have nested visibility. Functions exported by the module are marked with the exported attribute. This gives them public visibility.

Example:

 // Internal function with no arguments that returns a float32
 wasmssa.func @my_f32_func() -> f32

 // Exported function with no arguments that returns a float32
 wasmssa.func exported @my_f32_func() -> f32

 // A function that takes a local ref argument
 wasmssa.func @i64_wrap(%a: !wasmssa<local ref to i64>) -> i32

ge()

Return op name wasmssa.ge as a bitstring.

ge(ssa)

wasmssa.ge - Check if a float value is greater or equal to another

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.ge %b %c : i32
 ```

ge_si()

Return op name wasmssa.ge_si as a bitstring.

ge_si(ssa)

wasmssa.ge_si - Check if a signed integer value is greater or equal to another

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.ge_si %b %c : i32
 ```

ge_ui()

Return op name wasmssa.ge_ui as a bitstring.

ge_ui(ssa)

wasmssa.ge_ui - Check if an unsigned integer value is greater or equal to another

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.ge_ui %b %c : i32
 ```

global()

Return op name wasmssa.global as a bitstring.

global(ssa)

wasmssa.global - WebAssembly global value

Attributes

  • sym_name - Single, SymbolNameAttr, string attribute
  • type - Single, WasmSSA_ValTypeAttr, type attribute of 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference
  • isMutable - Optional, UnitAttr, unit attribute
  • exported - Optional, UnitAttr, unit attribute

Description

WebAssembly global variable. Body contains the initialization instructions for the variable value. The body must contain only instructions considered const in a webassembly context, such as wasmssa.const or global.get.

By default, wasmssa.global have nested visibility. Global exported by the module are marked with the exported attribute. This gives them public visibility.

Example:

// Define module_global_var, an internal mutable i32 global variable equal to 10.
wasmssa.global @module_global_var i32 mutable : {
      %[[VAL_0:.*]] = wasmssa.const 10 : i32
      wasmssa.return %[[VAL_0]] : i32
}

// Define global_var, an exported constant i32 global variable equal to 42.
wasmssa.global @global_var i32 : {
      %[[VAL_0:.*]] = wasmssa.const 42 : i32
      wasmssa.return %[[VAL_0]] : i32
}

global_get()

Return op name wasmssa.global_get as a bitstring.

global_get(ssa)

wasmssa.global_get - Returns the value of the global passed as argument.

Attributes

  • global - Single, FlatSymbolRefAttr, flat symbol reference attribute

Results

  • global_val - Single, WasmSSA_ValType, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Description

Retrieves the value of the global passed as argument and stores it in a variable

Example:

// Gets the value of `@global_0` and stores its value in %a
%a = wasmssa.global_get @global_0 : i32

global_set()

Return op name wasmssa.global_set as a bitstring.

global_set(ssa)

wasmssa.global_set - Sets the value of the mutable global passed as argument.

Attributes

  • global - Single, FlatSymbolRefAttr, flat symbol reference attribute

Operands

  • value - Single, WasmSSA_ValType, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Description

Sets the value of the mutable global referenced by the symbol to the given value.

Example:

// Sets the value of `@global_0` to `%v`.
wasmssa.global_set @global_0 to %v : i32

gt()

Return op name wasmssa.gt as a bitstring.

gt(ssa)

wasmssa.gt - Check if a float value is greater than another

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.gt %b %c : i32
 ```

gt_si()

Return op name wasmssa.gt_si as a bitstring.

gt_si(ssa)

wasmssa.gt_si - Check if a signed integer value is greater than another

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.gt_si %b %c : i32
 ```

gt_ui()

Return op name wasmssa.gt_ui as a bitstring.

gt_ui(ssa)

wasmssa.gt_ui - Check if an unsigned integer value is greater than another

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.gt_ui %b %c : i32
 ```

if()

Return op name wasmssa.if as a bitstring.

if(ssa)

wasmssa.if - Execute the if region if condition value is non-zero, the else region otherwise.

Operands

  • condition - Single, I32, 32-bit signless integer
  • inputs - Variadic, WasmSSA_ValType, variadic of 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Description

Execute the if region if the condition is non-zero. Otherwise the else region is executed. The else region can be empty but must return the same datatype as the if region. If clauses can be nested.

Example:

 // Runs the if clause is %a is non-zero
 wasmssa.if %a {
    // Execute if %a is non-zero
 } else {
    // else clause
 }

import_func()

Return op name wasmssa.import_func as a bitstring.

import_func(ssa)

wasmssa.import_func - Importing a function variable

Attributes

  • sym_name - Single, SymbolNameAttr, string attribute
  • moduleName - Single, StrAttr, string attribute
  • importName - Single, StrAttr, string attribute
  • type - Single, WasmSSA_FuncTypeAttr, type attribute of function type
  • arg_attrs - Optional, DictArrayAttr, Array of dictionary attributes
  • res_attrs - Optional, DictArrayAttr, Array of dictionary attributes

Description

Imports a function from another module

Example:

// Imports foo(i32) -> () from the module my_module
wasmssa.import_func "foo" from "my_module" as @func_0 {sym_visibility = "nested", type = (i32) -> ()}

import_global()

Return op name wasmssa.import_global as a bitstring.

import_global(ssa)

wasmssa.import_global - Importing a global variable

Attributes

  • sym_name - Single, SymbolNameAttr, string attribute
  • moduleName - Single, StrAttr, string attribute
  • importName - Single, StrAttr, string attribute
  • type - Single, WasmSSA_ValTypeAttr, type attribute of 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference
  • isMutable - Optional, UnitAttr, unit attribute

Description

Imports a global from another module

Example:

// Imports the "glob" i32 global from the module my_module as "global_0"
wasmssa.import_global "glob" from "my_module" as @global_0 nested : i32

import_mem()

Return op name wasmssa.import_mem as a bitstring.

import_mem(ssa)

wasmssa.import_mem - Importing a memory

Attributes

  • sym_name - Single, SymbolNameAttr, string attribute
  • moduleName - Single, StrAttr, string attribute
  • importName - Single, StrAttr, string attribute
  • limits - Single, WasmSSA_LimitTypeAttr, type attribute of Wasm limit type

Description

Import a memory from another module.

Example:

 // Import the memory `mem` from `my_module` as @mem_0
 wasmssa.import_mem "mem" from "my_module" as @mem_0 {limits = !wasmssa<limit[2:]>}

import_table()

Return op name wasmssa.import_table as a bitstring.

import_table(ssa)

wasmssa.import_table - Importing a table

Attributes

  • sym_name - Single, SymbolNameAttr, string attribute
  • moduleName - Single, StrAttr, string attribute
  • importName - Single, StrAttr, string attribute
  • type - Single, WasmSSA_TableTypeAttr, type attribute of Wasm table type

Description

Import a table from another module.

Example:

 // Import the table `table` from `my_module` as @table_0
 wasmssa.import_table "table" from "my_module" as @table_0 {type = !wasmssa<tabletype !wasmssa.funcref [2:]>}

le()

Return op name wasmssa.le as a bitstring.

le(ssa)

wasmssa.le - Check if a float value is less or equal to another

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.le %b %c : i32
 ```

le_si()

Return op name wasmssa.le_si as a bitstring.

le_si(ssa)

wasmssa.le_si - Check if a signed integer value is less or equal to another

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.le_si %b %c : i32
 ```

le_ui()

Return op name wasmssa.le_ui as a bitstring.

le_ui(ssa)

wasmssa.le_ui - Check if an unsigned integer value is less or equal to another

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.le_ui %b %c : i32
 ```

local()

Return op name wasmssa.local as a bitstring.

local(ssa)

wasmssa.local - Declaration of local variable

This op has support for result type inference.

Attributes

  • type - Single, WasmSSA_ValTypeAttr, type attribute of 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Results

  • result - Single, WasmSSA_LocalRef, Type of a local variable

Description

Declares a local variable

Example:

 // Declares `%a`, a float32 local
 %a = wasmssa.local of type f32

local_get()

Return op name wasmssa.local_get as a bitstring.

local_get(ssa)

wasmssa.local_get - Set local to value and return the operand.

This op has support for result type inference.

Operands

  • localVar - Single, WasmSSA_LocalRef, Type of a local variable

Results

  • result - Single, WasmSSA_ValType, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Description

Gets the value of a local variable and returns a reference to it.

Example:

 // Retrieves a reference to `%a`, a float32 local
 %b = wasmssa.local_get %a : ref to f32

local_set()

Return op name wasmssa.local_set as a bitstring.

local_set(ssa)

wasmssa.local_set - Set local to given value

Operands

  • localVar - Single, WasmSSA_LocalRef, Type of a local variable
  • value - Single, WasmSSA_ValType, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Description

Sets the value of a local variable.

Example:

 // Sets `%d`, to the value of `%c`
 wasmssa.local_set %d :  ref to i32 to %c : i32

local_tee()

Return op name wasmssa.local_tee as a bitstring.

local_tee(ssa)

wasmssa.local_tee - Set local to value and return the operand.

This op has support for result type inference.

Operands

  • localVar - Single, WasmSSA_LocalRef, Type of a local variable
  • value - Single, WasmSSA_ValType, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Results

  • result - Single, WasmSSA_ValType, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Description

Sets the value of a local variable and returns it.

Example:

 // Sets `%b`, to the value of `%c` and returns it in %a
  %a = wasmssa.local_tee %b :  ref to i32 to %c : i32

loop()

Return op name wasmssa.loop as a bitstring.

loop(ssa)

wasmssa.loop - Create a nesting level that define its entry as jump target.

Operands

  • inputs - Variadic, WasmSSA_ValType, variadic of 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Description

Represents a Wasm loop construct. This defines a nesting level with a label at the entry of the region.

Example:

wasmssa.loop {

} > ^successor

lt()

Return op name wasmssa.lt as a bitstring.

lt(ssa)

wasmssa.lt - Check if a float value is less than another

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.lt %b %c : i32
 ```

lt_si()

Return op name wasmssa.lt_si as a bitstring.

lt_si(ssa)

wasmssa.lt_si - Check if a signed integer value is less than another

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.lt_si %b %c : i32
 ```

lt_ui()

Return op name wasmssa.lt_ui as a bitstring.

lt_ui(ssa)

wasmssa.lt_ui - Check if an unsigned integer value is less than another

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.lt_ui %b %c : i32
 ```

max()

Return op name wasmssa.max as a bitstring.

max(ssa)

wasmssa.max - Compute the minimum of two floating point values.

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Description

Example:

 ```mlir
 %a = wasmssa.max %b %c : f32
 ```

memory()

Return op name wasmssa.memory as a bitstring.

memory(ssa)

wasmssa.memory - WebAssembly memory definition

Attributes

  • sym_name - Single, SymbolNameAttr, string attribute
  • limits - Single, WasmSSA_LimitTypeAttr, type attribute of Wasm limit type
  • exported - Optional, UnitAttr, unit attribute

Description

Define a memory to be used by the program. Multiple memories can be defined in the same module.

By default, wasmssa.memory have nested visibility. Memory exported by the module are marked with the exported attribute. This gives them public visibility.

Example:

 // Define the `mem_0` (internal)  memory with defined size bounds of [0:65536]
 wasmssa.memory @mem_0 !wasmssa<limit[0:65536]>

 // Define the `mem_1` exported  memory with minimal size of 512
 wasmssa.memory exported @mem_1 !wasmssa<limit[512:]>

min()

Return op name wasmssa.min as a bitstring.

min(ssa)

wasmssa.min - Compute the minimum of two floating point values.

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Description

Example:

 ```mlir
 %a = wasmssa.min %b %c : f32
 ```

mul()

Return op name wasmssa.mul as a bitstring.

mul(ssa)

wasmssa.mul - Multiply two values

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Description

Example:

 ```mlir
 %a = wasmssa.mul %b %c : i32
 ```

ne()

Return op name wasmssa.ne as a bitstring.

ne(ssa)

wasmssa.ne - Check if two values are different

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Results

  • result - Single, I32, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.ne %b %c : i32
 ```

nearest()

Return op name wasmssa.nearest as a bitstring.

nearest(ssa)

wasmssa.nearest - Round floating point value to the nearest integer, ties to even

This op has support for result type inference.

Operands

  • src - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Description

Example:

                                     ```mlir
                                     %a = wasmssa.nearest %b : f32
                                     ```

neg()

Return op name wasmssa.neg as a bitstring.

neg(ssa)

wasmssa.neg - Floating point negation

This op has support for result type inference.

Operands

  • src - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Description

Example:

                                     ```mlir
                                     %a = wasmssa.neg %b : f32
                                     ```

or()

Return op name wasmssa.or as a bitstring.

or(ssa)

wasmssa.or - Compute the bitwise OR of two values

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Description

Example:

 ```mlir
 %a = wasmssa.or %b %c : i32
 ```

popcnt()

Return op name wasmssa.popcnt as a bitstring.

popcnt(ssa)

wasmssa.popcnt - Population count of an integer.

This op has support for result type inference.

Operands

  • src - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Description

Example:

                                     ```mlir
                                     %a = wasmssa.popcnt %b : i32
                                     ```

promote()

Return op name wasmssa.promote as a bitstring.

promote(ssa)

wasmssa.promote - Get f64 representation of a f32 value.

Operands

  • input - Single, anonymous/composite constraint, 32-bit floating-point type

Results

  • result - Single, anonymous/composite constraint, 64-bit floating-point type

Description

Example:

 ```mlir
 %a = wasmssa.promote %b : f32 to f64
 ```

reinterpret()

Return op name wasmssa.reinterpret as a bitstring.

reinterpret(ssa)

wasmssa.reinterpret - Reinterpret the value represented by a bit vector by

  bit-casting it to another type of same representation width.

Operands

  • input - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Description

Example:

 ```mlir
 %a = wasmssa.reinterpret %b : f32 as i32
 ```

rem_si()

Return op name wasmssa.rem_si as a bitstring.

rem_si(ssa)

wasmssa.rem_si - Calculate the remainder of dividing two integer values as signed integer

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.rem_si %b %c : i32
 ```

rem_ui()

Return op name wasmssa.rem_ui as a bitstring.

rem_ui(ssa)

wasmssa.rem_ui - Calculate the remainder of dividing two integer values as an unsigned integer

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.rem_ui %b %c : i32
 ```

return()

Return op name wasmssa.return as a bitstring.

return(ssa)

wasmssa.return - Return from the current function frame

Operands

  • operands - Variadic, WasmSSA_ValType, variadic of 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

rotl()

Return op name wasmssa.rotl as a bitstring.

rotl(ssa)

wasmssa.rotl - Rotate left.

Consume an integer and an integer rotate. The first
integer shall be rotated left by N bits, where N is the value of the
second integer.

This op has support for result type inference.

Operands

  • val - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer
  • bits - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.rotl %b by %c bits : i64
 ```

rotr()

Return op name wasmssa.rotr as a bitstring.

rotr(ssa)

wasmssa.rotr - Rotate right.

Consume an integer, and an integer rotate. The first
integer shall be rotated right by N bits, where N is the value of the
second integer.

This op has support for result type inference.

Operands

  • val - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer
  • bits - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.rotr %b by %c bits : i64
 ```

select()

Return op name wasmssa.select as a bitstring.

select(ssa)

wasmssa.select - Select between two values based on a condition.

This op has support for result type inference.

Operands

  • true_value - Single, WasmSSA_ValType, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference
  • false_value - Single, WasmSSA_ValType, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference
  • condition - Single, I32, 32-bit signless integer

Results

  • result - Single, WasmSSA_ValType, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float or 128-bit signless integer or Opaque type for function reference or Opaque type for external reference

Description

Returns true_value if condition is non-zero, false_value otherwise. Both operands and the result must share the same Wasm value type.

Example:

// Returns %a if %cond is non-zero, otherwise %b.
%r = wasmssa.select %cond, %a, %b : i32

shl()

Return op name wasmssa.shl as a bitstring.

shl(ssa)

wasmssa.shl - Consume an integer and an integer shift amount. The first

integer shall be shifted left by N bits, where N is the value of the second
integer.

This op has support for result type inference.

Operands

  • val - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer
  • bits - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.shl %b by %c bits : i64
 ```

shr_s()

Return op name wasmssa.shr_s as a bitstring.

shr_s(ssa)

wasmssa.shr_s - Arithmetic right shift.

Consume an integer and an integer shift amount. The first
integer shall be shifted right by N bits, where N is the value of the
second integer.

Vacated bits on the left shall be filled with the sign bit.

This op has support for result type inference.

Operands

  • val - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer
  • bits - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.shr_s %b by %c bits : i64
 ```

shr_u()

Return op name wasmssa.shr_u as a bitstring.

shr_u(ssa)

wasmssa.shr_u - Logical right shift.

Consume an integer, and an integer shift amount. The first
integer shall be shifted right by N bits, where N is the value of the
second integer.

Vacated bits on the left shall be filled with zeroes.

This op has support for result type inference.

Operands

  • val - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer
  • bits - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer

Results

  • result - Single, WasmSSA_IntegerType, 32-bit signless integer or 64-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.shr_u %b by %c bits : i64
 ```

sqrt()

Return op name wasmssa.sqrt as a bitstring.

sqrt(ssa)

wasmssa.sqrt - Floating point square root

This op has support for result type inference.

Operands

  • src - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Description

Example:

                                     ```mlir
                                     %a = wasmssa.sqrt %b : f32
                                     ```

sub()

Return op name wasmssa.sub as a bitstring.

sub(ssa)

wasmssa.sub - Subtract two values

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Description

Example:

 ```mlir
 %a = wasmssa.sub %b %c : i32
 ```

table()

Return op name wasmssa.table as a bitstring.

table(ssa)

wasmssa.table - WebAssembly table value

Attributes

  • sym_name - Single, SymbolNameAttr, string attribute
  • type - Single, WasmSSA_TableTypeAttr, type attribute of Wasm table type
  • exported - Optional, UnitAttr, unit attribute

trunc()

Return op name wasmssa.trunc as a bitstring.

trunc(ssa)

wasmssa.trunc - Trunc of floating point value

This op has support for result type inference.

Operands

  • src - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Description

Example:

                                     ```mlir
                                     %a = wasmssa.trunc %b : f32
                                     ```

trunc_si()

Return op name wasmssa.trunc_si as a bitstring.

trunc_si(ssa)

wasmssa.trunc_si - Truncate floating point value to signed integer.

Consume a floating point value and produces a signed integer holding the value truncated toward zero.
Traps if the value is NaN, is infinity, or is outside the range of the target integer type.

Operands

  • input - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.trunc_si %b : f32 to i32
 ```

trunc_ui()

Return op name wasmssa.trunc_ui as a bitstring.

trunc_ui(ssa)

wasmssa.trunc_ui - Truncate floating point value to unsigned integer.

Consume a floating point value and produces an unsigned integer holding the value truncated toward zero.
Traps if the value is NaN, is infinity, is negative, or is outside the range of the target integer type.

Operands

  • input - Single, anonymous/composite constraint, 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.trunc_ui %b : f32 to i32
 ```

wrap()

Return op name wasmssa.wrap as a bitstring.

wrap(ssa)

wasmssa.wrap - Cast an i64 to i32 by using a wrapping mechanism: y = x mod 2^32

Operands

  • input - Single, anonymous/composite constraint, 64-bit signless integer

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer

Description

Example:

 ```mlir
 %a = wasmssa.wrap %b : i64 to i32
 ```

xor()

Return op name wasmssa.xor as a bitstring.

xor(ssa)

wasmssa.xor - Compute the bitwise XOR of two values

This op has support for result type inference.

Operands

  • lhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float
  • rhs - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Results

  • result - Single, anonymous/composite constraint, 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float

Description

Example:

 ```mlir
 %a = wasmssa.xor %b %c : i32
 ```