Go to the documentation of this file. 1 package com.cliffc.aa.type;
6 import java.util.HashMap;
7 import java.util.function.Predicate;
16 @Override
public boolean equals( Object o ) {
17 if(
this==o )
return true;
18 if( !(o instanceof
TypeFlt) )
return false;
26 return sb.
p(
_x>0?
"~":
"").
p(Math.abs(
_x)==1?
"n":
"").
p(
"flt").
p(
_z);
43 static void init1( HashMap<String,Type> types ) {
44 types.put(
"flt32",
FLT32);
45 types.put(
"flt64",
FLT64);
46 types.put(
"flt" ,
FLT64);
73 int maxz = Math.max(
_z,tf.
_z);
74 int minz = Math.min(
_z,tf.
_z);
76 if(
_x<= 0 && tf.
_x<= 0 )
return make(Math.min(
nn(),tf.
nn()),maxz,0);
77 if(
_x > 0 && tf.
_x > 0 )
return make(Math.min(
_x,tf.
_x),minz,0);
78 if(
_x==-2 && tf.
_x== 2 )
return this;
79 if(
_x== 2 && tf.
_x==-2 )
return tf;
84 if( that.
_x<0 )
return that;
89 private int nn() { assert
_x <=0;
return _con!=0 ||
_x== -1 ? -1 : -2; }
90 static int log(
double con ) {
return ((
double)(
float)
con)==
con ? 32 : 64; }
94 @Override
public boolean is_con() {
return _x==0; }
99 if(
_x==2 )
return nil;
125 @Override
public void walk( Predicate<Type> p ) { p.test(
this); }
static final TypeFlt FLT32
static final byte TMEMPTR
static void init1(HashMap< String, Type > types)
boolean cycle_equals(Type o)
RuntimeException typerr(Type t)
Memory type; the state of all of memory; memory edges order memory ops.
an implementation of language AA
static TypeInt con(long con)
static RuntimeException unimpl()
static final byte TFUNPTR
static Type con(double con)
static final TypeFlt[] TYPES
static final byte TSTRUCT
static Type make(int x, int z, double con)
TypeFlt init(int x, int z, double con)
final Type cross_nil(Type t)
static int log(double con)
static final byte TSCALAR
Tight/tiny StringBuilder wrapper.
SB str(SB sb, VBitSet dups, TypeMem mem, boolean debug)
an implementation of language AA
static final Pool[] POOLS
void walk(Predicate< Type > p)
static final TypeFlt NFLT64
static final byte TFUNSIG
static final TypeFlt FLT64