| AI Engine-ML Intrinsics User Guide (v2026.1)

Loading...
Searching...
No Matches
Functions
Integer Operations
Scalar Operations

## Overview

Intrinsics allowing you to perform select, absolute and delay operations on integer scalars.

## Functions
int | scalar_abs (int a)
| Scalar absolute value intrinsic.

## Scalar select intrinsics
Scalar select These instructions are equivalent to the ternary ?: operator and should normally be inferred by the compiler automatically.
char | select (bool, char, char)
unsigned char | select (bool, unsigned char, unsigned char)
signed short | select (bool, signed short, signed short)
unsigned short | select (bool, unsigned short, unsigned short)
int | select (bool, int, int)
unsigned int | select (bool, unsigned int, unsigned int)
long | select (bool, long, long)
unsigned long | select (bool, unsigned long, unsigned long)
void * | select (bool, void *, void *)

## Integer delay line
Returns the integer that is given as input after N cycles.
int | delay1 (int)
int | delay2 (int)
int | delay3 (int)
int | delay4 (int)
int | delay5 (int)
int | delay6 (int)

## Pointer delay line
Returns the pointer that is given as input after N cycles.
void * | delay1 (void *)
void * | delay2 (void *)
void * | delay3 (void *)
void * | delay4 (void *)
void * | delay5 (void *)
void * | delay6 (void *)

## Leading bit count
unsigned | clb (int n)
| Count number of leading consecutive bits. If a is positive, count leading 0's, otherwise count leading 1's.
unsigned | clb (unsigned n)
| Count number of leading consecutive 0's.
unsigned | clb (long long a)
| Count number of leading consecutive bits. If a is positive, count leading 0's, otherwise count leading 1's.
unsigned | clb (unsigned long long a)
| Count number of leading consecutive 0's.

## NOP
void | nop (unsigned delay)
| Insert pipeline bubbles in the micro-code.
void | nop ()
| Insert 2 pipeline bubbles in the micro-code.

## Function Documentation

## ◆ clb() [1/4]

unsigned clb | ( | int | n | ) |

Count number of leading consecutive bits. If a is positive, count leading 0's, otherwise count leading 1's.

## ◆ clb() [2/4]

unsigned clb | ( | long long | a | ) |

Count number of leading consecutive bits. If a is positive, count leading 0's, otherwise count leading 1's.

## ◆ clb() [3/4]

unsigned clb | ( | unsigned long long | a | ) |

Count number of leading consecutive 0's.

## ◆ clb() [4/4]

unsigned clb | ( | unsigned | n | ) |

Count number of leading consecutive 0's.

## ◆ delay1() [1/2]

int delay1 | ( | int |  | ) |

## ◆ delay1() [2/2]

void * delay1 | ( | void * |  | ) |

## ◆ delay2() [1/2]

int delay2 | ( | int |  | ) |

## ◆ delay2() [2/2]

void * delay2 | ( | void * |  | ) |

## ◆ delay3() [1/2]

int delay3 | ( | int |  | ) |

## ◆ delay3() [2/2]

void * delay3 | ( | void * |  | ) |

## ◆ delay4() [1/2]

int delay4 | ( | int |  | ) |

## ◆ delay4() [2/2]

void * delay4 | ( | void * |  | ) |

## ◆ delay5() [1/2]

int delay5 | ( | int |  | ) |

## ◆ delay5() [2/2]

void * delay5 | ( | void * |  | ) |

## ◆ delay6() [1/2]

int delay6 | ( | int |  | ) |

## ◆ delay6() [2/2]

void * delay6 | ( | void * |  | ) |

## ◆ nop() [1/2]

void nop | ( |  | ) |

Insert 2 pipeline bubbles in the micro-code.

Note
  Subsequent nops will be collapsed into a single nop (only the maximum value will be seen).

## ◆ nop() [2/2]

void nop | ( | unsigned | delay | ) |

Insert pipeline bubbles in the micro-code.

Parameters

  delay | Number of cycles between two instructions.

Note
  Delay must be a compile time constant.
  Subsequent nops will be collapsed into a single nop (only the maximum value will be seen).

## ◆ scalar_abs()

int scalar_abs | ( | int | a | ) |

Scalar absolute value intrinsic.

## ◆ select() [1/9]

char select | ( | bool | ,
|  | char | ,
|  | char | )

## ◆ select() [2/9]

int select | ( | bool | ,
|  | int | ,
|  | int | )

## ◆ select() [3/9]

long select | ( | bool | ,
|  | long | ,
|  | long | )

## ◆ select() [4/9]

signed short select | ( | bool | ,
|  | signed short | ,
|  | signed short | )

## ◆ select() [5/9]

unsigned char select | ( | bool | ,
|  | unsigned char | ,
|  | unsigned char | )

## ◆ select() [6/9]

unsigned int select | ( | bool | ,
|  | unsigned int | ,
|  | unsigned int | )

## ◆ select() [7/9]

unsigned long select | ( | bool | ,
|  | unsigned long | ,
|  | unsigned long | )

## ◆ select() [8/9]

unsigned short select | ( | bool | ,
|  | unsigned short | ,
|  | unsigned short | )

## ◆ select() [9/9]

void * select | ( | bool | ,
|  | void * | ,
|  | void * | )