31 lines · plain
1; RUN: llc -mattr=+fma -disable-cgp < %s -o - | FileCheck %s2; Check that the 2nd and 3rd arguments of fmaXXX231 reg1, reg2, mem3 are not commuted.3; <rdar://problem/16800495> 4target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"5target triple = "x86_64-apple-macosx"6 7; CHECK-LABEL: test1:8; %arg lives in xmm0 and it shouldn't be redefined until it is used in the FMA.9; CHECK-NOT: {{.*}}, %xmm010; %addr lives in rdi.11; %addr2 lives in rsi.12; CHECK: vmovss (%rdi), [[ADDR:%xmm[0-9]+]]13; The assembly syntax is in the reverse order.14; CHECK: vfmadd231ss (%rsi), [[ADDR]], %xmm015define void @test1(ptr %addr, ptr %addr2, float %arg) {16entry:17 br label %loop18 19loop:20 %sum0 = phi float [ %fma, %loop ], [ %arg, %entry ]21 %addrVal = load float, ptr %addr, align 422 %addr2Val = load float, ptr %addr2, align 423 %fmul = fmul contract float %addrVal, %addr2Val24 %fma = fadd contract float %sum0, %fmul25 br i1 true, label %exit, label %loop26 27exit:28 store float %fma, ptr %addr, align 429 ret void30}31