
// -----------
// This file was generated by riscv_ctg (https://github.com/riscv-software-src/riscv-ctg)
// version   : 0.7.1
// timestamp : Fri Jun 17 14:03:20 2022 GMT
// usage     : riscv_ctg \
//                  -- cgf //                  --cgf /scratch/pawan/work/normalised/RV32F/fsqrt.s.cgf \
 \
//                  -- xlen 32  \
//                  --randomize \
// -----------
//
// -----------
// Copyright (c) 2020. RISC-V International. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
// -----------
//
// This assembly file tests the fsqrt.s instruction of the RISC-V RV32F_Zicsr,RV32FD_Zicsr,RV64F_Zicsr,RV64FD_Zicsr extension for the fsqrt_b5 covergroup.
// 
#include "model_test.h"
#include "arch_test.h"
RVTEST_ISA("RV32IF_Zicsr,RV32IFD_Zicsr,RV64IF_Zicsr,RV64IFD_Zicsr")

.section .text.init
.globl rvtest_entry_point
rvtest_entry_point:
RVMODEL_BOOT
RVTEST_CODE_BEGIN

#ifdef TEST_CASE_1

RVTEST_CASE(0,"//check ISA:=regex(.*I.*F.*);def TEST_CASE_1=True;",fsqrt_b5)

RVTEST_FP_ENABLE()
RVTEST_VALBASEUPD(x3,test_dataset_0)
RVTEST_SIGBASE(x1,signature_x1_1)

inst_0:
// rs1 != rd, rs1==f30, rd==f11,fs1 == 0 and fe1 == 0x00 and fm1 == 0x000000 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fsqrt.s ; op1:f30; dest:f11; op1val:0x0; valaddr_reg:x3;
val_offset:0*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f11, f30, dyn, 0, 0, x3, 0*FLEN/8, x4, x1, x2)

inst_1:
// rs1 == rd, rs1==f27, rd==f27,fs1 == 0 and fe1 == 0x00 and fm1 == 0x000000 and  fcsr == 0x20 and rm_val == 7   
/* opcode: fsqrt.s ; op1:f27; dest:f27; op1val:0x0; valaddr_reg:x3;
val_offset:1*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 32 */
TEST_FPSR_OP(fsqrt.s, f27, f27, dyn, 32, 0, x3, 1*FLEN/8, x4, x1, x2)

inst_2:
// rs1==f28, rd==f9,fs1 == 0 and fe1 == 0x00 and fm1 == 0x000000 and  fcsr == 0x40 and rm_val == 7   
/* opcode: fsqrt.s ; op1:f28; dest:f9; op1val:0x0; valaddr_reg:x3;
val_offset:2*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 64 */
TEST_FPSR_OP(fsqrt.s, f9, f28, dyn, 64, 0, x3, 2*FLEN/8, x4, x1, x2)

inst_3:
// rs1==f4, rd==f5,fs1 == 0 and fe1 == 0x00 and fm1 == 0x000000 and  fcsr == 0x60 and rm_val == 7   
/* opcode: fsqrt.s ; op1:f4; dest:f5; op1val:0x0; valaddr_reg:x3;
val_offset:3*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 96 */
TEST_FPSR_OP(fsqrt.s, f5, f4, dyn, 96, 0, x3, 3*FLEN/8, x4, x1, x2)

inst_4:
// rs1==f3, rd==f23,fs1 == 0 and fe1 == 0x00 and fm1 == 0x000000 and  fcsr == 0x80 and rm_val == 7   
/* opcode: fsqrt.s ; op1:f3; dest:f23; op1val:0x0; valaddr_reg:x3;
val_offset:4*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 128 */
TEST_FPSR_OP(fsqrt.s, f23, f3, dyn, 128, 0, x3, 4*FLEN/8, x4, x1, x2)

