src/cmd/asm/internal/asm/testdata/amd64.s 153 lines View on github.com → Search inside
1// Copyright 2015 The Go Authors. All rights reserved.2// Use of this source code is governed by a BSD-style3// license that can be found in the LICENSE file.45// This input was created by taking the instruction productions in6// the old assembler's (6a's) grammar and hand-writing complete7// instructions for each rule, to guarantee we cover the same space.89#include "../../../../../runtime/textflag.h"1011TEXT	foo(SB), DUPOK|NOSPLIT, $01213// LTYPE1 nonrem	{ outcode($1, &$2); }14	NEGQ	R1115	NEGQ	4(R11)16	NEGQ	foo+4(SB)1718// LTYPE2 rimnon	{ outcode($1, &$2); }19	INT	$420	DIVB	R1121	DIVB	4(R11)22	DIVB	foo+4(SB)2324// LTYPE3 rimrem	{ outcode($1, &$2); }25	SUBQ $4, DI26	SUBQ R11, DI27	SUBQ 4(R11), DI28	SUBQ foo+4(SB), DI29	SUBQ $4, 8(R12)30	SUBQ R11, 8(R12)31	SUBQ R11, foo+4(SB)3233// LTYPE4 remrim	{ outcode($1, &$2); }34	CMPB	CX, $43536// LTYPER nonrel	{ outcode($1, &$2); }37label:38	JB	-4(PC) // JCS -4(PC)39	JB	label // JCS 174041// LTYPEC spec3	{ outcode($1, &$2); }42	JCS	2(PC)43	JMP	-4(PC)44	JCS	2(PC)45	JMP	label // JMP 1746	JCS	2(PC)47	JMP	foo+4(SB)48	JCS	2(PC)49	JMP	bar<>+4(SB)50	JCS	2(PC)51	JMP	bar<>+4(SB)(R11*4)52	JCS	2(PC)53	JMP	*4(SP) // JMP 4(SP)54	JCS	2(PC)55	JMP	*(R12) // JMP (R12)56	JCS	2(PC)57//	JMP	*(R12*4) // TODO: This line is silently dropped on the floor!58	JCS	2(PC)59	JMP	*(R12)(R13*4) // JMP (R12)(R13*4)60	JCS	2(PC)61	JMP	*(AX) // JMP (AX)62	JCS	2(PC)63	JMP	*(SP) // JMP (SP)64	JCS	2(PC)65//	JMP	*(AX*4) // TODO: This line is silently dropped on the floor!66	JCS	2(PC)67	JMP	*(AX)(AX*4) // JMP (AX)(AX*4)68	JCS	2(PC)69	JMP	4(SP)70	JCS	2(PC)71	JMP	(R12)72	JCS	2(PC)73//	JMP	(R12*4) // TODO: This line is silently dropped on the floor!74	JCS	2(PC)75	JMP	(R12)(R13*4)76	JCS	2(PC)77	JMP	(AX)78	JCS	2(PC)79	JMP	(SP)80	JCS	2(PC)81//	JMP	(AX*4) // TODO: This line is silently dropped on the floor!82	JCS	2(PC)83	JMP	(AX)(AX*4)84	JCS	2(PC)85	JMP	R138687// LTYPEN spec4	{ outcode($1, &$2); }88	NOP89	NOP	AX90	NOP	foo+4(SB)9192// LTYPES spec5	{ outcode($1, &$2); }93	SHLL	CX, R1294	SHLL	CX, foo+4(SB)95	// Old syntax, still accepted:96	SHLL	CX, R11:AX // SHLL CX, AX, R119798// LTYPEM spec6	{ outcode($1, &$2); }99	MOVL	AX, R11100	MOVL	$4, R11101//	MOVL	AX, 0(AX):DS // no longer works - did it ever?102103// LTYPEI spec7	{ outcode($1, &$2); }104	IMULB	DX105	IMULW	DX, BX106	IMULL	R11, R12107	IMULQ	foo+4(SB), R11108109// LTYPEXC spec8	{ outcode($1, &$2); }110	CMPPD	X1, X2, 4111	CMPPD	foo+4(SB), X2, 4112113// LTYPEX spec9	{ outcode($1, &$2); }114	PINSRW	$4, AX, X2115	PINSRW	$4, foo+4(SB), X2116117// LTYPERT spec10	{ outcode($1, &$2); }118	JCS	2(PC)119	RETFL	$4120121// Was bug: LOOP is a branch instruction.122	JCS	2(PC)123loop:124	LOOP	loop // LOOP125126	// Intel pseudonyms for our own renamings.127	PADDD	M2, M1 // PADDL M2, M1128	MOVDQ2Q	X1, M1 // MOVQ X1, M1129	MOVNTDQ	X1, (AX)	// MOVNTO X1, (AX)130	MOVOA	(AX), X1	// MOVO (AX), X1131132// Tests for SP indexed addresses.133	MOVQ	foo(SP)(AX*1), BX		// 488b1c04134	MOVQ	foo+32(SP)(CX*2), DX		// 488b544c20135	MOVQ	foo+32323(SP)(R8*4), R9		// 4e8b8c84437e0000136	MOVL	foo(SP)(SI*8), DI		// 8b3cf4137	MOVL	foo+32(SP)(R10*1), R11		// 468b5c1420138	MOVL	foo+32323(SP)(R12*2), R13	// 468bac64437e0000139	MOVW	foo(SP)(AX*4), R8		// 66448b0484140	MOVW	foo+32(SP)(R9*8), CX		// 66428b4ccc20141	MOVW	foo+32323(SP)(AX*1), DX		// 668b9404437e0000142	MOVB	foo(SP)(AX*2), AL		// 8a0444143	MOVB	foo+32(SP)(CX*4), AH		// 8a648c20144	MOVB	foo+32323(SP)(CX*8), R9		// 448a8ccc437e0000145146// Tests for TLS reference.147	MOVQ	(TLS), AX148	MOVQ	8(TLS), DX149150// LTYPE0 nonnon	{ outcode($1, &$2); }151	RET // c3152	RET	foo(SB)

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.