+let AddedComplexity = 10 in
+def TLS_gs_rr : I<0, Pseudo, (outs GR32:$dst), (ins GR32:$src),
+ "movl\t%gs:($src), $dst",
+ [(set GR32:$dst, (load (add X86TLStp, GR32:$src)))]>;
+
+let AddedComplexity = 15 in
+def TLS_gs_ri : I<0x8B, Pseudo, (outs GR32:$dst), (ins i32imm:$src),
+ "movl\t%gs:${src:mem}, $dst",
+ [(set GR32:$dst,
+ (load (add X86TLStp, (X86Wrapper tglobaltlsaddr:$src))))]>,
+ SegGS;
+
+let AddedComplexity = 15 in
+def TLS16_gs_ri : I<0x8B, Pseudo, (outs GR16:$dst), (ins i32imm:$src),
+ "movw\t%gs:${src:mem}, $dst",
+ [(set GR16:$dst,
+ (load (add X86TLStp,
+ (X86Wrapper tglobaltlsaddr:$src))))]>,
+ SegGS;
+
+let AddedComplexity = 15 in
+def TLS8_gs_ri : I<0x8B, Pseudo, (outs GR8:$dst), (ins i32imm:$src),
+ "movb\t%gs:${src:mem}, $dst",
+ [(set GR8:$dst,
+ (load (add X86TLStp,
+ (X86Wrapper tglobaltlsaddr:$src))))]>,
+ SegGS;
+
+let AddedComplexity = 15 in
+def TLS_ext16_gs_ri : I<0x8B, Pseudo, (outs GR32:$dst), (ins i32imm:$src),
+ "movzwl\t%gs:${src:mem}, $dst",
+ [(set GR32:$dst,
+ (extloadi32i16
+ (add X86TLStp,
+ (X86Wrapper tglobaltlsaddr:$src))))]>,
+ SegGS;
+
+let AddedComplexity = 15 in
+def TLS_sext16_gs_ri : I<0x8B, Pseudo, (outs GR32:$dst), (ins i32imm:$src),
+ "movswl\t%gs:${src:mem}, $dst",
+ [(set GR32:$dst,
+ (sextloadi32i16
+ (add X86TLStp,
+ (X86Wrapper tglobaltlsaddr:$src))))]>,
+ SegGS;
+
+let AddedComplexity = 15 in
+def TLS_zext16_gs_ri : I<0x8B, Pseudo, (outs GR32:$dst), (ins i32imm:$src),
+ "movzwl\t%gs:${src:mem}, $dst",
+ [(set GR32:$dst,
+ (zextloadi32i16
+ (add X86TLStp,
+ (X86Wrapper tglobaltlsaddr:$src))))]>,
+ SegGS;
+
+let AddedComplexity = 15 in
+def TLS_ext8_gs_ri : I<0x8B, Pseudo, (outs GR32:$dst), (ins i32imm:$src),
+ "movzbl\t%gs:${src:mem}, $dst",
+ [(set GR32:$dst,
+ (extloadi32i8
+ (add X86TLStp,
+ (X86Wrapper tglobaltlsaddr:$src))))]>,
+ SegGS;
+
+let AddedComplexity = 15 in
+def TLS_sext8_gs_ri : I<0x8B, Pseudo, (outs GR32:$dst), (ins i32imm:$src),
+ "movsbl\t%gs:${src:mem}, $dst",
+ [(set GR32:$dst,
+ (sextloadi32i8
+ (add X86TLStp,
+ (X86Wrapper tglobaltlsaddr:$src))))]>,
+ SegGS;
+
+let AddedComplexity = 15 in
+def TLS_zext8_gs_ri : I<0x8B, Pseudo, (outs GR32:$dst), (ins i32imm:$src),
+ "movzbl\t%gs:${src:mem}, $dst",
+ [(set GR32:$dst,
+ (zextloadi32i8
+ (add X86TLStp,
+ (X86Wrapper tglobaltlsaddr:$src))))]>,
+ SegGS;
+
+def TLS_tp : I<0x8B, Pseudo, (outs GR32:$dst), (ins),
+ "movl\t%gs:0, $dst",
+ [(set GR32:$dst, X86TLStp)]>, SegGS;
+