Rail Shafigulin via llvm-dev
2015-Nov-24 20:06 UTC
[llvm-dev] Hexagon and choosing of slots
> On Hexagon, the slot assignment is determined by the layout of the > instructions in memory. The order of the instructions in the packet does > not matter either in the IR, nor in the .s file, but it does when the > packet is encoded into the actual machine code. In LLVM, the Hexagon > shuffler orders the instructions just prior to encoding. > > Specifically, the instructions in the packet are encoded "in reverse", > i.e. the instruction that will go to the highest slot will be encoded > first, then the instruction that will go to the second highest slot, etc. > In case of a packet with 4 instructions, it will be > addr: slot3 > addr+4: slot2 > addr+8: slot1 > addr+12: slot0 > Not all slots have to be occupied. If they are not, the hardware will > assign the slots based on the instruction, but within a packet the slots > must be in a decreasing order. For example: > addr: slot2 > addr+4: slot0 > is ok, but > addr: slot1 > addr+4: slot0 > is not. > > There are also bits in each encoding word that indicate the end of the > packet: those must also be set properly by the compiler. > > -Krzysztof > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >Would you mind pointing me to the source code where actual shuffling occurs. I looked through lib/Target/Hexagon but was not able to find it. Is shuffling now part of a core code? Thanks, -- R -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151124/879853cf/attachment.html>
Krzysztof Parzyszek via llvm-dev
2015-Nov-24 20:16 UTC
[llvm-dev] Hexagon and choosing of slots
On 11/24/2015 2:06 PM, Rail Shafigulin wrote:> > Would you mind pointing me to the source code where actual shuffling > occurs. I looked through lib/Target/Hexagon but was not able to find it. > Is shuffling now part of a core code?The actual slot assignment is implemented here: lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp Here is a wrapper class used in MC: lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Rail Shafigulin via llvm-dev
2015-Nov-24 22:22 UTC
[llvm-dev] Hexagon and choosing of slots
On Tue, Nov 24, 2015 at 12:16 PM, Krzysztof Parzyszek < kparzysz at codeaurora.org> wrote:> On 11/24/2015 2:06 PM, Rail Shafigulin wrote: > >> >> Would you mind pointing me to the source code where actual shuffling >> occurs. I looked through lib/Target/Hexagon but was not able to find it. >> Is shuffling now part of a core code? >> > > The actual slot assignment is implemented here: > lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp > > Here is a wrapper class used in MC: > lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp > > > -Krzysztof > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation >Thanks!!! I also know why I wasn't able to find the shuffler. I'm working with LLVM 3.5 (at the moment I'm locked into it) and Hexagon target doesn't have the shuffler in it. -- R -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151124/f593f52b/attachment.html>