Eric Christopher | c206d46 | 2012-01-07 01:02:09 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=x86-64 -mattr=+avx |
Evan Cheng | 18fe458 | 2009-07-17 22:13:25 +0000 | [diff] [blame] | 2 | ; rdar://7066579 |
| 3 | |
Chris Lattner | 8936d2b | 2011-06-19 00:03:46 +0000 | [diff] [blame] | 4 | %0 = type { i64, i64, i64, i64, i64 } ; type %0 |
Evan Cheng | 18fe458 | 2009-07-17 22:13:25 +0000 | [diff] [blame] | 5 | |
Nick Lewycky | 9badf60 | 2011-07-08 00:19:27 +0000 | [diff] [blame] | 6 | define void @test1() nounwind { |
Evan Cheng | 18fe458 | 2009-07-17 22:13:25 +0000 | [diff] [blame] | 7 | entry: |
| 8 | %asmtmp = call %0 asm sideeffect "mov %cr0, $0 \0Amov %cr2, $1 \0Amov %cr3, $2 \0Amov %cr4, $3 \0Amov %cr8, $0 \0A", "=q,=q,=q,=q,=q,~{dirflag},~{fpsr},~{flags}"() nounwind ; <%0> [#uses=0] |
| 9 | ret void |
| 10 | } |
Nick Lewycky | 9badf60 | 2011-07-08 00:19:27 +0000 | [diff] [blame] | 11 | |
| 12 | ; PR9602 |
| 13 | define void @test2(float %tmp) nounwind { |
| 14 | call void asm sideeffect "$0", "q"(float %tmp) nounwind |
| 15 | call void asm sideeffect "$0", "Q"(float %tmp) nounwind |
| 16 | ret void |
| 17 | } |
| 18 | |
| 19 | define void @test3(double %tmp) nounwind { |
| 20 | call void asm sideeffect "$0", "q"(double %tmp) nounwind |
| 21 | ret void |
| 22 | } |
Eric Christopher | 9da7f30 | 2011-12-01 08:12:41 +0000 | [diff] [blame] | 23 | |
| 24 | ; rdar://10392864 |
| 25 | define void @test4(i8 signext %val, i8 signext %a, i8 signext %b, i8 signext %c, i8 signext %d) nounwind { |
| 26 | entry: |
| 27 | %0 = tail call { i8, i8, i8, i8, i8 } asm "foo $1, $2, $3, $4, $1\0Axchgb ${0:b}, ${0:h}", "=q,={ax},={bx},={cx},={dx},0,1,2,3,4,~{dirflag},~{fpsr},~{flags}"(i8 %val, i8 %a, i8 %b, i8 %c, i8 %d) nounwind |
| 28 | ret void |
| 29 | } |
Eric Christopher | c206d46 | 2012-01-07 01:02:09 +0000 | [diff] [blame] | 30 | |
| 31 | ; rdar://10614894 |
| 32 | define <8 x float> @test5(<8 x float> %a, <8 x float> %b) nounwind { |
| 33 | entry: |
| 34 | %0 = tail call <8 x float> asm "vperm2f128 $3, $2, $1, $0", "=x,x,x,i,~{dirflag},~{fpsr},~{flags}"(<8 x float> %a, <8 x float> %b, i32 16) nounwind |
| 35 | ret <8 x float> %0 |
| 36 | } |
| 37 | |