diff options
author | Dan Gohman <dan433584@gmail.com> | 2015-08-24 18:44:37 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2015-08-24 18:44:37 +0000 |
commit | 7b63484b997e08f98e29f9b50acab85e1a64adf3 (patch) | |
tree | 7c6f2ac530d119397d028f7128f950785164ecfb /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | 896e53fae806150d7eea7f11efe3738ca924dcd0 (diff) | |
download | bcm5719-llvm-7b63484b997e08f98e29f9b50acab85e1a64adf3.tar.gz bcm5719-llvm-7b63484b997e08f98e29f9b50acab85e1a64adf3.zip |
[WebAssembly] Skeleton FastISel support
llvm-svn: 245860
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 047ea9050a2..8cf859cf517 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -1867,6 +1867,25 @@ unsigned FastISel::fastEmitInst_rii(unsigned MachineInstOpcode, return ResultReg; } +unsigned FastISel::fastEmitInst_f(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + const ConstantFP *FPImm) { + const MCInstrDesc &II = TII.get(MachineInstOpcode); + + unsigned ResultReg = createResultReg(RC); + + if (II.getNumDefs() >= 1) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, II, ResultReg) + .addFPImm(FPImm); + else { + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, II) + .addFPImm(FPImm); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, + TII.get(TargetOpcode::COPY), ResultReg).addReg(II.ImplicitDefs[0]); + } + return ResultReg; +} + unsigned FastISel::fastEmitInst_rf(unsigned MachineInstOpcode, const TargetRegisterClass *RC, unsigned Op0, bool Op0IsKill, const ConstantFP *FPImm) { |