Changeset 4850


Ignore:
Timestamp:
Oct 19, 2015, 6:34:04 AM (2 years ago)
Author:
cameron
Message:

Fixes for set intersection

Location:
icGREP/icgrep-devel/icgrep
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/unicode_set.cpp

    r4818 r4850  
    2424#include <llvm/Support/Format.h>
    2525#include <include/simd-lib/builtins.hpp>
     26#include <iostream>
    2627
    2728namespace UCD {
     
    180181    for (auto i1 = quad_begin(), i2 = other.quad_begin(); i1 != e1 && i2 != e2; ) {
    181182        const auto n = std::min(i1.length(), i2.length());
    182         if (i1.type() == i2.type() && i1.type() != Mixed) {
    183             append_run(i1.type(), n, runs);
     183        if ((i1.type() == Full) && (i2.type() == Full)) {
     184            append_run(Full, n, runs);
     185            i1 += n;
     186            i2 += n;
     187        }
     188        else if ((i1.type() == Empty) || (i2.type() == Empty)) {
     189            append_run(Empty, n, runs);
    184190            i1 += n;
    185191            i2 += n;
     
    197203            i2 += n;
    198204        }
    199         else {
     205        else { //both Mixed
    200206            for (unsigned i = 0; i != n; ++i, ++i1, ++i2) {
    201207                append_quad(i1.quad() & i2.quad(), quads, runs);
  • icGREP/icgrep-devel/icgrep/re/re_compiler.cpp

    r4846 r4850  
    235235            ix->setLH(resolve(ix->getLH()));
    236236            ix->setRH(resolve(ix->getRH()));
    237             CC * lh = getDefinitionIfCC(diff->getLH());
    238             CC * rh = getDefinitionIfCC(diff->getRH());
     237            CC * lh = getDefinitionIfCC(ix->getLH());
     238            CC * rh = getDefinitionIfCC(ix->getRH());
    239239            if (lh && rh) {
    240240                return resolve(makeName("intersect", intersectCC(lh, rh)));
Note: See TracChangeset for help on using the changeset viewer.