
// -----------
// This file was generated by riscv_ctg (https://github.com/riscv-software-src/riscv-ctg)
// version   : 0.12.2
// timestamp : Wed Sep 25 04:44:02 2024 GMT
// usage     : riscv_ctg \
//                  -- cgf //                  --cgf /home/riscv/testing/riscv-ctg/sample_cgfs/dataset.cgf \
//                  --cgf /home/riscv/testing/riscv-ctg/sample_cgfs/sample_cgfs_fext/RV64Zhinx/rv64h_fcvt.lu.h.cgf \
 \
//                  -- xlen 64  \
//                  --randomize \
// -----------
//
// -----------
// Copyright (c) 2020. RISC-V International. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
// -----------
//
// This assembly file tests the fcvt.lu.h instruction of the RISC-V RV64_Zfinx_Zhinx extension for the fcvt.lu.h_b28 covergroup.
// 
#include "model_test.h"
#include "arch_test.h"
RVTEST_ISA("RV64I_Zfinx_Zhinx")

.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.*Zfinx.*Zhinx.*);def TEST_CASE_1=True;",fcvt.lu.h_b28)

RVTEST_FP_ENABLE()
RVTEST_VALBASEUPD(x1,test_dataset_0)
RVTEST_SIGBASE(x2,signature_x2_1)

inst_0:// rs1 != rd, rs1==x20, rd==x11,fs1 == 0 and fe1 == 0x00 and fm1 == 0x000 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x20; dest:x11; op1val:0x0; valaddr_reg:x1;
val_offset:0*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x11, x20, dyn, 0, 0, x1, 0*FLEN/8, x8, x2, x19,FLREG)

inst_1:// rs1 == rd, rs1==x12, rd==x12,fs1 == 0 and fe1 == 0x0e and fm1 == 0x092 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x12; dest:x12; op1val:0x3892; valaddr_reg:x1;
val_offset:1*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x12, x12, dyn, 0, 0, x1, 1*FLEN/8, x8, x2, x19,FLREG)

inst_2:// rs1==x26, rd==x21,fs1 == 0 and fe1 == 0x0f and fm1 == 0x000 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x26; dest:x21; op1val:0x3c00; valaddr_reg:x1;
val_offset:2*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x21, x26, dyn, 0, 0, x1, 2*FLEN/8, x8, x2, x19,FLREG)

inst_3:// rs1==x29, rd==x25,fs1 == 0 and fe1 == 0x0f and fm1 == 0x100 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x29; dest:x25; op1val:0x3d00; valaddr_reg:x1;
val_offset:3*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x25, x29, dyn, 0, 0, x1, 3*FLEN/8, x8, x2, x19,FLREG)

inst_4:// rs1==x10, rd==x6,fs1 == 0 and fe1 == 0x0f and fm1 == 0x200 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x10; dest:x6; op1val:0x3e00; valaddr_reg:x1;
val_offset:4*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x6, x10, dyn, 0, 0, x1, 4*FLEN/8, x8, x2, x19,FLREG)

inst_5:// rs1==x18, rd==x28,fs1 == 0 and fe1 == 0x0f and fm1 == 0x300 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x18; dest:x28; op1val:0x3f00; valaddr_reg:x1;
val_offset:5*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x28, x18, dyn, 0, 0, x1, 5*FLEN/8, x8, x2, x19,FLREG)

inst_6:// rs1==x0, rd==x22,fs1 == 0 and fe1 == 0x10 and fm1 == 0x000 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x0; dest:x22; op1val:0x0; valaddr_reg:x1;
val_offset:6*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x22, x0, dyn, 0, 0, x1, 6*FLEN/8, x8, x2, x19,FLREG)

inst_7:// rs1==x17, rd==x7,fs1 == 0 and fe1 == 0x10 and fm1 == 0x080 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x17; dest:x7; op1val:0x4080; valaddr_reg:x1;
val_offset:7*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x7, x17, dyn, 0, 0, x1, 7*FLEN/8, x8, x2, x19,FLREG)

