--- /dev/null
+# Copyright (C) 1997, 2004, 2006, 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't a csky target.
+if { ![istarget csky*-*-*]} then {
+ return
+}
+
+set cflags [board_info target cflags]
+if { [string first "ck6" "${cflags}"] >= 0 } {
+ verbose "the test is not support "
+ return
+}
+if { [string first "ck5" "${cflags}"] >= 0 } {
+ verbose "the test is not support "
+ return
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS ""
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "" } */
+
+float div32(float a, float b){
+ return a/b;
+}
+
+
+float div64(double a, double b){
+ return a/b;
+}
+
+/* { dg-final { scan-assembler "fdiv\.32" } }*/
+/* { dg-final { scan-assembler "fdiv\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-mfpu=fpv3" } */
+
+__fp16 funch(__fp16 a, __fp16 b)
+{
+ return a + b;
+}
+
+float funcs(float a, float b)
+{
+ return a + b;
+}
+
+double funcd(double a, double b)
+{
+ return a + b;
+}
+
+/* { dg-final { scan-assembler "fadd\.16" } }*/
+/* { dg-final { scan-assembler "fadd\.32" } }*/
+/* { dg-final { scan-assembler "fadd\.64" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "" } */
+
+float func(double a)
+{
+ return (float)a;
+}
+
+/* { dg-final { scan-assembler "fdtos" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-ffast-math" } */
+
+int lfloor_float32 (float x)
+{
+ return __builtin_lfloorf (x);
+}
+
+int lfloor_float64 (double x)
+{
+ return __builtin_lfloor (x);
+}
+
+
+float floor_float32 (float x)
+{
+ return __builtin_floorf (x);
+}
+
+double floor_float64 (double x)
+{
+ return __builtin_floor (x);
+}
+
+/* { dg-final { scan-assembler "fftoi\.f32\.s32\.rni" } }*/
+/* { dg-final { scan-assembler "fftoi\.f64\.s32\.rni" } }*/
+/* { dg-final { scan-assembler "fftofi\.f32\.rni" } }*/
+/* { dg-final { scan-assembler "fftofi\.f64\.rni" } }*/
+
+int lceil_float32 (float x)
+{
+ return __builtin_lceilf (x);
+}
+
+int lceil_float64 (double x)
+{
+ return __builtin_lceil (x);
+}
+
+
+float ceil_float32 (float x)
+{
+ return __builtin_ceilf (x);
+}
+
+double ceil_float64 (double x)
+{
+ return __builtin_ceil (x);
+}
+
+/* { dg-final { scan-assembler "fftoi\.f32\.s32\.rpi" } }*/
+/* { dg-final { scan-assembler "fftoi\.f64\.s32\.rpi" } }*/
+/* { dg-final { scan-assembler "fftofi\.f32\.rpi" } }*/
+/* { dg-final { scan-assembler "fftofi\.f64\.rpi" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options " -mfpu=fpv3" } */
+
+int funce(__fp16 a)
+{
+ return (int)a;
+}
+
+unsigned int funcf(__fp16 a)
+{
+ return (unsigned int)a;
+}
+
+int funca(float a)
+{
+ return (int)a;
+}
+
+unsigned int funcb(float a)
+{
+ return (unsigned int)a;
+}
+
+int funcc(double a)
+{
+ return (int)a;
+}
+
+unsigned int funcd(double a)
+{
+ return (unsigned int)a;
+}
+
+/* { dg-final { scan-assembler "fftoi\.f16\.s32\.rz" } }*/
+/* { dg-final { scan-assembler "fftoi\.f16\.u32\.rz" } }*/
+/* { dg-final { scan-assembler "fftoi\.f32\.s32\.rz" } }*/
+/* { dg-final { scan-assembler "fftoi\.f32\.u32\.rz" } }*/
+/* { dg-final { scan-assembler "fftoi\.f64\.s32\.rz" } }*/
+/* { dg-final { scan-assembler "fftoi\.f64\.u32\.rz" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-mfpu=fpv3" } */
+
+float func(__fp16 a)
+{
+ return (float)a;
+}
+
+/* { dg-final { scan-assembler "fhtos" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-mfpu=fpv3" } */
+
+__fp16 funce(int a)
+{
+ return (__fp16)a;
+}
+
+__fp16 funcf(unsigned int a)
+{
+ return (__fp16)a;
+}
+
+float funca(int a)
+{
+ return (float)a;
+}
+
+float funcb(unsigned int a)
+{
+ return (float)a;
+}
+
+double funcc(int a)
+{
+ return (double)a;
+}
+
+double funcd(unsigned int a)
+{
+ return (double)a;
+}
+
+//double funch(short a)
+//{
+// return (double)a;
+//}
+//
+//double funci(unsigned short a)
+//{
+// return (double)a;
+//}
+//
+//float funcj(short a)
+//{
+// return (float)a;
+//}
+//
+//float funck(unsigned short a)
+//{
+// return (float)a;
+//}
+
+__fp16 funcm(short a)
+{
+ return (__fp16)a;
+}
+
+__fp16 funcn(unsigned short a)
+{
+ return (__fp16)a;
+}
+
+/* { dg-final { scan-assembler "fitof\.s32\.f16" } }*/
+/* { dg-final { scan-assembler "fitof\.u32\.f16" } }*/
+/* { dg-final { scan-assembler "fitof\.s32\.f32" } }*/
+/* { dg-final { scan-assembler "fitof\.u32\.f32" } }*/
+/* { dg-final { scan-assembler "fitof\.s32\.f64" } }*/
+/* { dg-final { scan-assembler "fitof\.u32\.f64" } }*/
+/* { dg-final { scan-assembler "fitof\.s16\.f16" } }*/
+/* { dg-final { scan-assembler "fitof\.u16\.f16" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2 -mfpu=fpv3" } */
+
+#define FUNC(i) func_ ## i
+
+#define FTYPE __fp16
+FTYPE FUNC(ld16) (FTYPE *a, FTYPE *b)
+{
+ return *a = *b;
+}
+
+/* { dg-final { scan-assembler "fld\.16" } }*/
+/* { dg-final { scan-assembler "fst\.16" } }*/
+
+#undef FTYPE
+#define FTYPE float
+FTYPE FUNC(ld32) (FTYPE *a, FTYPE *b)
+{
+ return *a = *b;
+}
+
+/* { dg-final { scan-assembler "fld\.32" } }*/
+/* { dg-final { scan-assembler "fld\.32" } }*/
+
+#undef FTYPE
+#define FTYPE double
+FTYPE FUNC(ld64) (FTYPE *a, FTYPE *b)
+{
+ return *a = *b;
+}
+
+/* { dg-final { scan-assembler "fld\.64" } }*/
+/* { dg-final { scan-assembler "fst\.64" } }*/
+
+
+#undef FTYPE
+#define FTYPE __fp16
+FTYPE FUNC(ldr16) (FTYPE *a, int i, FTYPE *b)
+{
+ return a[i] = b[i];
+}
+
+/* { dg-final { scan-assembler "fldr\.16" } }*/
+/* { dg-final { scan-assembler "fstr\.16" } }*/
+
+#undef FTYPE
+#define FTYPE float
+FTYPE FUNC(ldr32) (FTYPE *a, int i, FTYPE *b)
+{
+ return a[i] = b[i];
+}
+
+/* { dg-final { scan-assembler "fldr\.32" } }*/
+/* { dg-final { scan-assembler "fstr\.32" } }*/
+
+#undef FTYPE
+#define FTYPE double
+FTYPE FUNC(ldr64) (FTYPE *a, int i, FTYPE *b)
+{
+ return a[i] = b[i];
+}
+
+/* { dg-final { scan-assembler "fldr\.64" } }*/
+/* { dg-final { scan-assembler "fstr\.64" } }*/
+
+
+#undef FTYPE
+#define FTYPE __fp16
+FTYPE FUNC(mov16) (FTYPE a, FTYPE b)
+{
+ a = b;
+ return a;
+}
+
+/* { dg-final { scan-assembler "fmov\.16" } }*/
+
+#undef FTYPE
+#define FTYPE float
+FTYPE FUNC(mov32) (FTYPE a, FTYPE b)
+{
+ a = b;
+ return a;
+}
+
+/* { dg-final { scan-assembler "fmov\.32" } }*/
+
+#undef FTYPE
+#define FTYPE double
+FTYPE FUNC(mov64) (FTYPE a, FTYPE b)
+{
+ a = b;
+ return a;
+}
+
+/* { dg-final { scan-assembler "fmov\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2 -mfpu=fpv3" } */
+
+#define FUNC(i) func_ ## i
+
+#define FTYPE __fp16
+FTYPE FUNC(movi16) (void)
+{
+ return 1.0;
+}
+
+/* { dg-final { scan-assembler "fmovi\.16" } }*/
+
+#undef FTYPE
+#define FTYPE float
+FTYPE FUNC(movi32) (void)
+{
+ return 1.0;
+}
+
+/* { dg-final { scan-assembler "fmovi\.32" } }*/
+
+#undef FTYPE
+#define FTYPE double
+FTYPE FUNC(movi64) (void)
+{
+ return 1.0;
+}
+
+/* { dg-final { scan-assembler "fmovi\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2 -mfpu=fpv3" } */
+
+__fp16 func16(__fp16 a, __fp16 b, __fp16 c){
+ a += b * c;
+ return a;
+}
+
+float func32(float a, float b, float c){
+ a += b * c;
+ return a;
+}
+
+
+double func64(double a, double b, double c){
+ a += b * c;
+ return a;
+}
+
+/* { dg-final { scan-assembler "ffmula\.16" } }*/
+/* { dg-final { scan-assembler "ffmula\.32" } }*/
+/* { dg-final { scan-assembler "ffmula\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2 -mfpu=fpv3" } */
+
+__fp16 func16(__fp16 a, __fp16 b, __fp16 c){
+ a -= b * c;
+ return a;
+}
+
+float func32(float a, float b, float c){
+ a -= b * c;
+ return a;
+}
+
+
+double func64(double a, double b, double c){
+ a -= b * c;
+ return a;
+}
+
+/* { dg-final { scan-assembler "ffmuls\.16" } }*/
+/* { dg-final { scan-assembler "ffmuls\.32" } }*/
+/* { dg-final { scan-assembler "ffmuls\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-mfpu=fpv3" } */
+
+__fp16 func16(__fp16 a)
+{
+ return -a;
+}
+
+float func32(float a)
+{
+ return -a;
+}
+
+double func64(double a)
+{
+ return -a;
+}
+
+/* { dg-final { scan-assembler "fneg\.32" } }*/
+/* { dg-final { scan-assembler "fneg\.64" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2" } */
+
+float fnmula32(float a, float b, float c){
+ return -(a + b * c);
+}
+
+double fnmula64(double a, double b, double c){
+ return -(a + b * c);
+}
+
+/* { dg-final { scan-assembler "ffnmula\.32" } }*/
+/* { dg-final { scan-assembler "ffnmula\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2" } */
+
+float fnmula32(float a, float b, float c){
+ return -a + b * c;
+}
+
+double fnmula64(double a, double b, double c){
+ return -a + b * c;
+}
+
+/* { dg-final { scan-assembler "ffnmuls\.32" } }*/
+/* { dg-final { scan-assembler "ffnmuls\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "" } */
+
+double func(float a)
+{
+ return (double)a;
+}
+
+/* { dg-final { scan-assembler "fstod" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-mfpu=fpv3" } */
+
+__fp16 func(float a)
+{
+ return (__fp16)a;
+}
+
+/* { dg-final { scan-assembler "fstoh" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-mfpu=fpv3" } */
+
+__fp16 funch(__fp16 a, __fp16 b)
+{
+ return a - b;
+}
+
+float funcs(float a, float b)
+{
+ return a - b;
+}
+
+double funcd(double a, double b)
+{
+ return a - b;
+}
+
+/* { dg-final { scan-assembler "fsub\.16" } }*/
+/* { dg-final { scan-assembler "fsub\.32" } }*/
+/* { dg-final { scan-assembler "fsub\.64" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O1" } */
+
+//__fp16
+//fixed32_to_float16 (int i)
+//{
+// return ((__fp16) i / (1 << 15));
+//}
+//
+//__fp16
+//fixedu32_to_float16 (unsigned int i)
+//{
+// return ((__fp16) i / (1 << 15));
+//}
+//
+//float
+//fixed32_to_float32 (int i)
+//{
+// return ((float) i / (1 << 30));
+//}
+//
+//
+//float
+//fixedu32_to_float32 (unsigned int i)
+//{
+// return ((float) i / (1 << 30));
+//}
+//
+//double
+//fixed32_to_float64 (int i)
+//{
+// return ((double) i / (1 << 30));
+//}
+//
+//double
+//fixedu32_to_float64 (unsigned int i)
+//{
+// return ((double) i / (1 << 30));
+//}
+//
+//__fp16
+//fixed16_to_float16 (short i)
+//{
+// return ((__fp16) i / (1 << 15));
+//}
+//
+//__fp16
+//fixedu16_to_float16 (unsigned short i)
+//{
+// return ((__fp16) i / (1 << 15));
+//}
+//
+//float
+//fixed16_to_float32 (short i)
+//{
+// return ((float) i / (1 << 16));
+//}
+//
+//float
+//fixedu16_to_float32 (unsigned short i)
+//{
+// return ((float) i / (1 << 16));
+//}
+//
+//double
+//fixed16_to_float64 (short i)
+//{
+// return ((double) i / (1 << 16));
+//}
+//
+//double
+//fixedu16_to_float64 (unsigned short i)
+//{
+// return ((double) i / (1 << 16));
+//}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "" } */
+
+float fh32(float a, float b, float c, float d){
+ if(a > b)
+ return c;
+
+ return d;
+}
+
+double fh64(double a, double b, double c, double d){
+ if( a > b)
+ return c;
+ return d;
+}
+
+/* { dg-final { scan-assembler "fcmplt\.32" } }*/
+/* { dg-final { scan-assembler "fcmplt\.64" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "" } */
+
+float fhs32(float a, float b, float c, float d){
+ if(a >= b)
+ return c;
+ return d;
+}
+
+double fhs64(double a, double b, double c, double d){
+ if( a >= b)
+ return c;
+ return d;
+}
+
+/* { dg-final { scan-assembler "fcmphs\.32" } }*/
+/* { dg-final { scan-assembler "fcmphs\.64" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "" } */
+
+float fhsz32(float a, float b, float c){
+ if(a >= 0.0f)
+ return b;
+ else
+ return c;
+}
+
+double fhsz64(double a, double b, double c){
+ if( a >= 0.0)
+ return b;
+ else
+ return c;
+}
+
+/* { dg-final { scan-assembler "fcmphsz\.32" } }*/
+/* { dg-final { scan-assembler "fcmphsz\.64" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2" } */
+
+float fhz32(float a, float b, float c){
+ if(a > 0.0f)
+ return b;
+ else
+ return c;
+}
+
+double fhz64(double a, double b, double c){
+ if( a > 0.0)
+ return b;
+ else
+ return c;
+}
+
+/* { dg-final { scan-assembler "fcmphz\.32" } }*/
+/* { dg-final { scan-assembler "fcmphz\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2" } */
+
+float fls32(float a, float b, float c, float d){
+ if(a <= b)
+ return c;
+
+ return d;
+}
+
+double fhz64(double a, double b, double c, double d){
+ if( a <= b)
+ return c;
+ return d;
+}
+
+/* { dg-final { scan-assembler "fcmphs\.32" } }*/
+/* { dg-final { scan-assembler "fcmphs\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2" } */
+
+float flsz32(float a, float b, float c){
+ if(a <= 0.0f)
+ return b;
+ else
+ return c;
+}
+
+double fhz64(double a, double b, double c){
+ if( a <= 0.0)
+ return b;
+ else
+ return c;
+}
+
+/* { dg-final { scan-assembler "fcmplsz\.32" } }*/
+/* { dg-final { scan-assembler "fcmplsz\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "" } */
+
+float flt32(float a, float b, float c, float d){
+ if(a < b)
+ return c;
+ return d;
+}
+
+double flt64(double a, double b, double c, double d){
+ if( a < b)
+ return c;
+ return d;
+}
+
+/* { dg-final { scan-assembler "fcmplt\.32" } }*/
+/* { dg-final { scan-assembler "fcmplt\.64" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2" } */
+
+float fltz32(float a, float b, float c){
+ if(a < 0.0f)
+ return b;
+ else
+ return c;
+}
+
+double fltz64(double a, double b, double c){
+ if( a < 0.0)
+ return b;
+ else
+ return c;
+}
+
+/* { dg-final { scan-assembler "fcmpltz\.32" } }*/
+/* { dg-final { scan-assembler "fcmpltz\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2" } */
+
+extern float fmaxf( float x, float y );
+float fmax32(float a, float b){
+ return fmaxf(a, b);
+}
+
+extern double fmax( double x, double y );
+double fmax64(double a, double b){
+ return fmax(a, b);
+}
+
+/* { dg-final { scan-assembler "fmaxnm\.32" } }*/
+/* { dg-final { scan-assembler "fmaxnm\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2" } */
+
+extern float fminf( float x, float y );
+float fmin32(float a, float b){
+ return fminf(a, b);
+}
+
+extern double fmin( double x, double y );
+double fmin64(double a, double b){
+ return fmin(a, b);
+}
+
+/* { dg-final { scan-assembler "fminnm\.32" } }*/
+/* { dg-final { scan-assembler "fminnm\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "" } */
+
+float mul32(float a, float b){
+ return a*b;
+}
+
+double mul64(double a, double b){
+ return a*b;
+}
+
+/* { dg-final { scan-assembler "fmul\.32" } }*/
+/* { dg-final { scan-assembler "fmul\.64" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2" } */
+
+float func32(float a, float b, float c){
+ a += b * c;
+ return a;
+}
+
+double func64(double a, double b, double c){
+ a += b * c;
+ return a;
+}
+
+/* { dg-final { scan-assembler "fmula\.32" } }*/
+/* { dg-final { scan-assembler "fmula\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2" } */
+
+float muls32(float a, float b, float c){
+ a -= b * c;
+ return a;
+}
+
+double muls64(double a, double b, double c){
+ a -= b * c;
+ return a;
+}
+
+/* { dg-final { scan-assembler "fmuls\.32" } }*/
+/* { dg-final { scan-assembler "fmuls\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "" } */
+
+float fne32(float a, float b, float c, float d){
+ if(a != b)
+ return c;
+ return d;
+}
+
+double fne64(double a, double b, double c, double d){
+ if( a != b)
+ return c;
+ return d;
+}
+
+/* { dg-final { scan-assembler "fcmpne\.32" } }*/
+/* { dg-final { scan-assembler "fcmpne\.64" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "" } */
+
+float fnez32(float a, float b, float c){
+ if(a != 0.0f)
+ return b;
+ else
+ return c;
+}
+
+double fnez64(double a, double b, double c){
+ if( a != 0.0)
+ return b;
+ else
+ return c;
+}
+
+/* { dg-final { scan-assembler "fcmpnez\.32" } }*/
+/* { dg-final { scan-assembler "fcmpnez\.64" } }*/
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "" } */
+
+float recip32(float a){
+ return 1.0f/a;
+}
+
+double recip64(double a){
+ return 1.0/a;
+}
+
+/* { dg-final { scan-assembler "frecip\.32" } }*/
+/* { dg-final { scan-assembler "frecip\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2" } */
+
+float sqrtf(float);
+float sqrt32(float a){
+ return sqrtf(a);
+}
+
+double sqrt(double);
+double sqrt64(double a){
+ return sqrt(a);
+}
+
+/* { dg-final { scan-assembler "fsqrt\.32" } }*/
+/* { dg-final { scan-assembler "fsqrt\.64" } }*/
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O2" } */
+
+int func32(float a, float b)
+{
+ return __builtin_isunordered(a, b);
+}
+
+int func64(double a, double b)
+{
+ return __builtin_isunordered(a, b);
+}
+
+/* { dg-final { scan-assembler "fcmpuo\.32" } }*/
+/* { dg-final { scan-assembler "fcmpuo\.64" } }*/
+
+int func32z(float a)
+{
+ return __builtin_isunordered(a, 0);
+}
+
+int func64z(double a)
+{
+ return __builtin_isunordered(a, 0);
+}
+
+/* { dg-final { scan-assembler "fcmpuoz\.32" } }*/
+/* { dg-final { scan-assembler "fcmpuoz\.64" } }*/