Text file src/cmd/internal/obj/riscv/testdata/testbranch/branch_test.s

     1  // Copyright 2020 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build riscv64
     6  // +build riscv64
     7  
     8  #include "textflag.h"
     9  
    10  // func testBEQZ(a int64) (r bool)
    11  TEXT ·testBEQZ(SB),NOSPLIT,$0-9
    12  	MOV	a+0(FP), X5
    13  	MOV	$1, X6
    14  	BEQZ	X5, b
    15  	MOV	$0, X6
    16  b:
    17  	MOV	X6, r+8(FP)
    18  	RET
    19  
    20  // func testBGE(a, b int64) (r bool)
    21  TEXT ·testBGE(SB),NOSPLIT,$0-17
    22  	MOV	a+0(FP), X5
    23  	MOV	b+8(FP), X6
    24  	MOV	$1, X7
    25  	BGE	X5, X6, b
    26  	MOV	$0, X7
    27  b:
    28  	MOV	X7, r+16(FP)
    29  	RET
    30  
    31  // func testBGEU(a, b int64) (r bool)
    32  TEXT ·testBGEU(SB),NOSPLIT,$0-17
    33  	MOV	a+0(FP), X5
    34  	MOV	b+8(FP), X6
    35  	MOV	$1, X7
    36  	BGEU	X5, X6, b
    37  	MOV	$0, X7
    38  b:
    39  	MOV	X7, r+16(FP)
    40  	RET
    41  
    42  // func testBGEZ(a int64) (r bool)
    43  TEXT ·testBGEZ(SB),NOSPLIT,$0-9
    44  	MOV	a+0(FP), X5
    45  	MOV	$1, X6
    46  	BGEZ	X5, b
    47  	MOV	$0, X6
    48  b:
    49  	MOV	X6, r+8(FP)
    50  	RET
    51  
    52  // func testBGT(a, b int64) (r bool)
    53  TEXT ·testBGT(SB),NOSPLIT,$0-17
    54  	MOV	a+0(FP), X5
    55  	MOV	b+8(FP), X6
    56  	MOV	$1, X7
    57  	BGT	X5, X6, b
    58  	MOV	$0, X7
    59  b:
    60  	MOV	X7, r+16(FP)
    61  	RET
    62  
    63  // func testBGTU(a, b int64) (r bool)
    64  TEXT ·testBGTU(SB),NOSPLIT,$0-17
    65  	MOV	a+0(FP), X5
    66  	MOV	b+8(FP), X6
    67  	MOV	$1, X7
    68  	BGTU	X5, X6, b
    69  	MOV	$0, X7
    70  b:
    71  	MOV	X7, r+16(FP)
    72  	RET
    73  
    74  // func testBGTZ(a int64) (r bool)
    75  TEXT ·testBGTZ(SB),NOSPLIT,$0-9
    76  	MOV	a+0(FP), X5
    77  	MOV	$1, X6
    78  	BGTZ	X5, b
    79  	MOV	$0, X6
    80  b:
    81  	MOV	X6, r+8(FP)
    82  	RET
    83  
    84  // func testBLE(a, b int64) (r bool)
    85  TEXT ·testBLE(SB),NOSPLIT,$0-17
    86  	MOV	a+0(FP), X5
    87  	MOV	b+8(FP), X6
    88  	MOV	$1, X7
    89  	BLE	X5, X6, b
    90  	MOV	$0, X7
    91  b:
    92  	MOV	X7, r+16(FP)
    93  	RET
    94  
    95  // func testBLEU(a, b int64) (r bool)
    96  TEXT ·testBLEU(SB),NOSPLIT,$0-17
    97  	MOV	a+0(FP), X5
    98  	MOV	b+8(FP), X6
    99  	MOV	$1, X7
   100  	BLEU	X5, X6, b
   101  	MOV	$0, X7
   102  b:
   103  	MOV	X7, r+16(FP)
   104  	RET
   105  
   106  // func testBLEZ(a int64) (r bool)
   107  TEXT ·testBLEZ(SB),NOSPLIT,$0-9
   108  	MOV	a+0(FP), X5
   109  	MOV	$1, X6
   110  	BLEZ	X5, b
   111  	MOV	$0, X6
   112  b:
   113  	MOV	X6, r+8(FP)
   114  	RET
   115  
   116  // func testBLT(a, b int64) (r bool)
   117  TEXT ·testBLT(SB),NOSPLIT,$0-17
   118  	MOV	a+0(FP), X5
   119  	MOV	b+8(FP), X6
   120  	MOV	$1, X7
   121  	BLT	X5, X6, b
   122  	MOV	$0, X7
   123  b:
   124  	MOV	X7, r+16(FP)
   125  	RET
   126  
   127  // func testBLTU(a, b int64) (r bool)
   128  TEXT ·testBLTU(SB),NOSPLIT,$0-17
   129  	MOV	a+0(FP), X5
   130  	MOV	b+8(FP), X6
   131  	MOV	$1, X7
   132  	BLTU	X5, X6, b
   133  	MOV	$0, X7
   134  b:
   135  	MOV	X7, r+16(FP)
   136  	RET
   137  
   138  // func testBLTZ(a int64) (r bool)
   139  TEXT ·testBLTZ(SB),NOSPLIT,$0-9
   140  	MOV	a+0(FP), X5
   141  	MOV	$1, X6
   142  	BLTZ	X5, b
   143  	MOV	$0, X6
   144  b:
   145  	MOV	X6, r+8(FP)
   146  	RET
   147  
   148  // func testBNEZ(a int64) (r bool)
   149  TEXT ·testBNEZ(SB),NOSPLIT,$0-9
   150  	MOV	a+0(FP), X5
   151  	MOV	$1, X6
   152  	BNEZ	X5, b
   153  	MOV	$0, X6
   154  b:
   155  	MOV	X6, r+8(FP)
   156  	RET
   157  

View as plain text