Path: blob/master/runtime/compiler/env/J9ArithEnv.cpp
6000 views
/*******************************************************************************1* Copyright (c) 2000, 2016 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception20*******************************************************************************/2122#define J9_EXTERNAL_TO_VM2324#include "env/ArithEnv.hpp"25#include "j9.h"26#include "j9cfg.h"27#include "jilconsts.h"28#include "j9protos.h"2930float31J9::ArithEnv::floatAddFloat(float a, float b)32{33return helperCFloatPlusFloat(a, b);34}3536float37J9::ArithEnv::floatSubtractFloat(float a, float b)38{39return helperCFloatMinusFloat(a, b);40}4142float43J9::ArithEnv::floatMultiplyFloat(float a, float b)44{45return helperCFloatMultiplyFloat(a, b);46}4748float49J9::ArithEnv::floatDivideFloat(float a, float b)50{51return helperCFloatDivideFloat(a, b);52}53float54J9::ArithEnv::floatRemainderFloat(float a, float b)55{56return helperCFloatRemainderFloat(a, b);57}5859float60J9::ArithEnv::floatNegate(float a)61{62float c;63helperNegateFloat(&a, &c);64return c;65}6667double68J9::ArithEnv::doubleAddDouble(double a, double b)69{70return helperCDoublePlusDouble(a, b);71}7273double74J9::ArithEnv::doubleSubtractDouble(double a, double b)75{76return helperCDoubleMinusDouble(a, b);77}7879double80J9::ArithEnv::doubleMultiplyDouble(double a, double b)81{82return helperCDoubleMultiplyDouble(a, b);83}8485double86J9::ArithEnv::doubleDivideDouble(double a, double b)87{88return helperCDoubleDivideDouble(a, b);89}90double91J9::ArithEnv::doubleRemainderDouble(double a, double b)92{93return helperCDoubleRemainderDouble(a, b);94}9596double97J9::ArithEnv::doubleNegate(double a)98{99double c;100helperNegateDouble(&a, &c);101return c;102}103104double105J9::ArithEnv::floatToDouble(float a)106{107return helperCConvertFloatToDouble(a);108}109110float111J9::ArithEnv::doubleToFloat(double a)112{113return helperCConvertDoubleToFloat(a);114}115116int64_t117J9::ArithEnv::longRemainderLong(int64_t a, int64_t b)118{119return helperCLongRemainderLong(a, b);120}121122int64_t123J9::ArithEnv::longDivideLong(int64_t a, int64_t b)124{125return helperCLongDivideLong(a, b);126}127128int64_t129J9::ArithEnv::longMultiplyLong(int64_t a, int64_t b)130{131return helperCLongMultiplyLong(a, b);132}133134135