(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
nios2/
custom-fp-cmp-1.c
       1  /* Test generation of floating-point compare custom instructions.  */
       2  
       3  /* { dg-do compile } */
       4  /* { dg-options "-O1" } */
       5  
       6  /* -O1 in the options is significant.  Without it FP operations may not be
       7     optimized to custom instructions.  */
       8  
       9  #pragma GCC target ("custom-frdxhi=40")
      10  #pragma GCC target ("custom-frdxlo=41")
      11  #pragma GCC target ("custom-frdy=42")
      12  #pragma GCC target ("custom-fwrx=43")
      13  #pragma GCC target ("custom-fwry=44")
      14  
      15  #pragma GCC target ("custom-fcmpeqs=200")
      16  
      17  int
      18  test_fcmpeqs (float a, float b)
      19  {
      20    return (a == b);
      21  }
      22  
      23  /* { dg-final { scan-assembler "custom\\t200, .* # fcmpeqs .*" } } */
      24  
      25  #pragma GCC target ("custom-fcmpgtd=201")
      26  
      27  int
      28  test_fcmpgtd (double a, double b)
      29  {
      30    return (a > b);
      31  }
      32  
      33  /* { dg-final { scan-assembler "custom\\t201, .* # fcmpgtd .*" } } */
      34  
      35  #pragma GCC target ("custom-fcmples=202")
      36  
      37  int
      38  test_fcmples (float a, float b)
      39  {
      40    return (a <= b);
      41  }
      42  
      43  /* { dg-final { scan-assembler "custom\\t202, .* # fcmples .*" } } */
      44  
      45  #pragma GCC target ("custom-fcmpned=203")
      46  
      47  int
      48  test_fcmpned (double a, double b)
      49  {
      50    return (a != b);
      51  }
      52  
      53  /* { dg-final { scan-assembler "custom\\t203, .* # fcmpned .*" } } */