https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93128
Bug ID: 93128 Summary: PPC small floating point constants can be constructed using vector operations Product: gcc Version: 8.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: jens.seifert at de dot ibm.com Target Milestone: --- Input: #include <altivec.h> double d2() { return 2.0; } vector double v2() { return vec_splats(2.0); } gcc -O2 -maix64 -mcpu=power7 -maltivec const.C gcc uses load from constant area. Better alternative for "integer" values -15.0..+16.0. vspltisw 0,<integer value> xvcvsxwdp 1,32 0.0 already get constructed using xxlxor, which is great. Similar things can be done for vector float v2f() { return vec_splats(2.0f); }