[Bug target/93802] New: gcc generates a rlwinm/or pair instead of a single rlwimi (powerpc)

2020-02-18 Thread christophe.le...@c-s.fr
Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: christophe.le...@c-s.fr Target Milestone: --- unsigned long f(unsigned short x) { return (x << 16) | x; } Results in: : 0: 54 69 80 1e rlwi

[Bug c/93800] New: GCC adds unwanted nops to align loops on powerpc 8xx

2020-02-18 Thread christophe.le...@c-s.fr
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: christophe.le...@c-s.fr Target Milestone: --- GCC 9.2 add nops in front of loops. GCC 8.1 didn't when compiled for powerpc 8xx. On the 8xx, a nop is 1 cycle and alignment of loops provide no benefit, so this is a waste

[Bug target/92769] Powerpc: No way to set CR0[SO] on function return

2019-12-11 Thread christophe.le...@c-s.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92769 --- Comment #2 from Christophe Leroy --- But CR0 being volatile doesn't prevent GCC to set/clr its SO bit just before branching to LR as the ASM functions do, does it ? In our ABIs, r3 is also volatile in our ABIs, it doesn't prevent using it

[Bug c/92769] New: No way to set CR0[SO] on function return

2019-12-03 Thread christophe.le...@c-s.fr
Assignee: unassigned at gcc dot gnu.org Reporter: christophe.le...@c-s.fr Target Milestone: --- Linux system calls and Linux VDSO calls require the error status to be reflected through SO bit of CR0 register on function return. There is no way to do that from C functions

[Bug c/86131] New: powerpc: gcc uses costly multiply instead of shift left

2018-06-13 Thread christophe.le...@c-s.fr
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: christophe.le...@c-s.fr Target Milestone: --- unsigned long f1(unsigned long a, unsigned long b) { return a >> ((4 - a) * 8); } unsigned long f2(unsigned long a, unsigned

[Bug c/86106] New: powerpc: Suboptimal logical operation

2018-06-11 Thread christophe.le...@c-s.fr
Assignee: unassigned at gcc dot gnu.org Reporter: christophe.le...@c-s.fr Target Milestone: --- unsigned int g(unsigned int val) { unsigned int mask = 0x7f7f7f7f; return ~(((val & mask) + mask) | val | mask); } generates the following: 0020 : 20: 3d 20 7

[Bug c/82940] New: Suboptimal code for (a & 0x7f) | (b & 0x80) on powerpc

2017-11-10 Thread christophe.le...@c-s.fr
rity: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: christophe.le...@c-s.fr Target Milestone: --- unsigned char g(unsigned char t[], unsigned char v) { return (t[v & 0x7f] & 0x7f) | (v & 0x80); } 0008 : 8: 54 89 06 7e clrlwi r9

[Bug c/80134] New: powerpc: loop on p[i] and *p++ should give the same code

2017-03-21 Thread christophe.le...@c-s.fr
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: christophe.le...@c-s.fr Target Milestone: --- The below code should give the same code, shouldn't depend on whether we use p[i] or *p++ void memset32a(int *p, int v, unsigned int c) { int

[Bug c/80131] New: powerpc: 1U << (31 - x) doesn't generate optimised code

2017-03-21 Thread christophe.le...@c-s.fr
normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: christophe.le...@c-s.fr Target Milestone: --- I would expect the two functions below to generate the same code, but it doesn't unsigned int f1(unsigned int i) { return 1U <

[Bug c/80132] New: powerpc: irrelevant register move before operation

2017-03-21 Thread christophe.le...@c-s.fr
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: christophe.le...@c-s.fr Target Milestone: --- In the function below, the two first 'mr' instructions are unneeded, the loop should operate directly with r5 and r6 void memset64(long long *p, long long v, unsigned int c

[Bug regression/67288] [4.9 regression] non optimal simple function (useless additional shift/remove/shift/add)

2015-08-24 Thread christophe.le...@c-s.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67288 --- Comment #2 from Christophe Leroy christophe.le...@c-s.fr --- Compilation ok with below code [root@localhost knl]# cat flush.c #define L1_CACHE_SHIFT 4 #define L1_CACHE_BYTES (1 L1_CACHE_SHIFT) #define mb() __asm__ __volatile__ (sync

[Bug regression/67288] New: [4.9 regression] non optimal simple function (useless additional shift/remove/shift/add)

2015-08-20 Thread christophe.le...@c-s.fr
Severity: normal Priority: P3 Component: regression Assignee: unassigned at gcc dot gnu.org Reporter: christophe.le...@c-s.fr Target Milestone: --- The following function (Linux Kernel, compiled with -O2) was resulting in a good assembly with GCC 4.8.3

[Bug target/67290] New: powerpc: suboptimal add of u64 with u32

2015-08-20 Thread christophe.le...@c-s.fr
Assignee: unassigned at gcc dot gnu.org Reporter: christophe.le...@c-s.fr Target Milestone: --- #define u32 unsigned long #define u64 unsigned long long u64 target(u64 base, u32 offset) { return base + offset; } With GCC 4.9.3 we get: (same with GCC 4.8.3)