The ABI leaves the upper part of xmm register used to pass floating
point values unspecified, so it can contain garbage.  The receiving routines
need to care for this.  The XMM-to-XMM conversions (CVT*) only come in
a packed flavor, and the float->int conversion can throw a floating
point exception (if enabled) when the value doesn't fit the destination
integer, and this can happen easily when the upper half contain garbage.

So, make sure such garbage doesn't flow into the routines.

This is bnc #933903.

diff -urp sysdeps/x86_64/fpu.mm/exp10_bdozr.S sysdeps/x86_64/fpu/exp10_bdozr.S
--- sysdeps/x86_64/fpu.mm/exp10_bdozr.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/exp10_bdozr.S	2015-06-11 14:51:33.000000000 +0000
@@ -47,6 +47,7 @@ fname:
 .endif
 
     # x * (64/log10(2))
+    vmovq       %xmm0,%xmm0          #xmm0 = 0,x   #zero out the upper part
     vmulsd       .L__real_64_by_log10of2(%rip), %xmm0, %xmm1
 
     # n = int( x * (64/log10(2)) )
@@ -60,7 +61,6 @@ fname:
     # r2 *= ln10;
     # r1+r2  
     vmovlhps    %xmm1,%xmm1,%xmm1    #xmm1 = (double)n,(double)n
-    vmovq       %xmm0,%xmm0          #xmm0 = 0,x   #zero out the upper part
     vfmaddpd %xmm0,.L__log10of2_by_64_mtail_mhead(%rip),%xmm1,%xmm2
     vmulpd      .L__ln10(%rip),%xmm2,%xmm2    
     vhaddpd      %xmm2,%xmm2,%xmm2     #xmm2 = r,r
diff -urp sysdeps/x86_64/fpu.mm/exp10f_bdozr.S sysdeps/x86_64/fpu/exp10f_bdozr.S
--- sysdeps/x86_64/fpu.mm/exp10f_bdozr.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/exp10f_bdozr.S	2015-06-11 14:57:05.000000000 +0000
@@ -40,6 +40,7 @@ fname:
     jb .L__y_is_zero
 
     vcvtps2pd     %xmm0, %xmm2    #xmm2 = (double)x
+    vmovq         %xmm2, %xmm2    #zero out upper part
 
     # x * (64/log10of(2))
     vmulsd       .L__real_64_by_log10of2(%rip), %xmm2,%xmm3  #xmm3 = x * (64/ln(2)
diff -urp sysdeps/x86_64/fpu.mm/exp2_bdozr.S sysdeps/x86_64/fpu/exp2_bdozr.S
--- sysdeps/x86_64/fpu.mm/exp2_bdozr.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/exp2_bdozr.S	2015-06-11 14:54:10.000000000 +0000
@@ -46,6 +46,7 @@ fname:
     jb            .L__y_is_one    
 .endif
 
+    vmovq        %xmm0, %xmm0   #zero out upper part
     # x * (64)
     vmulsd       .L__real_64(%rip), %xmm0, %xmm1
 
diff -urp sysdeps/x86_64/fpu.mm/exp_bdozr.S sysdeps/x86_64/fpu/exp_bdozr.S
--- sysdeps/x86_64/fpu.mm/exp_bdozr.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/exp_bdozr.S	2015-06-11 14:53:05.000000000 +0000
@@ -45,6 +45,7 @@ fname:
     jb            .L__y_is_one    
 .endif
 
+    vmovq        %xmm0,%xmm0           #xmm0 = 0,x   #zero out the upper part
     # x * (64/ln(2))
     vmulsd       .L__real_64_by_log2(%rip), %xmm0,%xmm1
 
@@ -57,7 +58,6 @@ fname:
     # r2 = - n * ln(2)/64 tail    
     # r  = r1+r2    
     vmovlhps     %xmm1,%xmm1,%xmm1     #xmm1 = (double)n,(double)n
