Skip to content

Commit 4ba7e91

Browse files
committed
IR: Remove Int128.
1 parent 38ef77e commit 4ba7e91

17 files changed

Lines changed: 22 additions & 556 deletions

File tree

include/ir/base.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
#include "type.hpp"
2626
#include "type_alias.hpp"
27-
#include "utils/int128.hpp"
28-
#include "utils/int128.hpp"
2927
#include "utils/iterator.hpp"
3028
#include "utils/misc.hpp"
3129

@@ -384,10 +382,6 @@ class User : public Value {
384382

385383
template <typename T> std::string toIRString(T value) { return std::to_string(value); }
386384

387-
template <> inline std::string toIRString(int128_t value) {
388-
return Int128ToString(value);
389-
}
390-
391385
// Maybe there is some historical reasons :(
392386
// See https://llvm.org/docs/LangRef.html and https://groups.google.com/g/llvm-dev/c/IlqV3TbSk6M?pli=1
393387
// A Useful Tool: https://www.h-schmidt.net/FloatConverter/IEEE754.html

include/ir/constant.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#define GNALC_IR_CONSTANT_HPP
1111

1212
#include "base.hpp"
13-
#include "utils/int128.hpp"
1413

1514
#include <variant>
1615

@@ -79,7 +78,6 @@ using ConstantI1 = detail::BasicConstant<bool, IRBTYPE::I1>;
7978
using ConstantI8 = detail::BasicConstant<char, IRBTYPE::I8>;
8079
using ConstantInt = detail::BasicConstant<int, IRBTYPE::I32>;
8180
using ConstantI64 = detail::BasicConstant<int64_t, IRBTYPE::I64>;
82-
using ConstantI128 = detail::BasicConstant<int128_t, IRBTYPE::I128>;
8381
using ConstantFloat = detail::BasicConstant<float, IRBTYPE::FLOAT>;
8482
using ConstantIntVector = detail::BasicConstantVector<int, IRBTYPE::I32>;
8583
using ConstantFloatVector = detail::BasicConstantVector<float, IRBTYPE::FLOAT>;
@@ -88,7 +86,6 @@ using pConstI1 = std::shared_ptr<ConstantI1>;
8886
using pConstI8 = std::shared_ptr<ConstantI8>;
8987
using pConstI32 = std::shared_ptr<ConstantInt>;
9088
using pConstI64 = std::shared_ptr<ConstantI64>;
91-
using pConstI128 = std::shared_ptr<ConstantI128>;
9289
using pConstF32 = std::shared_ptr<ConstantFloat>;
9390
using pConstI32Vec = std::shared_ptr<ConstantIntVector>;
9491
using pConstF32Vec = std::shared_ptr<ConstantFloatVector>;
@@ -108,8 +105,6 @@ template <typename T> auto getIRConstantTypeHelper() {
108105
return ConstantInt(0);
109106
else if constexpr (std::is_same_v<U, int64_t>)
110107
return ConstantI64(0);
111-
else if constexpr (std::is_same_v<U, int128_t>)
112-
return ConstantI128(0);
113108
else if constexpr (std::is_same_v<U, float>)
114109
return ConstantFloat(0);
115110
}

include/ir/constant_pool.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class ConstantPool {
3131
pConstI8 getConst(char val);
3232
pConstI32 getConst(int val);
3333
pConstI64 getConst(int64_t val);
34-
pConstI128 getConst(int128_t val);
3534
pConstF32 getConst(float val);
3635
pConstI32Vec getConst(const std::vector<int>& val);
3736
pConstF32Vec getConst(const std::vector<float>& val);

include/ir/constant_proxy.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ class ConstantProxyHash;
2626
class ConstantProxy {
2727
friend class ConstantProxyHash;
2828

29-
std::variant<pConstI1, pConstI8, pConstI32, pConstI64, pConstI128,
30-
pConstF32, pConstI32Vec, pConstF32Vec> value;
29+
std::variant<pConstI1, pConstI8, pConstI32, pConstI64, pConstF32, pConstI32Vec, pConstF32Vec> value;
3130

3231
ConstantPool *pool;
3332

@@ -42,7 +41,6 @@ class ConstantProxy {
4241
explicit ConstantProxy(ConstantPool *pool_, pConstI8 value_);
4342
explicit ConstantProxy(ConstantPool *pool_, pConstI32 value_);
4443
explicit ConstantProxy(ConstantPool *pool_, pConstI64 value_);
45-
explicit ConstantProxy(ConstantPool *pool_, pConstI128 value_);
4644
explicit ConstantProxy(ConstantPool *pool_, pConstF32 value_);
4745
explicit ConstantProxy(ConstantPool *pool_, pConstI32Vec value_);
4846
explicit ConstantProxy(ConstantPool *pool_, pConstF32Vec value_);
@@ -53,7 +51,6 @@ class ConstantProxy {
5351
explicit ConstantProxy(ConstantPool *pool_, char value_);
5452
explicit ConstantProxy(ConstantPool *pool_, int value_);
5553
explicit ConstantProxy(ConstantPool *pool_, int64_t value_);
56-
explicit ConstantProxy(ConstantPool *pool_, int128_t value_);
5754
explicit ConstantProxy(ConstantPool *pool_, float value_);
5855
explicit ConstantProxy(ConstantPool *pool_, const std::vector<int>& value_);
5956
explicit ConstantProxy(ConstantPool *pool_, const std::vector<float>& value_);
@@ -88,14 +85,12 @@ class ConstantProxy {
8885
bool operator==(char rhs) const;
8986
bool operator==(int rhs) const;
9087
bool operator==(int64_t rhs) const;
91-
bool operator==(int128_t rhs) const;
9288
bool operator==(float rhs) const;
9389

9490
pConstI1 getConstantI1() const;
9591
pConstI8 getConstantI8() const;
9692
pConstI32 getConstantInt() const;
9793
pConstI64 getConstantI64() const;
98-
pConstI128 getConstantI128() const;
9994
pConstF32 getConstantFloat() const;
10095
pConstI32Vec getConstantIntVector() const;
10196
pConstF32Vec getConstantFloatVector() const;
@@ -106,7 +101,6 @@ class ConstantProxy {
106101
char get_i8() const;
107102
int get_int() const;
108103
int64_t get_i64() const;
109-
int128_t get_i128() const;
110104
float get_float() const;
111105
std::vector<int> get_i32_vector() const;
112106
std::vector<float> get_f32_vector() const;

include/ir/target/armv7.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ARMv7TargetInfo : public TargetInfo {
3434
return true;
3535
}
3636
bool isTypeSupported(const pType &type) const override {
37-
if (type->isI64() || type->isI128())
37+
if (type->isI64())
3838
return false;
3939
return true;
4040
}

include/ir/target/armv8.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class ARMv8TargetInfo : public TargetInfo {
1414
public:
1515
bool isInstSupported(OP op) const override { return true; }
1616
bool isTypeSupported(const pType &type) const override {
17-
if (type->isI128())
18-
return false;
1917
return true;
2018
}
2119
bool isIntrinsicSupported(const std::string &lib_fn_name) const override { return true; }

include/ir/target/riscv64.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ class RV64TargetInfo : public TargetInfo {
2626
return true;
2727
}
2828
bool isTypeSupported(const pType &type) const override {
29-
if (type->isI128())
30-
return false;
3129
return true;
3230
}
3331

include/ir/type.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ enum class IRBTYPE {
2626
I8, // For sylib's putf(char a[], ...)
2727
I32,
2828
I64,
29-
I128,
3029
FLOAT,
3130
VOID,
3231
UNDEFINED
@@ -47,8 +46,6 @@ inline size_t getBytes(IRBTYPE type) {
4746
return 4;
4847
case IRBTYPE::I64:
4948
return 8;
50-
case IRBTYPE::I128:
51-
return 16;
5249
default:
5350
Err::error("In IR::BType::getBytes(): illegal type.");
5451
return 0;
@@ -93,7 +90,6 @@ class Type : public std::enable_shared_from_this<Type> {
9390
bool isI8() const;
9491
bool isI32() const;
9592
bool isI64() const;
96-
bool isI128() const;
9793
bool isF32() const;
9894
bool isInteger() const;
9995
bool isFloatingPoint() const;
@@ -130,8 +126,6 @@ class BType : public Type {
130126
return "i32";
131127
case IRBTYPE::I64:
132128
return "i64";
133-
case IRBTYPE::I128:
134-
return "i128";
135129
case IRBTYPE::FLOAT:
136130
return "float";
137131
case IRBTYPE::VOID:

include/ir/visitor.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class IRVisitor {
4141
virtual void visit(ConstantI8 &node) { Err::not_implemented("IRVisitor::visit(ConstantI8&)"); }
4242
virtual void visit(ConstantInt &node) { Err::not_implemented("IRVisitor::visit(ConstantInt&)"); }
4343
virtual void visit(ConstantI64 &node) { Err::not_implemented("IRVisitor::visit(ConstantI64&)"); }
44-
virtual void visit(ConstantI128 &node) { Err::not_implemented("IRVisitor::visit(ConstantI128&)"); }
4544
virtual void visit(ConstantFloat &node) { Err::not_implemented("IRVisitor::visit(ConstantFloat&)"); }
4645
virtual void visit(ConstantIntVector &node) { Err::not_implemented("IRVisitor::visit(ConstantIntVector&)"); }
4746
virtual void visit(ConstantFloatVector &node) { Err::not_implemented("IRVisitor::visit(ConstantFloatVector&)"); }

0 commit comments

Comments
 (0)