blob: b6eca10803ecbbf0576e23619f446237cb56247d [file] [log] [blame]
Scott Michel0a92af42007-12-19 20:50:49 +00001; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
Scott Michelc9c8b2a2009-01-26 03:31:40 +00002; RUN: grep fsmbi %t1.s | count 3
Chris Lattner994d6cf2008-01-18 19:53:43 +00003; RUN: grep 32768 %t1.s | count 2
4; RUN: grep xor %t1.s | count 4
Scott Michelc9c8b2a2009-01-26 03:31:40 +00005; RUN: grep and %t1.s | count 5
6; RUN: grep andbi %t1.s | count 3
7
Scott Michel9de5d0d2008-01-11 02:53:15 +00008target 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"
9target triple = "spu"
Scott Michel0a92af42007-12-19 20:50:49 +000010
11define double @fneg_dp(double %X) {
Scott Michel53dec472008-03-05 23:00:19 +000012 %Y = sub double -0.000000e+00, %X
13 ret double %Y
Scott Michel0a92af42007-12-19 20:50:49 +000014}
15
16define <2 x double> @fneg_dp_vec(<2 x double> %X) {
Scott Michel53dec472008-03-05 23:00:19 +000017 %Y = sub <2 x double> < double -0.0000e+00, double -0.0000e+00 >, %X
18 ret <2 x double> %Y
Scott Michel0a92af42007-12-19 20:50:49 +000019}
20
21define float @fneg_sp(float %X) {
Scott Michel53dec472008-03-05 23:00:19 +000022 %Y = sub float -0.000000e+00, %X
23 ret float %Y
Scott Michel0a92af42007-12-19 20:50:49 +000024}
25
26define <4 x float> @fneg_sp_vec(<4 x float> %X) {
Scott Michel53dec472008-03-05 23:00:19 +000027 %Y = sub <4 x float> <float -0.000000e+00, float -0.000000e+00,
Scott Michel0a92af42007-12-19 20:50:49 +000028 float -0.000000e+00, float -0.000000e+00>, %X
Scott Michel53dec472008-03-05 23:00:19 +000029 ret <4 x float> %Y
Scott Michel0a92af42007-12-19 20:50:49 +000030}
31
32declare double @fabs(double)
33
34declare float @fabsf(float)
35
36define double @fabs_dp(double %X) {
Scott Michelc9c8b2a2009-01-26 03:31:40 +000037 %Y = call double @fabs( double %X )
Scott Michel53dec472008-03-05 23:00:19 +000038 ret double %Y
Scott Michel0a92af42007-12-19 20:50:49 +000039}
40
41define float @fabs_sp(float %X) {
Scott Michelc9c8b2a2009-01-26 03:31:40 +000042 %Y = call float @fabsf( float %X )
Scott Michel53dec472008-03-05 23:00:19 +000043 ret float %Y
Scott Michel0a92af42007-12-19 20:50:49 +000044}