bool operator< (array_ref<U> const& t) const { T const* pself = data; U const* pother = t.data; for (; pself != &data[N] && pother != t.data[t.size()]; ++pself, ++pother) { if (*pself < *pother) return true; } if (N < t.size()) return true; return false; }
bool operator==(array_ref<U> const& t) const { if (N != t.size()) return false; T const* pself = data; U const* pother = t.data; for (; pself != &data[N]; ++pself, ++pother) { if (*pself != *pother) return false; } return true; }
/// Appends an indirect branch instruction to the active label scope. instruction goto_(value const & target, array_ref<label> const & labels) { // Note: no update to the current label. llvm::IRBuilder<> & bldr = current_builder(); llvm::IndirectBrInst * rv = SPRITE_APICALL( bldr.CreateIndirectBr(target.ptr(), labels.size()) ); for(label const & l : labels) rv->addDestination(l.ptr()); return instruction(rv); }
void f(array_ref<int> xs) { std::cout << std::accumulate(xs.begin(), xs.end(), 0) << '\n'; }
fir_state(const array_ref<const T>& taps) : taps(taps.size()), delayline(taps.size(), U(0)), delayline_cursor(0) { this->taps = reverse(make_univector(taps.data(), taps.size())); }