source: icGREP/icgrep-devel/icgrep/IR_Gen/idisa_sse_builder.h @ 6076

Last change on this file since 6076 was 6076, checked in by cameron, 11 months ago

IDISA_SSSE3 builder; other IDISA operations

File size: 2.3 KB
Line 
1#ifndef IDISA_SSE_BUILDER_H
2#define IDISA_SSE_BUILDER_H
3
4/*
5 *  Copyright (c) 2018 International Characters.
6 *  This software is licensed to the public under the Open Software License 3.0.
7 */
8
9#include <IR_Gen/idisa_builder.h>
10
11namespace IDISA {
12
13class IDISA_SSE_Builder : public virtual IDISA_Builder {
14public:
15 
16    IDISA_SSE_Builder(llvm::LLVMContext & C, unsigned bitBlockWidth, unsigned stride)
17    : IDISA_Builder(C, bitBlockWidth, stride) {
18
19    }
20
21    virtual std::string getBuilderUniqueName() override;
22    llvm::Value * hsimd_signmask(unsigned fw, llvm::Value * a) override;
23    llvm::Value * mvmd_compress(unsigned fw, llvm::Value * a, llvm::Value * select_mask) override;
24    ~IDISA_SSE_Builder() {}
25};
26
27class IDISA_SSE2_Builder : public IDISA_SSE_Builder {
28public:
29 
30    IDISA_SSE2_Builder(llvm::LLVMContext & C, unsigned bitBlockWidth, unsigned stride)
31    : IDISA_Builder(C, bitBlockWidth, stride)
32    , IDISA_SSE_Builder(C, bitBlockWidth, stride) {
33
34    }
35
36    virtual std::string getBuilderUniqueName() override;
37    llvm::Value * hsimd_signmask(unsigned fw, llvm::Value * a) override;
38    llvm::Value * hsimd_packh(unsigned fw, llvm::Value * a, llvm::Value * b) override;
39    llvm::Value * hsimd_packl(unsigned fw, llvm::Value * a, llvm::Value * b) override;
40    std::pair<llvm::Value *, llvm::Value *> bitblock_advance(llvm::Value * a, llvm::Value * shiftin, unsigned shift) override;
41    llvm::Value * mvmd_shuffle(unsigned fw, llvm::Value * data_table, llvm::Value * index_vector) override;
42    ~IDISA_SSE2_Builder() {}
43};
44
45class IDISA_SSSE3_Builder : public IDISA_SSE2_Builder {
46public:
47   
48    IDISA_SSSE3_Builder(llvm::LLVMContext & C, unsigned bitBlockWidth, unsigned stride)
49    : IDISA_Builder(C, bitBlockWidth, stride)
50    , IDISA_SSE2_Builder(C, bitBlockWidth, stride)
51    {
52
53    }
54   
55    virtual std::string getBuilderUniqueName() override;
56    llvm::Value * esimd_mergeh(unsigned fw, llvm::Value * a, llvm::Value * b) override;
57    llvm::Value * esimd_mergel(unsigned fw, llvm::Value * a, llvm::Value * b) override;
58    llvm::Value * mvmd_shuffle(unsigned fw, llvm::Value * data_table, llvm::Value * index_vector) override;
59    ~IDISA_SSSE3_Builder() {}
60
61private:
62    llvm::Constant * bit_interleave_byteshuffle_table(unsigned fw);
63};
64
65}
66
67#endif // IDISA_SSE_BUILDER_H
Note: See TracBrowser for help on using the repository browser.