+2015-08-26 Jiong Wang <jiong.wang@arm.com>
+
+ * config/aarch64/aarch64.opt (mtls-size): New entry.
+ * config/aarch64/aarch64.c (initialize_aarch64_tls_size): New function.
+ (aarch64_override_options_internal): Call initialize_aarch64_tls_size.
+ * doc/invoke.texi (AArch64 Options): Document -mtls-size.
+
2015-08-26 Matthew Wahab <matthew.wahab@arm.com>
* gcc/config/arm/arm-cores.def: Add FL_FOR_ARCH flag for each
return;
}
+/* A checking mechanism for the implementation of the tls size. */
+
+static void
+initialize_aarch64_tls_size (struct gcc_options *opts)
+{
+ if (aarch64_tls_size == 0)
+ aarch64_tls_size = 24;
+
+ switch (opts->x_aarch64_cmodel_var)
+ {
+ case AARCH64_CMODEL_TINY:
+ /* Both the default and maximum TLS size allowed under tiny is 1M which
+ needs two instructions to address, so we clamp the size to 24. */
+ if (aarch64_tls_size > 24)
+ aarch64_tls_size = 24;
+ break;
+ case AARCH64_CMODEL_SMALL:
+ /* The maximum TLS size allowed under small is 4G. */
+ if (aarch64_tls_size > 32)
+ aarch64_tls_size = 32;
+ break;
+ case AARCH64_CMODEL_LARGE:
+ /* The maximum TLS size allowed under large is 16E.
+ FIXME: 16E should be 64bit, we only support 48bit offset now. */
+ if (aarch64_tls_size > 48)
+ aarch64_tls_size = 48;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ return;
+}
+
/* Parse STRING looking for options in the format:
string :: option:string
option :: name=substring
}
initialize_aarch64_code_model (opts);
+ initialize_aarch64_tls_size (opts);
aarch64_override_options_after_change_1 (opts);
}
Target RejectNegative Joined Enum(tls_type) Var(aarch64_tls_dialect) Init(TLS_DESCRIPTORS) Save
Specify TLS dialect
+mtls-size=
+Target RejectNegative Joined Var(aarch64_tls_size) Enum(aarch64_tls_size)
+Specifies bit size of immediate TLS offsets. Valid values are 12, 24, 32, 48.
+
+Enum
+Name(aarch64_tls_size) Type(int)
+
+EnumValue
+Enum(aarch64_tls_size) String(12) Value(12)
+
+EnumValue
+Enum(aarch64_tls_size) String(24) Value(24)
+
+EnumValue
+Enum(aarch64_tls_size) String(32) Value(32)
+
+EnumValue
+Enum(aarch64_tls_size) String(48) Value(48)
+
march=
Target RejectNegative ToLower Joined Var(aarch64_arch_string)
-march=ARCH Use features of architecture ARCH
-mstrict-align @gol
-momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer @gol
-mtls-dialect=desc -mtls-dialect=traditional @gol
+-mtls-size=@var{size} @gol
-mfix-cortex-a53-835769 -mno-fix-cortex-a53-835769 @gol
-mfix-cortex-a53-843419 -mno-fix-cortex-a53-843419 @gol
-march=@var{name} -mcpu=@var{name} -mtune=@var{name}}
Use traditional TLS as the thread-local storage mechanism for dynamic accesses
of TLS variables.
+@item -mtls-size=@var{size}
+@opindex mtls-size
+Specify bit size of immediate TLS offsets. Valid values are 12, 24, 32, 48.
+This option depends on binutils higher than 2.25.
+
@item -mfix-cortex-a53-835769
@itemx -mno-fix-cortex-a53-835769
@opindex mfix-cortex-a53-835769