inst_5:
// rs1==f19, rd==f12,
/* opcode: fsqrt.s ; op1:f19; dest:f12; op1val:0x0; valaddr_reg:x3;
val_offset:5*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f12, f19, dyn, 0, 0, x3, 5*FLEN/8, x4, x1, x2)

inst_6:
// rs1==f10, rd==f28,
/* opcode: fsqrt.s ; op1:f10; dest:f28; op1val:0x0; valaddr_reg:x3;
val_offset:6*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f28, f10, dyn, 0, 0, x3, 6*FLEN/8, x4, x1, x2)

inst_7:
// rs1==f0, rd==f30,
/* opcode: fsqrt.s ; op1:f0; dest:f30; op1val:0x0; valaddr_reg:x3;
val_offset:7*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f30, f0, dyn, 0, 0, x3, 7*FLEN/8, x4, x1, x2)

inst_8:
// rs1==f12, rd==f17,
/* opcode: fsqrt.s ; op1:f12; dest:f17; op1val:0x0; valaddr_reg:x3;
val_offset:8*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f17, f12, dyn, 0, 0, x3, 8*FLEN/8, x4, x1, x2)

inst_9:
// rs1==f29, rd==f0,
/* opcode: fsqrt.s ; op1:f29; dest:f0; op1val:0x0; valaddr_reg:x3;
val_offset:9*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f0, f29, dyn, 0, 0, x3, 9*FLEN/8, x4, x1, x2)

inst_10:
// rs1==f25, rd==f22,
/* opcode: fsqrt.s ; op1:f25; dest:f22; op1val:0x0; valaddr_reg:x3;
val_offset:10*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f22, f25, dyn, 0, 0, x3, 10*FLEN/8, x4, x1, x2)

inst_11:
// rs1==f14, rd==f2,
/* opcode: fsqrt.s ; op1:f14; dest:f2; op1val:0x0; valaddr_reg:x3;
val_offset:11*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f2, f14, dyn, 0, 0, x3, 11*FLEN/8, x4, x1, x2)

inst_12:
// rs1==f16, rd==f15,
/* opcode: fsqrt.s ; op1:f16; dest:f15; op1val:0x0; valaddr_reg:x3;
val_offset:12*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f15, f16, dyn, 0, 0, x3, 12*FLEN/8, x4, x1, x2)

inst_13:
// rs1==f8, rd==f26,
/* opcode: fsqrt.s ; op1:f8; dest:f26; op1val:0x0; valaddr_reg:x3;
val_offset:13*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f26, f8, dyn, 0, 0, x3, 13*FLEN/8, x4, x1, x2)

inst_14:
// rs1==f1, rd==f25,
/* opcode: fsqrt.s ; op1:f1; dest:f25; op1val:0x0; valaddr_reg:x3;
val_offset:14*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f25, f1, dyn, 0, 0, x3, 14*FLEN/8, x4, x1, x2)

inst_15:
// rs1==f9, rd==f19,
/* opcode: fsqrt.s ; op1:f9; dest:f19; op1val:0x0; valaddr_reg:x3;
val_offset:15*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f19, f9, dyn, 0, 0, x3, 15*FLEN/8, x4, x1, x2)

inst_16:
// rs1==f5, rd==f18,
/* opcode: fsqrt.s ; op1:f5; dest:f18; op1val:0x0; valaddr_reg:x3;
val_offset:16*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f18, f5, dyn, 0, 0, x3, 16*FLEN/8, x4, x1, x2)

inst_17:
// rs1==f2, rd==f20,
/* opcode: fsqrt.s ; op1:f2; dest:f20; op1val:0x0; valaddr_reg:x3;
val_offset:17*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f20, f2, dyn, 0, 0, x3, 17*FLEN/8, x4, x1, x2)

inst_18:
// rs1==f11, rd==f4,
/* opcode: fsqrt.s ; op1:f11; dest:f4; op1val:0x0; valaddr_reg:x3;
val_offset:18*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f4, f11, dyn, 0, 0, x3, 18*FLEN/8, x4, x1, x2)

inst_19:
// rs1==f31, rd==f1,
/* opcode: fsqrt.s ; op1:f31; dest:f1; op1val:0x0; valaddr_reg:x3;
val_offset:19*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f1, f31, dyn, 0, 0, x3, 19*FLEN/8, x4, x1, x2)

inst_20:
// rs1==f6, rd==f7,
/* opcode: fsqrt.s ; op1:f6; dest:f7; op1val:0x0; valaddr_reg:x3;
val_offset:20*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f7, f6, dyn, 0, 0, x3, 20*FLEN/8, x4, x1, x2)

inst_21:
// rs1==f23, rd==f21,
/* opcode: fsqrt.s ; op1:f23; dest:f21; op1val:0x0; valaddr_reg:x3;
val_offset:21*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f21, f23, dyn, 0, 0, x3, 21*FLEN/8, x4, x1, x2)

inst_22:
// rs1==f24, rd==f29,
/* opcode: fsqrt.s ; op1:f24; dest:f29; op1val:0x0; valaddr_reg:x3;
val_offset:22*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f29, f24, dyn, 0, 0, x3, 22*FLEN/8, x4, x1, x2)

inst_23:
// rs1==f13, rd==f8,
/* opcode: fsqrt.s ; op1:f13; dest:f8; op1val:0x0; valaddr_reg:x3;
val_offset:23*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f8, f13, dyn, 0, 0, x3, 23*FLEN/8, x4, x1, x2)

inst_24:
// rs1==f21, rd==f3,
/* opcode: fsqrt.s ; op1:f21; dest:f3; op1val:0x0; valaddr_reg:x3;
val_offset:24*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f3, f21, dyn, 0, 0, x3, 24*FLEN/8, x4, x1, x2)

inst_25:
// rs1==f18, rd==f13,
/* opcode: fsqrt.s ; op1:f18; dest:f13; op1val:0x0; valaddr_reg:x3;
val_offset:25*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f13, f18, dyn, 0, 0, x3, 25*FLEN/8, x4, x1, x2)

inst_26:
// rs1==f26, rd==f16,
/* opcode: fsqrt.s ; op1:f26; dest:f16; op1val:0x0; valaddr_reg:x3;
val_offset:26*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f16, f26, dyn, 0, 0, x3, 26*FLEN/8, x4, x1, x2)

inst_27:
// rs1==f17, rd==f10,
/* opcode: fsqrt.s ; op1:f17; dest:f10; op1val:0x0; valaddr_reg:x3;
val_offset:27*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f10, f17, dyn, 0, 0, x3, 27*FLEN/8, x4, x1, x2)

inst_28:
// rs1==f20, rd==f14,
/* opcode: fsqrt.s ; op1:f20; dest:f14; op1val:0x0; valaddr_reg:x3;
val_offset:28*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f14, f20, dyn, 0, 0, x3, 28*FLEN/8, x4, x1, x2)

inst_29:
// rs1==f15, rd==f6,
/* opcode: fsqrt.s ; op1:f15; dest:f6; op1val:0x0; valaddr_reg:x3;
val_offset:29*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f6, f15, dyn, 0, 0, x3, 29*FLEN/8, x4, x1, x2)

inst_30:
// rs1==f7, rd==f24,
/* opcode: fsqrt.s ; op1:f7; dest:f24; op1val:0x0; valaddr_reg:x3;
val_offset:30*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f24, f7, dyn, 0, 0, x3, 30*FLEN/8, x4, x1, x2)

inst_31:
// rs1==f22, rd==f31,
/* opcode: fsqrt.s ; op1:f22; dest:f31; op1val:0x0; valaddr_reg:x3;
val_offset:31*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0 */
TEST_FPSR_OP(fsqrt.s, f31, f22, dyn, 0, 0, x3, 31*FLEN/8, x4, x1, x2)

