blob: 045bb05298923fe64567a4ca37dd5e856d27fccf [file] [log] [blame]
Scott Michel0a92af42007-12-19 20:50:49 +00001; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
Chris Lattner994d6cf2008-01-18 19:53:43 +00002; RUN: grep fsmbi %t1.s | count 3
3; RUN: grep 32768 %t1.s | count 2
4; RUN: grep xor %t1.s | count 4
5; RUN: grep and %t1.s | count 5
Scott Michel0a92af42007-12-19 20:50:49 +00006; RUN: grep andbi %t1.s | count 3
Scott Michel9de5d0d2008-01-11 02:53:15 +00007target 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"
8target triple = "spu"
Scott Michel0a92af42007-12-19 20:50:49 +00009
10define double @fneg_dp(double %X) {
Scott Michel53dec472008-03-05 23:00:19 +000011 %Y = sub double -0.000000e+00, %X
12 ret double %Y
Scott Michel0a92af42007-12-19 20:50:49 +000013}
14
15define <2 x double> @fneg_dp_vec(<2 x double> %X) {
Scott Michel53dec472008-03-05 23:00:19 +000016 %Y = sub <2 x double> < double -0.0000e+00, double -0.0000e+00 >, %X
17 ret <2 x double> %Y
Scott Michel0a92af42007-12-19 20:50:49 +000018}
19
20define float @fneg_sp(float %X) {
Scott Michel53dec472008-03-05 23:00:19 +000021 %Y = sub float -0.000000e+00, %X
22 ret float %Y
Scott Michel0a92af42007-12-19 20:50:49 +000023}
24
25define <4 x float> @fneg_sp_vec(<4 x float> %X) {
Scott Michel53dec472008-03-05 23:00:19 +000026 %Y = sub <4 x float> <float -0.000000e+00, float -0.000000e+00,
Scott Michel0a92af42007-12-19 20:50:49 +000027 float -0.000000e+00, float -0.000000e+00>, %X
Scott Michel53dec472008-03-05 23:00:19 +000028 ret <4 x float> %Y
Scott Michel0a92af42007-12-19 20:50:49 +000029}
30
31declare double @fabs(double)
32
33declare float @fabsf(float)
34
35define double @fabs_dp(double %X) {
Scott Michel53dec472008-03-05 23:00:19 +000036 %Y = call double @fabs( double %X ) ; <double> [#uses=1]
37 ret double %Y
Scott Michel0a92af42007-12-19 20:50:49 +000038}
39
40define float @fabs_sp(float %X) {
Scott Michel53dec472008-03-05 23:00:19 +000041 %Y = call float @fabsf( float %X ) ; <float> [#uses=1]
42 ret float %Y
Scott Michel0a92af42007-12-19 20:50:49 +000043}