From 493bb3d0d1db7ec1dccd4edb51f9911ba09754ee Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 29 Nov 2018 15:15:00 +1030 Subject: [PATCH] [RS6000] Replace TLSmode with P, and correct tls call mems There is really no need to define a TLSmode mode iterator that is identical (since !TARGET_64BIT == TARGET_32BIT) to the much used P mode iterator. It's nonsense to think we might ever want to support 32-bit TLS on 64-bit or vice versa! The patch also fixes a minor error in the call mems. All other direct calls use (call (mem:SI ..)). * config/rs6000/rs6000.md (TLSmode): Delete mode iterator. Replace with P throughout except for call mems which should use SI. (tls_abi_suffix, tls_sysv_suffix, tls_insn_suffix): Delete mode attributes. Replace with bits, mode and ptrload respectively. From-SVN: r266602 --- gcc/ChangeLog | 7 + gcc/config/rs6000/rs6000.md | 406 ++++++++++++++++++------------------ 2 files changed, 207 insertions(+), 206 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 85ae1d95c1f..3c9c0b450e1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-11-29 Alan Modra + + * config/rs6000/rs6000.md (TLSmode): Delete mode iterator. Replace + with P throughout except for call mems which should use SI. + (tls_abi_suffix, tls_sysv_suffix, tls_insn_suffix): Delete mode + attributes. Replace with bits, mode and ptrload respectively. + 2018-11-29 Alan Modra * config/rs6000/rs6000-protos.h (rs6000_indirect_call_template), diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index c918b04e64b..81914a99c90 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -9422,19 +9422,13 @@ ;; TLS support. -;; Mode attributes for different ABIs. -(define_mode_iterator TLSmode [(SI "! TARGET_64BIT") (DI "TARGET_64BIT")]) -(define_mode_attr tls_abi_suffix [(SI "32") (DI "64")]) -(define_mode_attr tls_sysv_suffix [(SI "si") (DI "di")]) -(define_mode_attr tls_insn_suffix [(SI "wz") (DI "d")]) - -(define_insn_and_split "tls_gd_aix" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (call (mem:TLSmode (match_operand:TLSmode 3 "symbol_ref_operand" "s")) +(define_insn_and_split "tls_gd_aix" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (call (mem:SI (match_operand:P 3 "symbol_ref_operand" "s")) (match_operand 4 "" "g"))) - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGD) + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGD) (clobber (reg:SI LR_REGNO))] "HAVE_AS_TLS && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)" { @@ -9447,28 +9441,28 @@ } "&& TARGET_TLS_MARKERS" [(set (match_dup 0) - (unspec:TLSmode [(match_dup 1) - (match_dup 2)] - UNSPEC_TLSGD)) + (unspec:P [(match_dup 1) + (match_dup 2)] + UNSPEC_TLSGD)) (parallel [(set (match_dup 0) - (call (mem:TLSmode (match_dup 3)) - (match_dup 4))) - (unspec:TLSmode [(match_dup 2)] UNSPEC_TLSGD) + (call (mem:SI (match_dup 3)) + (match_dup 4))) + (unspec:P [(match_dup 2)] UNSPEC_TLSGD) (clobber (reg:SI LR_REGNO))])] "" [(set_attr "type" "two") (set (attr "length") (if_then_else (ne (symbol_ref "TARGET_CMODEL") (symbol_ref "CMODEL_SMALL")) - (const_int 16) - (const_int 12)))]) + (const_int 16) + (const_int 12)))]) -(define_insn_and_split "tls_gd_sysv" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (call (mem:TLSmode (match_operand:TLSmode 3 "symbol_ref_operand" "s")) +(define_insn_and_split "tls_gd_sysv" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (call (mem:SI (match_operand:P 3 "symbol_ref_operand" "s")) (match_operand 4 "" "g"))) - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGD) + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGD) (clobber (reg:SI LR_REGNO))] "HAVE_AS_TLS && DEFAULT_ABI == ABI_V4" { @@ -9477,64 +9471,64 @@ } "&& TARGET_TLS_MARKERS" [(set (match_dup 0) - (unspec:TLSmode [(match_dup 1) - (match_dup 2)] - UNSPEC_TLSGD)) + (unspec:P [(match_dup 1) + (match_dup 2)] + UNSPEC_TLSGD)) (parallel [(set (match_dup 0) - (call (mem:TLSmode (match_dup 3)) - (match_dup 4))) - (unspec:TLSmode [(match_dup 2)] UNSPEC_TLSGD) + (call (mem:SI (match_dup 3)) + (match_dup 4))) + (unspec:P [(match_dup 2)] UNSPEC_TLSGD) (clobber (reg:SI LR_REGNO))])] "" [(set_attr "type" "two") (set_attr "length" "8")]) -(define_insn_and_split "*tls_gd" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGD))] +(define_insn_and_split "*tls_gd" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGD))] "HAVE_AS_TLS && TARGET_TLS_MARKERS" "addi %0,%1,%2@got@tlsgd" "&& TARGET_CMODEL != CMODEL_SMALL" [(set (match_dup 3) - (high:TLSmode - (unspec:TLSmode [(match_dup 1) (match_dup 2)] UNSPEC_TLSGD))) + (high:P + (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_TLSGD))) (set (match_dup 0) - (lo_sum:TLSmode (match_dup 3) - (unspec:TLSmode [(match_dup 1) (match_dup 2)] UNSPEC_TLSGD)))] + (lo_sum:P (match_dup 3) + (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_TLSGD)))] { operands[3] = gen_reg_rtx (TARGET_64BIT ? DImode : SImode); } [(set (attr "length") (if_then_else (ne (symbol_ref "TARGET_CMODEL") (symbol_ref "CMODEL_SMALL")) - (const_int 8) - (const_int 4)))]) - -(define_insn "*tls_gd_high" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (high:TLSmode - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGD)))] + (const_int 8) + (const_int 4)))]) + +(define_insn "*tls_gd_high" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (high:P + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGD)))] "HAVE_AS_TLS && TARGET_TLS_MARKERS && TARGET_CMODEL != CMODEL_SMALL" "addis %0,%1,%2@got@tlsgd@ha") -(define_insn "*tls_gd_low" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (lo_sum:TLSmode (match_operand:TLSmode 1 "gpc_reg_operand" "b") - (unspec:TLSmode [(match_operand:TLSmode 3 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGD)))] +(define_insn "*tls_gd_low" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (lo_sum:P (match_operand:P 1 "gpc_reg_operand" "b") + (unspec:P [(match_operand:P 3 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGD)))] "HAVE_AS_TLS && TARGET_TLS_MARKERS && TARGET_CMODEL != CMODEL_SMALL" "addi %0,%1,%2@got@tlsgd@l") -(define_insn "*tls_gd_call_aix" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (call (mem:TLSmode (match_operand:TLSmode 1 "symbol_ref_operand" "s")) +(define_insn "*tls_gd_call_aix" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (call (mem:SI (match_operand:P 1 "symbol_ref_operand" "s")) (match_operand 2 "" "g"))) - (unspec:TLSmode [(match_operand:TLSmode 3 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGD) + (unspec:P [(match_operand:P 3 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGD) (clobber (reg:SI LR_REGNO))] "HAVE_AS_TLS && TARGET_TLS_MARKERS && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)" @@ -9544,12 +9538,12 @@ [(set_attr "type" "branch") (set_attr "length" "8")]) -(define_insn "*tls_gd_call_sysv" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (call (mem:TLSmode (match_operand:TLSmode 1 "symbol_ref_operand" "s")) +(define_insn "*tls_gd_call_sysv" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (call (mem:SI (match_operand:P 1 "symbol_ref_operand" "s")) (match_operand 2 "" "g"))) - (unspec:TLSmode [(match_operand:TLSmode 3 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGD) + (unspec:P [(match_operand:P 3 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGD) (clobber (reg:SI LR_REGNO))] "HAVE_AS_TLS && DEFAULT_ABI == ABI_V4 && TARGET_TLS_MARKERS" { @@ -9557,12 +9551,12 @@ } [(set_attr "type" "branch")]) -(define_insn_and_split "tls_ld_aix" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (call (mem:TLSmode (match_operand:TLSmode 2 "symbol_ref_operand" "s")) +(define_insn_and_split "tls_ld_aix" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (call (mem:SI (match_operand:P 2 "symbol_ref_operand" "s")) (match_operand 3 "" "g"))) - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b")] - UNSPEC_TLSLD) + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b")] + UNSPEC_TLSLD) (clobber (reg:SI LR_REGNO))] "HAVE_AS_TLS && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)" { @@ -9575,26 +9569,26 @@ } "&& TARGET_TLS_MARKERS" [(set (match_dup 0) - (unspec:TLSmode [(match_dup 1)] - UNSPEC_TLSLD)) + (unspec:P [(match_dup 1)] + UNSPEC_TLSLD)) (parallel [(set (match_dup 0) - (call (mem:TLSmode (match_dup 2)) - (match_dup 3))) - (unspec:TLSmode [(const_int 0)] UNSPEC_TLSLD) + (call (mem:SI (match_dup 2)) + (match_dup 3))) + (unspec:P [(const_int 0)] UNSPEC_TLSLD) (clobber (reg:SI LR_REGNO))])] "" [(set_attr "type" "two") (set (attr "length") (if_then_else (ne (symbol_ref "TARGET_CMODEL") (symbol_ref "CMODEL_SMALL")) - (const_int 16) - (const_int 12)))]) + (const_int 16) + (const_int 12)))]) -(define_insn_and_split "tls_ld_sysv" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (call (mem:TLSmode (match_operand:TLSmode 2 "symbol_ref_operand" "s")) +(define_insn_and_split "tls_ld_sysv" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (call (mem:SI (match_operand:P 2 "symbol_ref_operand" "s")) (match_operand 3 "" "g"))) - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b")] - UNSPEC_TLSLD) + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b")] + UNSPEC_TLSLD) (clobber (reg:SI LR_REGNO))] "HAVE_AS_TLS && DEFAULT_ABI == ABI_V4" { @@ -9603,60 +9597,60 @@ } "&& TARGET_TLS_MARKERS" [(set (match_dup 0) - (unspec:TLSmode [(match_dup 1)] - UNSPEC_TLSLD)) + (unspec:P [(match_dup 1)] + UNSPEC_TLSLD)) (parallel [(set (match_dup 0) - (call (mem:TLSmode (match_dup 2)) - (match_dup 3))) - (unspec:TLSmode [(const_int 0)] UNSPEC_TLSLD) + (call (mem:SI (match_dup 2)) + (match_dup 3))) + (unspec:P [(const_int 0)] UNSPEC_TLSLD) (clobber (reg:SI LR_REGNO))])] "" [(set_attr "length" "8")]) -(define_insn_and_split "*tls_ld" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b")] - UNSPEC_TLSLD))] +(define_insn_and_split "*tls_ld" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b")] + UNSPEC_TLSLD))] "HAVE_AS_TLS && TARGET_TLS_MARKERS" "addi %0,%1,%&@got@tlsld" "&& TARGET_CMODEL != CMODEL_SMALL" [(set (match_dup 2) - (high:TLSmode - (unspec:TLSmode [(const_int 0) (match_dup 1)] UNSPEC_TLSLD))) + (high:P + (unspec:P [(const_int 0) (match_dup 1)] UNSPEC_TLSLD))) (set (match_dup 0) - (lo_sum:TLSmode (match_dup 2) - (unspec:TLSmode [(const_int 0) (match_dup 1)] UNSPEC_TLSLD)))] + (lo_sum:P (match_dup 2) + (unspec:P [(const_int 0) (match_dup 1)] UNSPEC_TLSLD)))] { operands[2] = gen_reg_rtx (TARGET_64BIT ? DImode : SImode); } [(set (attr "length") (if_then_else (ne (symbol_ref "TARGET_CMODEL") (symbol_ref "CMODEL_SMALL")) - (const_int 8) - (const_int 4)))]) - -(define_insn "*tls_ld_high" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (high:TLSmode - (unspec:TLSmode [(const_int 0) - (match_operand:TLSmode 1 "gpc_reg_operand" "b")] - UNSPEC_TLSLD)))] + (const_int 8) + (const_int 4)))]) + +(define_insn "*tls_ld_high" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (high:P + (unspec:P [(const_int 0) + (match_operand:P 1 "gpc_reg_operand" "b")] + UNSPEC_TLSLD)))] "HAVE_AS_TLS && TARGET_TLS_MARKERS && TARGET_CMODEL != CMODEL_SMALL" "addis %0,%1,%&@got@tlsld@ha") -(define_insn "*tls_ld_low" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (lo_sum:TLSmode (match_operand:TLSmode 1 "gpc_reg_operand" "b") - (unspec:TLSmode [(const_int 0) - (match_operand:TLSmode 2 "gpc_reg_operand" "b")] - UNSPEC_TLSLD)))] +(define_insn "*tls_ld_low" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (lo_sum:P (match_operand:P 1 "gpc_reg_operand" "b") + (unspec:P [(const_int 0) + (match_operand:P 2 "gpc_reg_operand" "b")] + UNSPEC_TLSLD)))] "HAVE_AS_TLS && TARGET_TLS_MARKERS && TARGET_CMODEL != CMODEL_SMALL" "addi %0,%1,%&@got@tlsld@l") -(define_insn "*tls_ld_call_aix" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (call (mem:TLSmode (match_operand:TLSmode 1 "symbol_ref_operand" "s")) +(define_insn "*tls_ld_call_aix" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (call (mem:SI (match_operand:P 1 "symbol_ref_operand" "s")) (match_operand 2 "" "g"))) - (unspec:TLSmode [(const_int 0)] UNSPEC_TLSLD) + (unspec:P [(const_int 0)] UNSPEC_TLSLD) (clobber (reg:SI LR_REGNO))] "HAVE_AS_TLS && TARGET_TLS_MARKERS && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)" @@ -9666,11 +9660,11 @@ [(set_attr "type" "branch") (set_attr "length" "8")]) -(define_insn "*tls_ld_call_sysv" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (call (mem:TLSmode (match_operand:TLSmode 1 "symbol_ref_operand" "s")) +(define_insn "*tls_ld_call_sysv" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (call (mem:SI (match_operand:P 1 "symbol_ref_operand" "s")) (match_operand 2 "" "g"))) - (unspec:TLSmode [(const_int 0)] UNSPEC_TLSLD) + (unspec:P [(const_int 0)] UNSPEC_TLSLD) (clobber (reg:SI LR_REGNO))] "HAVE_AS_TLS && DEFAULT_ABI == ABI_V4 && TARGET_TLS_MARKERS" { @@ -9678,142 +9672,142 @@ } [(set_attr "type" "branch")]) -(define_insn "tls_dtprel_" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSDTPREL))] +(define_insn "tls_dtprel_" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSDTPREL))] "HAVE_AS_TLS" "addi %0,%1,%2@dtprel") -(define_insn "tls_dtprel_ha_" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSDTPRELHA))] +(define_insn "tls_dtprel_ha_" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSDTPRELHA))] "HAVE_AS_TLS" "addis %0,%1,%2@dtprel@ha") -(define_insn "tls_dtprel_lo_" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSDTPRELLO))] +(define_insn "tls_dtprel_lo_" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSDTPRELLO))] "HAVE_AS_TLS" "addi %0,%1,%2@dtprel@l") -(define_insn_and_split "tls_got_dtprel_" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGOTDTPREL))] +(define_insn_and_split "tls_got_dtprel_" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGOTDTPREL))] "HAVE_AS_TLS" - "l %0,%2@got@dtprel(%1)" + " %0,%2@got@dtprel(%1)" "&& TARGET_CMODEL != CMODEL_SMALL" [(set (match_dup 3) - (high:TLSmode - (unspec:TLSmode [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTDTPREL))) + (high:P + (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTDTPREL))) (set (match_dup 0) - (lo_sum:TLSmode (match_dup 3) - (unspec:TLSmode [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTDTPREL)))] + (lo_sum:P (match_dup 3) + (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTDTPREL)))] { operands[3] = gen_reg_rtx (TARGET_64BIT ? DImode : SImode); } [(set (attr "length") (if_then_else (ne (symbol_ref "TARGET_CMODEL") (symbol_ref "CMODEL_SMALL")) - (const_int 8) - (const_int 4)))]) - -(define_insn "*tls_got_dtprel_high" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (high:TLSmode - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGOTDTPREL)))] + (const_int 8) + (const_int 4)))]) + +(define_insn "*tls_got_dtprel_high" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (high:P + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGOTDTPREL)))] "HAVE_AS_TLS && TARGET_CMODEL != CMODEL_SMALL" "addis %0,%1,%2@got@dtprel@ha") -(define_insn "*tls_got_dtprel_low" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r") - (lo_sum:TLSmode (match_operand:TLSmode 1 "gpc_reg_operand" "b") - (unspec:TLSmode [(match_operand:TLSmode 3 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGOTDTPREL)))] +(define_insn "*tls_got_dtprel_low" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (lo_sum:P (match_operand:P 1 "gpc_reg_operand" "b") + (unspec:P [(match_operand:P 3 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGOTDTPREL)))] "HAVE_AS_TLS && TARGET_CMODEL != CMODEL_SMALL" - "l %0,%2@got@dtprel@l(%1)") + " %0,%2@got@dtprel@l(%1)") -(define_insn "tls_tprel_" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSTPREL))] +(define_insn "tls_tprel_" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSTPREL))] "HAVE_AS_TLS" "addi %0,%1,%2@tprel") -(define_insn "tls_tprel_ha_" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSTPRELHA))] +(define_insn "tls_tprel_ha_" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSTPRELHA))] "HAVE_AS_TLS" "addis %0,%1,%2@tprel@ha") -(define_insn "tls_tprel_lo_" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSTPRELLO))] +(define_insn "tls_tprel_lo_" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSTPRELLO))] "HAVE_AS_TLS" "addi %0,%1,%2@tprel@l") ;; "b" output constraint here and on tls_tls input to support linker tls ;; optimization. The linker may edit the instructions emitted by a ;; tls_got_tprel/tls_tls pair to addis,addi. -(define_insn_and_split "tls_got_tprel_" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGOTTPREL))] +(define_insn_and_split "tls_got_tprel_" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGOTTPREL))] "HAVE_AS_TLS" - "l %0,%2@got@tprel(%1)" + " %0,%2@got@tprel(%1)" "&& TARGET_CMODEL != CMODEL_SMALL" [(set (match_dup 3) - (high:TLSmode - (unspec:TLSmode [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTTPREL))) + (high:P + (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTTPREL))) (set (match_dup 0) - (lo_sum:TLSmode (match_dup 3) - (unspec:TLSmode [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTTPREL)))] + (lo_sum:P (match_dup 3) + (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTTPREL)))] { operands[3] = gen_reg_rtx (TARGET_64BIT ? DImode : SImode); } [(set (attr "length") (if_then_else (ne (symbol_ref "TARGET_CMODEL") (symbol_ref "CMODEL_SMALL")) - (const_int 8) - (const_int 4)))]) - -(define_insn "*tls_got_tprel_high" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (high:TLSmode - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGOTTPREL)))] + (const_int 8) + (const_int 4)))]) + +(define_insn "*tls_got_tprel_high" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (high:P + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGOTTPREL)))] "HAVE_AS_TLS && TARGET_CMODEL != CMODEL_SMALL" "addis %0,%1,%2@got@tprel@ha") -(define_insn "*tls_got_tprel_low" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r") - (lo_sum:TLSmode (match_operand:TLSmode 1 "gpc_reg_operand" "b") - (unspec:TLSmode [(match_operand:TLSmode 3 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGOTTPREL)))] +(define_insn "*tls_got_tprel_low" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (lo_sum:P (match_operand:P 1 "gpc_reg_operand" "b") + (unspec:P [(match_operand:P 3 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGOTTPREL)))] "HAVE_AS_TLS && TARGET_CMODEL != CMODEL_SMALL" - "l %0,%2@got@tprel@l(%1)") + " %0,%2@got@tprel@l(%1)") -(define_insn "tls_tls_" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSTLS))] +(define_insn "tls_tls_" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSTLS))] "TARGET_ELF && HAVE_AS_TLS" "add %0,%1,%2@tls") -- 2.30.2