From 3a02f020eb72cb10f7f794532ddc35e478f7e86b Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 4 Sep 2006 19:05:01 +0000 Subject: [PATCH] add support for returning 64bit values git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30103 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMISelDAGToDAG.cpp | 9 +++++++++ test/CodeGen/ARM/long.ll | 32 ++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 test/CodeGen/ARM/long.ll diff --git a/lib/Target/ARM/ARMISelDAGToDAG.cpp b/lib/Target/ARM/ARMISelDAGToDAG.cpp index eba7c78aaa0..9a194975740 100644 --- a/lib/Target/ARM/ARMISelDAGToDAG.cpp +++ b/lib/Target/ARM/ARMISelDAGToDAG.cpp @@ -238,6 +238,15 @@ static SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG) { if (DAG.getMachineFunction().liveout_empty()) DAG.getMachineFunction().addLiveOut(ARM::R0); break; + case 5: + Copy = DAG.getCopyToReg(Chain, ARM::R1, Op.getOperand(3), SDOperand()); + Copy = DAG.getCopyToReg(Copy, ARM::R0, Op.getOperand(1), Copy.getValue(1)); + // If we haven't noted the R0+R1 are live out, do so now. + if (DAG.getMachineFunction().liveout_empty()) { + DAG.getMachineFunction().addLiveOut(ARM::R0); + DAG.getMachineFunction().addLiveOut(ARM::R1); + } + break; } //We must use RET_FLAG instead of BRIND because BRIND doesn't have a flag diff --git a/test/CodeGen/ARM/long.ll b/test/CodeGen/ARM/long.ll new file mode 100644 index 00000000000..f4ede17c03e --- /dev/null +++ b/test/CodeGen/ARM/long.ll @@ -0,0 +1,32 @@ +; RUN: llvm-as < %s | llc -march=arm && +; RUN: llvm-as < %s | llc -march=arm | grep "mov r1, #0" | wc -l | grep 4 && +; RUN: llvm-as < %s | llc -march=arm | grep "mov r0, #1" | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm | grep "mov r0, #2147483647" | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm | grep "mov r0, #-2147483648" | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm | grep "mov r0, #-1" | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm | grep "mov r1, #2147483647" | wc -l | grep 1 + +long %f1() { +entry: + ret long 0 +} + +long %f2() { +entry: + ret long 1 +} + +long %f3() { +entry: + ret long 2147483647 +} + +long %f4() { +entry: + ret long 2147483648 +} + +long %f5() { +entry: + ret long 9223372036854775807 +} -- 2.34.1