1 ; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
3 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=R600 -check-prefix=FUNC %s
6 ; FUNC-LABEL: {{^}}fmul_f32:
7 ; R600: MUL_IEEE {{\** *}}{{T[0-9]+\.[XYZW]}}, KC0[2].Z, KC0[2].W
10 define void @fmul_f32(float addrspace(1)* %out, float %a, float %b) {
12 %0 = fmul float %a, %b
13 store float %0, float addrspace(1)* %out
17 declare float @llvm.R600.load.input(i32) readnone
19 declare void @llvm.AMDGPU.store.output(float, i32)
21 ; FUNC-LABEL: {{^}}fmul_v2f32:
22 ; R600: MUL_IEEE {{\** *}}T{{[0-9]+\.[XYZW]}}
23 ; R600: MUL_IEEE {{\** *}}T{{[0-9]+\.[XYZW]}}
27 define void @fmul_v2f32(<2 x float> addrspace(1)* %out, <2 x float> %a, <2 x float> %b) {
29 %0 = fmul <2 x float> %a, %b
30 store <2 x float> %0, <2 x float> addrspace(1)* %out
34 ; FUNC-LABEL: {{^}}fmul_v4f32:
35 ; R600: MUL_IEEE {{\** *}}T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
36 ; R600: MUL_IEEE {{\** *}}T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
37 ; R600: MUL_IEEE {{\** *}}T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
38 ; R600: MUL_IEEE {{\** *}}T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
44 define void @fmul_v4f32(<4 x float> addrspace(1)* %out, <4 x float> addrspace(1)* %in) {
45 %b_ptr = getelementptr <4 x float>, <4 x float> addrspace(1)* %in, i32 1
46 %a = load <4 x float>, <4 x float> addrspace(1) * %in
47 %b = load <4 x float>, <4 x float> addrspace(1) * %b_ptr
48 %result = fmul <4 x float> %a, %b
49 store <4 x float> %result, <4 x float> addrspace(1)* %out
53 ; FUNC-LABEL: {{^}}test_mul_2_k:
57 define void @test_mul_2_k(float addrspace(1)* %out, float %x) #0 {
58 %y = fmul float %x, 2.0
59 %z = fmul float %y, 3.0
60 store float %z, float addrspace(1)* %out
64 ; FUNC-LABEL: {{^}}test_mul_2_k_inv:
69 define void @test_mul_2_k_inv(float addrspace(1)* %out, float %x) #0 {
70 %y = fmul float %x, 3.0
71 %z = fmul float %y, 2.0
72 store float %z, float addrspace(1)* %out
76 attributes #0 = { "less-precise-fpmad"="true" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "unsafe-fp-math"="true" }