-    vmovq        %xmm0,%xmm0           #xmm0 = 0,x   #zero out the upper part
     vfmaddpd     %xmm0,.L__log2_by_64_mtail_mhead(%rip),%xmm1,%xmm2
     vhaddpd      %xmm2,%xmm2,%xmm2     #xmm2 = r,r
     
diff -urp sysdeps/x86_64/fpu.mm/expf_bdozr.S sysdeps/x86_64/fpu/expf_bdozr.S
--- sysdeps/x86_64/fpu.mm/expf_bdozr.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/expf_bdozr.S	2015-06-11 14:56:22.000000000 +0000
@@ -40,6 +40,7 @@ fname:
     jb .L__y_is_zero
 
     vcvtps2pd     %xmm0, %xmm2    #xmm2 = (double)x
+    vmovq         %xmm2, %xmm2    #zero out upper part
 
     # x * (64/ln(2))
     vmulsd       .L__real_64_by_log2(%rip),%xmm2,%xmm3  #xmm3 = x * (64/ln(2)
diff -urp sysdeps/x86_64/fpu.mm/expm1_bdozr.S sysdeps/x86_64/fpu/expm1_bdozr.S
--- sysdeps/x86_64/fpu.mm/expm1_bdozr.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/expm1_bdozr.S	2015-06-11 14:59:08.000000000 +0000
@@ -45,6 +45,7 @@ fname:
     
     .p2align 4
 .L__Normal_Flow:
+    vmovq       %xmm0,%xmm0           #xmm0 = 0,x   #zero out the upper part
     # x * (64/ln(2))
     vmulsd       .L__real_64_by_log2(%rip),%xmm0,%xmm1
 
@@ -57,7 +58,6 @@ fname:
     # r2 = - n * ln(2)/64 tail    
     # r1+r2 
     vmovlhps    %xmm1,%xmm1,%xmm1     #xmm1 = (double)n,(double)n
-    vmovq       %xmm0,%xmm0           #xmm0 = 0,x   #zero out the upper part
     vfmaddpd    %xmm0,.L__log2_by_64_mtail_mhead(%rip),%xmm1,%xmm2
     vhaddpd     %xmm2,%xmm2,%xmm2     #xmm2 = r,r
         
diff -urp sysdeps/x86_64/fpu.mm/expm1f_bdozr.S sysdeps/x86_64/fpu/expm1f_bdozr.S
--- sysdeps/x86_64/fpu.mm/expm1f_bdozr.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/expm1f_bdozr.S	2015-06-11 14:59:41.000000000 +0000
@@ -47,6 +47,7 @@ fname:
 .L__Normal_Flow:
     #x_double = (double)x;
     vcvtps2pd    %xmm0, %xmm2    #xmm2 = (double)x
+    vmovq        %xmm2, %xmm2    #zero out upper part
     
     # x * (64/ln(2))
     vmulsd       .L__real_64_by_log2(%rip), %xmm2,%xmm3  #xmm3 = x * (64/ln(2)
diff -urp sysdeps/x86_64/fpu.mm/s_expm1.S sysdeps/x86_64/fpu/s_expm1.S
--- sysdeps/x86_64/fpu.mm/s_expm1.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/s_expm1.S	2015-06-11 14:34:30.000000000 +0000
@@ -49,7 +49,7 @@ fname:
     .p2align 4
 .L__Normal_Flow:
     # x * (64/ln(2))
-    movapd      %xmm0,%xmm1        
+    movq        %xmm0,%xmm1        #clear upper part, it might contain garbage
     mulsd       .L__real_64_by_log2(%rip), %xmm1
 
     # n = int( x * (64/ln(2)) )
diff -urp sysdeps/x86_64/fpu.mm/s_expm1f.S sysdeps/x86_64/fpu/s_expm1f.S
--- sysdeps/x86_64/fpu.mm/s_expm1f.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/s_expm1f.S	2015-06-11 14:34:59.000000000 +0000
@@ -50,6 +50,7 @@ fname:
 .L__Normal_Flow:
     #x_double = (double)x;
     cvtps2pd     %xmm0, %xmm0    #xmm0 = (double)x
