+2016-05-20 Cesar Philippidis <cesar@codesourcery.com>
+
+ * config/nvptx/nvptx.md (sincossf3): New pattern.
+
2016-05-20 H.J. Lu <hongjiu.lu@intel.com>
PR target/70738
""
"%.\\tsqrt%#%t0\\t%0, %1;")
+(define_expand "sincossf3"
+ [(set (match_operand:SF 0 "nvptx_register_operand" "=R")
+ (unspec:SF [(match_operand:SF 2 "nvptx_register_operand" "R")]
+ UNSPEC_COS))
+ (set (match_operand:SF 1 "nvptx_register_operand" "=R")
+ (unspec:SF [(match_dup 2)] UNSPEC_SIN))]
+ "flag_unsafe_math_optimizations"
+{
+ operands[2] = make_safe_from (operands[2], operands[0]);
+})
+
(define_insn "sinsf2"
[(set (match_operand:SF 0 "nvptx_register_operand" "=R")
(unspec:SF [(match_operand:SF 1 "nvptx_register_operand" "R")]
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern float sinf (float);
+extern float cosf (float);
+
+float
+sincos_add (float x)
+{
+ float s = sinf (x);
+ float c = cosf (x);
+
+ return s + c;
+}
+
+/* { dg-final { scan-assembler-times "sin.approx.f32" 1 } } */
+/* { dg-final { scan-assembler-times "cos.approx.f32" 1 } } */