Skip to content

Commit

Permalink
Added __int128
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed May 1, 2024
1 parent 36ca39e commit 8c1db67
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 0 deletions.
@@ -0,0 +1,50 @@
/*
* Copyright 2024 Budapest University of Technology and Economics
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package hu.bme.mit.theta.frontend.transformation.model.types.complex.integer.c128;

import hu.bme.mit.theta.frontend.ParseContext;
import hu.bme.mit.theta.frontend.transformation.model.types.complex.integer.CInteger;
import hu.bme.mit.theta.frontend.transformation.model.types.simple.CSimpleType;

public abstract class C128 extends CInteger {

private static final int RANK = 60;

protected C128(CSimpleType origin, ParseContext parseContext) {
super(origin, parseContext);
rank = RANK;
}

public <T, R> R accept(CComplexTypeVisitor<T, R> visitor, T param) {
return visitor.visit(this, param);
}

@Override
public String getTypeName() {
return "__int128";
}

@Override
public CInteger getSignedVersion() {
return new CSigned128(null, parseContext);
}

@Override
public CInteger getUnsignedVersion() {
return new CUnsigned128(null, parseContext);
}
}
@@ -0,0 +1,32 @@
/*
* Copyright 2024 Budapest University of Technology and Economics
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package hu.bme.mit.theta.frontend.transformation.model.types.complex.integer.c128;

import hu.bme.mit.theta.frontend.ParseContext;
import hu.bme.mit.theta.frontend.transformation.model.types.complex.integer.Signed;
import hu.bme.mit.theta.frontend.transformation.model.types.simple.CSimpleType;

public class CSigned128 extends C128 implements Signed {

public CSigned128(CSimpleType origin, ParseContext parseContext) {
super(origin, parseContext);
}

public <T, R> R accept(CComplexTypeVisitor<T, R> visitor, T param) {
return visitor.visit(this, param);
}
}
@@ -0,0 +1,33 @@
/*
* Copyright 2024 Budapest University of Technology and Economics
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package hu.bme.mit.theta.frontend.transformation.model.types.complex.integer.c128;

import hu.bme.mit.theta.frontend.ParseContext;
import hu.bme.mit.theta.frontend.transformation.model.types.complex.integer.Unsigned;
import hu.bme.mit.theta.frontend.transformation.model.types.simple.CSimpleType;

public class CUnsigned128 extends C128 implements Unsigned {

public CUnsigned128(CSimpleType origin, ParseContext parseContext) {
super(origin, parseContext);
unsigned = true;
}

public <T, R> R accept(CComplexTypeVisitor<T, R> visitor, T param) {
return visitor.visit(this, param);
}
}

0 comments on commit 8c1db67

Please sign in to comment.