/*
 * Copyright (c) 2016, Oracle and/or its affiliates.
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification, are
 * permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this list of
 * conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
 * conditions and the following disclaimer in the documentation and/or other materials provided
 * with the distribution.
 *
 * 3. Neither the name of the copyright holder nor the names of its contributors may be used to
 * endorse or promote products derived from this software without specific prior written
 * permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package com.oracle.truffle.llvm.intrinsics.c;

import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.llvm.LLVMIntrinsic.LLVMDoubleIntrinsic;
import com.oracle.truffle.llvm.nodes.base.floating.LLVMDoubleNode;

/**
 * Implements the C functions from math.h.
 */
public abstract class LLVMCMathsIntrinsics {

    // acos
    @NodeChild(type = LLVMDoubleNode.class)
    public abstract static class LLVMACos extends LLVMDoubleIntrinsic {

        @Specialization
        public double executeIntrinsic(double value) {
            return Math.acos(value);
        }
    }

    // asin
    @NodeChild(type = LLVMDoubleNode.class)
    public abstract static class LLVMASin extends LLVMDoubleIntrinsic {

        @Specialization
        public double executeIntrinsic(double value) {
            return Math.asin(value);
        }
    }

    // atan
    @NodeChild(type = LLVMDoubleNode.class)
    public abstract static class LLVMATan extends LLVMDoubleIntrinsic {

        @Specialization
        public double executeIntrinsic(double value) {
            return Math.atan(value);
        }
    }

    // cos
    @NodeChild(type = LLVMDoubleNode.class)
    public abstract static class LLVMCos extends LLVMDoubleIntrinsic {

        @Specialization
        public double executeIntrinsic(double value) {
            return Math.cos(value);
        }

    }

    // exp
    @NodeChild(type = LLVMDoubleNode.class)
    public abstract static class LLVMExp extends LLVMDoubleIntrinsic {

        @Specialization
        public double executeIntrinsic(double value) {
            return Math.exp(value);
        }
    }

    // log
    @NodeChild(type = LLVMDoubleNode.class)
    public abstract static class LLVMLog extends LLVMDoubleIntrinsic {

        @Specialization
        public double executeIntrinsic(double value) {
            return Math.log(value);
        }
    }

    // sqrt
    @NodeChild(type = LLVMDoubleNode.class)
    public abstract static class LLVMSqrt extends LLVMDoubleIntrinsic {

        @Specialization
        public double executeIntrinsic(double value) {
            return Math.sqrt(value);
        }

    }

    // sin
    @NodeChild(type = LLVMDoubleNode.class)
    public abstract static class LLVMSin extends LLVMDoubleIntrinsic {

        @Specialization
        public double executeIntrinsic(double value) {
            return Math.sin(value);
        }

    }

    // tan
    @NodeChild(type = LLVMDoubleNode.class)
    public abstract static class LLVMTan extends LLVMDoubleIntrinsic {

        @Specialization
        public double executeIntrinsic(double value) {
            return Math.tan(value);
        }

    }

    // tanh
    @NodeChild(type = LLVMDoubleNode.class)
    public abstract static class LLVMTanh extends LLVMDoubleIntrinsic {

        @Specialization
        public double executeIntrinsic(double value) {
            return Math.tanh(value);
        }

    }

}

@@ -1953,20 +1953,8 @@
  %7B%0A%0A
-    // acos%0A
     
@@ -1985,32 +1985,32 @@
 ubleNode.class)%0A
+
     public abstr
@@ -2203,20 +2203,8 @@
  %7D%0A%0A
-    // asin%0A
     
@@ -2453,20 +2453,8 @@
  %7D%0A%0A
-    // atan%0A
     
@@ -2703,19 +2703,8 @@
  %7D%0A%0A
-    // cos%0A
     
@@ -2952,19 +2952,8 @@
  %7D%0A%0A
-    // exp%0A
     
@@ -3200,19 +3200,8 @@
  %7D%0A%0A
-    // log%0A
     
@@ -3448,20 +3448,8 @@
  %7D%0A%0A
-    // sqrt%0A
     
@@ -3699,19 +3699,8 @@
  %7D%0A%0A
-    // sin%0A
     
@@ -3948,19 +3948,8 @@
  %7D%0A%0A
-    // tan%0A
     
@@ -4197,20 +4197,8 @@
  %7D%0A%0A
-    // tanh%0A
     

Remove redundant function name comments.