diff --git a/llvm/lib/Target/PowerPC/PPCInstrVSX.td b/llvm/lib/Target/PowerPC/PPCInstrVSX.td --- a/llvm/lib/Target/PowerPC/PPCInstrVSX.td +++ b/llvm/lib/Target/PowerPC/PPCInstrVSX.td @@ -1616,10 +1616,12 @@ // FIXME: Setting the hasSideEffects flag here to match current behaviour. let hasSideEffects = 1 in { - def XSMAXJDP : XX3_XT5_XA5_XB5<60, 144, "xsmaxjdp", vsrc, vsfrc, vsfrc, - IIC_VecFP, []>; - def XSMINJDP : XX3_XT5_XA5_XB5<60, 152, "xsminjdp", vsrc, vsfrc, vsfrc, - IIC_VecFP, []>; + def XSMAXJDP : XX3_XT5_XA5_XB5<60, 144, "xsmaxjdp", vsfrc, vsfrc, vsfrc, + IIC_VecFP, + [(set f64:$XT, (fmaximum f64:$XA, f64:$XB))]>; + def XSMINJDP : XX3_XT5_XA5_XB5<60, 152, "xsminjdp", vsfrc, vsfrc, vsfrc, + IIC_VecFP, + [(set f64:$XT, (fminimum f64:$XA, f64:$XB))]>; } // Vector Byte-Reverse H/W/D/Q Word diff --git a/llvm/test/CodeGen/PowerPC/fminmax-type-j.ll b/llvm/test/CodeGen/PowerPC/fminmax-type-j.ll new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/fminmax-type-j.ll @@ -0,0 +1,27 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \ +; RUN: -mcpu=pwr9 < %s | FileCheck %s + +declare double @llvm.maximum.f64(double, double) +declare double @llvm.minimum.f64(double, double) + +define double @test_max(double %a, double %b) { +; CHECK-LABEL: test_max: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: xsmaxjdp 1, 1, 2 +; CHECK-NEXT: blr +entry: + %0 = call double @llvm.maximum.f64(double %a, double %b) + ret double %0 +} + +define double @test_min(double %a, double %b) { +; CHECK-LABEL: test_min: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: xsminjdp 1, 1, 2 +; CHECK-NEXT: blr +entry: + %0 = call double @llvm.minimum.f64(double %a, double %b) + ret double %0 +} +