inst_8:// rs1==x9, rd==x23,fs1 == 0 and fe1 == 0x10 and fm1 == 0x100 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x9; dest:x23; op1val:0x4100; valaddr_reg:x1;
val_offset:8*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x23, x9, dyn, 0, 0, x1, 8*FLEN/8, x8, x2, x19,FLREG)

inst_9:// rs1==x14, rd==x5,fs1 == 0 and fe1 == 0x10 and fm1 == 0x180 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x14; dest:x5; op1val:0x4180; valaddr_reg:x1;
val_offset:9*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x5, x14, dyn, 0, 0, x1, 9*FLEN/8, x8, x2, x19,FLREG)

inst_10:// rs1==x13, rd==x20,fs1 == 0 and fe1 == 0x1c and fm1 == 0x2dc and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x13; dest:x20; op1val:0x72dc; valaddr_reg:x1;
val_offset:10*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x20, x13, dyn, 0, 0, x1, 10*FLEN/8, x8, x2, x19,FLREG)

inst_11:// rs1==x22, rd==x18,fs1 == 0 and fe1 == 0x1d and fm1 == 0x3ff and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x22; dest:x18; op1val:0x77ff; valaddr_reg:x1;
val_offset:11*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x18, x22, dyn, 0, 0, x1, 11*FLEN/8, x8, x2, x19,FLREG)

inst_12:// rs1==x3, rd==x10,fs1 == 0 and fe1 == 0x1f and fm1 == 0x000 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x3; dest:x10; op1val:0x7c00; valaddr_reg:x1;
val_offset:12*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x10, x3, dyn, 0, 0, x1, 12*FLEN/8, x8, x2, x19,FLREG)

inst_13:// rs1==x15, rd==x14,fs1 == 0 and fe1 == 0x1f and fm1 == 0x001 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x15; dest:x14; op1val:0x7c01; valaddr_reg:x1;
val_offset:13*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x14, x15, dyn, 0, 0, x1, 13*FLEN/8, x8, x2, x19,FLREG)

inst_14:// rs1==x23, rd==x3,fs1 == 0 and fe1 == 0x1f and fm1 == 0x201 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x23; dest:x3; op1val:0x7e01; valaddr_reg:x1;
val_offset:14*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x3, x23, dyn, 0, 0, x1, 14*FLEN/8, x8, x2, x19,FLREG)

inst_15:// rs1==x6, rd==x30,fs1 == 1 and fe1 == 0x00 and fm1 == 0x000 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x6; dest:x30; op1val:0x8000; valaddr_reg:x1;
val_offset:15*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x30, x6, dyn, 0, 0, x1, 15*FLEN/8, x8, x2, x19,FLREG)

inst_16:// rs1==x7, rd==x4,fs1 == 1 and fe1 == 0x0d and fm1 == 0x2c0 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x7; dest:x4; op1val:0xb6c0; valaddr_reg:x1;
val_offset:16*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x4, x7, dyn, 0, 0, x1, 16*FLEN/8, x8, x2, x19,FLREG)

inst_17:// rs1==x21, rd==x26,fs1 == 1 and fe1 == 0x0f and fm1 == 0x000 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x21; dest:x26; op1val:0xbc00; valaddr_reg:x1;
val_offset:17*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x26, x21, dyn, 0, 0, x1, 17*FLEN/8, x8, x2, x19,FLREG)

inst_18:// rs1==x30, rd==x16,fs1 == 1 and fe1 == 0x10 and fm1 == 0x180 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x30; dest:x16; op1val:0xc180; valaddr_reg:x1;
val_offset:18*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x16, x30, dyn, 0, 0, x1, 18*FLEN/8, x8, x2, x19,FLREG)
RVTEST_VALBASEUPD(x7,test_dataset_1)

inst_19:// rs1==x25, rd==x15,fs1 == 1 and fe1 == 0x10 and fm1 == 0x100 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x25; dest:x15; op1val:0xc100; valaddr_reg:x7;
val_offset:0*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x15, x25, dyn, 0, 0, x7, 0*FLEN/8, x10, x2, x19,FLREG)

