diff --git a/runtime/src/main/cpp/Natives.h b/runtime/src/main/cpp/Natives.h index fde5fbdfd38..bda14ffcc7e 100644 --- a/runtime/src/main/cpp/Natives.h +++ b/runtime/src/main/cpp/Natives.h @@ -8,7 +8,11 @@ typedef uint8_t KBool; typedef uint8_t KByte; typedef uint16_t KChar; // Note that it is signed. +typedef int16_t KShort; typedef int32_t KInt; +typedef int64_t KLong; +typedef float KFloat; +typedef double KDouble; typedef ObjHeader* KRef; typedef const ObjHeader* KConstRef; diff --git a/runtime/src/main/cpp/Operator.cpp b/runtime/src/main/cpp/Operator.cpp new file mode 100644 index 00000000000..3b371c284c1 --- /dev/null +++ b/runtime/src/main/cpp/Operator.cpp @@ -0,0 +1,342 @@ +#include + +#include "Natives.h" + + +extern "C" { +//--- Byte --------------------------------------------------------------------// + +KInt Kotlin_Byte_compareTo_Byte (KByte a, KByte b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Byte_compareTo_Short (KByte a, KShort b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Byte_compareTo_Int (KByte a, KInt b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Byte_compareTo_Long (KByte a, KLong b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Byte_compareTo_Float (KByte a, KFloat b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Byte_compareTo_Double (KByte a, KDouble b) { if (a == b) return 0; return (a < b) ? -1 : 1; } + +KInt Kotlin_Byte_plus_Byte (KByte a, KByte b) { return a + b; } +KInt Kotlin_Byte_plus_Short (KByte a, KShort b) { return a + b; } +KInt Kotlin_Byte_plus_Int (KByte a, KInt b) { return a + b; } +KLong Kotlin_Byte_plus_Long (KByte a, KLong b) { return a + b; } +KFloat Kotlin_Byte_plus_Float (KByte a, KFloat b) { return a + b; } +KDouble Kotlin_Byte_plus_Double (KByte a, KDouble b) { return a + b; } + +KInt Kotlin_Byte_minus_Byte (KByte a, KByte b) { return a - b; } +KInt Kotlin_Byte_minus_Short (KByte a, KShort b) { return a - b; } +KInt Kotlin_Byte_minus_Int (KByte a, KInt b) { return a - b; } +KLong Kotlin_Byte_minus_Long (KByte a, KLong b) { return a - b; } +KFloat Kotlin_Byte_minus_Float (KByte a, KFloat b) { return a - b; } +KDouble Kotlin_Byte_minus_Double (KByte a, KDouble b) { return a - b; } + +KInt Kotlin_Byte_div_Byte (KByte a, KByte b) { return a / b; } +KInt Kotlin_Byte_div_Short (KByte a, KShort b) { return a / b; } +KInt Kotlin_Byte_div_Int (KByte a, KInt b) { return a / b; } +KLong Kotlin_Byte_div_Long (KByte a, KLong b) { return a / b; } +KFloat Kotlin_Byte_div_Float (KByte a, KFloat b) { return a / b; } +KDouble Kotlin_Byte_div_Double (KByte a, KDouble b) { return a / b; } + +KInt Kotlin_Byte_mod_Byte (KByte a, KByte b) { return a % b; } +KInt Kotlin_Byte_mod_Short (KByte a, KShort b) { return a % b; } +KInt Kotlin_Byte_mod_Int (KByte a, KInt b) { return a % b; } +KLong Kotlin_Byte_mod_Long (KByte a, KLong b) { return a % b; } +KFloat Kotlin_Byte_mod_Float (KByte a, KFloat b) { return fmodf(a, b); } +KDouble Kotlin_Byte_mod_Double (KByte a, KDouble b) { return fmod (a, b); } + +KInt Kotlin_Byte_times_Byte (KByte a, KByte b) { return a * b; } +KInt Kotlin_Byte_times_Short (KByte a, KShort b) { return a * b; } +KInt Kotlin_Byte_times_Int (KByte a, KInt b) { return a * b; } +KLong Kotlin_Byte_times_Long (KByte a, KLong b) { return a * b; } +KFloat Kotlin_Byte_times_Float (KByte a, KFloat b) { return a * b; } +KDouble Kotlin_Byte_times_Double (KByte a, KDouble b) { return a * b; } + +KByte Kotlin_Byte_inc (KByte a ) { return ++a; } +KByte Kotlin_Byte_dec (KByte a ) { return --a; } +KInt Kotlin_Byte_unaryPlus (KByte a ) { return +a; } +KInt Kotlin_Byte_unaryMinus (KByte a ) { return -a; } + +KByte Kotlin_Byte_toByte (KByte a ) { return a; } +KShort Kotlin_Byte_toShort (KByte a ) { return a; } +KInt Kotlin_Byte_toInt (KByte a ) { return a; } +KLong Kotlin_Byte_toLong (KByte a ) { return a; } +KFloat Kotlin_Byte_toFloat (KByte a ) { return a; } +KDouble Kotlin_Byte_toDouble (KByte a ) { return a; } + +//--- Short -------------------------------------------------------------------// + +KInt Kotlin_Short_compareTo_Byte (KShort a, KByte b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Short_compareTo_Short (KShort a, KShort b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Short_compareTo_Int (KShort a, KInt b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Short_compareTo_Long (KShort a, KLong b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Short_compareTo_Float (KShort a, KFloat b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Short_compareTo_Double (KShort a, KDouble b) { if (a == b) return 0; return (a < b) ? -1 : 1; } + +KInt Kotlin_Short_plus_Byte (KShort a, KByte b) { return a + b; } +KInt Kotlin_Short_plus_Short (KShort a, KShort b) { return a + b; } +KInt Kotlin_Short_plus_Int (KShort a, KInt b) { return a + b; } +KLong Kotlin_Short_plus_Long (KShort a, KLong b) { return a + b; } +KFloat Kotlin_Short_plus_Float (KShort a, KFloat b) { return a + b; } +KDouble Kotlin_Short_plus_Double (KShort a, KDouble b) { return a + b; } + +KInt Kotlin_Short_minus_Byte (KShort a, KByte b) { return a - b; } +KInt Kotlin_Short_minus_Short (KShort a, KShort b) { return a - b; } +KInt Kotlin_Short_minus_Int (KShort a, KInt b) { return a - b; } +KLong Kotlin_Short_minus_Long (KShort a, KLong b) { return a - b; } +KFloat Kotlin_Short_minus_Float (KShort a, KFloat b) { return a - b; } +KDouble Kotlin_Short_minus_Double (KShort a, KDouble b) { return a - b; } + +KInt Kotlin_Short_div_Byte (KShort a, KByte b) { return a / b; } +KInt Kotlin_Short_div_Short (KShort a, KShort b) { return a / b; } +KInt Kotlin_Short_div_Int (KShort a, KInt b) { return a / b; } +KLong Kotlin_Short_div_Long (KShort a, KLong b) { return a / b; } +KFloat Kotlin_Short_div_Float (KShort a, KFloat b) { return a / b; } +KDouble Kotlin_Short_div_Double (KShort a, KDouble b) { return a / b; } + +KInt Kotlin_Short_mod_Byte (KShort a, KByte b) { return a % b; } +KInt Kotlin_Short_mod_Short (KShort a, KShort b) { return a % b; } +KInt Kotlin_Short_mod_Int (KShort a, KInt b) { return a % b; } +KLong Kotlin_Short_mod_Long (KShort a, KLong b) { return a % b; } +KFloat Kotlin_Short_mod_Float (KShort a, KFloat b) { return fmodf(a, b); } +KDouble Kotlin_Short_mod_Double (KShort a, KDouble b) { return fmod (a, b); } + +KInt Kotlin_Short_times_Byte (KShort a, KByte b) { return a * b; } +KInt Kotlin_Short_times_Short (KShort a, KShort b) { return a * b; } +KInt Kotlin_Short_times_Int (KShort a, KInt b) { return a * b; } +KLong Kotlin_Short_times_Long (KShort a, KLong b) { return a * b; } +KFloat Kotlin_Short_times_Float (KShort a, KFloat b) { return a * b; } +KDouble Kotlin_Short_times_Double (KShort a, KDouble b) { return a * b; } + +KShort Kotlin_Short_inc (KShort a ) { return ++a; } +KShort Kotlin_Short_dec (KShort a ) { return --a; } +KInt Kotlin_Short_unaryPlus (KShort a ) { return +a; } +KInt Kotlin_Short_unaryMinus (KShort a ) { return -a; } + +KByte Kotlin_Short_toByte (KShort a ) { return a; } +KShort Kotlin_Short_toShort (KShort a ) { return a; } +KInt Kotlin_Short_toInt (KShort a ) { return a; } +KLong Kotlin_Short_toLong (KShort a ) { return a; } +KFloat Kotlin_Short_toFloat (KShort a ) { return a; } +KDouble Kotlin_Short_toDouble (KShort a ) { return a; } + +//--- Int ---------------------------------------------------------------------// + +KInt Kotlin_Int_compareTo_Byte (KInt a, KByte b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Int_compareTo_Short (KInt a, KShort b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Int_compareTo_Int (KInt a, KInt b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Int_compareTo_Long (KInt a, KLong b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Int_compareTo_Float (KInt a, KFloat b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Int_compareTo_Double (KInt a, KDouble b) { if (a == b) return 0; return (a < b) ? -1 : 1; } + +KInt Kotlin_Int_plus_Byte (KInt a, KByte b) { return a + b; } +KInt Kotlin_Int_plus_Short (KInt a, KShort b) { return a + b; } +KInt Kotlin_Int_plus_Int (KInt a, KInt b) { return a + b; } +KLong Kotlin_Int_plus_Long (KInt a, KLong b) { return a + b; } +KFloat Kotlin_Int_plus_Float (KInt a, KFloat b) { return a + b; } +KDouble Kotlin_Int_plus_Double (KInt a, KDouble b) { return a + b; } + +KInt Kotlin_Int_minus_Byte (KInt a, KByte b) { return a - b; } +KInt Kotlin_Int_minus_Short (KInt a, KShort b) { return a - b; } +KInt Kotlin_Int_minus_Int (KInt a, KInt b) { return a - b; } +KLong Kotlin_Int_minus_Long (KInt a, KLong b) { return a - b; } +KFloat Kotlin_Int_minus_Float (KInt a, KFloat b) { return a - b; } +KDouble Kotlin_Int_minus_Double (KInt a, KDouble b) { return a - b; } + +KInt Kotlin_Int_div_Byte (KInt a, KByte b) { return a / b; } +KInt Kotlin_Int_div_Short (KInt a, KShort b) { return a / b; } +KInt Kotlin_Int_div_Int (KInt a, KInt b) { return a / b; } +KLong Kotlin_Int_div_Long (KInt a, KLong b) { return a / b; } +KFloat Kotlin_Int_div_Float (KInt a, KFloat b) { return a / b; } +KDouble Kotlin_Int_div_Double (KInt a, KDouble b) { return a / b; } + +KInt Kotlin_Int_mod_Byte (KInt a, KByte b) { return a % b; } +KInt Kotlin_Int_mod_Short (KInt a, KShort b) { return a % b; } +KInt Kotlin_Int_mod_Int (KInt a, KInt b) { return a % b; } +KLong Kotlin_Int_mod_Long (KInt a, KLong b) { return a % b; } +KFloat Kotlin_Int_mod_Float (KInt a, KFloat b) { return fmodf(a, b); } +KDouble Kotlin_Int_mod_Double (KInt a, KDouble b) { return fmod (a, b); } + +KInt Kotlin_Int_times_Byte (KInt a, KByte b) { return a * b; } +KInt Kotlin_Int_times_Short (KInt a, KShort b) { return a * b; } +KInt Kotlin_Int_times_Int (KInt a, KInt b) { return a * b; } +KLong Kotlin_Int_times_Long (KInt a, KLong b) { return a * b; } +KFloat Kotlin_Int_times_Float (KInt a, KFloat b) { return a * b; } +KDouble Kotlin_Int_times_Double (KInt a, KDouble b) { return a * b; } + +KInt Kotlin_Int_inc (KInt a ) { return ++a; } +KInt Kotlin_Int_dec (KInt a ) { return --a; } +KInt Kotlin_Int_unaryPlus (KInt a ) { return +a; } +KInt Kotlin_Int_unaryMinus (KInt a ) { return -a; } + +KByte Kotlin_Int_toByte (KInt a ) { return a; } +KShort Kotlin_Int_toShort (KInt a ) { return a; } +KInt Kotlin_Int_toInt (KInt a ) { return a; } +KLong Kotlin_Int_toLong (KInt a ) { return a; } +KFloat Kotlin_Int_toFloat (KInt a ) { return a; } +KDouble Kotlin_Int_toDouble (KInt a ) { return a; } + +//--- Long --------------------------------------------------------------------// + +KInt Kotlin_Long_compareTo_Byte (KLong a, KByte b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Long_compareTo_Short (KLong a, KShort b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Long_compareTo_Int (KLong a, KInt b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Long_compareTo_Long (KLong a, KLong b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Long_compareTo_Float (KLong a, KFloat b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Long_compareTo_Double (KLong a, KDouble b) { if (a == b) return 0; return (a < b) ? -1 : 1; } + +KLong Kotlin_Long_plus_Byte (KLong a, KByte b) { return a + b; } +KLong Kotlin_Long_plus_Short (KLong a, KShort b) { return a + b; } +KLong Kotlin_Long_plus_Int (KLong a, KInt b) { return a + b; } +KLong Kotlin_Long_plus_Long (KLong a, KLong b) { return a + b; } +KFloat Kotlin_Long_plus_Float (KLong a, KFloat b) { return a + b; } +KDouble Kotlin_Long_plus_Double (KLong a, KDouble b) { return a + b; } + +KLong Kotlin_Long_minus_Byte (KLong a, KByte b) { return a - b; } +KLong Kotlin_Long_minus_Short (KLong a, KShort b) { return a - b; } +KLong Kotlin_Long_minus_Int (KLong a, KInt b) { return a - b; } +KLong Kotlin_Long_minus_Long (KLong a, KLong b) { return a - b; } +KFloat Kotlin_Long_minus_Float (KLong a, KFloat b) { return a - b; } +KDouble Kotlin_Long_minus_Double (KLong a, KDouble b) { return a - b; } + +KLong Kotlin_Long_div_Byte (KLong a, KByte b) { return a / b; } +KLong Kotlin_Long_div_Short (KLong a, KShort b) { return a / b; } +KLong Kotlin_Long_div_Int (KLong a, KInt b) { return a / b; } +KLong Kotlin_Long_div_Long (KLong a, KLong b) { return a / b; } +KFloat Kotlin_Long_div_Float (KLong a, KFloat b) { return a / b; } +KDouble Kotlin_Long_div_Double (KLong a, KDouble b) { return a / b; } + +KLong Kotlin_Long_mod_Byte (KLong a, KByte b) { return a % b; } +KLong Kotlin_Long_mod_Short (KLong a, KShort b) { return a % b; } +KLong Kotlin_Long_mod_Int (KLong a, KInt b) { return a % b; } +KLong Kotlin_Long_mod_Long (KLong a, KLong b) { return a % b; } +KFloat Kotlin_Long_mod_Float (KLong a, KFloat b) { return fmodf(a, b); } +KDouble Kotlin_Long_mod_Double (KLong a, KDouble b) { return fmod (a, b); } + +KLong Kotlin_Long_times_Byte (KLong a, KByte b) { return a * b; } +KLong Kotlin_Long_times_Short (KLong a, KShort b) { return a * b; } +KLong Kotlin_Long_times_Int (KLong a, KInt b) { return a * b; } +KLong Kotlin_Long_times_Long (KLong a, KLong b) { return a * b; } +KFloat Kotlin_Long_times_Float (KLong a, KFloat b) { return a * b; } +KDouble Kotlin_Long_times_Double (KLong a, KDouble b) { return a * b; } + +KLong Kotlin_Long_inc (KLong a ) { return ++a; } +KLong Kotlin_Long_dec (KLong a ) { return --a; } +KLong Kotlin_Long_unaryPlus (KLong a ) { return +a; } +KLong Kotlin_Long_unaryMinus (KLong a ) { return -a; } + +KByte Kotlin_Long_toByte (KLong a ) { return a; } +KShort Kotlin_Long_toShort (KLong a ) { return a; } +KInt Kotlin_Long_toInt (KLong a ) { return a; } +KLong Kotlin_Long_toLong (KLong a ) { return a; } +KFloat Kotlin_Long_toFloat (KLong a ) { return a; } +KDouble Kotlin_Long_toDouble (KLong a ) { return a; } + +//--- Float -------------------------------------------------------------------// + +KInt Kotlin_Float_compareTo_Byte (KFloat a, KByte b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Float_compareTo_Short (KFloat a, KShort b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Float_compareTo_Int (KFloat a, KInt b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Float_compareTo_Long (KFloat a, KLong b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Float_compareTo_Float (KFloat a, KFloat b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Float_compareTo_Double (KFloat a, KDouble b) { if (a == b) return 0; return (a < b) ? -1 : 1; } + +KFloat Kotlin_Float_plus_Byte (KFloat a, KByte b) { return a + b; } +KFloat Kotlin_Float_plus_Short (KFloat a, KShort b) { return a + b; } +KFloat Kotlin_Float_plus_Int (KFloat a, KInt b) { return a + b; } +KFloat Kotlin_Float_plus_Long (KFloat a, KLong b) { return a + b; } +KFloat Kotlin_Float_plus_Float (KFloat a, KFloat b) { return a + b; } +KDouble Kotlin_Float_plus_Double (KFloat a, KDouble b) { return a + b; } + +KFloat Kotlin_Float_minus_Byte (KFloat a, KByte b) { return a - b; } +KFloat Kotlin_Float_minus_Short (KFloat a, KShort b) { return a - b; } +KFloat Kotlin_Float_minus_Int (KFloat a, KInt b) { return a - b; } +KFloat Kotlin_Float_minus_Long (KFloat a, KLong b) { return a - b; } +KFloat Kotlin_Float_minus_Float (KFloat a, KFloat b) { return a - b; } +KDouble Kotlin_Float_minus_Double (KFloat a, KDouble b) { return a - b; } + +KFloat Kotlin_Float_div_Byte (KFloat a, KByte b) { return a / b; } +KFloat Kotlin_Float_div_Short (KFloat a, KShort b) { return a / b; } +KFloat Kotlin_Float_div_Int (KFloat a, KInt b) { return a / b; } +KFloat Kotlin_Float_div_Long (KFloat a, KLong b) { return a / b; } +KFloat Kotlin_Float_div_Float (KFloat a, KFloat b) { return a / b; } +KDouble Kotlin_Float_div_Double (KFloat a, KDouble b) { return a / b; } + +KFloat Kotlin_Float_mod_Byte (KFloat a, KByte b) { return fmodf(a, b); } +KFloat Kotlin_Float_mod_Short (KFloat a, KShort b) { return fmodf(a, b); } +KFloat Kotlin_Float_mod_Int (KFloat a, KInt b) { return fmodf(a, b); } +KFloat Kotlin_Float_mod_Long (KFloat a, KLong b) { return fmodf(a, b); } +KFloat Kotlin_Float_mod_Float (KFloat a, KFloat b) { return fmodf(a, b); } +KDouble Kotlin_Float_mod_Double (KFloat a, KDouble b) { return fmod (a, b); } + +KFloat Kotlin_Float_times_Byte (KFloat a, KByte b) { return a * b; } +KFloat Kotlin_Float_times_Short (KFloat a, KShort b) { return a * b; } +KFloat Kotlin_Float_times_Int (KFloat a, KInt b) { return a * b; } +KFloat Kotlin_Float_times_Long (KFloat a, KLong b) { return a * b; } +KFloat Kotlin_Float_times_Float (KFloat a, KFloat b) { return a * b; } +KDouble Kotlin_Float_times_Double (KFloat a, KDouble b) { return a * b; } + +KFloat Kotlin_Float_inc (KFloat a ) { return ++a; } +KFloat Kotlin_Float_dec (KFloat a ) { return --a; } +KFloat Kotlin_Float_unaryPlus (KFloat a ) { return +a; } +KFloat Kotlin_Float_unaryMinus (KFloat a ) { return -a; } + +KByte Kotlin_Float_toByte (KFloat a ) { return a; } +KShort Kotlin_Float_toShort (KFloat a ) { return a; } +KInt Kotlin_Float_toInt (KFloat a ) { return a; } +KLong Kotlin_Float_toLong (KFloat a ) { return a; } +KFloat Kotlin_Float_toFloat (KFloat a ) { return a; } +KDouble Kotlin_Float_toDouble (KFloat a ) { return a; } + +//--- Double ------------------------------------------------------------------// + +KInt Kotlin_Double_compareTo_Byte (KDouble a, KByte b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Double_compareTo_Short (KDouble a, KShort b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Double_compareTo_Int (KDouble a, KInt b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Double_compareTo_Long (KDouble a, KLong b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Double_compareTo_Float (KDouble a, KFloat b) { if (a == b) return 0; return (a < b) ? -1 : 1; } +KInt Kotlin_Double_compareTo_Double (KDouble a, KDouble b) { if (a == b) return 0; return (a < b) ? -1 : 1; } + +KDouble Kotlin_Double_plus_Byte (KDouble a, KByte b) { return a + b; } +KDouble Kotlin_Double_plus_Short (KDouble a, KShort b) { return a + b; } +KDouble Kotlin_Double_plus_Int (KDouble a, KInt b) { return a + b; } +KDouble Kotlin_Double_plus_Long (KDouble a, KLong b) { return a + b; } +KDouble Kotlin_Double_plus_Float (KDouble a, KFloat b) { return a + b; } +KDouble Kotlin_Double_plus_Double (KDouble a, KDouble b) { return a + b; } + +KDouble Kotlin_Double_minus_Byte (KDouble a, KByte b) { return a - b; } +KDouble Kotlin_Double_minus_Short (KDouble a, KShort b) { return a - b; } +KDouble Kotlin_Double_minus_Int (KDouble a, KInt b) { return a - b; } +KDouble Kotlin_Double_minus_Long (KDouble a, KLong b) { return a - b; } +KDouble Kotlin_Double_minus_Float (KDouble a, KFloat b) { return a - b; } +KDouble Kotlin_Double_minus_Double (KDouble a, KDouble b) { return a - b; } + +KDouble Kotlin_Double_div_Byte (KDouble a, KByte b) { return a / b; } +KDouble Kotlin_Double_div_Short (KDouble a, KShort b) { return a / b; } +KDouble Kotlin_Double_div_Int (KDouble a, KInt b) { return a / b; } +KDouble Kotlin_Double_div_Long (KDouble a, KLong b) { return a / b; } +KDouble Kotlin_Double_div_Float (KDouble a, KFloat b) { return a / b; } +KDouble Kotlin_Double_div_Double (KDouble a, KDouble b) { return a / b; } + +KDouble Kotlin_Double_mod_Byte (KDouble a, KByte b) { return fmod(a, b); } +KDouble Kotlin_Double_mod_Short (KDouble a, KShort b) { return fmod(a, b); } +KDouble Kotlin_Double_mod_Int (KDouble a, KInt b) { return fmod(a, b); } +KDouble Kotlin_Double_mod_Long (KDouble a, KLong b) { return fmod(a, b); } +KDouble Kotlin_Double_mod_Float (KDouble a, KFloat b) { return fmod(a, b); } +KDouble Kotlin_Double_mod_Double (KDouble a, KDouble b) { return fmod(a, b); } + +KDouble Kotlin_Double_times_Byte (KDouble a, KByte b) { return a * b; } +KDouble Kotlin_Double_times_Short (KDouble a, KShort b) { return a * b; } +KDouble Kotlin_Double_times_Int (KDouble a, KInt b) { return a * b; } +KDouble Kotlin_Double_times_Long (KDouble a, KLong b) { return a * b; } +KDouble Kotlin_Double_times_Float (KDouble a, KFloat b) { return a * b; } +KDouble Kotlin_Double_times_Double (KDouble a, KDouble b) { return a * b; } + +KDouble Kotlin_Double_inc (KDouble a ) { return ++a; } +KDouble Kotlin_Double_dec (KDouble a ) { return --a; } +KDouble Kotlin_Double_unaryPlus (KDouble a ) { return +a; } +KDouble Kotlin_Double_unaryMinus (KDouble a ) { return -a; } + +KByte Kotlin_Double_toByte (KDouble a ) { return a; } +KShort Kotlin_Double_toShort (KDouble a ) { return a; } +KInt Kotlin_Double_toInt (KDouble a ) { return a; } +KLong Kotlin_Double_toLong (KDouble a ) { return a; } +KFloat Kotlin_Double_toFloat (KDouble a ) { return a; } +KDouble Kotlin_Double_toDouble (KDouble a ) { return a; } +} // extern "C" \ No newline at end of file diff --git a/runtime/src/main/kotlin/kotlin/Primitives.kt b/runtime/src/main/kotlin/kotlin/Primitives.kt index 2b28107c21a..a0eb66e935b 100644 --- a/runtime/src/main/kotlin/kotlin/Primitives.kt +++ b/runtime/src/main/kotlin/kotlin/Primitives.kt @@ -22,110 +22,150 @@ public class Byte : Number(), Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Byte_compareTo_Byte") external public override operator fun compareTo(other: Byte): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Byte_compareTo_Short") external public operator fun compareTo(other: Short): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Byte_compareTo_Int") external public operator fun compareTo(other: Int): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Byte_compareTo_Long") external public operator fun compareTo(other: Long): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Byte_compareTo_Float") external public operator fun compareTo(other: Float): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Byte_compareTo_Double") external public operator fun compareTo(other: Double): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Byte_plus_Byte") external public operator fun plus(other: Byte): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Byte_plus_Short") external public operator fun plus(other: Short): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Byte_plus_Int") external public operator fun plus(other: Int): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Byte_plus_Long") external public operator fun plus(other: Long): Long /** Adds the other value to this value. */ + @SymbolName("Kotlin_Byte_plus_Float") external public operator fun plus(other: Float): Float /** Adds the other value to this value. */ + @SymbolName("Kotlin_Byte_plus_Double") external public operator fun plus(other: Double): Double /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Byte_minus_Byte") external public operator fun minus(other: Byte): Int /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Byte_minus_Short") external public operator fun minus(other: Short): Int /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Byte_minus_Int") external public operator fun minus(other: Int): Int /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Byte_minus_Long") external public operator fun minus(other: Long): Long /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Byte_minus_Float") external public operator fun minus(other: Float): Float /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Byte_minus_Double") external public operator fun minus(other: Double): Double /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Byte_times_Byte") external public operator fun times(other: Byte): Int /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Byte_times_Short") external public operator fun times(other: Short): Int /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Byte_times_Int") external public operator fun times(other: Int): Int /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Byte_times_Long") external public operator fun times(other: Long): Long /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Byte_times_Float") external public operator fun times(other: Float): Float /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Byte_times_Double") external public operator fun times(other: Double): Double /** Divides this value by the other value. */ + @SymbolName("Kotlin_Byte_div_Byte") external public operator fun div(other: Byte): Int /** Divides this value by the other value. */ + @SymbolName("Kotlin_Byte_div_Short") external public operator fun div(other: Short): Int /** Divides this value by the other value. */ + @SymbolName("Kotlin_Byte_div_Int") external public operator fun div(other: Int): Int /** Divides this value by the other value. */ + @SymbolName("Kotlin_Byte_div_Long") external public operator fun div(other: Long): Long /** Divides this value by the other value. */ + @SymbolName("Kotlin_Byte_div_Float") external public operator fun div(other: Float): Float /** Divides this value by the other value. */ + @SymbolName("Kotlin_Byte_div_Double") external public operator fun div(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Byte_mod_Byte") external public operator fun mod(other: Byte): Int /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Byte_mod_Short") external public operator fun mod(other: Short): Int /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Byte_mod_Int") external public operator fun mod(other: Int): Int /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Byte_mod_Long") external public operator fun mod(other: Long): Long /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Byte_mod_Float") external public operator fun mod(other: Float): Float /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Byte_mod_Double") external public operator fun mod(other: Double): Double /** Increments this value. */ + @SymbolName("Kotlin_Byte_inc") external public operator fun inc(): Byte /** Decrements this value. */ + @SymbolName("Kotlin_Byte_dec") external public operator fun dec(): Byte /** Returns this value. */ + @SymbolName("Kotlin_Byte_unaryPlus") external public operator fun unaryPlus(): Int /** Returns the negative of this value. */ + @SymbolName("Kotlin_Byte_unaryMinus") external public operator fun unaryMinus(): Int /** Creates a range from this value to the specified [other] value. */ @@ -137,12 +177,19 @@ public class Byte : Number(), Comparable { /** Creates a range from this value to the specified [other] value. */ // external public operator fun rangeTo(other: Long): LongRange + @SymbolName("Kotlin_Byte_toByte") external public override fun toByte(): Byte + @SymbolName("Kotlin_Byte_toChar") external public override fun toChar(): Char + @SymbolName("Kotlin_Byte_toShort") external public override fun toShort(): Short + @SymbolName("Kotlin_Byte_toInt") external public override fun toInt(): Int + @SymbolName("Kotlin_Byte_toLong") external public override fun toLong(): Long + @SymbolName("Kotlin_Byte_toFloat") external public override fun toFloat(): Float + @SymbolName("Kotlin_Byte_toDouble") external public override fun toDouble(): Double // Konan-specific. @@ -172,110 +219,150 @@ public class Short : Number(), Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Short_compareTo_Byte") external public operator fun compareTo(other: Byte): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Short_compareTo_Short") external public override operator fun compareTo(other: Short): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Short_compareTo_Int") external public operator fun compareTo(other: Int): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Short_compareTo_Long") external public operator fun compareTo(other: Long): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Short_compareTo_Float") external public operator fun compareTo(other: Float): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Short_compareTo_Double") external public operator fun compareTo(other: Double): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Short_plus_Byte") external public operator fun plus(other: Byte): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Short_plus_Short") external public operator fun plus(other: Short): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Short_plus_Int") external public operator fun plus(other: Int): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Short_plus_Long") external public operator fun plus(other: Long): Long /** Adds the other value to this value. */ + @SymbolName("Kotlin_Short_plus_Float") external public operator fun plus(other: Float): Float /** Adds the other value to this value. */ + @SymbolName("Kotlin_Short_plus_Double") external public operator fun plus(other: Double): Double /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Short_minus_Byte") external public operator fun minus(other: Byte): Int /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Short_minus_Short") external public operator fun minus(other: Short): Int /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Short_minus_Int") external public operator fun minus(other: Int): Int /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Short_minus_Long") external public operator fun minus(other: Long): Long /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Short_minus_Float") external public operator fun minus(other: Float): Float /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Short_minus_Double") external public operator fun minus(other: Double): Double /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Short_times_Byte") external public operator fun times(other: Byte): Int /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Short_times_Short") external public operator fun times(other: Short): Int /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Short_times_Int") external public operator fun times(other: Int): Int /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Short_times_Long") external public operator fun times(other: Long): Long /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Short_times_Float") external public operator fun times(other: Float): Float /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Short_times_Double") external public operator fun times(other: Double): Double /** Divides this value by the other value. */ + @SymbolName("Kotlin_Short_div_Byte") external public operator fun div(other: Byte): Int /** Divides this value by the other value. */ + @SymbolName("Kotlin_Short_div_Short") external public operator fun div(other: Short): Int /** Divides this value by the other value. */ + @SymbolName("Kotlin_Short_div_Int") external public operator fun div(other: Int): Int /** Divides this value by the other value. */ + @SymbolName("Kotlin_Short_div_Long") external public operator fun div(other: Long): Long /** Divides this value by the other value. */ + @SymbolName("Kotlin_Short_div_Float") external public operator fun div(other: Float): Float /** Divides this value by the other value. */ + @SymbolName("Kotlin_Short_div_Double") external public operator fun div(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Short_mod_Byte") external public operator fun mod(other: Byte): Int /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Short_mod_Short") external public operator fun mod(other: Short): Int /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Short_mod_Int") external public operator fun mod(other: Int): Int /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Short_mod_Long") external public operator fun mod(other: Long): Long /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Short_mod_Float") external public operator fun mod(other: Float): Float /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Short_mod_Double") external public operator fun mod(other: Double): Double /** Increments this value. */ + @SymbolName("Kotlin_Short_inc") external public operator fun inc(): Short /** Decrements this value. */ + @SymbolName("Kotlin_Short_dec") external public operator fun dec(): Short /** Returns this value. */ + @SymbolName("Kotlin_Short_unaryPlus") external public operator fun unaryPlus(): Int /** Returns the negative of this value. */ + @SymbolName("Kotlin_Short_unaryMinus") external public operator fun unaryMinus(): Int /** Creates a range from this value to the specified [other] value. */ @@ -287,12 +374,19 @@ public class Short : Number(), Comparable { /** Creates a range from this value to the specified [other] value. */ // external public operator fun rangeTo(other: Long): LongRange + @SymbolName("Kotlin_Short_toByte") external public override fun toByte(): Byte + @SymbolName("Kotlin_Short_toChar") external public override fun toChar(): Char + @SymbolName("Kotlin_Short_toShort") external public override fun toShort(): Short + @SymbolName("Kotlin_Short_toInt") external public override fun toInt(): Int + @SymbolName("Kotlin_Short_toLong") external public override fun toLong(): Long + @SymbolName("Kotlin_Short_toFloat") external public override fun toFloat(): Float + @SymbolName("Kotlin_Short_toDouble") external public override fun toDouble(): Double } @@ -318,110 +412,150 @@ public class Int : Number(), Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Int_compareTo_Byte") external public operator fun compareTo(other: Byte): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Int_compareTo_Short") external public operator fun compareTo(other: Short): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Int_compareTo_Int") external public override operator fun compareTo(other: Int): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Int_compareTo_Long") external public operator fun compareTo(other: Long): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Int_compareTo_Float") external public operator fun compareTo(other: Float): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Int_compareTo_Double") external public operator fun compareTo(other: Double): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Int_plus_Byte") external public operator fun plus(other: Byte): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Int_plus_Short") external public operator fun plus(other: Short): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Int_plus_Int") external public operator fun plus(other: Int): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Int_plus_Long") external public operator fun plus(other: Long): Long /** Adds the other value to this value. */ + @SymbolName("Kotlin_Int_plus_Float") external public operator fun plus(other: Float): Float /** Adds the other value to this value. */ + @SymbolName("Kotlin_Int_plus_Double") external public operator fun plus(other: Double): Double /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Int_minus_Byte") external public operator fun minus(other: Byte): Int /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Int_minus_Short") external public operator fun minus(other: Short): Int /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Int_minus_Int") external public operator fun minus(other: Int): Int /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Int_minus_Long") external public operator fun minus(other: Long): Long /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Int_minus_Float") external public operator fun minus(other: Float): Float /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Int_minus_Double") external public operator fun minus(other: Double): Double /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Int_times_Byte") external public operator fun times(other: Byte): Int /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Int_times_Short") external public operator fun times(other: Short): Int /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Int_times_Int") external public operator fun times(other: Int): Int /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Int_times_Long") external public operator fun times(other: Long): Long /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Int_times_Float") external public operator fun times(other: Float): Float /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Int_times_Double") external public operator fun times(other: Double): Double /** Divides this value by the other value. */ + @SymbolName("Kotlin_Int_div_Byte") external public operator fun div(other: Byte): Int /** Divides this value by the other value. */ + @SymbolName("Kotlin_Int_div_Short") external public operator fun div(other: Short): Int /** Divides this value by the other value. */ + @SymbolName("Kotlin_Int_div_Int") external public operator fun div(other: Int): Int /** Divides this value by the other value. */ + @SymbolName("Kotlin_Int_div_Long") external public operator fun div(other: Long): Long /** Divides this value by the other value. */ + @SymbolName("Kotlin_Int_div_Float") external public operator fun div(other: Float): Float /** Divides this value by the other value. */ + @SymbolName("Kotlin_Int_div_Double") external public operator fun div(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Int_mod_Byte") external public operator fun mod(other: Byte): Int /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Int_mod_Short") external public operator fun mod(other: Short): Int /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Int_mod_Int") external public operator fun mod(other: Int): Int /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Int_mod_Long") external public operator fun mod(other: Long): Long /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Int_mod_Float") external public operator fun mod(other: Float): Float /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Int_mod_Double") external public operator fun mod(other: Double): Double /** Increments this value. */ + @SymbolName("Kotlin_Int_inc") external public operator fun inc(): Int /** Decrements this value. */ + @SymbolName("Kotlin_Int_dec") external public operator fun dec(): Int /** Returns this value. */ + @SymbolName("Kotlin_Int_unaryPlus") external public operator fun unaryPlus(): Int /** Returns the negative of this value. */ + @SymbolName("Kotlin_Int_unaryMinus") external public operator fun unaryMinus(): Int /** Creates a range from this value to the specified [other] value. */ @@ -434,26 +568,40 @@ public class Int : Number(), Comparable { // external public operator fun rangeTo(other: Long): LongRange /** Shifts this value left by [bits]. */ + @SymbolName("Kotlin_Int_shl_Int") external public infix fun shl(bitCount: Int): Int /** Shifts this value right by [bits], filling the leftmost bits with copies of the sign bit. */ + @SymbolName("Kotlin_Int_shr_Int") external public infix fun shr(bitCount: Int): Int /** Shifts this value right by [bits], filling the leftmost bits with zeros. */ + @SymbolName("Kotlin_Int_ushr_Int") external public infix fun ushr(bitCount: Int): Int /** Performs a bitwise AND operation between the two values. */ + @SymbolName("Kotlin_Int_and_Int") external public infix fun and(other: Int): Int /** Performs a bitwise OR operation between the two values. */ + @SymbolName("Kotlin_Int_or_Int") external public infix fun or(other: Int): Int /** Performs a bitwise XOR operation between the two values. */ + @SymbolName("Kotlin_Int_xor_Int") external public infix fun xor(other: Int): Int /** Inverts the bits in this value/ */ + @SymbolName("Kotlin_Int_inv") external public fun inv(): Int + @SymbolName("Kotlin_Int_toByte") external public override fun toByte(): Byte + @SymbolName("Kotlin_Int_toChar") external public override fun toChar(): Char + @SymbolName("Kotlin_Int_toShort") external public override fun toShort(): Short + @SymbolName("Kotlin_Int_toInt") external public override fun toInt(): Int + @SymbolName("Kotlin_Int_toLong") external public override fun toLong(): Long + @SymbolName("Kotlin_Int_toFloat") external public override fun toFloat(): Float + @SymbolName("Kotlin_Int_toDouble") external public override fun toDouble(): Double } @@ -479,110 +627,150 @@ public class Long : Number(), Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Long_compareTo_Byte") external public operator fun compareTo(other: Byte): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Long_compareTo_Short") external public operator fun compareTo(other: Short): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Long_compareTo_Int") external public operator fun compareTo(other: Int): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Long_compareTo_Long") external public override operator fun compareTo(other: Long): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Long_compareTo_Float") external public operator fun compareTo(other: Float): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Long_compareTo_Double") external public operator fun compareTo(other: Double): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Long_plus_Byte") external public operator fun plus(other: Byte): Long /** Adds the other value to this value. */ + @SymbolName("Kotlin_Long_plus_Short") external public operator fun plus(other: Short): Long /** Adds the other value to this value. */ + @SymbolName("Kotlin_Long_plus_Int") external public operator fun plus(other: Int): Long /** Adds the other value to this value. */ + @SymbolName("Kotlin_Long_plus_Long") external public operator fun plus(other: Long): Long /** Adds the other value to this value. */ + @SymbolName("Kotlin_Long_plus_Float") external public operator fun plus(other: Float): Float /** Adds the other value to this value. */ + @SymbolName("Kotlin_Long_plus_Double") external public operator fun plus(other: Double): Double /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Long_minus_Byte") external public operator fun minus(other: Byte): Long /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Long_minus_Short") external public operator fun minus(other: Short): Long /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Long_minus_Int") external public operator fun minus(other: Int): Long /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Long_minus_Long") external public operator fun minus(other: Long): Long /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Long_minus_Float") external public operator fun minus(other: Float): Float /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Long_minus_Double") external public operator fun minus(other: Double): Double /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Long_times_Byte") external public operator fun times(other: Byte): Long /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Long_times_Short") external public operator fun times(other: Short): Long /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Long_times_Int") external public operator fun times(other: Int): Long /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Long_times_Long") external public operator fun times(other: Long): Long /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Long_times_Float") external public operator fun times(other: Float): Float /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Long_times_Double") external public operator fun times(other: Double): Double /** Divides this value by the other value. */ + @SymbolName("Kotlin_Long_div_Byte") external public operator fun div(other: Byte): Long /** Divides this value by the other value. */ + @SymbolName("Kotlin_Long_div_Short") external public operator fun div(other: Short): Long /** Divides this value by the other value. */ + @SymbolName("Kotlin_Long_div_Int") external public operator fun div(other: Int): Long /** Divides this value by the other value. */ + @SymbolName("Kotlin_Long_div_Long") external public operator fun div(other: Long): Long /** Divides this value by the other value. */ + @SymbolName("Kotlin_Long_div_Float") external public operator fun div(other: Float): Float /** Divides this value by the other value. */ + @SymbolName("Kotlin_Long_div_Double") external public operator fun div(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Long_mod_Byte") external public operator fun mod(other: Byte): Long /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Long_mod_Short") external public operator fun mod(other: Short): Long /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Long_mod_Int") external public operator fun mod(other: Int): Long /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Long_mod_Long") external public operator fun mod(other: Long): Long /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Long_mod_Float") external public operator fun mod(other: Float): Float /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Long_mod_Double") external public operator fun mod(other: Double): Double /** Increments this value. */ + @SymbolName("Kotlin_Long_inc") external public operator fun inc(): Long /** Decrements this value. */ + @SymbolName("Kotlin_Long_dec") external public operator fun dec(): Long /** Returns this value. */ + @SymbolName("Kotlin_Long_unaryPlus") external public operator fun unaryPlus(): Long /** Returns the negative of this value. */ + @SymbolName("Kotlin_Long_unaryMinus") external public operator fun unaryMinus(): Long /** Creates a range from this value to the specified [other] value. */ @@ -595,26 +783,40 @@ public class Long : Number(), Comparable { // external public operator fun rangeTo(other: Long): LongRange /** Shifts this value left by [bits]. */ + @SymbolName("Kotlin_Long_shl_Long") external public infix fun shl(bitCount: Int): Long /** Shifts this value right by [bits], filling the leftmost bits with copies of the sign bit. */ + @SymbolName("Kotlin_Long_shr_Long") external public infix fun shr(bitCount: Int): Long /** Shifts this value right by [bits], filling the leftmost bits with zeros. */ + @SymbolName("Kotlin_Long_ushr_Long") external public infix fun ushr(bitCount: Int): Long /** Performs a bitwise AND operation between the two values. */ + @SymbolName("Kotlin_Long_and_Long") external public infix fun and(other: Long): Long /** Performs a bitwise OR operation between the two values. */ + @SymbolName("Kotlin_Long_or_Long") external public infix fun or(other: Long): Long /** Performs a bitwise XOR operation between the two values. */ + @SymbolName("Kotlin_Long_xor_Long") external public infix fun xor(other: Long): Long /** Inverts the bits in this value/ */ + @SymbolName("Kotlin_Long_inv") external public fun inv(): Long + @SymbolName("Kotlin_Long_toByte") external public override fun toByte(): Byte + @SymbolName("Kotlin_Long_toChar") external public override fun toChar(): Char + @SymbolName("Kotlin_Long_toShort") external public override fun toShort(): Short + @SymbolName("Kotlin_Long_toInt") external public override fun toInt(): Int + @SymbolName("Kotlin_Long_toLong") external public override fun toLong(): Long + @SymbolName("Kotlin_Long_toFloat") external public override fun toFloat(): Float + @SymbolName("Kotlin_Long_toDouble") external public override fun toDouble(): Double } @@ -655,119 +857,166 @@ public class Float : Number(), Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Float_compareTo_Byte") external public operator fun compareTo(other: Byte): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Float_compareTo_Short") external public operator fun compareTo(other: Short): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Float_compareTo_Int") external public operator fun compareTo(other: Int): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Float_compareTo_Long") external public operator fun compareTo(other: Long): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Float_compareTo_Float") external public override operator fun compareTo(other: Float): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Float_compareTo_Double") external public operator fun compareTo(other: Double): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Float_plus_Byte") external public operator fun plus(other: Byte): Float /** Adds the other value to this value. */ + @SymbolName("Kotlin_Float_plus_Short") external public operator fun plus(other: Short): Float /** Adds the other value to this value. */ + @SymbolName("Kotlin_Float_plus_Int") external public operator fun plus(other: Int): Float /** Adds the other value to this value. */ + @SymbolName("Kotlin_Float_plus_Long") external public operator fun plus(other: Long): Float /** Adds the other value to this value. */ + @SymbolName("Kotlin_Float_plus_Float") external public operator fun plus(other: Float): Float /** Adds the other value to this value. */ + @SymbolName("Kotlin_Float_plus_Double") external public operator fun plus(other: Double): Double /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Float_minus_Byte") external public operator fun minus(other: Byte): Float /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Float_minus_Short") external public operator fun minus(other: Short): Float /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Float_minus_Int") external public operator fun minus(other: Int): Float /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Float_minus_Long") external public operator fun minus(other: Long): Float /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Float_minus_Float") external public operator fun minus(other: Float): Float /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Float_minus_Double") external public operator fun minus(other: Double): Double /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Float_times_Byte") external public operator fun times(other: Byte): Float /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Float_times_Short") external public operator fun times(other: Short): Float /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Float_times_Int") external public operator fun times(other: Int): Float /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Float_times_Long") external public operator fun times(other: Long): Float /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Float_times_Float") external public operator fun times(other: Float): Float /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Float_times_Double") external public operator fun times(other: Double): Double /** Divides this value by the other value. */ + @SymbolName("Kotlin_Float_div_Byte") external public operator fun div(other: Byte): Float /** Divides this value by the other value. */ + @SymbolName("Kotlin_Float_div_Short") external public operator fun div(other: Short): Float /** Divides this value by the other value. */ + @SymbolName("Kotlin_Float_div_Int") external public operator fun div(other: Int): Float /** Divides this value by the other value. */ + @SymbolName("Kotlin_Float_div_Long") external public operator fun div(other: Long): Float /** Divides this value by the other value. */ + @SymbolName("Kotlin_Float_div_Float") external public operator fun div(other: Float): Float /** Divides this value by the other value. */ + @SymbolName("Kotlin_Float_div_Double") external public operator fun div(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Float_mod_Byte") external public operator fun mod(other: Byte): Float /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Float_mod_Short") external public operator fun mod(other: Short): Float /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Float_mod_Int") external public operator fun mod(other: Int): Float /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Float_mod_Long") external public operator fun mod(other: Long): Float /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Float_mod_Float") external public operator fun mod(other: Float): Float /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Float_mod_Double") external public operator fun mod(other: Double): Double /** Increments this value. */ + @SymbolName("Kotlin_Float_inc") external public operator fun inc(): Float /** Decrements this value. */ + @SymbolName("Kotlin_Float_dec") external public operator fun dec(): Float /** Returns this value. */ + @SymbolName("Kotlin_Float_unaryPlus") external public operator fun unaryPlus(): Float /** Returns the negative of this value. */ + @SymbolName("Kotlin_Float_unaryMinus") external public operator fun unaryMinus(): Float + @SymbolName("Kotlin_Float_toByte") external public override fun toByte(): Byte + @SymbolName("Kotlin_Float_toChar") external public override fun toChar(): Char + @SymbolName("Kotlin_Float_toShort") external public override fun toShort(): Short + @SymbolName("Kotlin_Float_toInt") external public override fun toInt(): Int + @SymbolName("Kotlin_Float_toLong") external public override fun toLong(): Long + @SymbolName("Kotlin_Float_toFloat") external public override fun toFloat(): Float + @SymbolName("Kotlin_Float_toDouble") external public override fun toDouble(): Double } @@ -808,118 +1057,165 @@ public class Double : Number(), Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Double_compareTo_Byte") external public operator fun compareTo(other: Byte): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Double_compareTo_Short") external public operator fun compareTo(other: Short): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Double_compareTo_Int") external public operator fun compareTo(other: Int): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Double_compareTo_Long") external public operator fun compareTo(other: Long): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Double_compareTo_Float") external public operator fun compareTo(other: Float): Int /** * Compares this value with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + @SymbolName("Kotlin_Double_compareTo_Double") external public override operator fun compareTo(other: Double): Int /** Adds the other value to this value. */ + @SymbolName("Kotlin_Double_plus_Byte") external public operator fun plus(other: Byte): Double /** Adds the other value to this value. */ + @SymbolName("Kotlin_Double_plus_Short") external public operator fun plus(other: Short): Double /** Adds the other value to this value. */ + @SymbolName("Kotlin_Double_plus_Int") external public operator fun plus(other: Int): Double /** Adds the other value to this value. */ + @SymbolName("Kotlin_Double_plus_Long") external public operator fun plus(other: Long): Double /** Adds the other value to this value. */ + @SymbolName("Kotlin_Double_plus_Float") external public operator fun plus(other: Float): Double /** Adds the other value to this value. */ + @SymbolName("Kotlin_Double_plus_Double") external public operator fun plus(other: Double): Double /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Double_minus_Byte") external public operator fun minus(other: Byte): Double /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Double_minus_Short") external public operator fun minus(other: Short): Double /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Double_minus_Int") external public operator fun minus(other: Int): Double /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Double_minus_Long") external public operator fun minus(other: Long): Double /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Double_minus_Float") external public operator fun minus(other: Float): Double /** Subtracts the other value from this value. */ + @SymbolName("Kotlin_Double_minus_Double") external public operator fun minus(other: Double): Double /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Double_times_Byte") external public operator fun times(other: Byte): Double /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Double_times_Short") external public operator fun times(other: Short): Double /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Double_times_Int") external public operator fun times(other: Int): Double /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Double_times_Long") external public operator fun times(other: Long): Double /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Double_times_Float") external public operator fun times(other: Float): Double /** Multiplies this value by the other value. */ + @SymbolName("Kotlin_Double_times_Double") external public operator fun times(other: Double): Double /** Divides this value by the other value. */ + @SymbolName("Kotlin_Double_div_Byte") external public operator fun div(other: Byte): Double /** Divides this value by the other value. */ + @SymbolName("Kotlin_Double_div_Short") external public operator fun div(other: Short): Double /** Divides this value by the other value. */ + @SymbolName("Kotlin_Double_div_Int") external public operator fun div(other: Int): Double /** Divides this value by the other value. */ + @SymbolName("Kotlin_Double_div_Long") external public operator fun div(other: Long): Double /** Divides this value by the other value. */ + @SymbolName("Kotlin_Double_div_Float") external public operator fun div(other: Float): Double /** Divides this value by the other value. */ + @SymbolName("Kotlin_Double_div_Double") external public operator fun div(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Double_mod_Byte") external public operator fun mod(other: Byte): Double /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Double_mod_Short") external public operator fun mod(other: Short): Double /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Double_mod_Int") external public operator fun mod(other: Int): Double /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Double_mod_Long") external public operator fun mod(other: Long): Double /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Double_mod_Float") external public operator fun mod(other: Float): Double /** Calculates the remainder of dividing this value by the other value. */ + @SymbolName("Kotlin_Double_mod_Double") external public operator fun mod(other: Double): Double /** Increments this value. */ + @SymbolName("Kotlin_Double_inc") external public operator fun inc(): Double /** Decrements this value. */ + @SymbolName("Kotlin_Double_dec") external public operator fun dec(): Double /** Returns this value. */ + @SymbolName("Kotlin_Double_unaryPlus") external public operator fun unaryPlus(): Double /** Returns the negative of this value. */ + @SymbolName("Kotlin_Double_unaryMinus") external public operator fun unaryMinus(): Double + @SymbolName("Kotlin_Double_toByte") external public override fun toByte(): Byte + @SymbolName("Kotlin_Double_toChar") external public override fun toChar(): Char + @SymbolName("Kotlin_Double_toShort") external public override fun toShort(): Short + @SymbolName("Kotlin_Double_toInt") external public override fun toInt(): Int + @SymbolName("Kotlin_Double_toLong") external public override fun toLong(): Long + @SymbolName("Kotlin_Double_toFloat") external public override fun toFloat(): Float + @SymbolName("Kotlin_Double_toDouble") external public override fun toDouble(): Double }