[llvm] 36ac436 - add testcases for D128647, NFC

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 06:55:01 PDT 2022


Author: Chen Zheng
Date: 2022-06-30T09:54:49-04:00
New Revision: 36ac436068341cbe517903220aae57302c17ade9

URL: https://github.com/llvm/llvm-project/commit/36ac436068341cbe517903220aae57302c17ade9
DIFF: https://github.com/llvm/llvm-project/commit/36ac436068341cbe517903220aae57302c17ade9.diff

LOG: add testcases for D128647, NFC

Added: 
    

Modified: 
    llvm/test/Transforms/InstSimplify/constant-fold-fp-denormal.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstSimplify/constant-fold-fp-denormal.ll b/llvm/test/Transforms/InstSimplify/constant-fold-fp-denormal.ll
index 24722c6560df5..5d57e9f399c95 100644
--- a/llvm/test/Transforms/InstSimplify/constant-fold-fp-denormal.ll
+++ b/llvm/test/Transforms/InstSimplify/constant-fold-fp-denormal.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt -S -instsimplify < %s | FileCheck %s
 
 ; Test cases for denormal handling mode when constant folding floating point
@@ -14,6 +15,7 @@
 define float @test_float_fadd_ieee() #0 {
 ; CHECK-LABEL: @test_float_fadd_ieee(
 ; CHECK-NEXT:    ret float 0xB800000000000000
+;
 ; default ieee mode leaves result as a denormal
   %result = fadd float 0xB810000000000000, 0x3800000000000000
   ret float %result
@@ -22,6 +24,7 @@ define float @test_float_fadd_ieee() #0 {
 define float @test_float_fadd_pzero_out() #1 {
 ; CHECK-LABEL: @test_float_fadd_pzero_out(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; denormal result is flushed to positive zero
   %result = fadd float 0xB810000000000000, 0x3800000000000000
   ret float %result
@@ -30,6 +33,7 @@ define float @test_float_fadd_pzero_out() #1 {
 define float @test_float_fadd_psign_out() #2 {
 ; CHECK-LABEL: @test_float_fadd_psign_out(
 ; CHECK-NEXT:    ret float -0.000000e+00
+;
 ; denormal result is flushed to sign preserved zero
   %result = fadd float 0xB810000000000000, 0x3800000000000000
   ret float %result
@@ -38,6 +42,7 @@ define float @test_float_fadd_psign_out() #2 {
 define float @test_float_fadd_pzero_in() #3 {
 ; CHECK-LABEL: @test_float_fadd_pzero_in(
 ; CHECK-NEXT:    ret float 0xB810000000000000
+;
 ; denormal operand is treated as zero
 ; normal operand added to zero results in the same operand as a result
   %result = fadd float 0xB810000000000000, 0x3800000000000000
@@ -47,6 +52,7 @@ define float @test_float_fadd_pzero_in() #3 {
 define float @test_float_fadd_psign_in() #4 {
 ; CHECK-LABEL: @test_float_fadd_psign_in(
 ; CHECK-NEXT:    ret float 0xB810000000000000
+;
 ; denormal operand is treated as zero
 ; normal operand added to zero results in the same operand as a result
   %result = fadd float 0xB810000000000000, 0x3800000000000000
@@ -56,6 +62,7 @@ define float @test_float_fadd_psign_in() #4 {
 define float @test_float_fadd_pzero_f32_out() #5 {
 ; CHECK-LABEL: @test_float_fadd_pzero_f32_out(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; f32 only attribute should flush float output
 ; default ieee mode leaves result as a denormal
   %result = fadd float 0xB810000000000000, 0x3800000000000000
@@ -65,51 +72,57 @@ define float @test_float_fadd_pzero_f32_out() #5 {
 define double @test_double_fadd_ieee() #0 {
 ; CHECK-LABEL: @test_double_fadd_ieee(
 ; CHECK-NEXT:    ret double 0x8008000000000000
+;
 ; default ieee mode leaves result as a denormal
-  %result = fadd double 0x8010000000000000, 0x8000000000000
+  %result = fadd double 0x8010000000000000, 0x0008000000000000
   ret double %result
 }
 
 define double @test_double_fadd_pzero_out() #1 {
 ; CHECK-LABEL: @test_double_fadd_pzero_out(
 ; CHECK-NEXT:    ret double 0.000000e+00
+;
 ; denormal result is flushed to positive zero
-  %result = fadd double 0x8010000000000000, 0x8000000000000
+  %result = fadd double 0x8010000000000000, 0x0008000000000000
   ret double %result
 }
 
 define double @test_double_fadd_psign_out() #2 {
 ; CHECK-LABEL: @test_double_fadd_psign_out(
 ; CHECK-NEXT:    ret double -0.000000e+00
+;
 ; denormal result is flushed to sign preserved zero
-  %result = fadd double 0x8010000000000000, 0x8000000000000
+  %result = fadd double 0x8010000000000000, 0x0008000000000000
   ret double %result
 }
 
 define double @test_double_fadd_pzero_in() #3 {
 ; CHECK-LABEL: @test_double_fadd_pzero_in(
 ; CHECK-NEXT:    ret double 0x8010000000000000
+;
 ; denormal operand is treated as zero
 ; normal operand added to zero results in the same operand as a result
-  %result = fadd double 0x8010000000000000, 0x8000000000000
+  %result = fadd double 0x8010000000000000, 0x0008000000000000
   ret double %result
 }
 
 define double @test_double_fadd_psign_in() #4 {
 ; CHECK-LABEL: @test_double_fadd_psign_in(
 ; CHECK-NEXT:    ret double 0x8010000000000000
+;
 ; denormal operand is treated as zero
 ; normal operand added to zero results in the same operand as a result
-  %result = fadd double 0x8010000000000000, 0x8000000000000
+  %result = fadd double 0x8010000000000000, 0x0008000000000000
   ret double %result
 }
 
 define double @test_double_fadd_f32_ieee() #5 {
 ; CHECK-LABEL: @test_double_fadd_f32_ieee(
 ; CHECK-NEXT:    ret double 0x8008000000000000
+;
 ; f32 only attribute should not flush doubles
 ; default ieee mode leaves result as a denormal
-  %result = fadd double 0x8010000000000000, 0x8000000000000
+  %result = fadd double 0x8010000000000000, 0x0008000000000000
   ret double %result
 }
 
@@ -124,6 +137,7 @@ define double @test_double_fadd_f32_ieee() #5 {
 define float @test_float_fsub_ieee() #0 {
 ; CHECK-LABEL: @test_float_fsub_ieee(
 ; CHECK-NEXT:    ret float 0xB800000000000000
+;
 ; default ieee mode leaves result as a denormal
   %result = fsub float 0x3800000000000000, 0x3810000000000000
   ret float %result
@@ -132,6 +146,7 @@ define float @test_float_fsub_ieee() #0 {
 define float @test_float_fsub_pzero_out() #1 {
 ; CHECK-LABEL: @test_float_fsub_pzero_out(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; denormal result is flushed to positive zero
   %result = fsub float 0x3800000000000000, 0x3810000000000000
   ret float %result
@@ -140,6 +155,7 @@ define float @test_float_fsub_pzero_out() #1 {
 define float @test_float_fsub_psign_out() #2 {
 ; CHECK-LABEL: @test_float_fsub_psign_out(
 ; CHECK-NEXT:    ret float -0.000000e+00
+;
 ; denormal result is flushed to sign preserved zero
   %result = fsub float 0x3800000000000000, 0x3810000000000000
   ret float %result
@@ -148,6 +164,7 @@ define float @test_float_fsub_psign_out() #2 {
 define float @test_float_fsub_pzero_in() #3 {
 ; CHECK-LABEL: @test_float_fsub_pzero_in(
 ; CHECK-NEXT:    ret float 0xB810000000000000
+;
 ; denormal operand is treated as zero
 ; normal operand subtracted from zero produces the same operand, negated
   %result = fsub float 0x3800000000000000, 0x3810000000000000
@@ -157,6 +174,7 @@ define float @test_float_fsub_pzero_in() #3 {
 define float @test_float_fsub_psign_in() #4 {
 ; CHECK-LABEL: @test_float_fsub_psign_in(
 ; CHECK-NEXT:    ret float 0xB810000000000000
+;
 ; denormal operand is treated as zero
 ; normal operand subtracted from zero produces the same operand, negated
   %result = fsub float 0x3800000000000000, 0x3810000000000000
@@ -166,6 +184,7 @@ define float @test_float_fsub_psign_in() #4 {
 define float @test_float_fsub_pzero_f32_out() #5 {
 ; CHECK-LABEL: @test_float_fsub_pzero_f32_out(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; f32 only attribute should flush float output
 ; same as pzero_out above
   %result = fsub float 0x3800000000000000, 0x3810000000000000
@@ -175,51 +194,57 @@ define float @test_float_fsub_pzero_f32_out() #5 {
 define double @test_double_fsub_ieee() #0 {
 ; CHECK-LABEL: @test_double_fsub_ieee(
 ; CHECK-NEXT:    ret double 0x8008000000000000
+;
 ; default ieee mode leaves result as a denormal
-  %result = fsub double 0x8000000000000, 0x10000000000000
+  %result = fsub double 0x0008000000000000, 0x0010000000000000
   ret double %result
 }
 
 define double @test_double_fsub_pzero_out() #1 {
 ; CHECK-LABEL: @test_double_fsub_pzero_out(
 ; CHECK-NEXT:    ret double 0.000000e+00
+;
 ; denormal result is flushed to positive zero
-  %result = fsub double 0x8000000000000, 0x10000000000000
+  %result = fsub double 0x0008000000000000, 0x0010000000000000
   ret double %result
 }
 
 define double @test_double_fsub_psign_out() #2 {
 ; CHECK-LABEL: @test_double_fsub_psign_out(
 ; CHECK-NEXT:    ret double -0.000000e+00
+;
 ; denormal result is flushed to sign preserved zero
-  %result = fsub double 0x8000000000000, 0x10000000000000
+  %result = fsub double 0x0008000000000000, 0x0010000000000000
   ret double %result
 }
 
 define double @test_double_fsub_pzero_in() #3 {
 ; CHECK-LABEL: @test_double_fsub_pzero_in(
 ; CHECK-NEXT:    ret double 0x8010000000000000
+;
 ; denormal operand is treated as zero
 ; normal operand subtracted from zero produces the same operand, negated
-  %result = fsub double 0x8000000000000, 0x10000000000000
+  %result = fsub double 0x0008000000000000, 0x0010000000000000
   ret double %result
 }
 
 define double @test_double_fsub_psign_in() #4 {
 ; CHECK-LABEL: @test_double_fsub_psign_in(
 ; CHECK-NEXT:    ret double 0x8010000000000000
+;
 ; denormal operand is treated as zero
 ; normal operand subtracted from zero produces the same operand, negated
-  %result = fsub double 0x8000000000000, 0x10000000000000
+  %result = fsub double 0x0008000000000000, 0x0010000000000000
   ret double %result
 }
 
 define double @test_double_fsub_f32_ieee() #5 {
 ; CHECK-LABEL: @test_double_fsub_f32_ieee(
 ; CHECK-NEXT:    ret double 0x8008000000000000
+;
 ; f32 only attribute should not flush doubles
 ; default ieee mode leaves result as a denormal
-  %result = fsub double 0x8000000000000, 0x10000000000000
+  %result = fsub double 0x0008000000000000, 0x0010000000000000
   ret double %result
 }
 
@@ -236,6 +261,7 @@ define double @test_double_fsub_f32_ieee() #5 {
 define float @test_float_fmul_ieee() #0 {
 ; CHECK-LABEL: @test_float_fmul_ieee(
 ; CHECK-NEXT:    ret float 0xB800000000000000
+;
 ; default ieee mode leaves result as a denormal
   %result = fmul float 0x3810000000000000, -5.000000e-01
   ret float %result
@@ -244,6 +270,7 @@ define float @test_float_fmul_ieee() #0 {
 define float @test_float_fmul_pzero_out() #1 {
 ; CHECK-LABEL: @test_float_fmul_pzero_out(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; denormal result is flushed to positive zero
   %result = fmul float 0x3810000000000000, -5.000000e-01
   ret float %result
@@ -252,6 +279,7 @@ define float @test_float_fmul_pzero_out() #1 {
 define float @test_float_fmul_psign_out() #2 {
 ; CHECK-LABEL: @test_float_fmul_psign_out(
 ; CHECK-NEXT:    ret float -0.000000e+00
+;
 ; denormal result is flushed to sign preserved zero
   %result = fmul float 0x3810000000000000, -5.000000e-01
   ret float %result
@@ -260,6 +288,7 @@ define float @test_float_fmul_psign_out() #2 {
 define float @test_float_fmul_pzero_in() #3 {
 ; CHECK-LABEL: @test_float_fmul_pzero_in(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; denormal operand is treated as positive zero
 ; anything multiplied by zero gives a zero result
   %result = fmul float 0xB800000000000000, 2.000000e-00
@@ -269,6 +298,7 @@ define float @test_float_fmul_pzero_in() #3 {
 define float @test_float_fmul_psign_in() #4 {
 ; CHECK-LABEL: @test_float_fmul_psign_in(
 ; CHECK-NEXT:    ret float -0.000000e+00
+;
 ; denormal operand is treated as signed zero
 ; anything multiplied by zero gives a zero result
   %result = fmul float 0xB800000000000000, 2.000000e-00
@@ -278,6 +308,7 @@ define float @test_float_fmul_psign_in() #4 {
 define float @test_float_fmul_pzero_f32_out() #1 {
 ; CHECK-LABEL: @test_float_fmul_pzero_f32_out(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; f32 only attribute should flush float output
 ; same as pzero_out above
   %result = fmul float 0x3810000000000000, -5.000000e-01
@@ -287,30 +318,34 @@ define float @test_float_fmul_pzero_f32_out() #1 {
 define double @test_double_fmul_ieee() #0 {
 ; CHECK-LABEL: @test_double_fmul_ieee(
 ; CHECK-NEXT:    ret double 0x8008000000000000
+;
 ; default ieee mode leaves result as a denormal
-  %result = fmul double 0x10000000000000, -5.000000e-01
+  %result = fmul double 0x00010000000000000, -5.000000e-01
   ret double %result
 }
 
 define double @test_double_fmul_pzero_out() #1 {
 ; CHECK-LABEL: @test_double_fmul_pzero_out(
 ; CHECK-NEXT:    ret double 0.000000e+00
+;
 ; denormal result is flushed to positive zero
-  %result = fmul double 0x10000000000000, -5.000000e-01
+  %result = fmul double 0x00010000000000000, -5.000000e-01
   ret double %result
 }
 
 define double @test_double_fmul_psign_out() #2 {
 ; CHECK-LABEL: @test_double_fmul_psign_out(
 ; CHECK-NEXT:    ret double -0.000000e+00
+;
 ; denormal result is flushed to sign preserved zero
-  %result = fmul double 0x10000000000000, -5.000000e-01
+  %result = fmul double 0x0010000000000000, -5.000000e-01
   ret double %result
 }
 
 define double @test_double_fmul_pzero_in() #3 {
 ; CHECK-LABEL: @test_double_fmul_pzero_in(
 ; CHECK-NEXT:    ret double 0.000000e+00
+;
 ; denormal operand is treated as positive zero
 ; anything multiplied by zero gives a zero result
   %result = fmul double 0x8008000000000000, 2.000000e-00
@@ -320,6 +355,7 @@ define double @test_double_fmul_pzero_in() #3 {
 define double @test_double_fmul_psign_in() #4 {
 ; CHECK-LABEL: @test_double_fmul_psign_in(
 ; CHECK-NEXT:    ret double -0.000000e+00
+;
 ; denormal operand is treated as signed zero
 ; anything multiplied by zero gives a zero result
   %result = fmul double 0x8008000000000000, 2.000000e-00
@@ -329,9 +365,10 @@ define double @test_double_fmul_psign_in() #4 {
 define double @test_double_fmul_f32_ieee() #5 {
 ; CHECK-LABEL: @test_double_fmul_f32_ieee(
 ; CHECK-NEXT:    ret double 0x8008000000000000
+;
 ; f32 only attribute should not flush doubles
 ; default ieee mode leaves result as a denormal
-  %result = fmul double 0x10000000000000, -5.000000e-01
+  %result = fmul double 0x0010000000000000, -5.000000e-01
   ret double %result
 }
 
@@ -348,6 +385,7 @@ define double @test_double_fmul_f32_ieee() #5 {
 define float @test_float_fdiv_ieee() #0 {
 ; CHECK-LABEL: @test_float_fdiv_ieee(
 ; CHECK-NEXT:    ret float 0xB800000000000000
+;
 ; default ieee mode leaves result as a denormal
   %result = fdiv float 0x3810000000000000, -2.000000e-00
   ret float %result
@@ -356,6 +394,7 @@ define float @test_float_fdiv_ieee() #0 {
 define float @test_float_fdiv_pzero_out() #1 {
 ; CHECK-LABEL: @test_float_fdiv_pzero_out(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; denormal result is flushed to positive zero
   %result = fdiv float 0x3810000000000000, -2.000000e-00
   ret float %result
@@ -364,6 +403,7 @@ define float @test_float_fdiv_pzero_out() #1 {
 define float @test_float_fdiv_psign_out() #2 {
 ; CHECK-LABEL: @test_float_fdiv_psign_out(
 ; CHECK-NEXT:    ret float -0.000000e+00
+;
 ; denormal result is flushed to sign preserved zero
   %result = fdiv float 0x3810000000000000, -2.000000e-00
   ret float %result
@@ -372,6 +412,7 @@ define float @test_float_fdiv_psign_out() #2 {
 define float @test_float_fdiv_pzero_in() #3 {
 ; CHECK-LABEL: @test_float_fdiv_pzero_in(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; denormal operand is treated as zero
 ; zero divided by anything gives a zero result
   %result = fdiv float 0xB800000000000000, 5.000000e-01
@@ -381,6 +422,7 @@ define float @test_float_fdiv_pzero_in() #3 {
 define float @test_float_fdiv_psign_in() #4 {
 ; CHECK-LABEL: @test_float_fdiv_psign_in(
 ; CHECK-NEXT:    ret float -0.000000e+00
+;
 ; denormal operand is treated as zero
 ; zero divided by anything gives a zero result
   %result = fmul float 0xB800000000000000, 5.000000e-01
@@ -390,6 +432,7 @@ define float @test_float_fdiv_psign_in() #4 {
 define float @test_float_fdiv_pzero_f32_out() #1 {
 ; CHECK-LABEL: @test_float_fdiv_pzero_f32_out(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; f32 only attribute should flush float output
 ; same as pzero_out above
   %result = fdiv float 0x3810000000000000, -2.000000e-00
@@ -399,30 +442,34 @@ define float @test_float_fdiv_pzero_f32_out() #1 {
 define double @test_double_fdiv_ieee() #0 {
 ; CHECK-LABEL: @test_double_fdiv_ieee(
 ; CHECK-NEXT:    ret double 0x8008000000000000
+;
 ; default ieee mode leaves result as a denormal
-  %result = fdiv double 0x10000000000000, -2.000000e-00
+  %result = fdiv double 0x0010000000000000, -2.000000e-00
   ret double %result
 }
 
 define double @test_double_fdiv_pzero_out() #1 {
 ; CHECK-LABEL: @test_double_fdiv_pzero_out(
 ; CHECK-NEXT:    ret double 0.000000e+00
+;
 ; denormal result is flushed to positive zero
-  %result = fdiv double 0x10000000000000, -2.000000e-00
+  %result = fdiv double 0x0010000000000000, -2.000000e-00
   ret double %result
 }
 
 define double @test_double_fdiv_psign_out() #2 {
 ; CHECK-LABEL: @test_double_fdiv_psign_out(
 ; CHECK-NEXT:    ret double -0.000000e+00
+;
 ; denormal result is flushed to sign preserved zero
-  %result = fdiv double 0x10000000000000, -2.000000e-00
+  %result = fdiv double 0x0010000000000000, -2.000000e-00
   ret double %result
 }
 
 define double @test_double_fdiv_pzero_in() #3 {
 ; CHECK-LABEL: @test_double_fdiv_pzero_in(
 ; CHECK-NEXT:    ret double 0.000000e+00
+;
 ; denormal operand is treated as zero
 ; zero divided by anything gives a zero result
   %result = fdiv double 0x8008000000000000, 5.000000e-01
@@ -432,6 +479,7 @@ define double @test_double_fdiv_pzero_in() #3 {
 define double @test_double_fdiv_psign_in() #4 {
 ; CHECK-LABEL: @test_double_fdiv_psign_in(
 ; CHECK-NEXT:    ret double -0.000000e+00
+;
 ; denormal operand is treated as zero
 ; zero divided by anything gives a zero result
   %result = fdiv double 0x8008000000000000, 5.000000e-01
@@ -441,9 +489,10 @@ define double @test_double_fdiv_psign_in() #4 {
 define double @test_double_fdiv_f32_ieee() #5 {
 ; CHECK-LABEL: @test_double_fdiv_f32_ieee(
 ; CHECK-NEXT:    ret double 0x8008000000000000
+;
 ; f32 only attribute should not flush doubles
 ; default ieee mode leaves result as a denormal
-  %result = fdiv double 0x10000000000000, -2.000000e-00
+  %result = fdiv double 0x0010000000000000, -2.000000e-00
   ret double %result
 }
 
@@ -460,6 +509,7 @@ define double @test_double_fdiv_f32_ieee() #5 {
 define float @test_float_frem_ieee_out() #0 {
 ; CHECK-LABEL: @test_float_frem_ieee_out(
 ; CHECK-NEXT:    ret float 0xB800000000000000
+;
 ; default ieee mode leaves result as a denormal
   %result = frem float 0xB818000000000000, 0x3810000000000000
   ret float %result
@@ -468,6 +518,7 @@ define float @test_float_frem_ieee_out() #0 {
 define float @test_float_frem_pzero_out() #1 {
 ; CHECK-LABEL: @test_float_frem_pzero_out(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; denormal result is flushed to positive zero
   %result = frem float 0xB818000000000000, 0x3810000000000000
   ret float %result
@@ -476,6 +527,7 @@ define float @test_float_frem_pzero_out() #1 {
 define float @test_float_frem_psign_out() #2 {
 ; CHECK-LABEL: @test_float_frem_psign_out(
 ; CHECK-NEXT:    ret float -0.000000e+00
+;
 ; denormal result is flushed to sign preserved zero
   %result = frem float 0xB818000000000000, 0x3810000000000000
   ret float %result
@@ -484,6 +536,7 @@ define float @test_float_frem_psign_out() #2 {
 define float @test_float_frem_ieee_in() #0 {
 ; CHECK-LABEL: @test_float_frem_ieee_in(
 ; CHECK-NEXT:    ret float 0x3800000000000000
+;
 ; default ieee mode leaves result same as input
   %result = frem float 0x3800000000000000, 2.000000e+00
   ret float %result
@@ -492,6 +545,7 @@ define float @test_float_frem_ieee_in() #0 {
 define float @test_float_frem_pzero_in() #3 {
 ; CHECK-LABEL: @test_float_frem_pzero_in(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; denormal operand is treated as zero
 ; remainder is now zero
   %result = frem float 0x3800000000000000, 2.000000e+00
@@ -501,6 +555,7 @@ define float @test_float_frem_pzero_in() #3 {
 define float @test_float_frem_psign_in() #4 {
 ; CHECK-LABEL: @test_float_frem_psign_in(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; denormal operand is treated as zero
 ; remainder is now zero
   %result = frem float 0x3800000000000000, 2.000000e+00
@@ -510,6 +565,7 @@ define float @test_float_frem_psign_in() #4 {
 define float @test_float_frem_pzero_f32_out() #1 {
 ; CHECK-LABEL: @test_float_frem_pzero_f32_out(
 ; CHECK-NEXT:    ret float 0.000000e+00
+;
 ; f32 only attribute should flush float output
 ; same as pzero_out above
   %result = frem float 0xB818000000000000, 0x3810000000000000
@@ -519,59 +575,66 @@ define float @test_float_frem_pzero_f32_out() #1 {
 define double @test_double_frem_ieee_out() #0 {
 ; CHECK-LABEL: @test_double_frem_ieee_out(
 ; CHECK-NEXT:    ret double 0x8008000000000000
+;
 ; default ieee mode leaves result as a denormal
-  %result = frem double 0x8018000000000000, 0x10000000000000
+  %result = frem double 0x8018000000000000, 0x0010000000000000
   ret double %result
 }
 
 define double @test_double_frem_pzero_out() #1 {
 ; CHECK-LABEL: @test_double_frem_pzero_out(
 ; CHECK-NEXT:    ret double 0.000000e+00
+;
 ; denormal result is flushed to positive zero
-  %result = frem double 0x8018000000000000, 0x10000000000000
+  %result = frem double 0x8018000000000000, 0x0010000000000000
   ret double %result
 }
 
 define double @test_double_frem_psign_out() #2 {
 ; CHECK-LABEL: @test_double_frem_psign_out(
 ; CHECK-NEXT:    ret double -0.000000e+00
+;
 ; denormal result is flushed to sign preserved zero
-  %result = frem double 0x8018000000000000, 0x10000000000000
+  %result = frem double 0x8018000000000000, 0x0010000000000000
   ret double %result
 }
 
 define double @test_double_frem_ieee_in() #0 {
 ; CHECK-LABEL: @test_double_frem_ieee_in(
 ; CHECK-NEXT:    ret double 0x8000000000000
+;
 ; default ieee mode leaves result same as input
-  %result = frem double 0x8000000000000, 2.000000e+00
+  %result = frem double 0x0008000000000000, 2.000000e+00
   ret double %result
 }
 
 define double @test_double_frem_pzero_in() #3 {
-; CHECK-LABEL: @test_double_frem_pzero_in( 
+; CHECK-LABEL: @test_double_frem_pzero_in(
 ; CHECK-NEXT:    ret double 0.000000e+00
+;
 ; denormal operand is treated as zero
 ; remainder is now zero
-  %result = frem double 0x8000000000000, 2.000000e+00
+  %result = frem double 0x0008000000000000, 2.000000e+00
   ret double %result
 }
 
 define double @test_double_frem_psign_in() #4 {
 ; CHECK-LABEL: @test_double_frem_psign_in(
 ; CHECK-NEXT:    ret double 0.000000e+00
+;
 ; denormal operand is treated as zero
 ; remainder is now zero
-  %result = frem double 0x8000000000000, 2.000000e+00
+  %result = frem double 0x0008000000000000, 2.000000e+00
   ret double %result
 }
 
 define double @test_double_frem_f32_ieee() #5 {
 ; CHECK-LABEL: @test_double_frem_f32_ieee(
 ; CHECK-NEXT:    ret double 0x8008000000000000
+;
 ; f32 only attribute should not flush doubles
 ; default ieee mode leaves result as a denormal
-  %result = frem double 0x8018000000000000, 0x10000000000000
+  %result = frem double 0x8018000000000000, 0x0010000000000000
   ret double %result
 }
 
@@ -584,6 +647,7 @@ define double @test_double_frem_f32_ieee() #5 {
 define float @test_float_fneg_ieee() #0 {
 ; CHECK-LABEL: @test_float_fneg_ieee(
 ; CHECK-NEXT:    ret float 0xB800000000000000
+;
   %result = fneg float 0x3800000000000000
   ret float %result
 }
@@ -591,6 +655,7 @@ define float @test_float_fneg_ieee() #0 {
 define float @test_float_fneg_pzero_out() #0 {
 ; CHECK-LABEL: @test_float_fneg_pzero_out(
 ; CHECK-NEXT:    ret float 0xB800000000000000
+;
   %result = fneg float 0x3800000000000000
   ret float %result
 }
@@ -598,6 +663,7 @@ define float @test_float_fneg_pzero_out() #0 {
 define float @test_float_fneg_psign_out() #0 {
 ; CHECK-LABEL: @test_float_fneg_psign_out(
 ; CHECK-NEXT:    ret float 0xB800000000000000
+;
   %result = fneg float 0x3800000000000000
   ret float %result
 }
@@ -605,6 +671,7 @@ define float @test_float_fneg_psign_out() #0 {
 define float @test_float_fneg_pzero_in() #0 {
 ; CHECK-LABEL: @test_float_fneg_pzero_in(
 ; CHECK-NEXT:    ret float 0xB800000000000000
+;
   %result = fneg float 0x3800000000000000
   ret float %result
 }
@@ -612,6 +679,7 @@ define float @test_float_fneg_pzero_in() #0 {
 define float @test_float_fneg_psign_in() #0 {
 ; CHECK-LABEL: @test_float_fneg_psign_in(
 ; CHECK-NEXT:    ret float 0xB800000000000000
+;
   %result = fneg float 0x3800000000000000
   ret float %result
 }
@@ -619,6 +687,7 @@ define float @test_float_fneg_psign_in() #0 {
 define float @test_float_fneg_pzero_f32_out() #5 {
 ; CHECK-LABEL: @test_float_fneg_pzero_f32_out(
 ; CHECK-NEXT:    ret float 0xB800000000000000
+;
   %result = fneg float 0x3800000000000000
   ret float %result
 }
@@ -626,48 +695,417 @@ define float @test_float_fneg_pzero_f32_out() #5 {
 define double @test_double_fneg_ieee() #0 {
 ; CHECK-LABEL: @test_double_fneg_ieee(
 ; CHECK-NEXT:    ret double 0x8008000000000000
-  %result = fneg double 0x8000000000000
+;
+  %result = fneg double 0x0008000000000000
   ret double %result
 }
 
 define double @test_double_fneg_pzero_out() #1 {
 ; CHECK-LABEL: @test_double_fneg_pzero_out(
 ; CHECK-NEXT:    ret double 0x8008000000000000
-  %result = fneg double 0x8000000000000
+;
+  %result = fneg double 0x0008000000000000
   ret double %result
 }
 
 define double @test_double_fneg_psign_out() #2 {
 ; CHECK-LABEL: @test_double_fneg_psign_out(
 ; CHECK-NEXT:    ret double 0x8008000000000000
-  %result = fneg double 0x8000000000000
+;
+  %result = fneg double 0x0008000000000000
   ret double %result
 }
 
 define double @test_double_fneg_pzero_in() #3 {
 ; CHECK-LABEL: @test_double_fneg_pzero_in(
 ; CHECK-NEXT:    ret double 0x8008000000000000
-  %result = fneg double 0x8000000000000
+;
+  %result = fneg double 0x0008000000000000
   ret double %result
 }
 
 define double @test_double_fneg_psign_in() #4 {
 ; CHECK-LABEL: @test_double_fneg_psign_in(
 ; CHECK-NEXT:    ret double 0x8008000000000000
-  %result = fneg double 0x8000000000000
+;
+  %result = fneg double 0x0008000000000000
   ret double %result
 }
 
 define double @test_double_fneg_f32_ieee() #5 {
 ; CHECK-LABEL: @test_double_fneg_f32_ieee(
 ; CHECK-NEXT:    ret double 0x8008000000000000
-  %result = fneg double 0x8000000000000
+;
+  %result = fneg double 0x0008000000000000
   ret double %result
 }
 
+define i1 @fcmp_double_ieee_in_ieee_out() #0 {
+; CHECK-LABEL: @fcmp_double_ieee_in_ieee_out(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp une double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_float_ieee_in_ieee_out() #0 {
+; CHECK-LABEL: @fcmp_float_ieee_in_ieee_out(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp une float 0x3800000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_pz_in_pz_out() #6 {
+; CHECK-LABEL: @fcmp_double_pz_in_pz_out(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp une double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_float_pz_in_pz_out() #6 {
+; CHECK-LABEL: @fcmp_float_pz_in_pz_out(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp une float 0x3800000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ps_in_ps_out() #7 {
+; CHECK-LABEL: @fcmp_double_ps_in_ps_out(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp une double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_float_ps_in_ps_out() #7 {
+; CHECK-LABEL: @fcmp_float_ps_in_ps_out(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp une float 0x3800000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_pz_out_ieee_in() #1 {
+; CHECK-LABEL: @fcmp_double_pz_out_ieee_in(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp une double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ps_out_ieee_in() #2 {
+; CHECK-LABEL: @fcmp_double_ps_out_ieee_in(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp une double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_out_pz_in() #3 {
+; CHECK-LABEL: @fcmp_double_ieee_out_pz_in(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp une double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_out_ps_in() #4 {
+; CHECK-LABEL: @fcmp_double_ieee_out_ps_in(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp une double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_f32_pz_in() #8 {
+; CHECK-LABEL: @fcmp_double_f32_pz_in(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp une double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_two_denormal_ins() #6 {
+; CHECK-LABEL: @fcmp_double_two_denormal_ins(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp une double 0x0008100000000000, 0x0008000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ps_in_ps_out_false() #6 {
+; CHECK-LABEL: @fcmp_double_ps_in_ps_out_false(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 false
+;
+entry:
+  %cmp = fcmp false double 0x0008100000000000, 0x0008000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_in_ieee_out_false() #0 {
+; CHECK-LABEL: @fcmp_double_ieee_in_ieee_out_false(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 false
+;
+entry:
+  %cmp = fcmp false double 0x0008100000000000, 0x0008000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ps_in_ps_out_true() #6 {
+; CHECK-LABEL: @fcmp_double_ps_in_ps_out_true(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp true double 0x0008100000000000, 0x0008000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_in_ieee_out_true() #0 {
+; CHECK-LABEL: @fcmp_double_ieee_in_ieee_out_true(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp true double 0x0008100000000000, 0x0008000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ps_in_ps_out_oeq() #6 {
+; CHECK-LABEL: @fcmp_double_ps_in_ps_out_oeq(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 false
+;
+entry:
+  %cmp = fcmp oeq double 0x0008100000000000, 0x0008000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_in_ieee_out_oeq() #0 {
+; CHECK-LABEL: @fcmp_double_ieee_in_ieee_out_oeq(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 false
+;
+entry:
+  %cmp = fcmp oeq double 0x0008100000000000, 0x0008000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ps_in_ps_out_one() #6 {
+; CHECK-LABEL: @fcmp_double_ps_in_ps_out_one(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp one double 0x0008100000000000, 0x0008000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_in_ieee_out_one() #0 {
+; CHECK-LABEL: @fcmp_double_ieee_in_ieee_out_one(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp one double 0x0008100000000000, 0x0008000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ps_in_ps_out_ord1() #6 {
+; CHECK-LABEL: @fcmp_double_ps_in_ps_out_ord1(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 false
+;
+entry:
+  %cmp = fcmp ord double 0x0008000000000000, 0x7ff1000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_in_ieee_out_ord1() #0 {
+; CHECK-LABEL: @fcmp_double_ieee_in_ieee_out_ord1(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 false
+;
+entry:
+  %cmp = fcmp ord double 0x0008000000000000, 0x7ff1000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ps_in_ps_out_ord2() #6 {
+; CHECK-LABEL: @fcmp_double_ps_in_ps_out_ord2(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp ord double 0x0008000000000000, 0x1ff1000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_in_ieee_out_ord2() #0 {
+; CHECK-LABEL: @fcmp_double_ieee_in_ieee_out_ord2(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp ord double 0x0008000000000000, 0x1ff1000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_pz_in_pz_out_ugt() #7 {
+; CHECK-LABEL: @fcmp_double_pz_in_pz_out_ugt(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp ugt double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_in_ieee_out_ugt() #0 {
+; CHECK-LABEL: @fcmp_double_ieee_in_ieee_out_ugt(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp ugt double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_pz_in_pz_out_ult() #7 {
+; CHECK-LABEL: @fcmp_double_pz_in_pz_out_ult(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 false
+;
+entry:
+  %cmp = fcmp ult double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_in_ieee_out_ult() #0 {
+; CHECK-LABEL: @fcmp_double_ieee_in_ieee_out_ult(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 false
+;
+entry:
+  %cmp = fcmp ult double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_pz_in_pz_out_uge() #7 {
+; CHECK-LABEL: @fcmp_double_pz_in_pz_out_uge(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp uge double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_in_ieee_out_uge() #0 {
+; CHECK-LABEL: @fcmp_double_ieee_in_ieee_out_uge(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp uge double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_pz_in_pz_out_ule() #7 {
+; CHECK-LABEL: @fcmp_double_pz_in_pz_out_ule(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 false
+;
+entry:
+  %cmp = fcmp ule double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_in_ieee_out_ule() #0 {
+; CHECK-LABEL: @fcmp_double_ieee_in_ieee_out_ule(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 false
+;
+entry:
+  %cmp = fcmp ule double 0x0008000000000000, 0x0
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_pz_in_pz_out_uno() #7 {
+; CHECK-LABEL: @fcmp_double_pz_in_pz_out_uno(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp uno double 0x0008000000000000, 0x7ff1000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_in_ieee_out_uno() #0 {
+; CHECK-LABEL: @fcmp_double_ieee_in_ieee_out_uno(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 true
+;
+entry:
+  %cmp = fcmp uno double 0x0008000000000000, 0x7ff1000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_pz_in_pz_out_uno2() #7 {
+; CHECK-LABEL: @fcmp_double_pz_in_pz_out_uno2(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 false
+;
+entry:
+  %cmp = fcmp uno double 0x0008000000000000, 0x1ff1000000000000
+  ret i1 %cmp
+}
+
+define i1 @fcmp_double_ieee_in_ieee_out_uno2() #0 {
+; CHECK-LABEL: @fcmp_double_ieee_in_ieee_out_uno2(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i1 false
+;
+entry:
+  %cmp = fcmp uno double 0x0008000000000000, 0x1ff1000000000000
+  ret i1 %cmp
+}
+
 attributes #0 = { nounwind "denormal-fp-math"="ieee,ieee" }
 attributes #1 = { nounwind "denormal-fp-math"="positive-zero,ieee" }
 attributes #2 = { nounwind "denormal-fp-math"="preserve-sign,ieee" }
 attributes #3 = { nounwind "denormal-fp-math"="ieee,positive-zero" }
 attributes #4 = { nounwind "denormal-fp-math"="ieee,preserve-sign" }
 attributes #5 = { nounwind "denormal-fp-math"="ieee,ieee" "denormal-fp-math-f32"="positive-zero,ieee" }
+attributes #6 = { nounwind "denormal-fp-math"="positive-zero,positive-zero" }
+attributes #7 = { nounwind "denormal-fp-math"="preserve-sign,preserve-sign" }
+attributes #8 = { nounwind "denormal-fp-math"="ieee,ieee" "denormal-fp-math-f32"="positive-zero,positive-zero" }


        


More information about the llvm-commits mailing list