source: icGREP/icgrep-devel/icgrep/kernels/evenodd.cpp

Last change on this file was 6261, checked in by nmedfort, 7 months ago

Work on OptimizationBranch?; revisited pipeline termination

File size: 894 bytes
RevLine 
[5282]1/*
2 *  Copyright (c) 2017 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
5
6#include "evenodd.h"
[5436]7#include <kernels/kernel_builder.h>
[5282]8
9using namespace llvm;
10
11namespace kernel {
12
[5440]13void EvenOddKernel::generateDoBlockMethod(const std::unique_ptr<KernelBuilder> & iBuilder) {
[5282]14    Value * even = iBuilder->simd_fill(64, iBuilder->getInt64(0x5555555555555555));
15    Value * odd = iBuilder->bitCast(iBuilder->simd_fill(8, iBuilder->getInt8(0xAA)));
[5440]16    iBuilder->storeOutputStreamBlock("even_odd", iBuilder->getInt32(0), even);
17    iBuilder->storeOutputStreamBlock("even_odd", iBuilder->getInt32(1), odd);
[5282]18}
19
[6261]20EvenOddKernel::EvenOddKernel(const std::unique_ptr<kernel::KernelBuilder> & b)
21: BlockOrientedKernel(b, "EvenOdd", {Binding{b->getStreamSetTy(8, 1), "BasisBits"}}, {Binding{b->getStreamSetTy(2, 1), "even_odd"}}, {}, {}, {}) {
[5282]22
23}
24
25}
Note: See TracBrowser for help on using the repository browser.