
// -----------
// This file was generated by riscv_ctg (https://github.com/riscv-software-src/riscv-ctg)
// version   : 0.11.0
// timestamp : Thu Jul  6 07:22:23 2023 GMT
// usage     : riscv_ctg \
//                  -- cgf //                  --cgf /home/riscv/riscv-ctg/sample_cgfs/dataset.cgf \
//                  --cgf /home/riscv/riscv-ctg/sample_cgfs/sample_cgfs_fext/RV64Zdinx/fcvt.lu.d.cgf \
 \
//                  -- xlen 64  \
// -----------
//
// -----------
// Copyright (c) 2020. RISC-V International. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
// -----------
//
// This assembly file tests the fcvt.lu.d instruction of the RISC-V RV64_Zfinx_Zdinx extension for the fcvt.lu.d_b1 covergroup.
// 
#include "model_test.h"
#include "arch_test.h"
RVTEST_ISA("RV64I_Zfinx_Zdinx")

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

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

inst_0:// rs1==x28, rd==x30,fs1 == 0 and fe1 == 0x000 and fm1 == 0x0000000000000 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x28; dest:x30; op1val:0x0; valaddr_reg:x5;
val_offset:0*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x30, x28, dyn, 0, 0, x5, 0*FLEN/8, x7, x1, x3,LREG)

inst_1:// rs1==x30, rd==x28,fs1 == 1 and fe1 == 0x000 and fm1 == 0x0000000000000 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x30; dest:x28; op1val:0x8000000000000000; valaddr_reg:x5;
val_offset:1*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x28, x30, dyn, 0, 0, x5, 1*FLEN/8, x7, x1, x3,LREG)

inst_2:// rs1==x24, rd==x26,fs1 == 0 and fe1 == 0x000 and fm1 == 0x0000000000001 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x24; dest:x26; op1val:0x1; valaddr_reg:x5;
val_offset:2*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x26, x24, dyn, 0, 0, x5, 2*FLEN/8, x7, x1, x3,LREG)

inst_3:// rs1==x26, rd==x24,fs1 == 1 and fe1 == 0x000 and fm1 == 0x0000000000001 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x26; dest:x24; op1val:0x8000000000000001; valaddr_reg:x5;
val_offset:3*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x24, x26, dyn, 0, 0, x5, 3*FLEN/8, x7, x1, x3,LREG)

inst_4:// rs1==x20, rd==x22,fs1 == 0 and fe1 == 0x000 and fm1 == 0x0000000000002 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x20; dest:x22; op1val:0x2; valaddr_reg:x5;
val_offset:4*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x22, x20, dyn, 0, 0, x5, 4*FLEN/8, x7, x1, x3,LREG)

inst_5:// rs1==x22, rd==x20,fs1 == 1 and fe1 == 0x000 and fm1 == 0x0000000000002 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x22; dest:x20; op1val:0x8000000000000002; valaddr_reg:x5;
val_offset:5*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x20, x22, dyn, 0, 0, x5, 5*FLEN/8, x7, x1, x3,LREG)

inst_6:// rs1==x16, rd==x18,fs1 == 0 and fe1 == 0x000 and fm1 == 0xfffffffffffff and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x16; dest:x18; op1val:0xfffffffffffff; valaddr_reg:x5;
val_offset:6*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x18, x16, dyn, 0, 0, x5, 6*FLEN/8, x7, x1, x3,LREG)

inst_7:// rs1==x18, rd==x16,fs1 == 1 and fe1 == 0x000 and fm1 == 0xfffffffffffff and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x18; dest:x16; op1val:0x800fffffffffffff; valaddr_reg:x5;
val_offset:7*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x16, x18, dyn, 0, 0, x5, 7*FLEN/8, x7, x1, x3,LREG)

inst_8:// rs1==x12, rd==x14,fs1 == 0 and fe1 == 0x001 and fm1 == 0x0000000000000 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x12; dest:x14; op1val:0x10000000000000; valaddr_reg:x5;
val_offset:8*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x14, x12, dyn, 0, 0, x5, 8*FLEN/8, x7, x1, x3,LREG)

inst_9:// rs1==x14, rd==x12,fs1 == 1 and fe1 == 0x001 and fm1 == 0x0000000000000 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x14; dest:x12; op1val:0x8010000000000000; valaddr_reg:x5;
val_offset:9*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x12, x14, dyn, 0, 0, x5, 9*FLEN/8, x7, x1, x3,LREG)

inst_10:// rs1==x8, rd==x10,fs1 == 0 and fe1 == 0x001 and fm1 == 0x0000000000002 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x8; dest:x10; op1val:0x10000000000002; valaddr_reg:x5;
val_offset:10*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x10, x8, dyn, 0, 0, x5, 10*FLEN/8, x7, x1, x3,LREG)

inst_11:// rs1==x10, rd==x8,fs1 == 1 and fe1 == 0x001 and fm1 == 0x0000000000002 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x10; dest:x8; op1val:0x8010000000000002; valaddr_reg:x5;
val_offset:11*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x8, x10, dyn, 0, 0, x5, 11*FLEN/8, x7, x1, x3,LREG)

inst_12:// rs1==x4, rd==x6,fs1 == 0 and fe1 == 0x7fe and fm1 == 0xfffffffffffff and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x4; dest:x6; op1val:0x7fefffffffffffff; valaddr_reg:x5;
val_offset:12*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x6, x4, dyn, 0, 0, x5, 12*FLEN/8, x7, x1, x3,LREG)

