xref: /aosp_15_r20/external/bazelbuild-rules_go/tests/core/cross/asm.s (revision 9bb1b549b6a84214c53be0924760be030e66b93a)
1// Example assembly copied from https://github.com/rpccloud/goid
2
3#include "go_asm.h"
4#include "textflag.h"
5
6#ifdef GOARCH_386
7#define	get_tls(r)	MOVL TLS, r
8#define	g(r)	0(r)(TLS*1)
9#endif
10
11TEXT ·getg(SB), NOSPLIT, $0-4
12    get_tls(CX)
13    MOVL    g(CX), AX
14    MOVL    AX, ret+0(FP)
15    RET
16