From: Rafael Espindola Date: Fri, 13 Oct 2006 17:37:35 +0000 (+0000) Subject: add FNEGS and FNEGD X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=33d06bcfd41447b94cd66126b948469d41f7f2ef;p=oota-llvm.git add FNEGS and FNEGD git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30932 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM/ARMInstrInfo.td b/lib/Target/ARM/ARMInstrInfo.td index 4954865b6c5..fde132aaea0 100644 --- a/lib/Target/ARM/ARMInstrInfo.td +++ b/lib/Target/ARM/ARMInstrInfo.td @@ -269,6 +269,14 @@ def FSUBD : InstARM<(ops DFPRegs:$dst, DFPRegs:$a, DFPRegs:$b), "fsubd $dst, $a, $b", [(set DFPRegs:$dst, (fsub DFPRegs:$a, DFPRegs:$b))]>; +def FNEGS : InstARM<(ops FPRegs:$dst, FPRegs:$src), + "fnegs $dst, $src", + [(set FPRegs:$dst, (fneg FPRegs:$src))]>; + +def FNEGD : InstARM<(ops DFPRegs:$dst, DFPRegs:$src), + "fnegd $dst, $src", + [(set DFPRegs:$dst, (fneg DFPRegs:$src))]>; + def FMULS : InstARM<(ops FPRegs:$dst, FPRegs:$a, FPRegs:$b), "fmuls $dst, $a, $b", [(set FPRegs:$dst, (fmul FPRegs:$a, FPRegs:$b))]>; diff --git a/test/CodeGen/ARM/fparith.ll b/test/CodeGen/ARM/fparith.ll index 7210eee9ddd..c72a8738735 100644 --- a/test/CodeGen/ARM/fparith.ll +++ b/test/CodeGen/ARM/fparith.ll @@ -2,7 +2,9 @@ ; RUN: llvm-as < %s | llc -march=arm | grep fadds && ; RUN: llvm-as < %s | llc -march=arm | grep faddd && ; RUN: llvm-as < %s | llc -march=arm | grep fmuls && -; RUN: llvm-as < %s | llc -march=arm | grep fmuld +; RUN: llvm-as < %s | llc -march=arm | grep fmuld && +; RUN: llvm-as < %s | llc -march=arm | grep fnegs && +; RUN: llvm-as < %s | llc -march=arm | grep fnegd float %f1(float %a, float %b) { entry: @@ -39,3 +41,15 @@ entry: %tmp = sub double %a, %b ret double %tmp } + +float %f7(float %a) { +entry: + %tmp1 = sub float -0.000000e+00, %a + ret float %tmp1 +} + +double %f8(double %a) { +entry: + %tmp1 = sub double -0.000000e+00, %a + ret double %tmp1 +}