--- old/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java 2013-12-12 12:32:45.481342611 -0600 +++ new/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java 2013-12-12 12:32:45.397342611 -0600 @@ -648,11 +648,61 @@ throw GraalInternalError.unimplemented(); } + /** + * Emit the LIR code for the Math.Abs intrinsic. + * + * @param input the source operand + * @return Value representing the result of the operation + */ @Override public Value emitMathAbs(Value input) { - throw GraalInternalError.unimplemented(); + Variable result = newVariable(input.getPlatformKind()); + append(new Op1Stack(ABS, result, input)); + return result; + } + + /** + * Emit the LIR code for the Math.Ceil intrinsic. + * + * @param input the source operand + * @return Value representing the result of the operation + */ + public Value emitMathCeil(Value input) { + Variable result = newVariable(input.getPlatformKind()); + append(new Op1Stack(CEIL, result, input)); + return result; } + /** + * Emit the LIR code for the Math.Floor intrinsic. + * + * @param input the source operand + * @return Value representing the result of the operation + */ + public Value emitMathFloor(Value input) { + Variable result = newVariable(input.getPlatformKind()); + append(new Op1Stack(FLOOR, result, input)); + return result; + } + + /** + * Emit the LIR code for the Math.Rint intrinsic. + * + * @param input the source operand + * @return Value representing the result of the operation + */ + public Value emitMathRint(Value input) { + Variable result = newVariable(input.getPlatformKind()); + append(new Op1Stack(RINT, result, input)); + return result; + } + + /** + * Emit the LIR code for the Math.sqrt intrinsic. + * + * @param input the source operand + * @return value representing the result of the operation + */ @Override public Value emitMathSqrt(Value input) { Variable result = newVariable(input.getPlatformKind()); @@ -784,4 +834,5 @@ public void visitInfopointNode(InfopointNode i) { throw GraalInternalError.unimplemented(); } + }