inst_20:// rs1==x1, rd==x8,fs1 == 1 and fe1 == 0x10 and fm1 == 0x080 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x1; dest:x8; op1val:0xc080; valaddr_reg:x7;
val_offset:1*FLEN/8; rmval:dyn; correctval:??; testreg:x19;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x8, x1, dyn, 0, 0, x7, 1*FLEN/8, x10, x2, x19,FLREG)

inst_21:// rs1==x24, rd==x27,fs1 == 1 and fe1 == 0x10 and fm1 == 0x000 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x24; dest:x27; op1val:0xc000; valaddr_reg:x7;
val_offset:2*FLEN/8; rmval:dyn; correctval:??; testreg:x6;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x27, x24, dyn, 0, 0, x7, 2*FLEN/8, x10, x2, x6,FLREG)
RVTEST_SIGBASE(x3,signature_x3_0)

inst_22:// rs1==x27, rd==x2,fs1 == 1 and fe1 == 0x0f and fm1 == 0x300 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x27; dest:x2; op1val:0xbf00; valaddr_reg:x7;
val_offset:3*FLEN/8; rmval:dyn; correctval:??; testreg:x6;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x2, x27, dyn, 0, 0, x7, 3*FLEN/8, x10, x3, x6,FLREG)

inst_23:// rs1==x5, rd==x29,fs1 == 1 and fe1 == 0x0f and fm1 == 0x200 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x5; dest:x29; op1val:0xbe00; valaddr_reg:x7;
val_offset:4*FLEN/8; rmval:dyn; correctval:??; testreg:x6;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x29, x5, dyn, 0, 0, x7, 4*FLEN/8, x10, x3, x6,FLREG)

inst_24:// rs1==x19, rd==x17,fs1 == 1 and fe1 == 0x0f and fm1 == 0x100 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x19; dest:x17; op1val:0xbd00; valaddr_reg:x7;
val_offset:5*FLEN/8; rmval:dyn; correctval:??; testreg:x6;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x17, x19, dyn, 0, 0, x7, 5*FLEN/8, x10, x3, x6,FLREG)

inst_25:// rs1==x8, rd==x0,fs1 == 1 and fe1 == 0x1d and fm1 == 0x259 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x8; dest:x0; op1val:0xf659; valaddr_reg:x7;
val_offset:6*FLEN/8; rmval:dyn; correctval:??; testreg:x6;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x0, x8, dyn, 0, 0, x7, 6*FLEN/8, x10, x3, x6,FLREG)

inst_26:// rs1==x28, rd==x1,fs1 == 1 and fe1 == 0x1e and fm1 == 0x000 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x28; dest:x1; op1val:0xf800; valaddr_reg:x7;
val_offset:7*FLEN/8; rmval:dyn; correctval:??; testreg:x6;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x1, x28, dyn, 0, 0, x7, 7*FLEN/8, x10, x3, x6,FLREG)

inst_27:// rs1==x31, rd==x13,fs1 == 1 and fe1 == 0x1f and fm1 == 0x000 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x31; dest:x13; op1val:0xfc00; valaddr_reg:x7;
val_offset:8*FLEN/8; rmval:dyn; correctval:??; testreg:x6;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x13, x31, dyn, 0, 0, x7, 8*FLEN/8, x10, x3, x6,FLREG)