inst_13:// rs1==x6, rd==x4,fs1 == 1 and fe1 == 0x7fe and fm1 == 0xfffffffffffff and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x6; dest:x4; op1val:0xffefffffffffffff; valaddr_reg:x5;
val_offset:13*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x4, x6, dyn, 0, 0, x5, 13*FLEN/8, x7, x1, x3,LREG)

inst_14:// rs1==x2,fs1 == 0 and fe1 == 0x7ff and fm1 == 0x0000000000000 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x2; dest:x31; op1val:0x7ff0000000000000; valaddr_reg:x5;
val_offset:14*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x31, x2, dyn, 0, 0, x5, 14*FLEN/8, x7, x1, x3,LREG)

inst_15:// rd==x2,fs1 == 1 and fe1 == 0x7ff and fm1 == 0x0000000000000 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x31; dest:x2; op1val:0xfff0000000000000; valaddr_reg:x5;
val_offset:15*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x2, x31, dyn, 0, 0, x5, 15*FLEN/8, x7, x1, x3,LREG)

inst_16:// fs1 == 0 and fe1 == 0x7ff and fm1 == 0x8000000000000 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x30; dest:x31; op1val:0x7ff8000000000000; valaddr_reg:x5;
val_offset:16*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x31, x30, dyn, 0, 0, x5, 16*FLEN/8, x7, x1, x3,LREG)

inst_17:// fs1 == 1 and fe1 == 0x7ff and fm1 == 0x8000000000000 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x30; dest:x31; op1val:0xfff8000000000000; valaddr_reg:x5;
val_offset:17*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x31, x30, dyn, 0, 0, x5, 17*FLEN/8, x7, x1, x3,LREG)

inst_18:// fs1 == 0 and fe1 == 0x7ff and fm1 == 0x8000000000001 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x30; dest:x31; op1val:0x7ff8000000000001; valaddr_reg:x5;
val_offset:18*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x31, x30, dyn, 0, 0, x5, 18*FLEN/8, x7, x1, x3,LREG)

inst_19:// fs1 == 1 and fe1 == 0x7ff and fm1 == 0x8000000000001 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x30; dest:x31; op1val:0xfff8000000000001; valaddr_reg:x5;
val_offset:19*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x31, x30, dyn, 0, 0, x5, 19*FLEN/8, x7, x1, x3,LREG)

inst_20:// fs1 == 0 and fe1 == 0x7ff and fm1 == 0x0000000000001 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x30; dest:x31; op1val:0x7ff0000000000001; valaddr_reg:x5;
val_offset:20*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x31, x30, dyn, 0, 0, x5, 20*FLEN/8, x7, x1, x3,LREG)

inst_21:// fs1 == 1 and fe1 == 0x7ff and fm1 == 0x0000000000001 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x30; dest:x31; op1val:0xfff0000000000001; valaddr_reg:x5;
val_offset:21*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x31, x30, dyn, 0, 0, x5, 21*FLEN/8, x7, x1, x3,LREG)

inst_22:// fs1 == 0 and fe1 == 0x3ff and fm1 == 0x0000000000000 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x30; dest:x31; op1val:0x3ff0000000000000; valaddr_reg:x5;
val_offset:22*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x31, x30, dyn, 0, 0, x5, 22*FLEN/8, x7, x1, x3,LREG)

inst_23:// fs1 == 1 and fe1 == 0x3f8 and fm1 == 0x0000000000000 and  fcsr == 0x0 and rm_val == 7   
/* opcode: fcvt.lu.d ; op1:x30; dest:x31; op1val:0xbf80000000000000; valaddr_reg:x5;
val_offset:23*FLEN/8; rmval:dyn; correctval:0; testreg:x3;
fcsr_val:0*/
TEST_FPID_OP(fcvt.lu.d, x31, x30, dyn, 0, 0, x5, 23*FLEN/8, x7, x1, x3,LREG)
#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,64,FLEN)
NAN_BOXED(9223372036854775808,64,FLEN)
NAN_BOXED(1,64,FLEN)
NAN_BOXED(9223372036854775809,64,FLEN)
NAN_BOXED(2,64,FLEN)
NAN_BOXED(9223372036854775810,64,FLEN)
NAN_BOXED(4503599627370495,64,FLEN)
NAN_BOXED(9227875636482146303,64,FLEN)
NAN_BOXED(4503599627370496,64,FLEN)
NAN_BOXED(9227875636482146304,64,FLEN)
NAN_BOXED(4503599627370498,64,FLEN)
NAN_BOXED(9227875636482146306,64,FLEN)
NAN_BOXED(9218868437227405311,64,FLEN)
NAN_BOXED(18442240474082181119,64,FLEN)
NAN_BOXED(9218868437227405312,64,FLEN)
NAN_BOXED(18442240474082181120,64,FLEN)
NAN_BOXED(9221120237041090560,64,FLEN)
NAN_BOXED(18444492273895866368,64,FLEN)
NAN_BOXED(9221120237041090561,64,FLEN)
NAN_BOXED(18444492273895866369,64,FLEN)
NAN_BOXED(9218868437227405313,64,FLEN)
NAN_BOXED(18442240474082181121,64,FLEN)
NAN_BOXED(4607182418800017408,64,FLEN)
NAN_BOXED(13799029258263199744,64,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 48*((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
