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

Last change on this file since 5292 was 5292, checked in by nmedfort, 2 years ago

Removed 'function' and 'self' parameters from generateXXXMethod() functions.

File size: 1.1 KB
Line 
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"
7#include <IR_Gen/idisa_builder.h>  // for IDISA_Builder
8
9using namespace llvm;
10
11namespace kernel {
12
13void EvenOddKernel::generateDoBlockMethod(Value * blockNo) {
14    Value * even = iBuilder->simd_fill(64, iBuilder->getInt64(0x5555555555555555));
15    Value * odd = iBuilder->bitCast(iBuilder->simd_fill(8, iBuilder->getInt8(0xAA)));
16    Value * evenBitsPtr = getStream("even_odd", blockNo, iBuilder->getInt32(0));
17    iBuilder->CreateBlockAlignedStore(even, evenBitsPtr);
18    Value * oddBitsPtr = getStream("even_odd", blockNo, iBuilder->getInt32(1));
19    iBuilder->CreateBlockAlignedStore(odd, oddBitsPtr);
20}
21
22EvenOddKernel::EvenOddKernel(IDISA::IDISA_Builder * builder)
23: BlockOrientedKernel(builder, "EvenOdd", {Binding{builder->getStreamSetTy(8, 1), "BasisBits"}}, {Binding{builder->getStreamSetTy(2, 1), "even_odd"}}, {}, {}, {}) {
24    setNoTerminateAttribute(true);
25    setDoBlockUpdatesProducedItemCountsAttribute(false);
26
27}
28
29}
Note: See TracBrowser for help on using the repository browser.