aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/flags_arm64_test.s
blob: 639d7e3aedc299ece9b9a0a27debc8b566eee922 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

#include "textflag.h"

TEXT ·asmAddFlags(SB),NOSPLIT,$0-24
	MOVD	x+0(FP), R0
	MOVD	y+8(FP), R1
	CMN	R0, R1
	WORD	$0xd53b4200 //	MOVD	NZCV, R0
	MOVD	R0, ret+16(FP)
	RET

TEXT ·asmSubFlags(SB),NOSPLIT,$0-24
	MOVD	x+0(FP), R0
	MOVD	y+8(FP), R1
	CMP	R1, R0
	WORD	$0xd53b4200 //	MOVD	NZCV, R0
	MOVD	R0, ret+16(FP)
	RET

TEXT ·asmAndFlags(SB),NOSPLIT,$0-24
	MOVD	x+0(FP), R0
	MOVD	y+8(FP), R1
	TST	R1, R0
	WORD	$0xd53b4200 //	MOVD	NZCV, R0
	BIC	$0x30000000, R0 // clear C, V bits, as TST does not change those flags
	MOVD	R0, ret+16(FP)
	RET