Skip to content

Commit

Permalink
powerpc: Fix encoding of POWER8 instruction
Browse files Browse the repository at this point in the history
This patch adds a binary encoding for 'mtvsrd' instruction to avoid
build failures when assembler does not support POWER8.
  • Loading branch information
Adhemerval Zanella committed Nov 3, 2014
1 parent 04b76b5 commit 5e4df28
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2014-11-03 Adhemerval Zanella <azanella@linux.vnet.ibm.com>

* sysdeps/powerpc/powerpc64/power8/memset.S (MTVSRD_V1_R4): Encode
mtvsrd instruction in binary form.

2014-11-03 Andreas Schwab <schwab@suse.de>

[BZ #17522]
Expand Down
9 changes: 8 additions & 1 deletion sysdeps/powerpc/powerpc64/power8/memset.S
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
<http://www.gnu.org/licenses/>. */

#include <sysdep.h>
#include <endian.h>

#if __BYTE_ORDER == __LITTLE_ENDIAN
#define MTVSRD_V1_R4 .byte 0x66,0x01,0x24,0x7c /* mtvsrd v1,r4 */
#else
#define MTVSRD_V1_R4 .byte 0x7c,0x24,0x01,0x66
#endif

/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
Returns 's'. */
Expand Down Expand Up @@ -142,7 +149,7 @@ L(tail_bytes):
vector instruction to achieve best throughput. */
L(huge_vector):
/* Replicate set byte to quadword in VMX register. */
mtvsrd v1,r4
MTVSRD_V1_R4
xxpermdi 32,v0,v1,0
vspltb v2,v0,15

Expand Down

0 comments on commit 5e4df28

Please sign in to comment.