https://llvm.org/bugs/show_bug.cgi?id=31144
Bug ID: 31144 Summary: [ppc] Convert char/short to double through memory Product: libraries Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Backend: PowerPC Assignee: unassignedb...@nondot.org Reporter: car...@google.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Compile following code with options -m64 -O2 extern void bar(double); void foo(char* p) { bar(*p); } void foo1(unsigned short* p) { bar(*p); } LLVM generates: .Lfunc_lep0: .localentry foo, .Lfunc_lep0-.Lfunc_gep0 # BB#0: # %entry mflr 0 std 31, -8(1) std 0, 16(1) stdu 1, -112(1) lbz 3, 0(3) // load original value mr 31, 1 addi 4, 31, 100 stw 3, 100(31) // store ori 2, 2, 0 lxsiwzx 0, 0, 4 // load xscvuxddp 1, 0 bl bar nop addi 1, 1, 112 ld 0, 16(1) ld 31, -8(1) mtlr 0 blr Note that lxsiwzx is immediately following stw, they access the same memory, it is very slow. Instruction mtvsrwz can be used to move a value from integer register to VSX register directly. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs