| AI Engine-ML v2 Intrinsics User Guide v2025.2

Loading...
Searching...
No Matches
Insert and extract generating new vector
Compiler optimizations » Code optimizations

Example:

// Create a new vector based on a and b, but avoid the final extract
rule(a,b,d) {
t0 = undef();
t0 = insert(t0,0,a);
t0 = insert(t0,1,b);
d = t0;
return extract_low(t0);
} -> {
t0 = undef();
t0 = insert(t0,0,a);
t0 = insert(t0,1,b);
d = t0;
return a;
}
rule(a,b,d) {
t0 = undef();
t0 = insert(t0,0,a);
t0 = insert(t0,1,b);
d = t0;
return extract_high(t0);
} -> {
t0 = undef();
t0 = insert(t0,0,a);
t0 = insert(t0,1,b);
d = t0;
return b;
}