Package gnu.kawa.functions
Class CompileArith
- java.lang.Object
-
- gnu.kawa.functions.CompileArith
-
- All Implemented Interfaces:
Inlineable
public class CompileArith extends Object implements Inlineable
-
-
Field Summary
Fields Modifier and Type Field Description static CompileArith
MINUS
static CompileArith
PLUS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
appropriateIntConstant(Expression[] args, int iarg, InlineCalls visitor)
static boolean
appropriateLongConstant(Expression[] args, int iarg, InlineCalls visitor)
static Type
combineType(Type t1, Type t2)
void
compile(ApplyExp exp, Compilation comp, Target target)
void
compileGeneric(ApplyExp exp, Compilation comp, Target target)
boolean
compileIntNum(Expression arg1, Expression arg2, int kind1, int kind2, Compilation comp)
static CompileArith
forBitwise(Object proc)
static CompileArith
forDiv(Object proc)
static CompileArith
forMul(Object proc)
static int
getReturnKind(int kind1, int kind2, int op)
int
getReturnKind(Expression[] args)
This actually returns the "promoted argument type".Type
getReturnType(Expression[] args)
static Expression
pairwise(Procedure proc, Expression rproc, Expression[] args, InlineCalls visitor)
Convert (PROC A B C) to (PROC (PROC A B) C) etc.int
primitiveOpcode()
static Expression
validateApplyAdd(AddOp proc, ApplyExp exp, InlineCalls visitor)
static Expression
validateApplyArithOp(ApplyExp exp, InlineCalls visitor, Type required, Procedure proc)
static Expression
validateApplyDiv(DivideOp proc, ApplyExp exp, InlineCalls visitor)
static Expression
validateApplyNot(ApplyExp exp, int kind, InlineCalls visitor)
-
-
-
Field Detail
-
PLUS
public static CompileArith PLUS
-
MINUS
public static CompileArith MINUS
-
-
Method Detail
-
forMul
public static CompileArith forMul(Object proc)
-
forDiv
public static CompileArith forDiv(Object proc)
-
forBitwise
public static CompileArith forBitwise(Object proc)
-
appropriateIntConstant
public static boolean appropriateIntConstant(Expression[] args, int iarg, InlineCalls visitor)
-
appropriateLongConstant
public static boolean appropriateLongConstant(Expression[] args, int iarg, InlineCalls visitor)
-
validateApplyArithOp
public static Expression validateApplyArithOp(ApplyExp exp, InlineCalls visitor, Type required, Procedure proc)
-
compileGeneric
public void compileGeneric(ApplyExp exp, Compilation comp, Target target)
-
compile
public void compile(ApplyExp exp, Compilation comp, Target target)
- Specified by:
compile
in interfaceInlineable
-
compileIntNum
public boolean compileIntNum(Expression arg1, Expression arg2, int kind1, int kind2, Compilation comp)
-
getReturnKind
public static int getReturnKind(int kind1, int kind2, int op)
-
getReturnKind
public int getReturnKind(Expression[] args)
This actually returns the "promoted argument type". The result kind is different for divide.
-
getReturnType
public Type getReturnType(Expression[] args)
-
validateApplyAdd
public static Expression validateApplyAdd(AddOp proc, ApplyExp exp, InlineCalls visitor)
-
validateApplyDiv
public static Expression validateApplyDiv(DivideOp proc, ApplyExp exp, InlineCalls visitor)
-
validateApplyNot
public static Expression validateApplyNot(ApplyExp exp, int kind, InlineCalls visitor)
-
primitiveOpcode
public int primitiveOpcode()
-
pairwise
public static Expression pairwise(Procedure proc, Expression rproc, Expression[] args, InlineCalls visitor)
Convert (PROC A B C) to (PROC (PROC A B) C) etc.
-
-