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

Last change on this file since 6106 was 6106, checked in by cameron, 10 months ago

mergeh, mergel for arbitrary BitBlockWidth?

File size: 2.4 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
13const unsigned SSE_width = 128;
14   
15class IDISA_SSE_Builder : public virtual IDISA_Builder {
16public:
17    const unsigned NativeBitBlockWidth = SSE_width;
18    IDISA_SSE_Builder(llvm::LLVMContext & C, unsigned bitBlockWidth, unsigned laneWidth)
19    : IDISA_Builder(C, SSE_width, bitBlockWidth, laneWidth) {
20
21    }
22
23    virtual std::string getBuilderUniqueName() override;
24    llvm::Value * hsimd_signmask(unsigned fw, llvm::Value * a) override;
25    llvm::Value * mvmd_compress(unsigned fw, llvm::Value * a, llvm::Value * select_mask) override;
26    ~IDISA_SSE_Builder() {}
27};
28
29class IDISA_SSE2_Builder : public IDISA_SSE_Builder {
30public:
31    const unsigned NativeBitBlockWidth = SSE_width;
32    IDISA_SSE2_Builder(llvm::LLVMContext & C, unsigned bitBlockWidth, unsigned laneWidth)
33    : IDISA_Builder(C, SSE_width, bitBlockWidth, laneWidth)
34    , IDISA_SSE_Builder(C, bitBlockWidth, laneWidth) {
35
36    }
37
38    virtual std::string getBuilderUniqueName() override;
39    llvm::Value * hsimd_signmask(unsigned fw, llvm::Value * a) override;
40    llvm::Value * hsimd_packh(unsigned fw, llvm::Value * a, llvm::Value * b) override;
41    llvm::Value * hsimd_packl(unsigned fw, llvm::Value * a, llvm::Value * b) override;
42    std::pair<llvm::Value *, llvm::Value *> bitblock_advance(llvm::Value * a, llvm::Value * shiftin, unsigned shift) override;
43    llvm::Value * mvmd_shuffle(unsigned fw, llvm::Value * data_table, llvm::Value * index_vector) override;
44    ~IDISA_SSE2_Builder() {}
45};
46
47class IDISA_SSSE3_Builder : public IDISA_SSE2_Builder {
48public:
49    const unsigned NativeBitBlockWidth = SSE_width;
50    IDISA_SSSE3_Builder(llvm::LLVMContext & C, unsigned bitBlockWidth, unsigned laneWidth)
51    : IDISA_Builder(C, SSE_width, bitBlockWidth, laneWidth)
52    , IDISA_SSE2_Builder(C, bitBlockWidth, laneWidth)
53    {
54
55    }
56   
57    virtual std::string getBuilderUniqueName() override;
58    llvm::Value * esimd_mergeh(unsigned fw, llvm::Value * a, llvm::Value * b) override;
59    llvm::Value * esimd_mergel(unsigned fw, llvm::Value * a, llvm::Value * b) override;
60    llvm::Value * mvmd_shuffle(unsigned fw, llvm::Value * data_table, llvm::Value * index_vector) override;
61    ~IDISA_SSSE3_Builder() {}
62
63};
64
65}
66
67#endif // IDISA_SSE_BUILDER_H
Note: See TracBrowser for help on using the repository browser.