blob: 26adda0b00550c26ed8214ff744f5c874508865d [file] [log] [blame]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
; RUN: -mtriple=powerpc64-unknown-unknown < %s | FileCheck -allow-deprecated-dag-overlap %s \
; RUN: -check-prefix=P9BE -implicit-check-not frsp
; RUN: llc -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck -allow-deprecated-dag-overlap %s \
; RUN: -check-prefix=P9LE -implicit-check-not frsp
; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
; RUN: -mtriple=powerpc64-unknown-unknown < %s | FileCheck -allow-deprecated-dag-overlap %s \
; RUN: -check-prefix=P8BE -implicit-check-not frsp
; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck -allow-deprecated-dag-overlap %s \
; RUN: -check-prefix=P8LE -implicit-check-not frsp
; This test case comes from the following C test case (included as it may be
; slightly more readable than the LLVM IR.
;/* This test case provides various ways of building vectors to ensure we
; produce optimal code for all cases. The cases are (for each type):
; - All zeros
; - All ones - split to build-vector-allones.ll
; - Splat of a constant
; - From different values already in registers
; - From different constants
; - From different values in memory
; - Splat of a value in register
; - Splat of a value in memory
; - Inserting element into existing vector
; - Inserting element from existing vector into existing vector
;
; With conversions (float <-> int)
; - Splat of a constant
; - From different values already in registers
; - From different constants
; - From different values in memory
; - Splat of a value in register
; - Splat of a value in memory
; - Inserting element into existing vector
; - Inserting element from existing vector into existing vector
;*/
;
;/*=================================== int ===================================*/
;// P8: xxlxor //
;// P9: xxlxor //
;vector int allZeroi() { //
; return (vector int)0; //
;} //
;// P8: vspltisb -1 //
;// P9: xxspltisb 255 //
;vector int spltConst1i() { //
; return (vector int)1; //
;} //
;// P8: vspltisw -15; vsrw //
;// P9: vspltisw -15; vsrw //
;vector int spltConst16ki() { //
; return (vector int)((1<<15) - 1); //
;} //
;// P8: vspltisw -16; vsrw //
;// P9: vspltisw -16; vsrw //
;vector int spltConst32ki() { //
; return (vector int)((1<<16) - 1); //
;} //
;// P8: 4 x mtvsrwz, 2 x xxmrgh, vmrgow //
;// P9: 2 x mtvsrdd, vmrgow //
;vector int fromRegsi(int a, int b, int c, int d) { //
; return (vector int){ a, b, c, d }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx (or even lxv) //
;vector int fromDiffConstsi() { //
; return (vector int) { 242, -113, 889, 19 }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx //
;vector int fromDiffMemConsAi(int *arr) { //
; return (vector int) { arr[0], arr[1], arr[2], arr[3] }; //
;} //
;// P8: 2 x lxvd2x, 2 x xxswapd, vperm //
;// P9: 2 x lxvx, vperm //
;vector int fromDiffMemConsDi(int *arr) { //
; return (vector int) { arr[3], arr[2], arr[1], arr[0] }; //
;} //
;// P8: sldi 2, lxvd2x, xxswapd //
;// P9: sldi 2, lxvx //
;vector int fromDiffMemVarAi(int *arr, int elem) { //
; return (vector int) { arr[elem], arr[elem+1], arr[elem+2], arr[elem+3] }; //
;} //
;// P8: sldi 2, 2 x lxvd2x, 2 x xxswapd, vperm //
;// P9: sldi 2, 2 x lxvx, vperm //
;vector int fromDiffMemVarDi(int *arr, int elem) { //
; return (vector int) { arr[elem], arr[elem-1], arr[elem-2], arr[elem-3] }; //
;} //
;// P8: 4 x lwz, 4 x mtvsrwz, 2 x xxmrghd, vmrgow //
;// P9: 4 x lwz, 2 x mtvsrdd, vmrgow //
;vector int fromRandMemConsi(int *arr) { //
; return (vector int) { arr[4], arr[18], arr[2], arr[88] }; //
;} //
;// P8: sldi 2, 4 x lwz, 4 x mtvsrwz, 2 x xxmrghd, vmrgow //
;// P9: sldi 2, add, 4 x lwz, 2 x mtvsrdd, vmrgow //
;vector int fromRandMemVari(int *arr, int elem) { //
; return (vector int) { arr[elem+4], arr[elem+1], arr[elem+2], arr[elem+8] };//
;} //
;// P8: mtvsrwz, xxspltw //
;// P9: mtvsrws //
;vector int spltRegVali(int val) { //
; return (vector int) val; //
;} //
;// P8: (LE) lfiwzx, xxpermdi, xxspltw (BE): lfiwzx, xxsldwi, xxspltw //
;// P9: (LE) lfiwzx, xxpermdi, xxspltw (BE): lfiwzx, xxsldwi, xxspltw //
;vector int spltMemVali(int *ptr) { //
; return (vector int)*ptr; //
;} //
;// P8: vspltisw //
;// P9: vspltisw //
;vector int spltCnstConvftoi() { //
; return (vector int) 4.74f; //
;} //
;// P8: 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;// P9: 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;vector int fromRegsConvftoi(float a, float b, float c, float d) { //
; return (vector int) { a, b, c, d }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx (even lxv) //
;vector int fromDiffConstsConvftoi() { //
; return (vector int) { 24.46f, 234.f, 988.19f, 422.39f }; //
;} //
;// P8: lxvd2x, xxswapd, xvcvspsxws //
;// P9: lxvx, xvcvspsxws //
;vector int fromDiffMemConsAConvftoi(float *ptr) { //
; return (vector int) { ptr[0], ptr[1], ptr[2], ptr[3] }; //
;} //
;// P8: 2 x lxvd2x, 2 x xxswapd, vperm, xvcvspsxws //
;// P9: 2 x lxvx, vperm, xvcvspsxws //
;vector int fromDiffMemConsDConvftoi(float *ptr) { //
; return (vector int) { ptr[3], ptr[2], ptr[1], ptr[0] }; //
;} //
;// P8: 4 x lxsspx, 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;// P9: 4 x lxssp, 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;// Note: if the consecutive loads learns to handle pre-inc, this can be: //
;// sldi 2, load, xvcvspuxws //
;vector int fromDiffMemVarAConvftoi(float *arr, int elem) { //
; return (vector int) { arr[elem], arr[elem+1], arr[elem+2], arr[elem+3] }; //
;} //
;// P8: 4 x lxsspx, 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;// P9: 4 x lxssp, 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;// Note: if the consecutive loads learns to handle pre-inc, this can be: //
;// sldi 2, 2 x load, vperm, xvcvspuxws //
;vector int fromDiffMemVarDConvftoi(float *arr, int elem) { //
; return (vector int) { arr[elem], arr[elem-1], arr[elem-2], arr[elem-3] }; //
;} //
;// P8: xscvdpsxws, xxspltw //
;// P9: xscvdpsxws, xxspltw //
;vector int spltRegValConvftoi(float val) { //
; return (vector int) val; //
;} //
;// P8: lxsspx, xscvdpsxws, xxspltw //
;// P9: lxvwsx, xvcvspsxws //
;vector int spltMemValConvftoi(float *ptr) { //
; return (vector int)*ptr; //
;} //
;// P8: vspltisw //
;// P9: vspltisw //
;vector int spltCnstConvdtoi() { //
; return (vector int) 4.74; //
;} //
;// P8: 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;// P9: 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;vector int fromRegsConvdtoi(double a, double b, double c, double d) { //
; return (vector int) { a, b, c, d }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx (even lxv) //
;vector int fromDiffConstsConvdtoi() { //
; return (vector int) { 24.46, 234., 988.19, 422.39 }; //
;} //
;// P8: 2 x lxvd2x, 2 x xxswapd, xxmrgld, xxmrghd, 2 x xvcvspsxws, vmrgew //
;// P9: 2 x lxvx, 2 x xxswapd, xxmrgld, xxmrghd, 2 x xvcvspsxws, vmrgew //
;vector int fromDiffMemConsAConvdtoi(double *ptr) { //
; return (vector int) { ptr[0], ptr[1], ptr[2], ptr[3] }; //
;} //
;// P8: 4 x lxsdx, 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;// P9: 4 x lfd, 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;vector int fromDiffMemConsDConvdtoi(double *ptr) { //
; return (vector int) { ptr[3], ptr[2], ptr[1], ptr[0] }; //
;} //
;// P8: lfdux, 3 x lxsdx, 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;// P9: lfdux, 3 x lfd, 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;vector int fromDiffMemVarAConvdtoi(double *arr, int elem) { //
; return (vector int) { arr[elem], arr[elem+1], arr[elem+2], arr[elem+3] }; //
;} //
;// P8: lfdux, 3 x lxsdx, 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;// P9: lfdux, 3 x lfd, 2 x xxmrghd, 2 x xvcvspsxws, vmrgew //
;vector int fromDiffMemVarDConvdtoi(double *arr, int elem) { //
; return (vector int) { arr[elem], arr[elem-1], arr[elem-2], arr[elem-3] }; //
;} //
;// P8: xscvdpsxws, xxspltw //
;// P9: xscvdpsxws, xxspltw //
;vector int spltRegValConvdtoi(double val) { //
; return (vector int) val; //
;} //
;// P8: lxsdx, xscvdpsxws, xxspltw //
;// P9: lxssp, xscvdpsxws, xxspltw //
;vector int spltMemValConvdtoi(double *ptr) { //
; return (vector int)*ptr; //
;} //
;/*=================================== int ===================================*/
;/*=============================== unsigned int ==============================*/
;// P8: xxlxor //
;// P9: xxlxor //
;vector unsigned int allZeroui() { //
; return (vector unsigned int)0; //
;} //
;// P8: vspltisb -1 //
;// P9: xxspltisb 255 //
;vector unsigned int spltConst1ui() { //
; return (vector unsigned int)1; //
;} //
;// P8: vspltisw -15; vsrw //
;// P9: vspltisw -15; vsrw //
;vector unsigned int spltConst16kui() { //
; return (vector unsigned int)((1<<15) - 1); //
;} //
;// P8: vspltisw -16; vsrw //
;// P9: vspltisw -16; vsrw //
;vector unsigned int spltConst32kui() { //
; return (vector unsigned int)((1<<16) - 1); //
;} //
;// P8: 4 x mtvsrwz, 2 x xxmrghd, vmrgow //
;// P9: 2 x mtvsrdd, vmrgow //
;vector unsigned int fromRegsui(unsigned int a, unsigned int b, //
; unsigned int c, unsigned int d) { //
; return (vector unsigned int){ a, b, c, d }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx (or even lxv) //
;vector unsigned int fromDiffConstsui() { //
; return (vector unsigned int) { 242, -113, 889, 19 }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx //
;vector unsigned int fromDiffMemConsAui(unsigned int *arr) { //
; return (vector unsigned int) { arr[0], arr[1], arr[2], arr[3] }; //
;} //
;// P8: 2 x lxvd2x, 2 x xxswapd, vperm //
;// P9: 2 x lxvx, vperm //
;vector unsigned int fromDiffMemConsDui(unsigned int *arr) { //
; return (vector unsigned int) { arr[3], arr[2], arr[1], arr[0] }; //
;} //
;// P8: sldi 2, lxvd2x, xxswapd //
;// P9: sldi 2, lxvx //
;vector unsigned int fromDiffMemVarAui(unsigned int *arr, int elem) { //
; return (vector unsigned int) { arr[elem], arr[elem+1], //
; arr[elem+2], arr[elem+3] }; //
;} //
;// P8: sldi 2, 2 x lxvd2x, 2 x xxswapd, vperm //
;// P9: sldi 2, 2 x lxvx, vperm //
;vector unsigned int fromDiffMemVarDui(unsigned int *arr, int elem) { //
; return (vector unsigned int) { arr[elem], arr[elem-1], //
; arr[elem-2], arr[elem-3] }; //
;} //
;// P8: 4 x lwz, 4 x mtvsrwz, 2 x xxmrghd, vmrgow //
;// P9: 4 x lwz, 2 x mtvsrdd, vmrgow //
;vector unsigned int fromRandMemConsui(unsigned int *arr) { //
; return (vector unsigned int) { arr[4], arr[18], arr[2], arr[88] }; //
;} //
;// P8: sldi 2, 4 x lwz, 4 x mtvsrwz, 2 x xxmrghd, vmrgow //
;// P9: sldi 2, add, 4 x lwz, 2 x mtvsrdd, vmrgow //
;vector unsigned int fromRandMemVarui(unsigned int *arr, int elem) { //
; return (vector unsigned int) { arr[elem+4], arr[elem+1], //
; arr[elem+2], arr[elem+8] }; //
;} //
;// P8: mtvsrwz, xxspltw //
;// P9: mtvsrws //
;vector unsigned int spltRegValui(unsigned int val) { //
; return (vector unsigned int) val; //
;} //
;// P8: (LE) lfiwzx, xxpermdi, xxspltw (BE): lfiwzx, xxsldwi, xxspltw //
;// P9: (LE) lfiwzx, xxpermdi, xxspltw (BE): lfiwzx, xxsldwi, xxspltw //
;vector unsigned int spltMemValui(unsigned int *ptr) { //
; return (vector unsigned int)*ptr; //
;} //
;// P8: vspltisw //
;// P9: vspltisw //
;vector unsigned int spltCnstConvftoui() { //
; return (vector unsigned int) 4.74f; //
;} //
;// P8: 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;// P9: 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;vector unsigned int fromRegsConvftoui(float a, float b, float c, float d) { //
; return (vector unsigned int) { a, b, c, d }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx (even lxv) //
;vector unsigned int fromDiffConstsConvftoui() { //
; return (vector unsigned int) { 24.46f, 234.f, 988.19f, 422.39f }; //
;} //
;// P8: lxvd2x, xxswapd, xvcvspuxws //
;// P9: lxvx, xvcvspuxws //
;vector unsigned int fromDiffMemConsAConvftoui(float *ptr) { //
; return (vector unsigned int) { ptr[0], ptr[1], ptr[2], ptr[3] }; //
;} //
;// P8: 2 x lxvd2x, 2 x xxswapd, vperm, xvcvspuxws //
;// P9: 2 x lxvx, vperm, xvcvspuxws //
;vector unsigned int fromDiffMemConsDConvftoui(float *ptr) { //
; return (vector unsigned int) { ptr[3], ptr[2], ptr[1], ptr[0] }; //
;} //
;// P8: lfsux, 3 x lxsspx, 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;// P9: lfsux, 3 x lfs, 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;// Note: if the consecutive loads learns to handle pre-inc, this can be: //
;// sldi 2, load, xvcvspuxws //
;vector unsigned int fromDiffMemVarAConvftoui(float *arr, int elem) { //
; return (vector unsigned int) { arr[elem], arr[elem+1], //
; arr[elem+2], arr[elem+3] }; //
;} //
;// P8: lfsux, 3 x lxsspx, 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;// P9: lfsux, 3 x lfs, 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;// Note: if the consecutive loads learns to handle pre-inc, this can be: //
;// sldi 2, 2 x load, vperm, xvcvspuxws //
;vector unsigned int fromDiffMemVarDConvftoui(float *arr, int elem) { //
; return (vector unsigned int) { arr[elem], arr[elem-1], //
; arr[elem-2], arr[elem-3] }; //
;} //
;// P8: xscvdpuxws, xxspltw //
;// P9: xscvdpuxws, xxspltw //
;vector unsigned int spltRegValConvftoui(float val) { //
; return (vector unsigned int) val; //
;} //
;// P8: lxsspx, xscvdpuxws, xxspltw //
;// P9: lxvwsx, xvcvspuxws //
;vector unsigned int spltMemValConvftoui(float *ptr) { //
; return (vector unsigned int)*ptr; //
;} //
;// P8: vspltisw //
;// P9: vspltisw //
;vector unsigned int spltCnstConvdtoui() { //
; return (vector unsigned int) 4.74; //
;} //
;// P8: 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;// P9: 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;vector unsigned int fromRegsConvdtoui(double a, double b, //
; double c, double d) { //
; return (vector unsigned int) { a, b, c, d }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx (even lxv) //
;vector unsigned int fromDiffConstsConvdtoui() { //
; return (vector unsigned int) { 24.46, 234., 988.19, 422.39 }; //
;} //
;// P8: 2 x lxvd2x, 2 x xxswapd, xxmrgld, xxmrghd, 2 x xvcvspuxws, vmrgew //
;// P9: 2 x lxvx, xxmrgld, xxmrghd, 2 x xvcvspuxws, vmrgew //
;vector unsigned int fromDiffMemConsAConvdtoui(double *ptr) { //
; return (vector unsigned int) { ptr[0], ptr[1], ptr[2], ptr[3] }; //
;} //
;// P8: 4 x lxsdx, 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;// P9: 4 x lfd, 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;vector unsigned int fromDiffMemConsDConvdtoui(double *ptr) { //
; return (vector unsigned int) { ptr[3], ptr[2], ptr[1], ptr[0] }; //
;} //
;// P8: lfdux, 3 x lxsdx, 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;// P9: lfdux, 3 x lfd, 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;vector unsigned int fromDiffMemVarAConvdtoui(double *arr, int elem) { //
; return (vector unsigned int) { arr[elem], arr[elem+1], //
; arr[elem+2], arr[elem+3] }; //
;} //
;// P8: lfdux, 3 x lxsdx, 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;// P9: lfdux, 3 x lfd, 2 x xxmrghd, 2 x xvcvspuxws, vmrgew //
;vector unsigned int fromDiffMemVarDConvdtoui(double *arr, int elem) { //
; return (vector unsigned int) { arr[elem], arr[elem-1], //
; arr[elem-2], arr[elem-3] }; //
;} //
;// P8: xscvdpuxws, xxspltw //
;// P9: xscvdpuxws, xxspltw //
;vector unsigned int spltRegValConvdtoui(double val) { //
; return (vector unsigned int) val; //
;} //
;// P8: lxsspx, xscvdpuxws, xxspltw //
;// P9: lfd, xscvdpuxws, xxspltw //
;vector unsigned int spltMemValConvdtoui(double *ptr) { //
; return (vector unsigned int)*ptr; //
;} //
;/*=============================== unsigned int ==============================*/
;/*=============================== long long =================================*/
;// P8: xxlxor //
;// P9: xxlxor //
;vector long long allZeroll() { //
; return (vector long long)0; //
;} //
;// P8: vspltisb -1 //
;// P9: xxspltisb 255 //
;vector long long spltConst1ll() { //
; return (vector long long)1; //
;} //
;// P8: constant pool load (possible: vmrgew (xxlxor), (vspltisw, vsrw)) //
;// P9: constant pool load (possible: vmrgew (xxlxor), (vspltisw, vsrw)) //
;vector long long spltConst16kll() { //
; return (vector long long)((1<<15) - 1); //
;} //
;// P8: constant pool load (possible: vmrgew (xxlxor), (vspltisw, vsrw)) //
;// P9: constant pool load (possible: vmrgew (xxlxor), (vspltisw, vsrw)) //
;vector long long spltConst32kll() { //
; return (vector long long)((1<<16) - 1); //
;} //
;// P8: 2 x mtvsrd, xxmrghd //
;// P9: mtvsrdd //
;vector long long fromRegsll(long long a, long long b) { //
; return (vector long long){ a, b }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx (or even lxv) //
;vector long long fromDiffConstsll() { //
; return (vector long long) { 242, -113 }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx //
;vector long long fromDiffMemConsAll(long long *arr) { //
; return (vector long long) { arr[0], arr[1] }; //
;} //
;// P8: lxvd2x //
;// P9: lxvx, xxswapd (maybe just use lxvd2x) //
;vector long long fromDiffMemConsDll(long long *arr) { //
; return (vector long long) { arr[3], arr[2] }; //
;} //
;// P8: sldi 3, lxvd2x, xxswapd //
;// P9: sldi 3, lxvx //
;vector long long fromDiffMemVarAll(long long *arr, int elem) { //
; return (vector long long) { arr[elem], arr[elem+1] }; //
;} //
;// P8: sldi 3, lxvd2x //
;// P9: sldi 3, lxvx, xxswapd (maybe just use lxvd2x) //
;vector long long fromDiffMemVarDll(long long *arr, int elem) { //
; return (vector long long) { arr[elem], arr[elem-1] }; //
;} //
;// P8: 2 x ld, 2 x mtvsrd, xxmrghd //
;// P9: 2 x ld, mtvsrdd //
;vector long long fromRandMemConsll(long long *arr) { //
; return (vector long long) { arr[4], arr[18] }; //
;} //
;// P8: sldi 3, add, 2 x ld, 2 x mtvsrd, xxmrghd //
;// P9: sldi 3, add, 2 x ld, mtvsrdd //
;vector long long fromRandMemVarll(long long *arr, int elem) { //
; return (vector long long) { arr[elem+4], arr[elem+1] }; //
;} //
;// P8: mtvsrd, xxspltd //
;// P9: mtvsrdd //
;vector long long spltRegValll(long long val) { //
; return (vector long long) val; //
;} //
;// P8: lxvdsx //
;// P9: lxvdsx //
;vector long long spltMemValll(long long *ptr) { //
; return (vector long long)*ptr; //
;} //
;// P8: constant pool load (possible: vmrgew (xxlxor), (vspltisw)) //
;// P9: constant pool load (possible: vmrgew (xxlxor), (vspltisw)) //
;vector long long spltCnstConvftoll() { //
; return (vector long long) 4.74f; //
;} //
;// P8: xxmrghd, xvcvdpsxds //
;// P9: xxmrghd, xvcvdpsxds //
;vector long long fromRegsConvftoll(float a, float b) { //
; return (vector long long) { a, b }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx (even lxv) //
;vector long long fromDiffConstsConvftoll() { //
; return (vector long long) { 24.46f, 234.f }; //
;} //
;// P8: 2 x lxsspx, xxmrghd, xvcvdpsxds //
;// P9: 2 x lxssp, xxmrghd, xvcvdpsxds //
;vector long long fromDiffMemConsAConvftoll(float *ptr) { //
; return (vector long long) { ptr[0], ptr[1] }; //
;} //
;// P8: 2 x lxsspx, xxmrghd, xvcvdpsxds //
;// P9: 2 x lxssp, xxmrghd, xvcvdpsxds //
;vector long long fromDiffMemConsDConvftoll(float *ptr) { //
; return (vector long long) { ptr[3], ptr[2] }; //
;} //
;// P8: sldi 2, lfsux, lxsspx, xxmrghd, xvcvdpsxds //
;// P9: sldi 2, lfsux, lfs, xxmrghd, xvcvdpsxds //
;vector long long fromDiffMemVarAConvftoll(float *arr, int elem) { //
; return (vector long long) { arr[elem], arr[elem+1] }; //
;} //
;// P8: sldi 2, lfsux, lxsspx, xxmrghd, xvcvdpsxds //
;// P9: sldi 2, lfsux, lfs, xxmrghd, xvcvdpsxds //
;vector long long fromDiffMemVarDConvftoll(float *arr, int elem) { //
; return (vector long long) { arr[elem], arr[elem-1] }; //
;} //
;// P8: xscvdpsxds, xxspltd //
;// P9: xscvdpsxds, xxspltd //
;vector long long spltRegValConvftoll(float val) { //
; return (vector long long) val; //
;} //
;// P8: lxsspx, xscvdpsxds, xxspltd //
;// P9: lfs, xscvdpsxds, xxspltd //
;vector long long spltMemValConvftoll(float *ptr) { //
; return (vector long long)*ptr; //
;} //
;// P8: constant pool load (possible: vmrgew (xxlxor), (vspltisw)) //
;// P9: constant pool load (possible: vmrgew (xxlxor), (vspltisw)) //
;vector long long spltCnstConvdtoll() { //
; return (vector long long) 4.74; //
;} //
;// P8: xxmrghd, xvcvdpsxds //
;// P9: xxmrghd, xvcvdpsxds //
;vector long long fromRegsConvdtoll(double a, double b) { //
; return (vector long long) { a, b }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx (even lxv) //
;vector long long fromDiffConstsConvdtoll() { //
; return (vector long long) { 24.46, 234. }; //
;} //
;// P8: lxvd2x, xxswapd, xvcvdpsxds //
;// P9: lxvx, xvcvdpsxds //
;vector long long fromDiffMemConsAConvdtoll(double *ptr) { //
; return (vector long long) { ptr[0], ptr[1] }; //
;} //
;// P8: lxvd2x, xvcvdpsxds //
;// P9: lxvx, xxswapd, xvcvdpsxds //
;vector long long fromDiffMemConsDConvdtoll(double *ptr) { //
; return (vector long long) { ptr[3], ptr[2] }; //
;} //
;// P8: sldi 3, lxvd2x, xxswapd, xvcvdpsxds //
;// P9: sldi 3, lxvx, xvcvdpsxds //
;vector long long fromDiffMemVarAConvdtoll(double *arr, int elem) { //
; return (vector long long) { arr[elem], arr[elem+1] }; //
;} //
;// P8: sldi 3, lxvd2x, xvcvdpsxds //
;// P9: sldi 3, lxvx, xxswapd, xvcvdpsxds //
;vector long long fromDiffMemVarDConvdtoll(double *arr, int elem) { //
; return (vector long long) { arr[elem], arr[elem-1] }; //
;} //
;// P8: xscvdpsxds, xxspltd //
;// P9: xscvdpsxds, xxspltd //
;vector long long spltRegValConvdtoll(double val) { //
; return (vector long long) val; //
;} //
;// P8: lxvdsx, xvcvdpsxds //
;// P9: lxvdsx, xvcvdpsxds //
;vector long long spltMemValConvdtoll(double *ptr) { //
; return (vector long long)*ptr; //
;} //
;/*=============================== long long =================================*/
;/*========================== unsigned long long =============================*/
;// P8: xxlxor //
;// P9: xxlxor //
;vector unsigned long long allZeroull() { //
; return (vector unsigned long long)0; //
;} //
;// P8: vspltisb -1 //
;// P9: xxspltisb 255 //
;vector unsigned long long spltConst1ull() { //
; return (vector unsigned long long)1; //
;} //
;// P8: constant pool load (possible: vmrgew (xxlxor), (vspltisw, vsrw)) //
;// P9: constant pool load (possible: vmrgew (xxlxor), (vspltisw, vsrw)) //
;vector unsigned long long spltConst16kull() { //
; return (vector unsigned long long)((1<<15) - 1); //
;} //
;// P8: constant pool load (possible: vmrgew (xxlxor), (vspltisw, vsrw)) //
;// P9: constant pool load (possible: vmrgew (xxlxor), (vspltisw, vsrw)) //
;vector unsigned long long spltConst32kull() { //
; return (vector unsigned long long)((1<<16) - 1); //
;} //
;// P8: 2 x mtvsrd, xxmrghd //
;// P9: mtvsrdd //
;vector unsigned long long fromRegsull(unsigned long long a, //
; unsigned long long b) { //
; return (vector unsigned long long){ a, b }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx (or even lxv) //
;vector unsigned long long fromDiffConstsull() { //
; return (vector unsigned long long) { 242, -113 }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx //
;vector unsigned long long fromDiffMemConsAull(unsigned long long *arr) { //
; return (vector unsigned long long) { arr[0], arr[1] }; //
;} //
;// P8: lxvd2x //
;// P9: lxvx, xxswapd (maybe just use lxvd2x) //
;vector unsigned long long fromDiffMemConsDull(unsigned long long *arr) { //
; return (vector unsigned long long) { arr[3], arr[2] }; //
;} //
;// P8: sldi 3, lxvd2x, xxswapd //
;// P9: sldi 3, lxvx //
;vector unsigned long long fromDiffMemVarAull(unsigned long long *arr, //
; int elem) { //
; return (vector unsigned long long) { arr[elem], arr[elem+1] }; //
;} //
;// P8: sldi 3, lxvd2x //
;// P9: sldi 3, lxvx, xxswapd (maybe just use lxvd2x) //
;vector unsigned long long fromDiffMemVarDull(unsigned long long *arr, //
; int elem) { //
; return (vector unsigned long long) { arr[elem], arr[elem-1] }; //
;} //
;// P8: 2 x ld, 2 x mtvsrd, xxmrghd //
;// P9: 2 x ld, mtvsrdd //
;vector unsigned long long fromRandMemConsull(unsigned long long *arr) { //
; return (vector unsigned long long) { arr[4], arr[18] }; //
;} //
;// P8: sldi 3, add, 2 x ld, 2 x mtvsrd, xxmrghd //
;// P9: sldi 3, add, 2 x ld, mtvsrdd //
;vector unsigned long long fromRandMemVarull(unsigned long long *arr, //
; int elem) { //
; return (vector unsigned long long) { arr[elem+4], arr[elem+1] }; //
;} //
;// P8: mtvsrd, xxspltd //
;// P9: mtvsrdd //
;vector unsigned long long spltRegValull(unsigned long long val) { //
; return (vector unsigned long long) val; //
;} //
;// P8: lxvdsx //
;// P9: lxvdsx //
;vector unsigned long long spltMemValull(unsigned long long *ptr) { //
; return (vector unsigned long long)*ptr; //
;} //
;// P8: constant pool load (possible: vmrgew (xxlxor), (vspltisw)) //
;// P9: constant pool load (possible: vmrgew (xxlxor), (vspltisw)) //
;vector unsigned long long spltCnstConvftoull() { //
; return (vector unsigned long long) 4.74f; //
;} //
;// P8: xxmrghd, xvcvdpuxds //
;// P9: xxmrghd, xvcvdpuxds //
;vector unsigned long long fromRegsConvftoull(float a, float b) { //
; return (vector unsigned long long) { a, b }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx (even lxv) //
;vector unsigned long long fromDiffConstsConvftoull() { //
; return (vector unsigned long long) { 24.46f, 234.f }; //
;} //
;// P8: 2 x lxsspx, xxmrghd, xvcvdpuxds //
;// P9: 2 x lxssp, xxmrghd, xvcvdpuxds //
;vector unsigned long long fromDiffMemConsAConvftoull(float *ptr) { //
; return (vector unsigned long long) { ptr[0], ptr[1] }; //
;} //
;// P8: 2 x lxsspx, xxmrghd, xvcvdpuxds //
;// P9: 2 x lxssp, xxmrghd, xvcvdpuxds //
;vector unsigned long long fromDiffMemConsDConvftoull(float *ptr) { //
; return (vector unsigned long long) { ptr[3], ptr[2] }; //
;} //
;// P8: sldi 2, lfsux, lxsspx, xxmrghd, xvcvdpuxds //
;// P9: sldi 2, lfsux, lfs, xxmrghd, xvcvdpuxds //
;vector unsigned long long fromDiffMemVarAConvftoull(float *arr, int elem) { //
; return (vector unsigned long long) { arr[elem], arr[elem+1] }; //
;} //
;// P8: sldi 2, lfsux, lxsspx, xxmrghd, xvcvdpuxds //
;// P9: sldi 2, lfsux, lfs, xxmrghd, xvcvdpuxds //
;vector unsigned long long fromDiffMemVarDConvftoull(float *arr, int elem) { //
; return (vector unsigned long long) { arr[elem], arr[elem-1] }; //
;} //
;// P8: xscvdpuxds, xxspltd //
;// P9: xscvdpuxds, xxspltd //
;vector unsigned long long spltRegValConvftoull(float val) { //
; return (vector unsigned long long) val; //
;} //
;// P8: lxsspx, xscvdpuxds, xxspltd //
;// P9: lfs, xscvdpuxds, xxspltd //
;vector unsigned long long spltMemValConvftoull(float *ptr) { //
; return (vector unsigned long long)*ptr; //
;} //
;// P8: constant pool load (possible: vmrgew (xxlxor), (vspltisw)) //
;// P9: constant pool load (possible: vmrgew (xxlxor), (vspltisw)) //
;vector unsigned long long spltCnstConvdtoull() { //
; return (vector unsigned long long) 4.74; //
;} //
;// P8: xxmrghd, xvcvdpuxds //
;// P9: xxmrghd, xvcvdpuxds //
;vector unsigned long long fromRegsConvdtoull(double a, double b) { //
; return (vector unsigned long long) { a, b }; //
;} //
;// P8: lxvd2x, xxswapd //
;// P9: lxvx (even lxv) //
;vector unsigned long long fromDiffConstsConvdtoull() { //
; return (vector unsigned long long) { 24.46, 234. }; //
;} //
;// P8: lxvd2x, xxswapd, xvcvdpuxds //
;// P9: lxvx, xvcvdpuxds //
;vector unsigned long long fromDiffMemConsAConvdtoull(double *ptr) { //
; return (vector unsigned long long) { ptr[0], ptr[1] }; //
;} //
;// P8: lxvd2x, xvcvdpuxds //
;// P9: lxvx, xxswapd, xvcvdpuxds //
;vector unsigned long long fromDiffMemConsDConvdtoull(double *ptr) { //
; return (vector unsigned long long) { ptr[3], ptr[2] }; //
;} //
;// P8: sldi 3, lxvd2x, xxswapd, xvcvdpuxds //
;// P9: sldi 3, lxvx, xvcvdpuxds //
;vector unsigned long long fromDiffMemVarAConvdtoull(double *arr, int elem) { //
; return (vector unsigned long long) { arr[elem], arr[elem+1] }; //
;} //
;// P8: sldi 3, lxvd2x, xvcvdpuxds //
;// P9: sldi 3, lxvx, xxswapd, xvcvdpuxds //
;vector unsigned long long fromDiffMemVarDConvdtoull(double *arr, int elem) { //
; return (vector unsigned long long) { arr[elem], arr[elem-1] }; //
;} //
;// P8: xscvdpuxds, xxspltd //
;// P9: xscvdpuxds, xxspltd //
;vector unsigned long long spltRegValConvdtoull(double val) { //
; return (vector unsigned long long) val; //
;} //
;// P8: lxvdsx, xvcvdpuxds //
;// P9: lxvdsx, xvcvdpuxds //
;vector unsigned long long spltMemValConvdtoull(double *ptr) { //
; return (vector unsigned long long)*ptr; //
;} //
;/*========================== unsigned long long ==============================*/
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @allZeroi() {
; P9BE-LABEL: allZeroi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: xxlxor v2, v2, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: allZeroi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: xxlxor v2, v2, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: allZeroi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: xxlxor v2, v2, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: allZeroi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: xxlxor v2, v2, v2
; P8LE-NEXT: blr
entry:
ret <4 x i32> zeroinitializer
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @spltConst1i() {
; P9BE-LABEL: spltConst1i:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: vspltisw v2, 1
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltConst1i:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: vspltisw v2, 1
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltConst1i:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: vspltisw v2, 1
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltConst1i:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: vspltisw v2, 1
; P8LE-NEXT: blr
entry:
ret <4 x i32> <i32 1, i32 1, i32 1, i32 1>
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @spltConst16ki() {
; P9BE-LABEL: spltConst16ki:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: vspltisw v2, -15
; P9BE-NEXT: vsrw v2, v2, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltConst16ki:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: vspltisw v2, -15
; P9LE-NEXT: vsrw v2, v2, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltConst16ki:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: vspltisw v2, -15
; P8BE-NEXT: vsrw v2, v2, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltConst16ki:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: vspltisw v2, -15
; P8LE-NEXT: vsrw v2, v2, v2
; P8LE-NEXT: blr
entry:
ret <4 x i32> <i32 32767, i32 32767, i32 32767, i32 32767>
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @spltConst32ki() {
; P9BE-LABEL: spltConst32ki:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: vspltisw v2, -16
; P9BE-NEXT: vsrw v2, v2, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltConst32ki:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: vspltisw v2, -16
; P9LE-NEXT: vsrw v2, v2, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltConst32ki:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: vspltisw v2, -16
; P8BE-NEXT: vsrw v2, v2, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltConst32ki:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: vspltisw v2, -16
; P8LE-NEXT: vsrw v2, v2, v2
; P8LE-NEXT: blr
entry:
ret <4 x i32> <i32 65535, i32 65535, i32 65535, i32 65535>
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @fromRegsi(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d) {
; P9BE-LABEL: fromRegsi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: rldimi r6, r5, 32, 0
; P9BE-NEXT: rldimi r4, r3, 32, 0
; P9BE-NEXT: mtvsrdd v2, r4, r6
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromRegsi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: rldimi r3, r4, 32, 0
; P9LE-NEXT: rldimi r5, r6, 32, 0
; P9LE-NEXT: mtvsrdd v2, r5, r3
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromRegsi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: rldimi r6, r5, 32, 0
; P8BE-NEXT: rldimi r4, r3, 32, 0
; P8BE-NEXT: mtvsrd f0, r6
; P8BE-NEXT: mtvsrd f1, r4
; P8BE-NEXT: xxmrghd v2, vs1, vs0
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromRegsi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: rldimi r3, r4, 32, 0
; P8LE-NEXT: rldimi r5, r6, 32, 0
; P8LE-NEXT: mtvsrd f0, r3
; P8LE-NEXT: mtvsrd f1, r5
; P8LE-NEXT: xxmrghd v2, vs1, vs0
; P8LE-NEXT: blr
entry:
%vecinit = insertelement <4 x i32> undef, i32 %a, i32 0
%vecinit1 = insertelement <4 x i32> %vecinit, i32 %b, i32 1
%vecinit2 = insertelement <4 x i32> %vecinit1, i32 %c, i32 2
%vecinit3 = insertelement <4 x i32> %vecinit2, i32 %d, i32 3
ret <4 x i32> %vecinit3
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @fromDiffConstsi() {
; P9BE-LABEL: fromDiffConstsi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: addis r3, r2, .LCPI5_0@toc@ha
; P9BE-NEXT: addi r3, r3, .LCPI5_0@toc@l
; P9BE-NEXT: lxvx v2, 0, r3
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffConstsi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: addis r3, r2, .LCPI5_0@toc@ha
; P9LE-NEXT: addi r3, r3, .LCPI5_0@toc@l
; P9LE-NEXT: lxvx v2, 0, r3
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffConstsi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: addis r3, r2, .LCPI5_0@toc@ha
; P8BE-NEXT: addi r3, r3, .LCPI5_0@toc@l
; P8BE-NEXT: lxvw4x v2, 0, r3
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffConstsi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: addis r3, r2, .LCPI5_0@toc@ha
; P8LE-NEXT: addi r3, r3, .LCPI5_0@toc@l
; P8LE-NEXT: lvx v2, 0, r3
; P8LE-NEXT: blr
entry:
ret <4 x i32> <i32 242, i32 -113, i32 889, i32 19>
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemConsAi(i32* nocapture readonly %arr) {
; P9BE-LABEL: fromDiffMemConsAi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lxv v2, 0(r3)
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemConsAi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lxv v2, 0(r3)
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemConsAi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: lxvw4x v2, 0, r3
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemConsAi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: lxvd2x vs0, 0, r3
; P8LE-NEXT: xxswapd v2, vs0
; P8LE-NEXT: blr
entry:
%0 = load i32, i32* %arr, align 4
%vecinit = insertelement <4 x i32> undef, i32 %0, i32 0
%arrayidx1 = getelementptr inbounds i32, i32* %arr, i64 1
%1 = load i32, i32* %arrayidx1, align 4
%vecinit2 = insertelement <4 x i32> %vecinit, i32 %1, i32 1
%arrayidx3 = getelementptr inbounds i32, i32* %arr, i64 2
%2 = load i32, i32* %arrayidx3, align 4
%vecinit4 = insertelement <4 x i32> %vecinit2, i32 %2, i32 2
%arrayidx5 = getelementptr inbounds i32, i32* %arr, i64 3
%3 = load i32, i32* %arrayidx5, align 4
%vecinit6 = insertelement <4 x i32> %vecinit4, i32 %3, i32 3
ret <4 x i32> %vecinit6
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemConsDi(i32* nocapture readonly %arr) {
; P9BE-LABEL: fromDiffMemConsDi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lxv v2, 0(r3)
; P9BE-NEXT: addis r3, r2, .LCPI7_0@toc@ha
; P9BE-NEXT: addi r3, r3, .LCPI7_0@toc@l
; P9BE-NEXT: lxvx v3, 0, r3
; P9BE-NEXT: vperm v2, v2, v2, v3
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemConsDi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lxvw4x v2, 0, r3
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemConsDi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: addis r4, r2, .LCPI7_0@toc@ha
; P8BE-NEXT: lxvw4x v2, 0, r3
; P8BE-NEXT: addi r4, r4, .LCPI7_0@toc@l
; P8BE-NEXT: lxvw4x v3, 0, r4
; P8BE-NEXT: vperm v2, v2, v2, v3
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemConsDi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: lxvd2x vs0, 0, r3
; P8LE-NEXT: addis r4, r2, .LCPI7_0@toc@ha
; P8LE-NEXT: addi r3, r4, .LCPI7_0@toc@l
; P8LE-NEXT: lvx v2, 0, r3
; P8LE-NEXT: xxswapd v3, vs0
; P8LE-NEXT: vperm v2, v3, v3, v2
; P8LE-NEXT: blr
entry:
%arrayidx = getelementptr inbounds i32, i32* %arr, i64 3
%0 = load i32, i32* %arrayidx, align 4
%vecinit = insertelement <4 x i32> undef, i32 %0, i32 0
%arrayidx1 = getelementptr inbounds i32, i32* %arr, i64 2
%1 = load i32, i32* %arrayidx1, align 4
%vecinit2 = insertelement <4 x i32> %vecinit, i32 %1, i32 1
%arrayidx3 = getelementptr inbounds i32, i32* %arr, i64 1
%2 = load i32, i32* %arrayidx3, align 4
%vecinit4 = insertelement <4 x i32> %vecinit2, i32 %2, i32 2
%3 = load i32, i32* %arr, align 4
%vecinit6 = insertelement <4 x i32> %vecinit4, i32 %3, i32 3
ret <4 x i32> %vecinit6
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemVarAi(i32* nocapture readonly %arr, i32 signext %elem) {
; P9BE-LABEL: fromDiffMemVarAi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: sldi r4, r4, 2
; P9BE-NEXT: lxvx v2, r3, r4
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemVarAi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: sldi r4, r4, 2
; P9LE-NEXT: lxvx v2, r3, r4
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemVarAi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: sldi r4, r4, 2
; P8BE-NEXT: lxvw4x v2, r3, r4
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemVarAi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: sldi r4, r4, 2
; P8LE-NEXT: lxvd2x vs0, r3, r4
; P8LE-NEXT: xxswapd v2, vs0
; P8LE-NEXT: blr
entry:
%idxprom = sext i32 %elem to i64
%arrayidx = getelementptr inbounds i32, i32* %arr, i64 %idxprom
%0 = load i32, i32* %arrayidx, align 4
%vecinit = insertelement <4 x i32> undef, i32 %0, i32 0
%add = add nsw i32 %elem, 1
%idxprom1 = sext i32 %add to i64
%arrayidx2 = getelementptr inbounds i32, i32* %arr, i64 %idxprom1
%1 = load i32, i32* %arrayidx2, align 4
%vecinit3 = insertelement <4 x i32> %vecinit, i32 %1, i32 1
%add4 = add nsw i32 %elem, 2
%idxprom5 = sext i32 %add4 to i64
%arrayidx6 = getelementptr inbounds i32, i32* %arr, i64 %idxprom5
%2 = load i32, i32* %arrayidx6, align 4
%vecinit7 = insertelement <4 x i32> %vecinit3, i32 %2, i32 2
%add8 = add nsw i32 %elem, 3
%idxprom9 = sext i32 %add8 to i64
%arrayidx10 = getelementptr inbounds i32, i32* %arr, i64 %idxprom9
%3 = load i32, i32* %arrayidx10, align 4
%vecinit11 = insertelement <4 x i32> %vecinit7, i32 %3, i32 3
ret <4 x i32> %vecinit11
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemVarDi(i32* nocapture readonly %arr, i32 signext %elem) {
; P9BE-LABEL: fromDiffMemVarDi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: sldi r4, r4, 2
; P9BE-NEXT: add r3, r3, r4
; P9BE-NEXT: addi r3, r3, -12
; P9BE-NEXT: lxvx v2, 0, r3
; P9BE-NEXT: addis r3, r2, .LCPI9_0@toc@ha
; P9BE-NEXT: addi r3, r3, .LCPI9_0@toc@l
; P9BE-NEXT: lxvx v3, 0, r3
; P9BE-NEXT: vperm v2, v2, v2, v3
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemVarDi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: sldi r4, r4, 2
; P9LE-NEXT: add r3, r3, r4
; P9LE-NEXT: addi r3, r3, -12
; P9LE-NEXT: lxvx v2, 0, r3
; P9LE-NEXT: addis r3, r2, .LCPI9_0@toc@ha
; P9LE-NEXT: addi r3, r3, .LCPI9_0@toc@l
; P9LE-NEXT: lxvx v3, 0, r3
; P9LE-NEXT: vperm v2, v2, v2, v3
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemVarDi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: sldi r4, r4, 2
; P8BE-NEXT: addis r5, r2, .LCPI9_0@toc@ha
; P8BE-NEXT: add r3, r3, r4
; P8BE-NEXT: addi r4, r5, .LCPI9_0@toc@l
; P8BE-NEXT: addi r3, r3, -12
; P8BE-NEXT: lxvw4x v3, 0, r4
; P8BE-NEXT: lxvw4x v2, 0, r3
; P8BE-NEXT: vperm v2, v2, v2, v3
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemVarDi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: sldi r4, r4, 2
; P8LE-NEXT: addis r5, r2, .LCPI9_0@toc@ha
; P8LE-NEXT: add r3, r3, r4
; P8LE-NEXT: addi r3, r3, -12
; P8LE-NEXT: lxvd2x vs0, 0, r3
; P8LE-NEXT: addi r3, r5, .LCPI9_0@toc@l
; P8LE-NEXT: lvx v3, 0, r3
; P8LE-NEXT: xxswapd v2, vs0
; P8LE-NEXT: vperm v2, v2, v2, v3
; P8LE-NEXT: blr
entry:
%idxprom = sext i32 %elem to i64
%arrayidx = getelementptr inbounds i32, i32* %arr, i64 %idxprom
%0 = load i32, i32* %arrayidx, align 4
%vecinit = insertelement <4 x i32> undef, i32 %0, i32 0
%sub = add nsw i32 %elem, -1
%idxprom1 = sext i32 %sub to i64
%arrayidx2 = getelementptr inbounds i32, i32* %arr, i64 %idxprom1
%1 = load i32, i32* %arrayidx2, align 4
%vecinit3 = insertelement <4 x i32> %vecinit, i32 %1, i32 1
%sub4 = add nsw i32 %elem, -2
%idxprom5 = sext i32 %sub4 to i64
%arrayidx6 = getelementptr inbounds i32, i32* %arr, i64 %idxprom5
%2 = load i32, i32* %arrayidx6, align 4
%vecinit7 = insertelement <4 x i32> %vecinit3, i32 %2, i32 2
%sub8 = add nsw i32 %elem, -3
%idxprom9 = sext i32 %sub8 to i64
%arrayidx10 = getelementptr inbounds i32, i32* %arr, i64 %idxprom9
%3 = load i32, i32* %arrayidx10, align 4
%vecinit11 = insertelement <4 x i32> %vecinit7, i32 %3, i32 3
ret <4 x i32> %vecinit11
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromRandMemConsi(i32* nocapture readonly %arr) {
; P9BE-LABEL: fromRandMemConsi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lwz r4, 16(r3)
; P9BE-NEXT: lwz r5, 72(r3)
; P9BE-NEXT: lwz r6, 8(r3)
; P9BE-NEXT: lwz r3, 352(r3)
; P9BE-NEXT: rldimi r3, r6, 32, 0
; P9BE-NEXT: rldimi r5, r4, 32, 0
; P9BE-NEXT: mtvsrdd v2, r5, r3
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromRandMemConsi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lwz r4, 16(r3)
; P9LE-NEXT: lwz r5, 72(r3)
; P9LE-NEXT: lwz r6, 8(r3)
; P9LE-NEXT: lwz r3, 352(r3)
; P9LE-NEXT: rldimi r4, r5, 32, 0
; P9LE-NEXT: rldimi r6, r3, 32, 0
; P9LE-NEXT: mtvsrdd v2, r6, r4
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromRandMemConsi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: lwz r4, 8(r3)
; P8BE-NEXT: lwz r5, 352(r3)
; P8BE-NEXT: lwz r6, 16(r3)
; P8BE-NEXT: lwz r3, 72(r3)
; P8BE-NEXT: rldimi r5, r4, 32, 0
; P8BE-NEXT: rldimi r3, r6, 32, 0
; P8BE-NEXT: mtvsrd f0, r5
; P8BE-NEXT: mtvsrd f1, r3
; P8BE-NEXT: xxmrghd v2, vs1, vs0
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromRandMemConsi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: lwz r4, 16(r3)
; P8LE-NEXT: lwz r5, 72(r3)
; P8LE-NEXT: lwz r6, 8(r3)
; P8LE-NEXT: lwz r3, 352(r3)
; P8LE-NEXT: rldimi r4, r5, 32, 0
; P8LE-NEXT: rldimi r6, r3, 32, 0
; P8LE-NEXT: mtvsrd f0, r4
; P8LE-NEXT: mtvsrd f1, r6
; P8LE-NEXT: xxmrghd v2, vs1, vs0
; P8LE-NEXT: blr
entry:
%arrayidx = getelementptr inbounds i32, i32* %arr, i64 4
%0 = load i32, i32* %arrayidx, align 4
%vecinit = insertelement <4 x i32> undef, i32 %0, i32 0
%arrayidx1 = getelementptr inbounds i32, i32* %arr, i64 18
%1 = load i32, i32* %arrayidx1, align 4
%vecinit2 = insertelement <4 x i32> %vecinit, i32 %1, i32 1
%arrayidx3 = getelementptr inbounds i32, i32* %arr, i64 2
%2 = load i32, i32* %arrayidx3, align 4
%vecinit4 = insertelement <4 x i32> %vecinit2, i32 %2, i32 2
%arrayidx5 = getelementptr inbounds i32, i32* %arr, i64 88
%3 = load i32, i32* %arrayidx5, align 4
%vecinit6 = insertelement <4 x i32> %vecinit4, i32 %3, i32 3
ret <4 x i32> %vecinit6
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromRandMemVari(i32* nocapture readonly %arr, i32 signext %elem) {
; P9BE-LABEL: fromRandMemVari:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: sldi r4, r4, 2
; P9BE-NEXT: add r3, r3, r4
; P9BE-NEXT: lwz r4, 16(r3)
; P9BE-NEXT: lwz r5, 4(r3)
; P9BE-NEXT: lwz r6, 8(r3)
; P9BE-NEXT: lwz r3, 32(r3)
; P9BE-NEXT: rldimi r3, r6, 32, 0
; P9BE-NEXT: rldimi r5, r4, 32, 0
; P9BE-NEXT: mtvsrdd v2, r5, r3
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromRandMemVari:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: sldi r4, r4, 2
; P9LE-NEXT: add r3, r3, r4
; P9LE-NEXT: lwz r4, 16(r3)
; P9LE-NEXT: lwz r5, 4(r3)
; P9LE-NEXT: lwz r6, 8(r3)
; P9LE-NEXT: lwz r3, 32(r3)
; P9LE-NEXT: rldimi r4, r5, 32, 0
; P9LE-NEXT: rldimi r6, r3, 32, 0
; P9LE-NEXT: mtvsrdd v2, r6, r4
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromRandMemVari:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: sldi r4, r4, 2
; P8BE-NEXT: add r3, r3, r4
; P8BE-NEXT: lwz r4, 8(r3)
; P8BE-NEXT: lwz r5, 32(r3)
; P8BE-NEXT: lwz r6, 16(r3)
; P8BE-NEXT: lwz r3, 4(r3)
; P8BE-NEXT: rldimi r5, r4, 32, 0
; P8BE-NEXT: rldimi r3, r6, 32, 0
; P8BE-NEXT: mtvsrd f0, r5
; P8BE-NEXT: mtvsrd f1, r3
; P8BE-NEXT: xxmrghd v2, vs1, vs0
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromRandMemVari:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: sldi r4, r4, 2
; P8LE-NEXT: add r3, r3, r4
; P8LE-NEXT: lwz r4, 16(r3)
; P8LE-NEXT: lwz r5, 4(r3)
; P8LE-NEXT: lwz r6, 8(r3)
; P8LE-NEXT: lwz r3, 32(r3)
; P8LE-NEXT: rldimi r4, r5, 32, 0
; P8LE-NEXT: rldimi r6, r3, 32, 0
; P8LE-NEXT: mtvsrd f0, r4
; P8LE-NEXT: mtvsrd f1, r6
; P8LE-NEXT: xxmrghd v2, vs1, vs0
; P8LE-NEXT: blr
entry:
%add = add nsw i32 %elem, 4
%idxprom = sext i32 %add to i64
%arrayidx = getelementptr inbounds i32, i32* %arr, i64 %idxprom
%0 = load i32, i32* %arrayidx, align 4
%vecinit = insertelement <4 x i32> undef, i32 %0, i32 0
%add1 = add nsw i32 %elem, 1
%idxprom2 = sext i32 %add1 to i64
%arrayidx3 = getelementptr inbounds i32, i32* %arr, i64 %idxprom2
%1 = load i32, i32* %arrayidx3, align 4
%vecinit4 = insertelement <4 x i32> %vecinit, i32 %1, i32 1
%add5 = add nsw i32 %elem, 2
%idxprom6 = sext i32 %add5 to i64
%arrayidx7 = getelementptr inbounds i32, i32* %arr, i64 %idxprom6
%2 = load i32, i32* %arrayidx7, align 4
%vecinit8 = insertelement <4 x i32> %vecinit4, i32 %2, i32 2
%add9 = add nsw i32 %elem, 8
%idxprom10 = sext i32 %add9 to i64
%arrayidx11 = getelementptr inbounds i32, i32* %arr, i64 %idxprom10
%3 = load i32, i32* %arrayidx11, align 4
%vecinit12 = insertelement <4 x i32> %vecinit8, i32 %3, i32 3
ret <4 x i32> %vecinit12
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @spltRegVali(i32 signext %val) {
; P9BE-LABEL: spltRegVali:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: mtvsrws v2, r3
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltRegVali:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: mtvsrws v2, r3
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltRegVali:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: mtvsrwz f0, r3
; P8BE-NEXT: xxspltw v2, vs0, 1
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltRegVali:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: mtvsrwz f0, r3
; P8LE-NEXT: xxspltw v2, vs0, 1
; P8LE-NEXT: blr
entry:
%splat.splatinsert = insertelement <4 x i32> undef, i32 %val, i32 0
%splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
ret <4 x i32> %splat.splat
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @spltMemVali(i32* nocapture readonly %ptr) {
; P9BE-LABEL: spltMemVali:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lxvwsx v2, 0, r3
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltMemVali:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lxvwsx v2, 0, r3
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltMemVali:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: lfiwzx f0, 0, r3
; P8BE-NEXT: xxsldwi vs0, f0, f0, 1
; P8BE-NEXT: xxspltw v2, vs0, 0
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltMemVali:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: lfiwzx f0, 0, r3
; P8LE-NEXT: xxpermdi vs0, f0, f0, 2
; P8LE-NEXT: xxspltw v2, vs0, 3
; P8LE-NEXT: blr
entry:
%0 = load i32, i32* %ptr, align 4
%splat.splatinsert = insertelement <4 x i32> undef, i32 %0, i32 0
%splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
ret <4 x i32> %splat.splat
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @spltCnstConvftoi() {
; P9BE-LABEL: spltCnstConvftoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: vspltisw v2, 4
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltCnstConvftoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: vspltisw v2, 4
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltCnstConvftoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: vspltisw v2, 4
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltCnstConvftoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: vspltisw v2, 4
; P8LE-NEXT: blr
entry:
ret <4 x i32> <i32 4, i32 4, i32 4, i32 4>
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @fromRegsConvftoi(float %a, float %b, float %c, float %d) {
; P9BE-LABEL: fromRegsConvftoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: # kill: def $f4 killed $f4 def $vsl4
; P9BE-NEXT: # kill: def $f2 killed $f2 def $vsl2
; P9BE-NEXT: xxmrghd vs0, vs2, vs4
; P9BE-NEXT: # kill: def $f3 killed $f3 def $vsl3
; P9BE-NEXT: # kill: def $f1 killed $f1 def $vsl1
; P9BE-NEXT: xvcvdpsxws v2, vs0
; P9BE-NEXT: xxmrghd vs0, vs1, vs3
; P9BE-NEXT: xvcvdpsxws v3, vs0
; P9BE-NEXT: vmrgew v2, v3, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromRegsConvftoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: # kill: def $f3 killed $f3 def $vsl3
; P9LE-NEXT: # kill: def $f1 killed $f1 def $vsl1
; P9LE-NEXT: xxmrghd vs0, vs3, vs1
; P9LE-NEXT: # kill: def $f4 killed $f4 def $vsl4
; P9LE-NEXT: # kill: def $f2 killed $f2 def $vsl2
; P9LE-NEXT: xvcvdpsxws v2, vs0
; P9LE-NEXT: xxmrghd vs0, vs4, vs2
; P9LE-NEXT: xvcvdpsxws v3, vs0
; P9LE-NEXT: vmrgew v2, v3, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromRegsConvftoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: # kill: def $f1 killed $f1 def $vsl1
; P8BE-NEXT: # kill: def $f4 killed $f4 def $vsl4
; P8BE-NEXT: # kill: def $f3 killed $f3 def $vsl3
; P8BE-NEXT: # kill: def $f2 killed $f2 def $vsl2
; P8BE-NEXT: xxmrghd vs0, vs2, vs4
; P8BE-NEXT: xxmrghd vs1, vs1, vs3
; P8BE-NEXT: xvcvdpsxws v2, vs0
; P8BE-NEXT: xvcvdpsxws v3, vs1
; P8BE-NEXT: vmrgew v2, v3, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromRegsConvftoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: # kill: def $f1 killed $f1 def $vsl1
; P8LE-NEXT: # kill: def $f4 killed $f4 def $vsl4
; P8LE-NEXT: # kill: def $f3 killed $f3 def $vsl3
; P8LE-NEXT: # kill: def $f2 killed $f2 def $vsl2
; P8LE-NEXT: xxmrghd vs0, vs3, vs1
; P8LE-NEXT: xxmrghd vs1, vs4, vs2
; P8LE-NEXT: xvcvdpsxws v2, vs0
; P8LE-NEXT: xvcvdpsxws v3, vs1
; P8LE-NEXT: vmrgew v2, v3, v2
; P8LE-NEXT: blr
entry:
%conv = fptosi float %a to i32
%vecinit = insertelement <4 x i32> undef, i32 %conv, i32 0
%conv1 = fptosi float %b to i32
%vecinit2 = insertelement <4 x i32> %vecinit, i32 %conv1, i32 1
%conv3 = fptosi float %c to i32
%vecinit4 = insertelement <4 x i32> %vecinit2, i32 %conv3, i32 2
%conv5 = fptosi float %d to i32
%vecinit6 = insertelement <4 x i32> %vecinit4, i32 %conv5, i32 3
ret <4 x i32> %vecinit6
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @fromDiffConstsConvftoi() {
; P9BE-LABEL: fromDiffConstsConvftoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: addis r3, r2, .LCPI16_0@toc@ha
; P9BE-NEXT: addi r3, r3, .LCPI16_0@toc@l
; P9BE-NEXT: lxvx v2, 0, r3
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffConstsConvftoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: addis r3, r2, .LCPI16_0@toc@ha
; P9LE-NEXT: addi r3, r3, .LCPI16_0@toc@l
; P9LE-NEXT: lxvx v2, 0, r3
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffConstsConvftoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: addis r3, r2, .LCPI16_0@toc@ha
; P8BE-NEXT: addi r3, r3, .LCPI16_0@toc@l
; P8BE-NEXT: lxvw4x v2, 0, r3
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffConstsConvftoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: addis r3, r2, .LCPI16_0@toc@ha
; P8LE-NEXT: addi r3, r3, .LCPI16_0@toc@l
; P8LE-NEXT: lvx v2, 0, r3
; P8LE-NEXT: blr
entry:
ret <4 x i32> <i32 24, i32 234, i32 988, i32 422>
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemConsAConvftoi(float* nocapture readonly %ptr) {
; P9BE-LABEL: fromDiffMemConsAConvftoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lxv vs0, 0(r3)
; P9BE-NEXT: xvcvspsxws v2, vs0
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemConsAConvftoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lxv vs0, 0(r3)
; P9LE-NEXT: xvcvspsxws v2, vs0
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemConsAConvftoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: lxvw4x vs0, 0, r3
; P8BE-NEXT: xvcvspsxws v2, vs0
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemConsAConvftoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: lxvd2x vs0, 0, r3
; P8LE-NEXT: xxswapd v2, vs0
; P8LE-NEXT: xvcvspsxws v2, v2
; P8LE-NEXT: blr
entry:
%0 = bitcast float* %ptr to <4 x float>*
%1 = load <4 x float>, <4 x float>* %0, align 4
%2 = fptosi <4 x float> %1 to <4 x i32>
ret <4 x i32> %2
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemConsDConvftoi(float* nocapture readonly %ptr) {
; P9BE-LABEL: fromDiffMemConsDConvftoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lxv v2, 0(r3)
; P9BE-NEXT: addis r3, r2, .LCPI18_0@toc@ha
; P9BE-NEXT: addi r3, r3, .LCPI18_0@toc@l
; P9BE-NEXT: lxvx v3, 0, r3
; P9BE-NEXT: vperm v2, v2, v2, v3
; P9BE-NEXT: xvcvspsxws v2, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemConsDConvftoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lxv v2, 0(r3)
; P9LE-NEXT: addis r3, r2, .LCPI18_0@toc@ha
; P9LE-NEXT: addi r3, r3, .LCPI18_0@toc@l
; P9LE-NEXT: lxvx v3, 0, r3
; P9LE-NEXT: vperm v2, v2, v2, v3
; P9LE-NEXT: xvcvspsxws v2, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemConsDConvftoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: addis r4, r2, .LCPI18_0@toc@ha
; P8BE-NEXT: lxvw4x v2, 0, r3
; P8BE-NEXT: addi r4, r4, .LCPI18_0@toc@l
; P8BE-NEXT: lxvw4x v3, 0, r4
; P8BE-NEXT: vperm v2, v2, v2, v3
; P8BE-NEXT: xvcvspsxws v2, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemConsDConvftoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: lxvd2x vs0, 0, r3
; P8LE-NEXT: addis r4, r2, .LCPI18_0@toc@ha
; P8LE-NEXT: addi r3, r4, .LCPI18_0@toc@l
; P8LE-NEXT: lvx v2, 0, r3
; P8LE-NEXT: xxswapd v3, vs0
; P8LE-NEXT: vperm v2, v3, v3, v2
; P8LE-NEXT: xvcvspsxws v2, v2
; P8LE-NEXT: blr
entry:
%arrayidx = getelementptr inbounds float, float* %ptr, i64 3
%0 = load float, float* %arrayidx, align 4
%conv = fptosi float %0 to i32
%vecinit = insertelement <4 x i32> undef, i32 %conv, i32 0
%arrayidx1 = getelementptr inbounds float, float* %ptr, i64 2
%1 = load float, float* %arrayidx1, align 4
%conv2 = fptosi float %1 to i32
%vecinit3 = insertelement <4 x i32> %vecinit, i32 %conv2, i32 1
%arrayidx4 = getelementptr inbounds float, float* %ptr, i64 1
%2 = load float, float* %arrayidx4, align 4
%conv5 = fptosi float %2 to i32
%vecinit6 = insertelement <4 x i32> %vecinit3, i32 %conv5, i32 2
%3 = load float, float* %ptr, align 4
%conv8 = fptosi float %3 to i32
%vecinit9 = insertelement <4 x i32> %vecinit6, i32 %conv8, i32 3
ret <4 x i32> %vecinit9
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemVarAConvftoi(float* nocapture readonly %arr, i32 signext %elem) {
; P9BE-LABEL: fromDiffMemVarAConvftoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: sldi r4, r4, 2
; P9BE-NEXT: lfsux f0, r3, r4
; P9BE-NEXT: lfs f1, 12(r3)
; P9BE-NEXT: lfs f2, 4(r3)
; P9BE-NEXT: xxmrghd vs1, vs2, vs1
; P9BE-NEXT: xvcvdpsp v2, vs1
; P9BE-NEXT: lfs f1, 8(r3)
; P9BE-NEXT: xxmrghd vs0, vs0, vs1
; P9BE-NEXT: xvcvdpsp v3, vs0
; P9BE-NEXT: vmrgew v2, v3, v2
; P9BE-NEXT: xvcvspsxws v2, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemVarAConvftoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: sldi r4, r4, 2
; P9LE-NEXT: lfsux f0, r3, r4
; P9LE-NEXT: lfs f1, 8(r3)
; P9LE-NEXT: xxmrghd vs0, vs1, vs0
; P9LE-NEXT: lfs f1, 12(r3)
; P9LE-NEXT: xvcvdpsp v2, vs0
; P9LE-NEXT: lfs f0, 4(r3)
; P9LE-NEXT: xxmrghd vs0, vs1, vs0
; P9LE-NEXT: xvcvdpsp v3, vs0
; P9LE-NEXT: vmrgew v2, v3, v2
; P9LE-NEXT: xvcvspsxws v2, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemVarAConvftoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: sldi r4, r4, 2
; P8BE-NEXT: lfsux f0, r3, r4
; P8BE-NEXT: lfs f1, 12(r3)
; P8BE-NEXT: lfs f2, 4(r3)
; P8BE-NEXT: lfs f3, 8(r3)
; P8BE-NEXT: xxmrghd vs1, vs2, vs1
; P8BE-NEXT: xxmrghd vs0, vs0, vs3
; P8BE-NEXT: xvcvdpsp v2, vs1
; P8BE-NEXT: xvcvdpsp v3, vs0
; P8BE-NEXT: vmrgew v2, v3, v2
; P8BE-NEXT: xvcvspsxws v2, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemVarAConvftoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: sldi r4, r4, 2
; P8LE-NEXT: lfsux f0, r3, r4
; P8LE-NEXT: lfs f1, 8(r3)
; P8LE-NEXT: lfs f2, 4(r3)
; P8LE-NEXT: lfs f3, 12(r3)
; P8LE-NEXT: xxmrghd vs0, vs1, vs0
; P8LE-NEXT: xxmrghd vs1, vs3, vs2
; P8LE-NEXT: xvcvdpsp v2, vs0
; P8LE-NEXT: xvcvdpsp v3, vs1
; P8LE-NEXT: vmrgew v2, v3, v2
; P8LE-NEXT: xvcvspsxws v2, v2
; P8LE-NEXT: blr
entry:
%idxprom = sext i32 %elem to i64
%arrayidx = getelementptr inbounds float, float* %arr, i64 %idxprom
%0 = load float, float* %arrayidx, align 4
%conv = fptosi float %0 to i32
%vecinit = insertelement <4 x i32> undef, i32 %conv, i32 0
%add = add nsw i32 %elem, 1
%idxprom1 = sext i32 %add to i64
%arrayidx2 = getelementptr inbounds float, float* %arr, i64 %idxprom1
%1 = load float, float* %arrayidx2, align 4
%conv3 = fptosi float %1 to i32
%vecinit4 = insertelement <4 x i32> %vecinit, i32 %conv3, i32 1
%add5 = add nsw i32 %elem, 2
%idxprom6 = sext i32 %add5 to i64
%arrayidx7 = getelementptr inbounds float, float* %arr, i64 %idxprom6
%2 = load float, float* %arrayidx7, align 4
%conv8 = fptosi float %2 to i32
%vecinit9 = insertelement <4 x i32> %vecinit4, i32 %conv8, i32 2
%add10 = add nsw i32 %elem, 3
%idxprom11 = sext i32 %add10 to i64
%arrayidx12 = getelementptr inbounds float, float* %arr, i64 %idxprom11
%3 = load float, float* %arrayidx12, align 4
%conv13 = fptosi float %3 to i32
%vecinit14 = insertelement <4 x i32> %vecinit9, i32 %conv13, i32 3
ret <4 x i32> %vecinit14
; FIXME: implement finding consecutive loads with pre-inc
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemVarDConvftoi(float* nocapture readonly %arr, i32 signext %elem) {
; P9BE-LABEL: fromDiffMemVarDConvftoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: sldi r4, r4, 2
; P9BE-NEXT: lfsux f0, r3, r4
; P9BE-NEXT: lfs f1, -12(r3)
; P9BE-NEXT: lfs f2, -4(r3)
; P9BE-NEXT: xxmrghd vs1, vs2, vs1
; P9BE-NEXT: xvcvdpsp v2, vs1
; P9BE-NEXT: lfs f1, -8(r3)
; P9BE-NEXT: xxmrghd vs0, vs0, vs1
; P9BE-NEXT: xvcvdpsp v3, vs0
; P9BE-NEXT: vmrgew v2, v3, v2
; P9BE-NEXT: xvcvspsxws v2, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemVarDConvftoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: sldi r4, r4, 2
; P9LE-NEXT: lfsux f0, r3, r4
; P9LE-NEXT: lfs f1, -8(r3)
; P9LE-NEXT: xxmrghd vs0, vs1, vs0
; P9LE-NEXT: lfs f1, -12(r3)
; P9LE-NEXT: xvcvdpsp v2, vs0
; P9LE-NEXT: lfs f0, -4(r3)
; P9LE-NEXT: xxmrghd vs0, vs1, vs0
; P9LE-NEXT: xvcvdpsp v3, vs0
; P9LE-NEXT: vmrgew v2, v3, v2
; P9LE-NEXT: xvcvspsxws v2, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemVarDConvftoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: sldi r4, r4, 2
; P8BE-NEXT: lfsux f0, r3, r4
; P8BE-NEXT: lfs f1, -12(r3)
; P8BE-NEXT: lfs f2, -4(r3)
; P8BE-NEXT: lfs f3, -8(r3)
; P8BE-NEXT: xxmrghd vs1, vs2, vs1
; P8BE-NEXT: xxmrghd vs0, vs0, vs3
; P8BE-NEXT: xvcvdpsp v2, vs1
; P8BE-NEXT: xvcvdpsp v3, vs0
; P8BE-NEXT: vmrgew v2, v3, v2
; P8BE-NEXT: xvcvspsxws v2, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemVarDConvftoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: sldi r4, r4, 2
; P8LE-NEXT: lfsux f0, r3, r4
; P8LE-NEXT: lfs f1, -8(r3)
; P8LE-NEXT: lfs f2, -4(r3)
; P8LE-NEXT: lfs f3, -12(r3)
; P8LE-NEXT: xxmrghd vs0, vs1, vs0
; P8LE-NEXT: xxmrghd vs1, vs3, vs2
; P8LE-NEXT: xvcvdpsp v2, vs0
; P8LE-NEXT: xvcvdpsp v3, vs1
; P8LE-NEXT: vmrgew v2, v3, v2
; P8LE-NEXT: xvcvspsxws v2, v2
; P8LE-NEXT: blr
entry:
%idxprom = sext i32 %elem to i64
%arrayidx = getelementptr inbounds float, float* %arr, i64 %idxprom
%0 = load float, float* %arrayidx, align 4
%conv = fptosi float %0 to i32
%vecinit = insertelement <4 x i32> undef, i32 %conv, i32 0
%sub = add nsw i32 %elem, -1
%idxprom1 = sext i32 %sub to i64
%arrayidx2 = getelementptr inbounds float, float* %arr, i64 %idxprom1
%1 = load float, float* %arrayidx2, align 4
%conv3 = fptosi float %1 to i32
%vecinit4 = insertelement <4 x i32> %vecinit, i32 %conv3, i32 1
%sub5 = add nsw i32 %elem, -2
%idxprom6 = sext i32 %sub5 to i64
%arrayidx7 = getelementptr inbounds float, float* %arr, i64 %idxprom6
%2 = load float, float* %arrayidx7, align 4
%conv8 = fptosi float %2 to i32
%vecinit9 = insertelement <4 x i32> %vecinit4, i32 %conv8, i32 2
%sub10 = add nsw i32 %elem, -3
%idxprom11 = sext i32 %sub10 to i64
%arrayidx12 = getelementptr inbounds float, float* %arr, i64 %idxprom11
%3 = load float, float* %arrayidx12, align 4
%conv13 = fptosi float %3 to i32
%vecinit14 = insertelement <4 x i32> %vecinit9, i32 %conv13, i32 3
ret <4 x i32> %vecinit14
; FIXME: implement finding consecutive loads with pre-inc
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @spltRegValConvftoi(float %val) {
; P9BE-LABEL: spltRegValConvftoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: xscvdpsxws f0, f1
; P9BE-NEXT: xxspltw v2, vs0, 1
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltRegValConvftoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: xscvdpsxws f0, f1
; P9LE-NEXT: xxspltw v2, vs0, 1
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltRegValConvftoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: xscvdpsxws f0, f1
; P8BE-NEXT: xxspltw v2, vs0, 1
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltRegValConvftoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: xscvdpsxws f0, f1
; P8LE-NEXT: xxspltw v2, vs0, 1
; P8LE-NEXT: blr
entry:
%conv = fptosi float %val to i32
%splat.splatinsert = insertelement <4 x i32> undef, i32 %conv, i32 0
%splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
ret <4 x i32> %splat.splat
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @spltMemValConvftoi(float* nocapture readonly %ptr) {
; P9BE-LABEL: spltMemValConvftoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lxvwsx vs0, 0, r3
; P9BE-NEXT: xvcvspsxws v2, vs0
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltMemValConvftoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lxvwsx vs0, 0, r3
; P9LE-NEXT: xvcvspsxws v2, vs0
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltMemValConvftoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: lfsx f0, 0, r3
; P8BE-NEXT: xscvdpsxws f0, f0
; P8BE-NEXT: xxspltw v2, vs0, 1
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltMemValConvftoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: lfsx f0, 0, r3
; P8LE-NEXT: xscvdpsxws f0, f0
; P8LE-NEXT: xxspltw v2, vs0, 1
; P8LE-NEXT: blr
entry:
%0 = load float, float* %ptr, align 4
%conv = fptosi float %0 to i32
%splat.splatinsert = insertelement <4 x i32> undef, i32 %conv, i32 0
%splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
ret <4 x i32> %splat.splat
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @spltCnstConvdtoi() {
; P9BE-LABEL: spltCnstConvdtoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: vspltisw v2, 4
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltCnstConvdtoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: vspltisw v2, 4
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltCnstConvdtoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: vspltisw v2, 4
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltCnstConvdtoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: vspltisw v2, 4
; P8LE-NEXT: blr
entry:
ret <4 x i32> <i32 4, i32 4, i32 4, i32 4>
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @fromRegsConvdtoi(double %a, double %b, double %c, double %d) {
; P9BE-LABEL: fromRegsConvdtoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: # kill: def $f4 killed $f4 def $vsl4
; P9BE-NEXT: # kill: def $f2 killed $f2 def $vsl2
; P9BE-NEXT: xxmrghd vs0, vs2, vs4
; P9BE-NEXT: # kill: def $f3 killed $f3 def $vsl3
; P9BE-NEXT: # kill: def $f1 killed $f1 def $vsl1
; P9BE-NEXT: xvcvdpsxws v2, vs0
; P9BE-NEXT: xxmrghd vs0, vs1, vs3
; P9BE-NEXT: xvcvdpsxws v3, vs0
; P9BE-NEXT: vmrgew v2, v3, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromRegsConvdtoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: # kill: def $f3 killed $f3 def $vsl3
; P9LE-NEXT: # kill: def $f1 killed $f1 def $vsl1
; P9LE-NEXT: xxmrghd vs0, vs3, vs1
; P9LE-NEXT: # kill: def $f4 killed $f4 def $vsl4
; P9LE-NEXT: # kill: def $f2 killed $f2 def $vsl2
; P9LE-NEXT: xvcvdpsxws v2, vs0
; P9LE-NEXT: xxmrghd vs0, vs4, vs2
; P9LE-NEXT: xvcvdpsxws v3, vs0
; P9LE-NEXT: vmrgew v2, v3, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromRegsConvdtoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: # kill: def $f1 killed $f1 def $vsl1
; P8BE-NEXT: # kill: def $f4 killed $f4 def $vsl4
; P8BE-NEXT: # kill: def $f3 killed $f3 def $vsl3
; P8BE-NEXT: # kill: def $f2 killed $f2 def $vsl2
; P8BE-NEXT: xxmrghd vs0, vs2, vs4
; P8BE-NEXT: xxmrghd vs1, vs1, vs3
; P8BE-NEXT: xvcvdpsxws v2, vs0
; P8BE-NEXT: xvcvdpsxws v3, vs1
; P8BE-NEXT: vmrgew v2, v3, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromRegsConvdtoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: # kill: def $f1 killed $f1 def $vsl1
; P8LE-NEXT: # kill: def $f4 killed $f4 def $vsl4
; P8LE-NEXT: # kill: def $f3 killed $f3 def $vsl3
; P8LE-NEXT: # kill: def $f2 killed $f2 def $vsl2
; P8LE-NEXT: xxmrghd vs0, vs3, vs1
; P8LE-NEXT: xxmrghd vs1, vs4, vs2
; P8LE-NEXT: xvcvdpsxws v2, vs0
; P8LE-NEXT: xvcvdpsxws v3, vs1
; P8LE-NEXT: vmrgew v2, v3, v2
; P8LE-NEXT: blr
entry:
%conv = fptosi double %a to i32
%vecinit = insertelement <4 x i32> undef, i32 %conv, i32 0
%conv1 = fptosi double %b to i32
%vecinit2 = insertelement <4 x i32> %vecinit, i32 %conv1, i32 1
%conv3 = fptosi double %c to i32
%vecinit4 = insertelement <4 x i32> %vecinit2, i32 %conv3, i32 2
%conv5 = fptosi double %d to i32
%vecinit6 = insertelement <4 x i32> %vecinit4, i32 %conv5, i32 3
ret <4 x i32> %vecinit6
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @fromDiffConstsConvdtoi() {
; P9BE-LABEL: fromDiffConstsConvdtoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: addis r3, r2, .LCPI25_0@toc@ha
; P9BE-NEXT: addi r3, r3, .LCPI25_0@toc@l
; P9BE-NEXT: lxvx v2, 0, r3
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffConstsConvdtoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: addis r3, r2, .LCPI25_0@toc@ha
; P9LE-NEXT: addi r3, r3, .LCPI25_0@toc@l
; P9LE-NEXT: lxvx v2, 0, r3
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffConstsConvdtoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: addis r3, r2, .LCPI25_0@toc@ha
; P8BE-NEXT: addi r3, r3, .LCPI25_0@toc@l
; P8BE-NEXT: lxvw4x v2, 0, r3
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffConstsConvdtoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: addis r3, r2, .LCPI25_0@toc@ha
; P8LE-NEXT: addi r3, r3, .LCPI25_0@toc@l
; P8LE-NEXT: lvx v2, 0, r3
; P8LE-NEXT: blr
entry:
ret <4 x i32> <i32 24, i32 234, i32 988, i32 422>
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemConsAConvdtoi(double* nocapture readonly %ptr) {
; P9BE-LABEL: fromDiffMemConsAConvdtoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lxv vs0, 0(r3)
; P9BE-NEXT: lxv vs1, 16(r3)
; P9BE-NEXT: xxmrgld vs2, vs0, vs1
; P9BE-NEXT: xxmrghd vs0, vs0, vs1
; P9BE-NEXT: xvcvdpsxws v2, vs2
; P9BE-NEXT: xvcvdpsxws v3, vs0
; P9BE-NEXT: vmrgew v2, v3, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemConsAConvdtoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lxv vs0, 0(r3)
; P9LE-NEXT: lxv vs1, 16(r3)
; P9LE-NEXT: xxmrgld vs2, vs1, vs0
; P9LE-NEXT: xxmrghd vs0, vs1, vs0
; P9LE-NEXT: xvcvdpsxws v2, vs2
; P9LE-NEXT: xvcvdpsxws v3, vs0
; P9LE-NEXT: vmrgew v2, v3, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemConsAConvdtoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: li r4, 16
; P8BE-NEXT: lxvd2x vs0, 0, r3
; P8BE-NEXT: lxvd2x vs1, r3, r4
; P8BE-NEXT: xxmrgld vs2, vs0, vs1
; P8BE-NEXT: xxmrghd vs0, vs0, vs1
; P8BE-NEXT: xvcvdpsxws v2, vs2
; P8BE-NEXT: xvcvdpsxws v3, vs0
; P8BE-NEXT: vmrgew v2, v3, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemConsAConvdtoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: li r4, 16
; P8LE-NEXT: lxvd2x vs0, 0, r3
; P8LE-NEXT: lxvd2x vs1, r3, r4
; P8LE-NEXT: xxswapd vs0, vs0
; P8LE-NEXT: xxswapd vs1, vs1
; P8LE-NEXT: xxmrgld vs2, vs1, vs0
; P8LE-NEXT: xxmrghd vs0, vs1, vs0
; P8LE-NEXT: xvcvdpsxws v2, vs2
; P8LE-NEXT: xvcvdpsxws v3, vs0
; P8LE-NEXT: vmrgew v2, v3, v2
; P8LE-NEXT: blr
entry:
%0 = bitcast double* %ptr to <2 x double>*
%1 = load <2 x double>, <2 x double>* %0, align 8
%2 = fptosi <2 x double> %1 to <2 x i32>
%arrayidx4 = getelementptr inbounds double, double* %ptr, i64 2
%3 = bitcast double* %arrayidx4 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3, align 8
%5 = fptosi <2 x double> %4 to <2 x i32>
%vecinit9 = shufflevector <2 x i32> %2, <2 x i32> %5, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
ret <4 x i32> %vecinit9
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemConsDConvdtoi(double* nocapture readonly %ptr) {
; P9BE-LABEL: fromDiffMemConsDConvdtoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lfd f0, 24(r3)
; P9BE-NEXT: lfd f1, 16(r3)
; P9BE-NEXT: lfd f2, 8(r3)
; P9BE-NEXT: xxmrghd vs0, vs0, vs2
; P9BE-NEXT: lfd f3, 0(r3)
; P9BE-NEXT: xxmrghd vs1, vs1, vs3
; P9BE-NEXT: xvcvdpsxws v2, vs1
; P9BE-NEXT: xvcvdpsxws v3, vs0
; P9BE-NEXT: vmrgew v2, v3, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemConsDConvdtoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lfd f0, 24(r3)
; P9LE-NEXT: lfd f2, 8(r3)
; P9LE-NEXT: xxmrghd vs0, vs2, vs0
; P9LE-NEXT: lfd f1, 16(r3)
; P9LE-NEXT: lfd f3, 0(r3)
; P9LE-NEXT: xvcvdpsxws v2, vs0
; P9LE-NEXT: xxmrghd vs0, vs3, vs1
; P9LE-NEXT: xvcvdpsxws v3, vs0
; P9LE-NEXT: vmrgew v2, v3, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemConsDConvdtoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: lfdx f3, 0, r3
; P8BE-NEXT: lfd f0, 24(r3)
; P8BE-NEXT: lfd f1, 8(r3)
; P8BE-NEXT: lfd f2, 16(r3)
; P8BE-NEXT: xxmrghd vs0, vs0, vs1
; P8BE-NEXT: xxmrghd vs1, vs2, vs3
; P8BE-NEXT: xvcvdpsxws v2, vs0
; P8BE-NEXT: xvcvdpsxws v3, vs1
; P8BE-NEXT: vmrgew v2, v2, v3
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemConsDConvdtoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: lfdx f3, 0, r3
; P8LE-NEXT: lfd f0, 24(r3)
; P8LE-NEXT: lfd f1, 8(r3)
; P8LE-NEXT: lfd f2, 16(r3)
; P8LE-NEXT: xxmrghd vs0, vs1, vs0
; P8LE-NEXT: xxmrghd vs1, vs3, vs2
; P8LE-NEXT: xvcvdpsxws v2, vs0
; P8LE-NEXT: xvcvdpsxws v3, vs1
; P8LE-NEXT: vmrgew v2, v3, v2
; P8LE-NEXT: blr
entry:
%arrayidx = getelementptr inbounds double, double* %ptr, i64 3
%0 = load double, double* %arrayidx, align 8
%conv = fptosi double %0 to i32
%vecinit = insertelement <4 x i32> undef, i32 %conv, i32 0
%arrayidx1 = getelementptr inbounds double, double* %ptr, i64 2
%1 = load double, double* %arrayidx1, align 8
%conv2 = fptosi double %1 to i32
%vecinit3 = insertelement <4 x i32> %vecinit, i32 %conv2, i32 1
%arrayidx4 = getelementptr inbounds double, double* %ptr, i64 1
%2 = load double, double* %arrayidx4, align 8
%conv5 = fptosi double %2 to i32
%vecinit6 = insertelement <4 x i32> %vecinit3, i32 %conv5, i32 2
%3 = load double, double* %ptr, align 8
%conv8 = fptosi double %3 to i32
%vecinit9 = insertelement <4 x i32> %vecinit6, i32 %conv8, i32 3
ret <4 x i32> %vecinit9
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemVarAConvdtoi(double* nocapture readonly %arr, i32 signext %elem) {
; P9BE-LABEL: fromDiffMemVarAConvdtoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: sldi r4, r4, 3
; P9BE-NEXT: lfdux f0, r3, r4
; P9BE-NEXT: lfd f1, 8(r3)
; P9BE-NEXT: lfd f2, 16(r3)
; P9BE-NEXT: lfd f3, 24(r3)
; P9BE-NEXT: xxmrghd vs1, vs1, vs3
; P9BE-NEXT: xxmrghd vs0, vs0, vs2
; P9BE-NEXT: xvcvdpsxws v2, vs1
; P9BE-NEXT: xvcvdpsxws v3, vs0
; P9BE-NEXT: vmrgew v2, v3, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemVarAConvdtoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: sldi r4, r4, 3
; P9LE-NEXT: lfdux f0, r3, r4
; P9LE-NEXT: lfd f2, 16(r3)
; P9LE-NEXT: lfd f1, 8(r3)
; P9LE-NEXT: lfd f3, 24(r3)
; P9LE-NEXT: xxmrghd vs0, vs2, vs0
; P9LE-NEXT: xvcvdpsxws v2, vs0
; P9LE-NEXT: xxmrghd vs0, vs3, vs1
; P9LE-NEXT: xvcvdpsxws v3, vs0
; P9LE-NEXT: vmrgew v2, v3, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemVarAConvdtoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: sldi r4, r4, 3
; P8BE-NEXT: lfdux f0, r3, r4
; P8BE-NEXT: lfd f1, 8(r3)
; P8BE-NEXT: lfd f2, 24(r3)
; P8BE-NEXT: lfd f3, 16(r3)
; P8BE-NEXT: xxmrghd vs1, vs1, vs2
; P8BE-NEXT: xxmrghd vs0, vs0, vs3
; P8BE-NEXT: xvcvdpsxws v2, vs1
; P8BE-NEXT: xvcvdpsxws v3, vs0
; P8BE-NEXT: vmrgew v2, v3, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemVarAConvdtoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: sldi r4, r4, 3
; P8LE-NEXT: lfdux f0, r3, r4
; P8LE-NEXT: lfd f1, 16(r3)
; P8LE-NEXT: lfd f2, 8(r3)
; P8LE-NEXT: lfd f3, 24(r3)
; P8LE-NEXT: xxmrghd vs0, vs1, vs0
; P8LE-NEXT: xxmrghd vs1, vs3, vs2
; P8LE-NEXT: xvcvdpsxws v2, vs0
; P8LE-NEXT: xvcvdpsxws v3, vs1
; P8LE-NEXT: vmrgew v2, v3, v2
; P8LE-NEXT: blr
entry:
%idxprom = sext i32 %elem to i64
%arrayidx = getelementptr inbounds double, double* %arr, i64 %idxprom
%0 = load double, double* %arrayidx, align 8
%conv = fptosi double %0 to i32
%vecinit = insertelement <4 x i32> undef, i32 %conv, i32 0
%add = add nsw i32 %elem, 1
%idxprom1 = sext i32 %add to i64
%arrayidx2 = getelementptr inbounds double, double* %arr, i64 %idxprom1
%1 = load double, double* %arrayidx2, align 8
%conv3 = fptosi double %1 to i32
%vecinit4 = insertelement <4 x i32> %vecinit, i32 %conv3, i32 1
%add5 = add nsw i32 %elem, 2
%idxprom6 = sext i32 %add5 to i64
%arrayidx7 = getelementptr inbounds double, double* %arr, i64 %idxprom6
%2 = load double, double* %arrayidx7, align 8
%conv8 = fptosi double %2 to i32
%vecinit9 = insertelement <4 x i32> %vecinit4, i32 %conv8, i32 2
%add10 = add nsw i32 %elem, 3
%idxprom11 = sext i32 %add10 to i64
%arrayidx12 = getelementptr inbounds double, double* %arr, i64 %idxprom11
%3 = load double, double* %arrayidx12, align 8
%conv13 = fptosi double %3 to i32
%vecinit14 = insertelement <4 x i32> %vecinit9, i32 %conv13, i32 3
ret <4 x i32> %vecinit14
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemVarDConvdtoi(double* nocapture readonly %arr, i32 signext %elem) {
; P9BE-LABEL: fromDiffMemVarDConvdtoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: sldi r4, r4, 3
; P9BE-NEXT: lfdux f0, r3, r4
; P9BE-NEXT: lfd f1, -8(r3)
; P9BE-NEXT: lfd f2, -16(r3)
; P9BE-NEXT: lfd f3, -24(r3)
; P9BE-NEXT: xxmrghd vs1, vs1, vs3
; P9BE-NEXT: xxmrghd vs0, vs0, vs2
; P9BE-NEXT: xvcvdpsxws v2, vs1
; P9BE-NEXT: xvcvdpsxws v3, vs0
; P9BE-NEXT: vmrgew v2, v3, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemVarDConvdtoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: sldi r4, r4, 3
; P9LE-NEXT: lfdux f0, r3, r4
; P9LE-NEXT: lfd f2, -16(r3)
; P9LE-NEXT: lfd f1, -8(r3)
; P9LE-NEXT: lfd f3, -24(r3)
; P9LE-NEXT: xxmrghd vs0, vs2, vs0
; P9LE-NEXT: xvcvdpsxws v2, vs0
; P9LE-NEXT: xxmrghd vs0, vs3, vs1
; P9LE-NEXT: xvcvdpsxws v3, vs0
; P9LE-NEXT: vmrgew v2, v3, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemVarDConvdtoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: sldi r4, r4, 3
; P8BE-NEXT: lfdux f0, r3, r4
; P8BE-NEXT: lfd f1, -8(r3)
; P8BE-NEXT: lfd f2, -24(r3)
; P8BE-NEXT: lfd f3, -16(r3)
; P8BE-NEXT: xxmrghd vs1, vs1, vs2
; P8BE-NEXT: xxmrghd vs0, vs0, vs3
; P8BE-NEXT: xvcvdpsxws v2, vs1
; P8BE-NEXT: xvcvdpsxws v3, vs0
; P8BE-NEXT: vmrgew v2, v3, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemVarDConvdtoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: sldi r4, r4, 3
; P8LE-NEXT: lfdux f0, r3, r4
; P8LE-NEXT: lfd f1, -16(r3)
; P8LE-NEXT: lfd f2, -8(r3)
; P8LE-NEXT: lfd f3, -24(r3)
; P8LE-NEXT: xxmrghd vs0, vs1, vs0
; P8LE-NEXT: xxmrghd vs1, vs3, vs2
; P8LE-NEXT: xvcvdpsxws v2, vs0
; P8LE-NEXT: xvcvdpsxws v3, vs1
; P8LE-NEXT: vmrgew v2, v3, v2
; P8LE-NEXT: blr
entry:
%idxprom = sext i32 %elem to i64
%arrayidx = getelementptr inbounds double, double* %arr, i64 %idxprom
%0 = load double, double* %arrayidx, align 8
%conv = fptosi double %0 to i32
%vecinit = insertelement <4 x i32> undef, i32 %conv, i32 0
%sub = add nsw i32 %elem, -1
%idxprom1 = sext i32 %sub to i64
%arrayidx2 = getelementptr inbounds double, double* %arr, i64 %idxprom1
%1 = load double, double* %arrayidx2, align 8
%conv3 = fptosi double %1 to i32
%vecinit4 = insertelement <4 x i32> %vecinit, i32 %conv3, i32 1
%sub5 = add nsw i32 %elem, -2
%idxprom6 = sext i32 %sub5 to i64
%arrayidx7 = getelementptr inbounds double, double* %arr, i64 %idxprom6
%2 = load double, double* %arrayidx7, align 8
%conv8 = fptosi double %2 to i32
%vecinit9 = insertelement <4 x i32> %vecinit4, i32 %conv8, i32 2
%sub10 = add nsw i32 %elem, -3
%idxprom11 = sext i32 %sub10 to i64
%arrayidx12 = getelementptr inbounds double, double* %arr, i64 %idxprom11
%3 = load double, double* %arrayidx12, align 8
%conv13 = fptosi double %3 to i32
%vecinit14 = insertelement <4 x i32> %vecinit9, i32 %conv13, i32 3
ret <4 x i32> %vecinit14
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @spltRegValConvdtoi(double %val) {
; P9BE-LABEL: spltRegValConvdtoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: xscvdpsxws f0, f1
; P9BE-NEXT: xxspltw v2, vs0, 1
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltRegValConvdtoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: xscvdpsxws f0, f1
; P9LE-NEXT: xxspltw v2, vs0, 1
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltRegValConvdtoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: xscvdpsxws f0, f1
; P8BE-NEXT: xxspltw v2, vs0, 1
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltRegValConvdtoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: xscvdpsxws f0, f1
; P8LE-NEXT: xxspltw v2, vs0, 1
; P8LE-NEXT: blr
entry:
%conv = fptosi double %val to i32
%splat.splatinsert = insertelement <4 x i32> undef, i32 %conv, i32 0
%splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
ret <4 x i32> %splat.splat
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @spltMemValConvdtoi(double* nocapture readonly %ptr) {
; P9BE-LABEL: spltMemValConvdtoi:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lfd f0, 0(r3)
; P9BE-NEXT: xscvdpsxws f0, f0
; P9BE-NEXT: xxspltw v2, vs0, 1
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltMemValConvdtoi:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lfd f0, 0(r3)
; P9LE-NEXT: xscvdpsxws f0, f0
; P9LE-NEXT: xxspltw v2, vs0, 1
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltMemValConvdtoi:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: lfdx f0, 0, r3
; P8BE-NEXT: xscvdpsxws f0, f0
; P8BE-NEXT: xxspltw v2, vs0, 1
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltMemValConvdtoi:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: lfdx f0, 0, r3
; P8LE-NEXT: xscvdpsxws f0, f0
; P8LE-NEXT: xxspltw v2, vs0, 1
; P8LE-NEXT: blr
entry:
%0 = load double, double* %ptr, align 8
%conv = fptosi double %0 to i32
%splat.splatinsert = insertelement <4 x i32> undef, i32 %conv, i32 0
%splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
ret <4 x i32> %splat.splat
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @allZeroui() {
; P9BE-LABEL: allZeroui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: xxlxor v2, v2, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: allZeroui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: xxlxor v2, v2, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: allZeroui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: xxlxor v2, v2, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: allZeroui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: xxlxor v2, v2, v2
; P8LE-NEXT: blr
entry:
ret <4 x i32> zeroinitializer
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @spltConst1ui() {
; P9BE-LABEL: spltConst1ui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: vspltisw v2, 1
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltConst1ui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: vspltisw v2, 1
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltConst1ui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: vspltisw v2, 1
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltConst1ui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: vspltisw v2, 1
; P8LE-NEXT: blr
entry:
ret <4 x i32> <i32 1, i32 1, i32 1, i32 1>
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @spltConst16kui() {
; P9BE-LABEL: spltConst16kui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: vspltisw v2, -15
; P9BE-NEXT: vsrw v2, v2, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltConst16kui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: vspltisw v2, -15
; P9LE-NEXT: vsrw v2, v2, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltConst16kui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: vspltisw v2, -15
; P8BE-NEXT: vsrw v2, v2, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltConst16kui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: vspltisw v2, -15
; P8LE-NEXT: vsrw v2, v2, v2
; P8LE-NEXT: blr
entry:
ret <4 x i32> <i32 32767, i32 32767, i32 32767, i32 32767>
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @spltConst32kui() {
; P9BE-LABEL: spltConst32kui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: vspltisw v2, -16
; P9BE-NEXT: vsrw v2, v2, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltConst32kui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: vspltisw v2, -16
; P9LE-NEXT: vsrw v2, v2, v2
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltConst32kui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: vspltisw v2, -16
; P8BE-NEXT: vsrw v2, v2, v2
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltConst32kui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: vspltisw v2, -16
; P8LE-NEXT: vsrw v2, v2, v2
; P8LE-NEXT: blr
entry:
ret <4 x i32> <i32 65535, i32 65535, i32 65535, i32 65535>
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @fromRegsui(i32 zeroext %a, i32 zeroext %b, i32 zeroext %c, i32 zeroext %d) {
; P9BE-LABEL: fromRegsui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: rldimi r6, r5, 32, 0
; P9BE-NEXT: rldimi r4, r3, 32, 0
; P9BE-NEXT: mtvsrdd v2, r4, r6
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromRegsui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: rldimi r3, r4, 32, 0
; P9LE-NEXT: rldimi r5, r6, 32, 0
; P9LE-NEXT: mtvsrdd v2, r5, r3
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromRegsui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: rldimi r6, r5, 32, 0
; P8BE-NEXT: rldimi r4, r3, 32, 0
; P8BE-NEXT: mtvsrd f0, r6
; P8BE-NEXT: mtvsrd f1, r4
; P8BE-NEXT: xxmrghd v2, vs1, vs0
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromRegsui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: rldimi r3, r4, 32, 0
; P8LE-NEXT: rldimi r5, r6, 32, 0
; P8LE-NEXT: mtvsrd f0, r3
; P8LE-NEXT: mtvsrd f1, r5
; P8LE-NEXT: xxmrghd v2, vs1, vs0
; P8LE-NEXT: blr
entry:
%vecinit = insertelement <4 x i32> undef, i32 %a, i32 0
%vecinit1 = insertelement <4 x i32> %vecinit, i32 %b, i32 1
%vecinit2 = insertelement <4 x i32> %vecinit1, i32 %c, i32 2
%vecinit3 = insertelement <4 x i32> %vecinit2, i32 %d, i32 3
ret <4 x i32> %vecinit3
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @fromDiffConstsui() {
; P9BE-LABEL: fromDiffConstsui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: addis r3, r2, .LCPI37_0@toc@ha
; P9BE-NEXT: addi r3, r3, .LCPI37_0@toc@l
; P9BE-NEXT: lxvx v2, 0, r3
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffConstsui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: addis r3, r2, .LCPI37_0@toc@ha
; P9LE-NEXT: addi r3, r3, .LCPI37_0@toc@l
; P9LE-NEXT: lxvx v2, 0, r3
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffConstsui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: addis r3, r2, .LCPI37_0@toc@ha
; P8BE-NEXT: addi r3, r3, .LCPI37_0@toc@l
; P8BE-NEXT: lxvw4x v2, 0, r3
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffConstsui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: addis r3, r2, .LCPI37_0@toc@ha
; P8LE-NEXT: addi r3, r3, .LCPI37_0@toc@l
; P8LE-NEXT: lvx v2, 0, r3
; P8LE-NEXT: blr
entry:
ret <4 x i32> <i32 242, i32 -113, i32 889, i32 19>
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemConsAui(i32* nocapture readonly %arr) {
; P9BE-LABEL: fromDiffMemConsAui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lxv v2, 0(r3)
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemConsAui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lxv v2, 0(r3)
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemConsAui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: lxvw4x v2, 0, r3
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemConsAui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: lxvd2x vs0, 0, r3
; P8LE-NEXT: xxswapd v2, vs0
; P8LE-NEXT: blr
entry:
%0 = load i32, i32* %arr, align 4
%vecinit = insertelement <4 x i32> undef, i32 %0, i32 0
%arrayidx1 = getelementptr inbounds i32, i32* %arr, i64 1
%1 = load i32, i32* %arrayidx1, align 4
%vecinit2 = insertelement <4 x i32> %vecinit, i32 %1, i32 1
%arrayidx3 = getelementptr inbounds i32, i32* %arr, i64 2
%2 = load i32, i32* %arrayidx3, align 4
%vecinit4 = insertelement <4 x i32> %vecinit2, i32 %2, i32 2
%arrayidx5 = getelementptr inbounds i32, i32* %arr, i64 3
%3 = load i32, i32* %arrayidx5, align 4
%vecinit6 = insertelement <4 x i32> %vecinit4, i32 %3, i32 3
ret <4 x i32> %vecinit6
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemConsDui(i32* nocapture readonly %arr) {
; P9BE-LABEL: fromDiffMemConsDui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lxv v2, 0(r3)
; P9BE-NEXT: addis r3, r2, .LCPI39_0@toc@ha
; P9BE-NEXT: addi r3, r3, .LCPI39_0@toc@l
; P9BE-NEXT: lxvx v3, 0, r3
; P9BE-NEXT: vperm v2, v2, v2, v3
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemConsDui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lxvw4x v2, 0, r3
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemConsDui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: addis r4, r2, .LCPI39_0@toc@ha
; P8BE-NEXT: lxvw4x v2, 0, r3
; P8BE-NEXT: addi r4, r4, .LCPI39_0@toc@l
; P8BE-NEXT: lxvw4x v3, 0, r4
; P8BE-NEXT: vperm v2, v2, v2, v3
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemConsDui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: lxvd2x vs0, 0, r3
; P8LE-NEXT: addis r4, r2, .LCPI39_0@toc@ha
; P8LE-NEXT: addi r3, r4, .LCPI39_0@toc@l
; P8LE-NEXT: lvx v2, 0, r3
; P8LE-NEXT: xxswapd v3, vs0
; P8LE-NEXT: vperm v2, v3, v3, v2
; P8LE-NEXT: blr
entry:
%arrayidx = getelementptr inbounds i32, i32* %arr, i64 3
%0 = load i32, i32* %arrayidx, align 4
%vecinit = insertelement <4 x i32> undef, i32 %0, i32 0
%arrayidx1 = getelementptr inbounds i32, i32* %arr, i64 2
%1 = load i32, i32* %arrayidx1, align 4
%vecinit2 = insertelement <4 x i32> %vecinit, i32 %1, i32 1
%arrayidx3 = getelementptr inbounds i32, i32* %arr, i64 1
%2 = load i32, i32* %arrayidx3, align 4
%vecinit4 = insertelement <4 x i32> %vecinit2, i32 %2, i32 2
%3 = load i32, i32* %arr, align 4
%vecinit6 = insertelement <4 x i32> %vecinit4, i32 %3, i32 3
ret <4 x i32> %vecinit6
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemVarAui(i32* nocapture readonly %arr, i32 signext %elem) {
; P9BE-LABEL: fromDiffMemVarAui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: sldi r4, r4, 2
; P9BE-NEXT: lxvx v2, r3, r4
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemVarAui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: sldi r4, r4, 2
; P9LE-NEXT: lxvx v2, r3, r4
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemVarAui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: sldi r4, r4, 2
; P8BE-NEXT: lxvw4x v2, r3, r4
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemVarAui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: sldi r4, r4, 2
; P8LE-NEXT: lxvd2x vs0, r3, r4
; P8LE-NEXT: xxswapd v2, vs0
; P8LE-NEXT: blr
entry:
%idxprom = sext i32 %elem to i64
%arrayidx = getelementptr inbounds i32, i32* %arr, i64 %idxprom
%0 = load i32, i32* %arrayidx, align 4
%vecinit = insertelement <4 x i32> undef, i32 %0, i32 0
%add = add nsw i32 %elem, 1
%idxprom1 = sext i32 %add to i64
%arrayidx2 = getelementptr inbounds i32, i32* %arr, i64 %idxprom1
%1 = load i32, i32* %arrayidx2, align 4
%vecinit3 = insertelement <4 x i32> %vecinit, i32 %1, i32 1
%add4 = add nsw i32 %elem, 2
%idxprom5 = sext i32 %add4 to i64
%arrayidx6 = getelementptr inbounds i32, i32* %arr, i64 %idxprom5
%2 = load i32, i32* %arrayidx6, align 4
%vecinit7 = insertelement <4 x i32> %vecinit3, i32 %2, i32 2
%add8 = add nsw i32 %elem, 3
%idxprom9 = sext i32 %add8 to i64
%arrayidx10 = getelementptr inbounds i32, i32* %arr, i64 %idxprom9
%3 = load i32, i32* %arrayidx10, align 4
%vecinit11 = insertelement <4 x i32> %vecinit7, i32 %3, i32 3
ret <4 x i32> %vecinit11
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromDiffMemVarDui(i32* nocapture readonly %arr, i32 signext %elem) {
; P9BE-LABEL: fromDiffMemVarDui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: sldi r4, r4, 2
; P9BE-NEXT: add r3, r3, r4
; P9BE-NEXT: addi r3, r3, -12
; P9BE-NEXT: lxvx v2, 0, r3
; P9BE-NEXT: addis r3, r2, .LCPI41_0@toc@ha
; P9BE-NEXT: addi r3, r3, .LCPI41_0@toc@l
; P9BE-NEXT: lxvx v3, 0, r3
; P9BE-NEXT: vperm v2, v2, v2, v3
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromDiffMemVarDui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: sldi r4, r4, 2
; P9LE-NEXT: add r3, r3, r4
; P9LE-NEXT: addi r3, r3, -12
; P9LE-NEXT: lxvx v2, 0, r3
; P9LE-NEXT: addis r3, r2, .LCPI41_0@toc@ha
; P9LE-NEXT: addi r3, r3, .LCPI41_0@toc@l
; P9LE-NEXT: lxvx v3, 0, r3
; P9LE-NEXT: vperm v2, v2, v2, v3
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromDiffMemVarDui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: sldi r4, r4, 2
; P8BE-NEXT: addis r5, r2, .LCPI41_0@toc@ha
; P8BE-NEXT: add r3, r3, r4
; P8BE-NEXT: addi r4, r5, .LCPI41_0@toc@l
; P8BE-NEXT: addi r3, r3, -12
; P8BE-NEXT: lxvw4x v3, 0, r4
; P8BE-NEXT: lxvw4x v2, 0, r3
; P8BE-NEXT: vperm v2, v2, v2, v3
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromDiffMemVarDui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: sldi r4, r4, 2
; P8LE-NEXT: addis r5, r2, .LCPI41_0@toc@ha
; P8LE-NEXT: add r3, r3, r4
; P8LE-NEXT: addi r3, r3, -12
; P8LE-NEXT: lxvd2x vs0, 0, r3
; P8LE-NEXT: addi r3, r5, .LCPI41_0@toc@l
; P8LE-NEXT: lvx v3, 0, r3
; P8LE-NEXT: xxswapd v2, vs0
; P8LE-NEXT: vperm v2, v2, v2, v3
; P8LE-NEXT: blr
entry:
%idxprom = sext i32 %elem to i64
%arrayidx = getelementptr inbounds i32, i32* %arr, i64 %idxprom
%0 = load i32, i32* %arrayidx, align 4
%vecinit = insertelement <4 x i32> undef, i32 %0, i32 0
%sub = add nsw i32 %elem, -1
%idxprom1 = sext i32 %sub to i64
%arrayidx2 = getelementptr inbounds i32, i32* %arr, i64 %idxprom1
%1 = load i32, i32* %arrayidx2, align 4
%vecinit3 = insertelement <4 x i32> %vecinit, i32 %1, i32 1
%sub4 = add nsw i32 %elem, -2
%idxprom5 = sext i32 %sub4 to i64
%arrayidx6 = getelementptr inbounds i32, i32* %arr, i64 %idxprom5
%2 = load i32, i32* %arrayidx6, align 4
%vecinit7 = insertelement <4 x i32> %vecinit3, i32 %2, i32 2
%sub8 = add nsw i32 %elem, -3
%idxprom9 = sext i32 %sub8 to i64
%arrayidx10 = getelementptr inbounds i32, i32* %arr, i64 %idxprom9
%3 = load i32, i32* %arrayidx10, align 4
%vecinit11 = insertelement <4 x i32> %vecinit7, i32 %3, i32 3
ret <4 x i32> %vecinit11
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromRandMemConsui(i32* nocapture readonly %arr) {
; P9BE-LABEL: fromRandMemConsui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lwz r4, 16(r3)
; P9BE-NEXT: lwz r5, 72(r3)
; P9BE-NEXT: lwz r6, 8(r3)
; P9BE-NEXT: lwz r3, 352(r3)
; P9BE-NEXT: rldimi r3, r6, 32, 0
; P9BE-NEXT: rldimi r5, r4, 32, 0
; P9BE-NEXT: mtvsrdd v2, r5, r3
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromRandMemConsui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lwz r4, 16(r3)
; P9LE-NEXT: lwz r5, 72(r3)
; P9LE-NEXT: lwz r6, 8(r3)
; P9LE-NEXT: lwz r3, 352(r3)
; P9LE-NEXT: rldimi r4, r5, 32, 0
; P9LE-NEXT: rldimi r6, r3, 32, 0
; P9LE-NEXT: mtvsrdd v2, r6, r4
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromRandMemConsui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: lwz r4, 8(r3)
; P8BE-NEXT: lwz r5, 352(r3)
; P8BE-NEXT: lwz r6, 16(r3)
; P8BE-NEXT: lwz r3, 72(r3)
; P8BE-NEXT: rldimi r5, r4, 32, 0
; P8BE-NEXT: rldimi r3, r6, 32, 0
; P8BE-NEXT: mtvsrd f0, r5
; P8BE-NEXT: mtvsrd f1, r3
; P8BE-NEXT: xxmrghd v2, vs1, vs0
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromRandMemConsui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: lwz r4, 16(r3)
; P8LE-NEXT: lwz r5, 72(r3)
; P8LE-NEXT: lwz r6, 8(r3)
; P8LE-NEXT: lwz r3, 352(r3)
; P8LE-NEXT: rldimi r4, r5, 32, 0
; P8LE-NEXT: rldimi r6, r3, 32, 0
; P8LE-NEXT: mtvsrd f0, r4
; P8LE-NEXT: mtvsrd f1, r6
; P8LE-NEXT: xxmrghd v2, vs1, vs0
; P8LE-NEXT: blr
entry:
%arrayidx = getelementptr inbounds i32, i32* %arr, i64 4
%0 = load i32, i32* %arrayidx, align 4
%vecinit = insertelement <4 x i32> undef, i32 %0, i32 0
%arrayidx1 = getelementptr inbounds i32, i32* %arr, i64 18
%1 = load i32, i32* %arrayidx1, align 4
%vecinit2 = insertelement <4 x i32> %vecinit, i32 %1, i32 1
%arrayidx3 = getelementptr inbounds i32, i32* %arr, i64 2
%2 = load i32, i32* %arrayidx3, align 4
%vecinit4 = insertelement <4 x i32> %vecinit2, i32 %2, i32 2
%arrayidx5 = getelementptr inbounds i32, i32* %arr, i64 88
%3 = load i32, i32* %arrayidx5, align 4
%vecinit6 = insertelement <4 x i32> %vecinit4, i32 %3, i32 3
ret <4 x i32> %vecinit6
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @fromRandMemVarui(i32* nocapture readonly %arr, i32 signext %elem) {
; P9BE-LABEL: fromRandMemVarui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: sldi r4, r4, 2
; P9BE-NEXT: add r3, r3, r4
; P9BE-NEXT: lwz r4, 16(r3)
; P9BE-NEXT: lwz r5, 4(r3)
; P9BE-NEXT: lwz r6, 8(r3)
; P9BE-NEXT: lwz r3, 32(r3)
; P9BE-NEXT: rldimi r3, r6, 32, 0
; P9BE-NEXT: rldimi r5, r4, 32, 0
; P9BE-NEXT: mtvsrdd v2, r5, r3
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromRandMemVarui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: sldi r4, r4, 2
; P9LE-NEXT: add r3, r3, r4
; P9LE-NEXT: lwz r4, 16(r3)
; P9LE-NEXT: lwz r5, 4(r3)
; P9LE-NEXT: lwz r6, 8(r3)
; P9LE-NEXT: lwz r3, 32(r3)
; P9LE-NEXT: rldimi r4, r5, 32, 0
; P9LE-NEXT: rldimi r6, r3, 32, 0
; P9LE-NEXT: mtvsrdd v2, r6, r4
; P9LE-NEXT: blr
;
; P8BE-LABEL: fromRandMemVarui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: sldi r4, r4, 2
; P8BE-NEXT: add r3, r3, r4
; P8BE-NEXT: lwz r4, 8(r3)
; P8BE-NEXT: lwz r5, 32(r3)
; P8BE-NEXT: lwz r6, 16(r3)
; P8BE-NEXT: lwz r3, 4(r3)
; P8BE-NEXT: rldimi r5, r4, 32, 0
; P8BE-NEXT: rldimi r3, r6, 32, 0
; P8BE-NEXT: mtvsrd f0, r5
; P8BE-NEXT: mtvsrd f1, r3
; P8BE-NEXT: xxmrghd v2, vs1, vs0
; P8BE-NEXT: blr
;
; P8LE-LABEL: fromRandMemVarui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: sldi r4, r4, 2
; P8LE-NEXT: add r3, r3, r4
; P8LE-NEXT: lwz r4, 16(r3)
; P8LE-NEXT: lwz r5, 4(r3)
; P8LE-NEXT: lwz r6, 8(r3)
; P8LE-NEXT: lwz r3, 32(r3)
; P8LE-NEXT: rldimi r4, r5, 32, 0
; P8LE-NEXT: rldimi r6, r3, 32, 0
; P8LE-NEXT: mtvsrd f0, r4
; P8LE-NEXT: mtvsrd f1, r6
; P8LE-NEXT: xxmrghd v2, vs1, vs0
; P8LE-NEXT: blr
entry:
%add = add nsw i32 %elem, 4
%idxprom = sext i32 %add to i64
%arrayidx = getelementptr inbounds i32, i32* %arr, i64 %idxprom
%0 = load i32, i32* %arrayidx, align 4
%vecinit = insertelement <4 x i32> undef, i32 %0, i32 0
%add1 = add nsw i32 %elem, 1
%idxprom2 = sext i32 %add1 to i64
%arrayidx3 = getelementptr inbounds i32, i32* %arr, i64 %idxprom2
%1 = load i32, i32* %arrayidx3, align 4
%vecinit4 = insertelement <4 x i32> %vecinit, i32 %1, i32 1
%add5 = add nsw i32 %elem, 2
%idxprom6 = sext i32 %add5 to i64
%arrayidx7 = getelementptr inbounds i32, i32* %arr, i64 %idxprom6
%2 = load i32, i32* %arrayidx7, align 4
%vecinit8 = insertelement <4 x i32> %vecinit4, i32 %2, i32 2
%add9 = add nsw i32 %elem, 8
%idxprom10 = sext i32 %add9 to i64
%arrayidx11 = getelementptr inbounds i32, i32* %arr, i64 %idxprom10
%3 = load i32, i32* %arrayidx11, align 4
%vecinit12 = insertelement <4 x i32> %vecinit8, i32 %3, i32 3
ret <4 x i32> %vecinit12
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @spltRegValui(i32 zeroext %val) {
; P9BE-LABEL: spltRegValui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: mtvsrws v2, r3
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltRegValui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: mtvsrws v2, r3
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltRegValui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: mtvsrwz f0, r3
; P8BE-NEXT: xxspltw v2, vs0, 1
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltRegValui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: mtvsrwz f0, r3
; P8LE-NEXT: xxspltw v2, vs0, 1
; P8LE-NEXT: blr
entry:
%splat.splatinsert = insertelement <4 x i32> undef, i32 %val, i32 0
%splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
ret <4 x i32> %splat.splat
}
; Function Attrs: norecurse nounwind readonly
define <4 x i32> @spltMemValui(i32* nocapture readonly %ptr) {
; P9BE-LABEL: spltMemValui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: lxvwsx v2, 0, r3
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltMemValui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: lxvwsx v2, 0, r3
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltMemValui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: lfiwzx f0, 0, r3
; P8BE-NEXT: xxsldwi vs0, f0, f0, 1
; P8BE-NEXT: xxspltw v2, vs0, 0
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltMemValui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: lfiwzx f0, 0, r3
; P8LE-NEXT: xxpermdi vs0, f0, f0, 2
; P8LE-NEXT: xxspltw v2, vs0, 3
; P8LE-NEXT: blr
entry:
%0 = load i32, i32* %ptr, align 4
%splat.splatinsert = insertelement <4 x i32> undef, i32 %0, i32 0
%splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
ret <4 x i32> %splat.splat
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @spltCnstConvftoui() {
; P9BE-LABEL: spltCnstConvftoui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: vspltisw v2, 4
; P9BE-NEXT: blr
;
; P9LE-LABEL: spltCnstConvftoui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: vspltisw v2, 4
; P9LE-NEXT: blr
;
; P8BE-LABEL: spltCnstConvftoui:
; P8BE: # %bb.0: # %entry
; P8BE-NEXT: vspltisw v2, 4
; P8BE-NEXT: blr
;
; P8LE-LABEL: spltCnstConvftoui:
; P8LE: # %bb.0: # %entry
; P8LE-NEXT: vspltisw v2, 4
; P8LE-NEXT: blr
entry:
ret <4 x i32> <i32 4, i32 4, i32 4, i32 4>
}
; Function Attrs: norecurse nounwind readnone
define <4 x i32> @fromRegsConvftoui(float %a, float %b, float %c, float %d) {
; P9BE-LABEL: fromRegsConvftoui:
; P9BE: # %bb.0: # %entry
; P9BE-NEXT: # kill: def $f4 killed $f4 def $vsl4
; P9BE-NEXT: # kill: def $f2 killed $f2 def $vsl2
; P9BE-NEXT: xxmrghd vs0, vs2, vs4
; P9BE-NEXT: # kill: def $f3 killed $f3 def $vsl3
; P9BE-NEXT: # kill: def $f1 killed $f1 def $vsl1
; P9BE-NEXT: xvcvdpuxws v2, vs0
; P9BE-NEXT: xxmrghd vs0, vs1, vs3
; P9BE-NEXT: xvcvdpuxws v3, vs0
; P9BE-NEXT: vmrgew v2, v3, v2
; P9BE-NEXT: blr
;
; P9LE-LABEL: fromRegsConvftoui:
; P9LE: # %bb.0: # %entry
; P9LE-NEXT: # kill: def $f3 killed $f3 def $vsl3
; P9LE-NEXT: # kill: def $f1 killed $f1 def $vsl1
; P9LE-NEXT: xxmrghd vs0, vs3, vs1
; P9LE-NEXT: # kill: def $f4 killed $f4 def $vsl4
; P9LE-NEXT: # kill: def $f2 killed $f2 def $vsl2