aboutsummaryrefslogtreecommitdiff
path: root/tests/core/cross/asm.s
blob: 7a5d521933fc31c5995248514e3f7fb4f0efaa17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Example assembly copied from https://github.com/rpccloud/goid

#include "go_asm.h"
#include "textflag.h"

#ifdef GOARCH_386
#define	get_tls(r)	MOVL TLS, r
#define	g(r)	0(r)(TLS*1)
#endif

TEXT ·getg(SB), NOSPLIT, $0-4
    get_tls(CX)
    MOVL    g(CX), AX
    MOVL    AX, ret+0(FP)
    RET