[PATCH] D92758: [VE] Add vfmk intrinsic instructions
Simon Moll via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 9 00:32:09 PST 2020
simoll added inline comments.
================
Comment at: llvm/lib/Target/VE/VEInstrInfo.cpp:738
+
+ std::map<int, std::vector<int>> VFMKMap = {
+ {VE::VFMKyal, {VE::VFMKLal, VE::VFMKLal}},
----------------
Can we make this static and use something more lightweight than a `std::vector`?
std::map<unsigned, unsigned[2]>
================
Comment at: llvm/lib/Target/VE/VEInstrInfo.cpp:749
+
+ if (VFMKMap.find(Opcode) == VFMKMap.end()) {
+ report_fatal_error("unexpected opcode for pseudo vfmk");
----------------
better drop curly braces
================
Comment at: llvm/lib/Target/VE/VEInstrInfo.cpp:753-801
+ unsigned OpcodeUpper = VFMKMap[Opcode][0];
+ unsigned OpcodeLower = VFMKMap[Opcode][1];
+
+ MachineBasicBlock *MBB = MI.getParent();
+ DebugLoc DL = MI.getDebugLoc();
+ MachineInstrBuilder Bu = BuildMI(*MBB, MI, DL, TI.get(OpcodeUpper));
+ MachineInstrBuilder Bl = BuildMI(*MBB, MI, DL, TI.get(OpcodeLower));
----------------
I guess you could loop over this code for each part instead of replicating the code for the lower and upper part.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92758/new/
https://reviews.llvm.org/D92758
More information about the llvm-commits
mailing list