在 2024/1/26 下午4:52, Xi Ruoyao 写道:
On Fri, 2024-01-26 at 15:37 +0800, Lulu Cheng wrote:
+(define_insn "@load_tls<mode>"
[(set (match_operand:P 0 "register_operand" "=r")
(unspec:P
[(match_operand:P 1 "symbolic_operand" "")]
- UNSPEC_TLS_GD))]
+ UNSPEC_TLS))]
/* snip */
+{
+ enum loongarch_symbol_type symbol_type;
+ gcc_assert (loongarch_symbolic_constant_p (operands[1],
&symbol_type));
/* snip */
+ switch (symbol_type)
+ {
+ case SYMBOL_TLS_LE:
+ return "la.tls.le\t%0,%1";
+ case SYMBOL_TLS_IE:
+ return "la.tls.ie\t%0,%1";
+ case SYMBOL_TLSLDM:
+ return "la.tls.ld\t%0,%1";
+ case SYMBOL_TLSGD:
+ return "la.tls.gd\t%0,%1";
/* snip */
+ default:
+ gcc_unreachable ();
+ }
+}
+ [(set_attr "mode" "<MODE>")
+ (set_attr "length" "2")])
Should be 8, it's in bytes.
Um, sorry, I meant to use insn_count.