blob: 1e5e3b34144059e88f97241d80dd25dfb32c4866 [file] [log] [blame]
Dan Gohmanb7c0b242009-09-11 18:36:27 +00001; RUN: llc < %s -march=cellspu > %t1.s
Chris Lattner994d6cf2008-01-18 19:53:43 +00002; RUN: grep 32768 %t1.s | count 2
Scott Michela82d3f72009-03-17 16:45:16 +00003; RUN: grep xor %t1.s | count 4
Scott Michel7ea02ff2009-03-17 01:15:45 +00004; RUN: grep and %t1.s | count 2
Scott Michelc9c8b2a2009-01-26 03:31:40 +00005
Scott Michel9de5d0d2008-01-11 02:53:15 +00006target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
7target triple = "spu"
Scott Michel0a92af42007-12-19 20:50:49 +00008
9define double @fneg_dp(double %X) {
Dan Gohmanae3a0be2009-06-04 22:49:04 +000010 %Y = fsub double -0.000000e+00, %X
Scott Michel53dec472008-03-05 23:00:19 +000011 ret double %Y
Scott Michel0a92af42007-12-19 20:50:49 +000012}
13
14define <2 x double> @fneg_dp_vec(<2 x double> %X) {
Dan Gohmanae3a0be2009-06-04 22:49:04 +000015 %Y = fsub <2 x double> < double -0.0000e+00, double -0.0000e+00 >, %X
Scott Michel53dec472008-03-05 23:00:19 +000016 ret <2 x double> %Y
Scott Michel0a92af42007-12-19 20:50:49 +000017}
18
19define float @fneg_sp(float %X) {
Dan Gohmanae3a0be2009-06-04 22:49:04 +000020 %Y = fsub float -0.000000e+00, %X
Scott Michel53dec472008-03-05 23:00:19 +000021 ret float %Y
Scott Michel0a92af42007-12-19 20:50:49 +000022}
23
24define <4 x float> @fneg_sp_vec(<4 x float> %X) {
Dan Gohmanae3a0be2009-06-04 22:49:04 +000025 %Y = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00,
Scott Michel0a92af42007-12-19 20:50:49 +000026 float -0.000000e+00, float -0.000000e+00>, %X
Scott Michel53dec472008-03-05 23:00:19 +000027 ret <4 x float> %Y
Scott Michel0a92af42007-12-19 20:50:49 +000028}
29
30declare double @fabs(double)
31
32declare float @fabsf(float)
33
34define double @fabs_dp(double %X) {
Scott Michelc9c8b2a2009-01-26 03:31:40 +000035 %Y = call double @fabs( double %X )
Scott Michel53dec472008-03-05 23:00:19 +000036 ret double %Y
Scott Michel0a92af42007-12-19 20:50:49 +000037}
38
39define float @fabs_sp(float %X) {
Scott Michelc9c8b2a2009-01-26 03:31:40 +000040 %Y = call float @fabsf( float %X )
Scott Michel53dec472008-03-05 23:00:19 +000041 ret float %Y
Scott Michel0a92af42007-12-19 20:50:49 +000042}