[Bug target/82897] Unnecessary zero-extension when loading mask register from memory

2017-11-08 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82897 Uroš Bizjak changed: What|Removed |Added Status|ASSIGNED|NEW Assignee|ubizjak at gmail do

[Bug target/82897] Unnecessary zero-extension when loading mask register from memory

2017-11-08 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82897 --- Comment #8 from Jakub Jelinek --- That does something different though. But there is in C: if (targetm.calls.promote_prototypes (fundecl ? TREE_TYPE (fundecl) : 0) && INTEGRAL_TYPE_P (type) &

[Bug target/82897] Unnecessary zero-extension when loading mask register from memory

2017-11-08 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82897 --- Comment #7 from Uroš Bizjak --- Another idea is to add an "nopromote" attribute to builtin decl (in ix86_Add_new_buitins), detect this attribute in TARGET_PROMOTE_PROTOTYPES and disable promotion in this case. If this approach works, we can

[Bug target/82897] Unnecessary zero-extension when loading mask register from memory

2017-11-08 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82897 --- Comment #6 from Marek Polacek --- There is "type generic" attribute which disables certain promotions I think (or at least float -> double).

[Bug target/82897] Unnecessary zero-extension when loading mask register from memory

2017-11-08 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82897 --- Comment #5 from Uroš Bizjak --- Also, #include __mmask16 m; __m512i zzz; __m512i foo (__m512i x, __m512i y, int a) { zzz = _mm512_mask_slli_epi32 (y, m, x, a); return _mm512_mask_srai_epi32 (y, m, x, a); } defeats the proposed proto

[Bug target/82897] Unnecessary zero-extension when loading mask register from memory

2017-11-08 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82897 --- Comment #4 from Uroš Bizjak --- (In reply to Jakub Jelinek from comment #3) > Because builtins are treated like any other function calls, and if > short/char args are promoted for normal calls, they are promoted for > builtins too. Indeed. D

[Bug target/82897] Unnecessary zero-extension when loading mask register from memory

2017-11-08 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82897 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #3

[Bug target/82897] Unnecessary zero-extension when loading mask register from memory

2017-11-08 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82897 --- Comment #2 from Uroš Bizjak --- Hm, why does middle-end convert to integer in the first place? .optimized tree dump reads: foo (__m512i x, __m512i y, int a) { short unsigned int m.1_1; int _2; vector(16) int _7; vector(16) int _8;

[Bug target/82897] Unnecessary zero-extension when loading mask register from memory

2017-11-08 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82897 Uroš Bizjak changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed|