1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 01:36:01 +02:00

Missing pieces of __int128 and __float128 support.

This commit is contained in:
Sergey Prigogin 2012-12-03 10:34:17 -08:00
parent 9710ad9bb6
commit 5161f8de9a

View file

@ -33,6 +33,7 @@ public abstract class ArithmeticConversion {
eComplex(IBasicType.IS_COMPLEX); eComplex(IBasicType.IS_COMPLEX);
private final int fModifier; private final int fModifier;
private Domain(int modifier) { private Domain(int modifier) {
fModifier= modifier; fModifier= modifier;
} }
@ -120,11 +121,13 @@ public abstract class ArithmeticConversion {
case eChar16: case eChar16:
case eChar32: case eChar32:
case eInt: case eInt:
case eInt128:
case eWChar: case eWChar:
return true; return true;
case eDouble: case eDouble:
case eFloat: case eFloat:
case eFloat128:
case eUnspecified: case eUnspecified:
case eVoid: case eVoid:
case eNullPtr: case eNullPtr:
@ -219,6 +222,7 @@ public abstract class ArithmeticConversion {
case eWChar: case eWChar:
case eChar16: case eChar16:
return createBasicType(Kind.eInt, domain.getModifier()); return createBasicType(Kind.eInt, domain.getModifier());
case eChar32: case eChar32:
// Assuming 32 bits // Assuming 32 bits
return createBasicType(Kind.eInt, domain.getModifier() | IBasicType.IS_UNSIGNED); return createBasicType(Kind.eInt, domain.getModifier() | IBasicType.IS_UNSIGNED);
@ -227,11 +231,15 @@ public abstract class ArithmeticConversion {
if (bt.isShort()) if (bt.isShort())
return createBasicType(Kind.eInt, domain.getModifier()); return createBasicType(Kind.eInt, domain.getModifier());
return adjustDomain(bt, domain); return adjustDomain(bt, domain);
case eInt128:
return createBasicType(Kind.eInt128, domain.getModifier() | IBasicType.IS_UNSIGNED);
case eVoid: case eVoid:
case eUnspecified: case eUnspecified:
case eDouble: case eDouble:
case eFloat: case eFloat:
case eFloat128:
case eNullPtr: case eNullPtr:
assert false; assert false;
} }
@ -271,6 +279,8 @@ public abstract class ArithmeticConversion {
} }
private Rank getIntegerRank(IBasicType type) { private Rank getIntegerRank(IBasicType type) {
if (type.getKind() == Kind.eInt128)
return Rank.eLongLong;
assert type.getKind() == Kind.eInt; assert type.getKind() == Kind.eInt;
if (type.isLongLong()) if (type.isLongLong())
return Rank.eLongLong; return Rank.eLongLong;
@ -282,7 +292,7 @@ public abstract class ArithmeticConversion {
private boolean isLongDouble(IType type) { private boolean isLongDouble(IType type) {
if (type instanceof IBasicType) { if (type instanceof IBasicType) {
final IBasicType bt= (IBasicType) type; final IBasicType bt= (IBasicType) type;
return bt.isLong() && bt.getKind() == Kind.eDouble; return bt.isLong() && bt.getKind() == Kind.eDouble || bt.getKind() == Kind.eFloat128;
} }
return false; return false;
} }