final BigInteger size = t.getSizeInBits().getValue();
@Override public Unit matchScalarFloat( final TFloat t) throws JPRACompilerCheckerException { final BigInteger size = t.getSizeInBits().getValue(); if (!JPRAChecker.this.caps.isVectorFloatSizeSupported(size)) { throw JPRACompilerCheckerException.vectorFloatSizeNotSupported( t, size, JPRAChecker.this.caps.getVectorFloatSizeSupported()); } return Unit.unit(); } });
@Override public Unit matchScalarFloat( final TFloat t) throws JPRACompilerCheckerException { final BigInteger size = t.getSizeInBits().getValue(); if (!JPRAChecker.this.caps.isMatrixFloatSizeSupported(size)) { throw JPRACompilerCheckerException.matrixFloatSizeNotSupported( t, size, JPRAChecker.this.caps.getMatrixFloatSizeSupported()); } return Unit.unit(); } });
@Override public Unit matchFloat(final TFloat t) final BigInteger size = t.getSizeInBits().getValue();
@Override public Unit matchScalarFloat( final TFloat t) throws JPRACompilerCheckerException { final BigInteger size = t.getSizeInBits().getValue(); if (!JPRAChecker.this.caps.isVectorFloatSizeSupported(size)) { throw JPRACompilerCheckerException.vectorFloatSizeNotSupported( t, size, JPRAChecker.this.caps.getVectorFloatSizeSupported()); } return Unit.unit(); } });
@Override public Unit matchScalarFloat( final TFloat t) throws JPRACompilerCheckerException { final BigInteger size = t.getSizeInBits().getValue(); if (!JPRAChecker.this.caps.isMatrixFloatSizeSupported(size)) { throw JPRACompilerCheckerException.matrixFloatSizeNotSupported( t, size, JPRAChecker.this.caps.getMatrixFloatSizeSupported()); } return Unit.unit(); } });
@Override public Unit matchFloat(final TFloat t) { /* Construct a meta type field, and assign a value to it. */ final FieldName f_name = this.field.getName(); final ClassName c_name = JPRAClasses.getModelScalarTypeForScalarType(t); final String meta_field_name = JPRAGeneratedNames.getMetaTypeFieldName(f_name); this.class_builder.addField( c_name, meta_field_name, Modifier.FINAL, Modifier.PRIVATE); this.constructor_builder.addStatement( "this.$N = $T.of($L)", meta_field_name, c_name, t.getSizeInBits().getValue()); return Unit.unit(); }
final TFloat t) final int e_size = t.getSizeInBits().getValue().intValue(); switch (e_size) { case 32: {
final TFloat t) final int e_size = t.getSizeInBits().getValue().intValue(); switch (e_size) { case 16: {
@Test public final void testRecordTypeExprFloatSizeSupported() throws Exception { final JPRAParserType p = this.newParser(); final GlobalContextType c = GlobalContexts.newContext(new AlwaysEmptyLoader()); final JPRAResolverType r = this.newResolver(c); final JPRACheckerType ch = this.newChecker( c, JPRACheckerStandardCapabilities.newCapabilities()); final TypeExprType<IdentifierType, Untyped> te = r.resolveTypeExpression( p.parseTypeExpression( this.newStringSExpr("(float 32)"))); final TypeExprFloat<IdentifierType, TType> e = TypeExprFloat.class.cast(ch.checkTypeExpression(te)); final TFloat ti = TFloat.class.cast(e.getType()); Assert.assertEquals(BigInteger.valueOf(32L), ti.getSizeInBits().getValue()); }