inst_32:
// fs1 == 0 and fe1 == 0x00 and fm1 == 0x000000 and  fcsr == 0x20 and rm_val == 7   
/* opcode: fsqrt.s ; op1:f30; dest:f31; op1val:0x0; valaddr_reg:x3;
val_offset:32*FLEN/8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 32 */
TEST_FPSR_OP(fsqrt.s, f31, f30, dyn, 32, 0, x3, 32*FLEN/8, x4, x1, x2)
#endif


RVTEST_CODE_END
RVMODEL_HALT

RVTEST_DATA_BEGIN
.align 4
rvtest_data:
.word 0xbabecafe
.word 0xabecafeb
.word 0xbecafeba
.word 0xecafebab
test_dataset_0:
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
NAN_BOXED(0x0,32,FLEN)
RVTEST_DATA_END

RVMODEL_DATA_BEGIN
rvtest_sig_begin:
sig_begin_canary:
CANARY;


signature_x1_0:
    .fill 0*((SIGALIGN)/4),4,0xdeadbeef


signature_x1_1:
    .fill 66*((SIGALIGN)/4),4,0xdeadbeef

#ifdef rvtest_mtrap_routine

tsig_begin_canary:
CANARY;
tsig_begin_canary:
CANARY;
mtrap_sigptr:
    .fill 64*(XLEN/32),4,0xdeadbeef
tsig_end_canary:
CANARY;
tsig_end_canary:
CANARY;

#endif

#ifdef rvtest_gpr_save

gpr_save:
    .fill 32*XLEN/32,4,0xdeadbeef

#endif

sig_end_canary:
CANARY;
rvtest_sig_end:
RVMODEL_DATA_END
