From 3dce35b32e8e516a3956137ff1229983845088af Mon Sep 17 00:00:00 2001 From: Kelvin Nilsen Date: Tue, 16 Jan 2018 22:14:27 +0000 Subject: [PATCH] rs6000-p8swap.c (rs6000_gen_stvx): Generate different rtl trees depending on TARGET_64BIT. gcc/ChangeLog: 2018-01-16 Kelvin Nilsen * config/rs6000/rs6000-p8swap.c (rs6000_gen_stvx): Generate different rtl trees depending on TARGET_64BIT. (rs6000_gen_lvx): Likewise. From-SVN: r256762 --- gcc/ChangeLog | 6 ++ gcc/config/rs6000/rs6000-p8swap.c | 128 ++++++++++++++++++++++-------- 2 files changed, 102 insertions(+), 32 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 194f975d432..a4fa75c773f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-01-16 Kelvin Nilsen + + * config/rs6000/rs6000-p8swap.c (rs6000_gen_stvx): Generate + different rtl trees depending on TARGET_64BIT. + (rs6000_gen_lvx): Likewise. + 2018-01-16 Eric Botcazou * config/visium/visium.md (nop): Tweak comment. diff --git a/gcc/config/rs6000/rs6000-p8swap.c b/gcc/config/rs6000/rs6000-p8swap.c index 876f339a79e..a4322962d23 100644 --- a/gcc/config/rs6000/rs6000-p8swap.c +++ b/gcc/config/rs6000/rs6000-p8swap.c @@ -1554,23 +1554,39 @@ rs6000_gen_stvx (enum machine_mode mode, rtx dest_exp, rtx src_exp) op1 = XEXP (memory_address, 0); op2 = XEXP (memory_address, 1); if (mode == V16QImode) - stvx = gen_altivec_stvx_v16qi_2op (src_exp, op1, op2); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v16qi_2op (src_exp, op1, op2) + : gen_altivec_stvx_v16qi_2op_si (src_exp, op1, op2); else if (mode == V8HImode) - stvx = gen_altivec_stvx_v8hi_2op (src_exp, op1, op2); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v8hi_2op (src_exp, op1, op2) + : gen_altivec_stvx_v8hi_2op_si (src_exp, op1, op2); #ifdef HAVE_V8HFmode else if (mode == V8HFmode) - stvx = gen_altivec_stvx_v8hf_2op (src_exp, op1, op2); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v8hf_2op (src_exp, op1, op2) + : gen_altivec_stvx_v8hf_2op_si (src_exp, op1, op2); #endif else if (mode == V4SImode) - stvx = gen_altivec_stvx_v4si_2op (src_exp, op1, op2); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v4si_2op (src_exp, op1, op2) + : gen_altivec_stvx_v4si_2op_si (src_exp, op1, op2); else if (mode == V4SFmode) - stvx = gen_altivec_stvx_v4sf_2op (src_exp, op1, op2); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v4sf_2op (src_exp, op1, op2) + : gen_altivec_stvx_v4sf_2op_si (src_exp, op1, op2); else if (mode == V2DImode) - stvx = gen_altivec_stvx_v2di_2op (src_exp, op1, op2); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v2di_2op (src_exp, op1, op2) + : gen_altivec_stvx_v2di_2op_si (src_exp, op1, op2); else if (mode == V2DFmode) - stvx = gen_altivec_stvx_v2df_2op (src_exp, op1, op2); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v2df_2op (src_exp, op1, op2) + : gen_altivec_stvx_v2df_2op_si (src_exp, op1, op2); else if (mode == V1TImode) - stvx = gen_altivec_stvx_v1ti_2op (src_exp, op1, op2); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v1ti_2op (src_exp, op1, op2) + : gen_altivec_stvx_v1ti_2op_si (src_exp, op1, op2); else /* KFmode, TFmode, other modes not expected in this context. */ gcc_unreachable (); @@ -1578,23 +1594,39 @@ rs6000_gen_stvx (enum machine_mode mode, rtx dest_exp, rtx src_exp) else /* REG_P (memory_address) */ { if (mode == V16QImode) - stvx = gen_altivec_stvx_v16qi_1op (src_exp, memory_address); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v16qi_1op (src_exp, memory_address) + : gen_altivec_stvx_v16qi_1op_si (src_exp, memory_address); else if (mode == V8HImode) - stvx = gen_altivec_stvx_v8hi_1op (src_exp, memory_address); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v8hi_1op (src_exp, memory_address) + : gen_altivec_stvx_v8hi_1op_si (src_exp, memory_address); #ifdef HAVE_V8HFmode else if (mode == V8HFmode) - stvx = gen_altivec_stvx_v8hf_1op (src_exp, memory_address); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v8hf_1op (src_exp, memory_address) + : gen_altivec_stvx_v8hf_1op_si (src_exp, memory_address); #endif else if (mode == V4SImode) - stvx = gen_altivec_stvx_v4si_1op (src_exp, memory_address); + stvx =TARGET_64BIT + ? gen_altivec_stvx_v4si_1op (src_exp, memory_address) + : gen_altivec_stvx_v4si_1op_si (src_exp, memory_address); else if (mode == V4SFmode) - stvx = gen_altivec_stvx_v4sf_1op (src_exp, memory_address); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v4sf_1op (src_exp, memory_address) + : gen_altivec_stvx_v4sf_1op_si (src_exp, memory_address); else if (mode == V2DImode) - stvx = gen_altivec_stvx_v2di_1op (src_exp, memory_address); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v2di_1op (src_exp, memory_address) + : gen_altivec_stvx_v2di_1op_si (src_exp, memory_address); else if (mode == V2DFmode) - stvx = gen_altivec_stvx_v2df_1op (src_exp, memory_address); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v2df_1op (src_exp, memory_address) + : gen_altivec_stvx_v2df_1op_si (src_exp, memory_address); else if (mode == V1TImode) - stvx = gen_altivec_stvx_v1ti_1op (src_exp, memory_address); + stvx = TARGET_64BIT + ? gen_altivec_stvx_v1ti_1op (src_exp, memory_address) + : gen_altivec_stvx_v1ti_1op_si (src_exp, memory_address); else /* KFmode, TFmode, other modes not expected in this context. */ gcc_unreachable (); @@ -1702,23 +1734,39 @@ rs6000_gen_lvx (enum machine_mode mode, rtx dest_exp, rtx src_exp) op2 = XEXP (memory_address, 1); if (mode == V16QImode) - lvx = gen_altivec_lvx_v16qi_2op (dest_exp, op1, op2); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v16qi_2op (dest_exp, op1, op2) + : gen_altivec_lvx_v16qi_2op_si (dest_exp, op1, op2); else if (mode == V8HImode) - lvx = gen_altivec_lvx_v8hi_2op (dest_exp, op1, op2); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v8hi_2op (dest_exp, op1, op2) + : gen_altivec_lvx_v8hi_2op_si (dest_exp, op1, op2); #ifdef HAVE_V8HFmode else if (mode == V8HFmode) - lvx = gen_altivec_lvx_v8hf_2op (dest_exp, op1, op2); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v8hf_2op (dest_exp, op1, op2) + : gen_altivec_lvx_v8hf_2op_si (dest_exp, op1, op2); #endif else if (mode == V4SImode) - lvx = gen_altivec_lvx_v4si_2op (dest_exp, op1, op2); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v4si_2op (dest_exp, op1, op2) + : gen_altivec_lvx_v4si_2op_si (dest_exp, op1, op2); else if (mode == V4SFmode) - lvx = gen_altivec_lvx_v4sf_2op (dest_exp, op1, op2); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v4sf_2op (dest_exp, op1, op2) + : gen_altivec_lvx_v4sf_2op_si (dest_exp, op1, op2); else if (mode == V2DImode) - lvx = gen_altivec_lvx_v2di_2op (dest_exp, op1, op2); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v2di_2op (dest_exp, op1, op2) + : gen_altivec_lvx_v2di_2op_si (dest_exp, op1, op2); else if (mode == V2DFmode) - lvx = gen_altivec_lvx_v2df_2op (dest_exp, op1, op2); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v2df_2op (dest_exp, op1, op2) + : gen_altivec_lvx_v2df_2op_si (dest_exp, op1, op2); else if (mode == V1TImode) - lvx = gen_altivec_lvx_v1ti_2op (dest_exp, op1, op2); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v1ti_2op (dest_exp, op1, op2) + : gen_altivec_lvx_v1ti_2op_si (dest_exp, op1, op2); else /* KFmode, TFmode, other modes not expected in this context. */ gcc_unreachable (); @@ -1726,23 +1774,39 @@ rs6000_gen_lvx (enum machine_mode mode, rtx dest_exp, rtx src_exp) else /* REG_P (memory_address) */ { if (mode == V16QImode) - lvx = gen_altivec_lvx_v16qi_1op (dest_exp, memory_address); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v16qi_1op (dest_exp, memory_address) + : gen_altivec_lvx_v16qi_1op_si (dest_exp, memory_address); else if (mode == V8HImode) - lvx = gen_altivec_lvx_v8hi_1op (dest_exp, memory_address); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v8hi_1op (dest_exp, memory_address) + : gen_altivec_lvx_v8hi_1op_si (dest_exp, memory_address); #ifdef HAVE_V8HFmode else if (mode == V8HFmode) - lvx = gen_altivec_lvx_v8hf_1op (dest_exp, memory_address); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v8hf_1op (dest_exp, memory_address) + : gen_altivec_lvx_v8hf_1op_si (dest_exp, memory_address); #endif else if (mode == V4SImode) - lvx = gen_altivec_lvx_v4si_1op (dest_exp, memory_address); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v4si_1op (dest_exp, memory_address) + : gen_altivec_lvx_v4si_1op_si (dest_exp, memory_address); else if (mode == V4SFmode) - lvx = gen_altivec_lvx_v4sf_1op (dest_exp, memory_address); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v4sf_1op (dest_exp, memory_address) + : gen_altivec_lvx_v4sf_1op_si (dest_exp, memory_address); else if (mode == V2DImode) - lvx = gen_altivec_lvx_v2di_1op (dest_exp, memory_address); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v2di_1op (dest_exp, memory_address) + : gen_altivec_lvx_v2di_1op_si (dest_exp, memory_address); else if (mode == V2DFmode) - lvx = gen_altivec_lvx_v2df_1op (dest_exp, memory_address); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v2df_1op (dest_exp, memory_address) + : gen_altivec_lvx_v2df_1op_si (dest_exp, memory_address); else if (mode == V1TImode) - lvx = gen_altivec_lvx_v1ti_1op (dest_exp, memory_address); + lvx = TARGET_64BIT + ? gen_altivec_lvx_v1ti_1op (dest_exp, memory_address) + : gen_altivec_lvx_v1ti_1op_si (dest_exp, memory_address); else /* KFmode, TFmode, other modes not expected in this context. */ gcc_unreachable (); -- 2.30.2