WojciechMula/ternary-logic

x86-x64 target

HJLebbink opened this issue · 2 comments

I'd like to add a x86-x64 target, something like the following:

// code=0x04, function=(B and (A nor C)), lowered=((A or C) notand B), set=intel
template<> inline unsigned int ternary<0x04>(const unsigned int A, const unsigned int B, const unsigned int C) {
    const unsigned int t0 = A | C;
    const unsigned int t1 = ~t0 & B;
    return t1;
}

Simply because searching all truth-tables with 5 variables I only need 5 registers of 32-bits. The python you provided seems to allow such modifications, but I don't know where to start. Can I reuse sse_and_avx2.txt?

Personally I would manually rewrite ternary_sse.cpp with a lot of query-replaces. How would you have added an x86 target?

I've just added these targets, please check the latest commit. Does it fulfill your needs?

Excellent, works like a charm! Thanx