+    movq         %xmm0, %xmm0    #clear upper part, it might contain garbage
     
     # x * (64/ln(2))
     movapd      %xmm0,%xmm3      #xmm3 = (xouble)x
diff -urp sysdeps/x86_64/fpu.mm/w_exp.S sysdeps/x86_64/fpu/w_exp.S
--- sysdeps/x86_64/fpu.mm/w_exp.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/w_exp.S	2015-06-11 14:21:26.000000000 +0000
@@ -86,7 +86,7 @@ fname:
 .endif
 
     # x * (64/ln(2))
-    movapd      %xmm0,%xmm1        
+    movq        %xmm0,%xmm1     #clear upper half, it might contain garbage
     mulsd       .L__real_64_by_log2(%rip), %xmm1
 
     # n = int( x * (64/ln(2)) )
diff -urp sysdeps/x86_64/fpu.mm/w_exp10.S sysdeps/x86_64/fpu/w_exp10.S
--- sysdeps/x86_64/fpu.mm/w_exp10.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/w_exp10.S	2015-06-11 14:21:40.000000000 +0000
@@ -49,7 +49,7 @@ fname:
 .endif
 
     # x * (64/log10(2))
-    movapd      %xmm0,%xmm1        
+    movq        %xmm0,%xmm1        #clear upper half, it might contain garbage
     mulsd       .L__real_64_by_log10of2(%rip), %xmm1
 
     # n = int( x * (64/log10(2)) )
diff -urp sysdeps/x86_64/fpu.mm/w_exp10f.S sysdeps/x86_64/fpu/w_exp10f.S
--- sysdeps/x86_64/fpu.mm/w_exp10f.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/w_exp10f.S	2015-06-11 14:20:57.000000000 +0000
@@ -42,6 +42,7 @@ fname:
     jb .L__y_is_zero
 
     cvtps2pd     %xmm0, %xmm0    #xmm0 = (double)x
+    movq         %xmm0, %xmm0    #clear upper half, it might contain garbage
 
     # x * (64/log10of(2))
     movapd      %xmm0,%xmm3      #xmm3 = (xouble)x
diff -urp sysdeps/x86_64/fpu.mm/w_exp2.S sysdeps/x86_64/fpu/w_exp2.S
--- sysdeps/x86_64/fpu.mm/w_exp2.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/w_exp2.S	2015-06-11 14:21:33.000000000 +0000
@@ -50,7 +50,7 @@ fname:
 .endif
 
     # x * (64)
-    movapd      %xmm0,%xmm2        
+    movq        %xmm0,%xmm2        #clear upper half, it might contain garbage
     mulsd       .L__real_64(%rip), %xmm2
 
     # n = int( x * (64))
diff -urp sysdeps/x86_64/fpu.mm/w_exp2f.S sysdeps/x86_64/fpu/w_exp2f.S
--- sysdeps/x86_64/fpu.mm/w_exp2f.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/w_exp2f.S	2015-06-11 14:20:37.000000000 +0000
@@ -42,6 +42,7 @@ fname:
     jb .L__y_is_zero
 
     cvtps2pd     %xmm0, %xmm0    #xmm0 = (double)x
+    movq         %xmm0, %xmm0    #clear upper half, it might contain garbage
 
     # x * (64)
     movapd      %xmm0,%xmm3      #xmm3 = (double)x
diff -urp sysdeps/x86_64/fpu.mm/w_expf.S sysdeps/x86_64/fpu/w_expf.S
--- sysdeps/x86_64/fpu.mm/w_expf.S	2015-06-11 13:21:14.000000000 +0000
+++ sysdeps/x86_64/fpu/w_expf.S	2015-06-11 14:21:06.000000000 +0000
@@ -58,6 +58,7 @@ fname:
     jb .L__y_is_zero
 
     cvtps2pd     %xmm0, %xmm0    #xmm0 = (double)x
+    movq         %xmm0, %xmm0    #clear upper half, it might contain garbage
 
     # x * (64/ln(2))
     movapd      %xmm0,%xmm3      #xmm3 = (xouble)x