inst_28:// rs1==x11, rd==x24,
/* opcode: fcvt.lu.h ; op1:x11; dest:x24; op1val:0x0; valaddr_reg:x7;
val_offset:9*FLEN/8; rmval:rne; correctval:??; testreg:x6;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x24, x11, rne, 0, 0, x7, 9*FLEN/8, x10, x3, x6,FLREG)

inst_29:// rs1==x4, rd==x9,
/* opcode: fcvt.lu.h ; op1:x4; dest:x9; op1val:0x0; valaddr_reg:x7;
val_offset:10*FLEN/8; rmval:rne; correctval:??; testreg:x6;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x9, x4, rne, 0, 0, x7, 10*FLEN/8, x10, x3, x6,FLREG)

inst_30:// rs1==x16, rd==x19,
/* opcode: fcvt.lu.h ; op1:x16; dest:x19; op1val:0x0; valaddr_reg:x7;
val_offset:11*FLEN/8; rmval:rne; correctval:??; testreg:x6;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x19, x16, rne, 0, 0, x7, 11*FLEN/8, x10, x3, x6,FLREG)

inst_31:// rs1==x2, rd==x31,
/* opcode: fcvt.lu.h ; op1:x2; dest:x31; op1val:0x0; valaddr_reg:x7;
val_offset:12*FLEN/8; rmval:rne; correctval:??; testreg:x6;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x31, x2, rne, 0, 0, x7, 12*FLEN/8, x10, x3, x6,FLREG)

inst_32:// fs1 == 0 and fe1 == 0x10 and fm1 == 0x000 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0x0000  
/* opcode: fcvt.lu.h ; op1:x30; dest:x31; op1val:0x4000; valaddr_reg:x7;
val_offset:13*FLEN/8; rmval:dyn; correctval:??; testreg:x6;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x31, x30, dyn, 0, 0, x7, 13*FLEN/8, x10, x3, x6,FLREG)

inst_33:// fs1 == 1 and fe1 == 0x1d and fm1 == 0x259 and  fcsr == 0x0 and rm_val == 7  and rs1_sgn_prefix == 0xffff  
/* opcode: fcvt.lu.h ; op1:x30; dest:x31; op1val:0xf659; valaddr_reg:x7;
val_offset:14*FLEN/8; rmval:dyn; correctval:??; testreg:x6;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.h, x31, x30, dyn, 0, 0, x7, 14*FLEN/8, x10, x3, x6,FLREG)
#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(0,32,FLEN)
NAN_BOXED(14482,32,FLEN)
NAN_BOXED(15360,32,FLEN)
NAN_BOXED(15616,32,FLEN)
NAN_BOXED(15872,32,FLEN)
NAN_BOXED(16128,32,FLEN)
NAN_BOXED(0,32,FLEN)
NAN_BOXED(16512,32,FLEN)
NAN_BOXED(16640,32,FLEN)
NAN_BOXED(16768,32,FLEN)
NAN_BOXED(29404,32,FLEN)
NAN_BOXED(30719,32,FLEN)
NAN_BOXED(31744,32,FLEN)
NAN_BOXED(31745,32,FLEN)
NAN_BOXED(32257,32,FLEN)
NAN_BOXED(32768,16,FLEN)
NAN_BOXED(46784,16,FLEN)
NAN_BOXED(48128,16,FLEN)
NAN_BOXED(49536,16,FLEN)
test_dataset_1:
NAN_BOXED(49408,16,FLEN)
NAN_BOXED(49280,16,FLEN)
NAN_BOXED(49152,16,FLEN)
NAN_BOXED(48896,16,FLEN)
NAN_BOXED(48640,16,FLEN)
NAN_BOXED(48384,16,FLEN)
NAN_BOXED(63065,16,FLEN)
NAN_BOXED(63488,16,FLEN)
NAN_BOXED(64512,16,FLEN)
NAN_BOXED(0,16,FLEN)
NAN_BOXED(0,16,FLEN)
NAN_BOXED(0,16,FLEN)
NAN_BOXED(0,16,FLEN)
NAN_BOXED(16384,16,FLEN)
NAN_BOXED(63065,16,FLEN)
RVTEST_DATA_END

RVMODEL_DATA_BEGIN
rvtest_sig_begin:
sig_begin_canary:
CANARY;



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


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


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

#ifdef rvtest_mtrap_routine
tsig_begin_canary:
CANARY;

mtrap_sigptr:
    .fill 64*XLEN/32,4,0xdeadbeef

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
