Vincent Lejeune | 41d4cf2 | 2013-06-17 20:16:40 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=r600 -mcpu=cayman | FileCheck %s |
| 2 | |
| 3 | ;CHECK: DOT4 T{{[0-9]\.X}} |
| 4 | ;CHECK: MULADD_IEEE * T{{[0-9]\.W}} |
| 5 | |
Nicolai Haehnle | df3a20c | 2016-04-06 19:40:20 +0000 | [diff] [blame] | 6 | define amdgpu_vs void @main(<4 x float> inreg %reg0, <4 x float> inreg %reg1, <4 x float> inreg %reg2, <4 x float> inreg %reg3) { |
Vincent Lejeune | 41d4cf2 | 2013-06-17 20:16:40 +0000 | [diff] [blame] | 7 | main_body: |
Vincent Lejeune | f143af3 | 2013-11-11 22:10:24 +0000 | [diff] [blame] | 8 | %0 = extractelement <4 x float> %reg1, i32 0 |
| 9 | %1 = extractelement <4 x float> %reg1, i32 1 |
| 10 | %2 = extractelement <4 x float> %reg1, i32 2 |
| 11 | %3 = extractelement <4 x float> %reg2, i32 0 |
| 12 | %4 = extractelement <4 x float> %reg2, i32 1 |
| 13 | %5 = extractelement <4 x float> %reg2, i32 2 |
| 14 | %6 = extractelement <4 x float> %reg3, i32 0 |
| 15 | %7 = extractelement <4 x float> %reg3, i32 1 |
| 16 | %8 = extractelement <4 x float> %reg3, i32 2 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 17 | %9 = load <4 x float>, <4 x float> addrspace(8)* null |
David Blaikie | f72d05b | 2015-03-13 18:20:45 +0000 | [diff] [blame] | 18 | %10 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 1) |
Matt Arsenault | ca7f570 | 2016-07-14 05:47:17 +0000 | [diff] [blame] | 19 | %11 = call float @llvm.r600.dot4(<4 x float> %9, <4 x float> %9) |
Vincent Lejeune | 41d4cf2 | 2013-06-17 20:16:40 +0000 | [diff] [blame] | 20 | %12 = fmul float %0, %3 |
| 21 | %13 = fadd float %12, %6 |
| 22 | %14 = fmul float %1, %4 |
| 23 | %15 = fadd float %14, %7 |
| 24 | %16 = fmul float %2, %5 |
| 25 | %17 = fadd float %16, %8 |
| 26 | %18 = fmul float %11, %11 |
| 27 | %19 = fadd float %18, %0 |
| 28 | %20 = insertelement <4 x float> undef, float %13, i32 0 |
| 29 | %21 = insertelement <4 x float> %20, float %15, i32 1 |
| 30 | %22 = insertelement <4 x float> %21, float %17, i32 2 |
| 31 | %23 = insertelement <4 x float> %22, float %19, i32 3 |
Matt Arsenault | ca7f570 | 2016-07-14 05:47:17 +0000 | [diff] [blame] | 32 | %24 = call float @llvm.r600.dot4(<4 x float> %23, <4 x float> %10) |
Vincent Lejeune | 41d4cf2 | 2013-06-17 20:16:40 +0000 | [diff] [blame] | 33 | %25 = insertelement <4 x float> undef, float %24, i32 0 |
Matt Arsenault | 82e5e1e | 2016-07-15 21:27:08 +0000 | [diff] [blame] | 34 | call void @llvm.r600.store.swizzle(<4 x float> %25, i32 0, i32 2) |
Vincent Lejeune | 41d4cf2 | 2013-06-17 20:16:40 +0000 | [diff] [blame] | 35 | ret void |
| 36 | } |
| 37 | |
| 38 | ; Function Attrs: readnone |
Matt Arsenault | ca7f570 | 2016-07-14 05:47:17 +0000 | [diff] [blame] | 39 | declare float @llvm.r600.dot4(<4 x float>, <4 x float>) #1 |
Vincent Lejeune | 41d4cf2 | 2013-06-17 20:16:40 +0000 | [diff] [blame] | 40 | |
| 41 | |
Matt Arsenault | 82e5e1e | 2016-07-15 21:27:08 +0000 | [diff] [blame] | 42 | declare void @llvm.r600.store.swizzle(<4 x float>, i32, i32) |
Vincent Lejeune | 41d4cf2 | 2013-06-17 20:16:40 +0000 | [diff] [blame] | 43 | |
Vincent Lejeune | 41d4cf2 | 2013-06-17 20:16:40 +0000 | [diff] [blame] | 44 | attributes #1 = { readnone } |