|
| 1 | + |
| 2 | +// ----------- |
| 3 | +// This file was generated by riscv_ctg (https://github.com/riscv-software-src/riscv-ctg) |
| 4 | +// version : 0.11.0 |
| 5 | +// timestamp : Wed Aug 16 05:06:00 2023 GMT |
| 6 | +// usage : riscv_ctg \ |
| 7 | +// -- cgf // --cgf /home/riscv/riscv-ctg/sample_cgfs/dataset.cgf \ |
| 8 | +// --cgf /home/riscv/riscv-ctg/sample_cgfs/RV32C/fld.cgf \ |
| 9 | + \ |
| 10 | +// -- xlen 64 \ |
| 11 | +// ----------- |
| 12 | +// |
| 13 | +// ----------- |
| 14 | +// Copyright (c) 2020. RISC-V International. All rights reserved. |
| 15 | +// SPDX-License-Identifier: BSD-3-Clause |
| 16 | +// ----------- |
| 17 | +// |
| 18 | +// This assembly file tests the c.fld instruction of the RISC-V RV64FDC extension for the c.fld covergroup. |
| 19 | +// |
| 20 | +#include "model_test.h" |
| 21 | +#include "arch_test.h" |
| 22 | +RVTEST_ISA("RV64IFDC") |
| 23 | + |
| 24 | +.section .text.init |
| 25 | +.globl rvtest_entry_point |
| 26 | +rvtest_entry_point: |
| 27 | +RVMODEL_BOOT |
| 28 | +RVTEST_CODE_BEGIN |
| 29 | + |
| 30 | +#ifdef TEST_CASE_1 |
| 31 | + |
| 32 | +RVTEST_CASE(0,"//check ISA:=regex(.*I.*F.*D.*C.*);def TEST_CASE_1=True;",c.fld) |
| 33 | + |
| 34 | +RVTEST_FP_ENABLE() |
| 35 | +RVTEST_VALBASEUPD(x3,test_dataset_0) |
| 36 | +RVTEST_SIGBASE(x1,signature_x1_1) |
| 37 | + |
| 38 | +inst_0: |
| 39 | +// rs1 != rd, rs1==x15, rd==f15,imm_val == 0 and fcsr == 0, |
| 40 | +// opcode:c.fld; op1:x15; dest:f15; immval:0x0; align:0; flagreg:x4 |
| 41 | +TEST_LOAD_F(x1,x2,0,x15,f15,0x0,c.fld,0,x4) |
| 42 | + |
| 43 | +inst_1: |
| 44 | +// rs1==x14, rd==f14,imm_val > 0 and fcsr == 0, |
| 45 | +// opcode:c.fld; op1:x14; dest:f14; immval:0xf8; align:0; flagreg:x4 |
| 46 | +TEST_LOAD_F(x1,x2,0,x14,f14,0xf8,c.fld,0,x4) |
| 47 | + |
| 48 | +inst_2: |
| 49 | +// rs1==x13, rd==f13,imm_val == 168, |
| 50 | +// opcode:c.fld; op1:x13; dest:f13; immval:0xa8; align:0; flagreg:x4 |
| 51 | +TEST_LOAD_F(x1,x2,159,x13,f13,0xa8,c.fld,0,x4) |
| 52 | + |
| 53 | +inst_3: |
| 54 | +// rs1==x12, rd==f12,imm_val == 80, |
| 55 | +// opcode:c.fld; op1:x12; dest:f12; immval:0x50; align:0; flagreg:x4 |
| 56 | +TEST_LOAD_F(x1,x2,159,x12,f12,0x50,c.fld,0,x4) |
| 57 | + |
| 58 | +inst_4: |
| 59 | +// rs1==x11, rd==f11,imm_val == 8, |
| 60 | +// opcode:c.fld; op1:x11; dest:f11; immval:0x8; align:0; flagreg:x4 |
| 61 | +TEST_LOAD_F(x1,x2,159,x11,f11,0x8,c.fld,0,x4) |
| 62 | + |
| 63 | +inst_5: |
| 64 | +// rs1==x10, rd==f10,imm_val == 16, |
| 65 | +// opcode:c.fld; op1:x10; dest:f10; immval:0x10; align:0; flagreg:x4 |
| 66 | +TEST_LOAD_F(x1,x2,159,x10,f10,0x10,c.fld,0,x4) |
| 67 | + |
| 68 | +inst_6: |
| 69 | +// rs1==x9, rd==f9,imm_val == 240, |
| 70 | +// opcode:c.fld; op1:x9; dest:f9; immval:0xf0; align:0; flagreg:x4 |
| 71 | +TEST_LOAD_F(x1,x2,159,x9,f9,0xf0,c.fld,0,x4) |
| 72 | + |
| 73 | +inst_7: |
| 74 | +// rs1==x8, rd==f8,imm_val == 232, |
| 75 | +// opcode:c.fld; op1:x8; dest:f8; immval:0xe8; align:0; flagreg:x4 |
| 76 | +TEST_LOAD_F(x1,x2,159,x8,f8,0xe8,c.fld,0,x4) |
| 77 | + |
| 78 | +inst_8: |
| 79 | +// imm_val == 216, |
| 80 | +// opcode:c.fld; op1:x15; dest:f15; immval:0xd8; align:0; flagreg:x4 |
| 81 | +TEST_LOAD_F(x1,x2,159,x15,f15,0xd8,c.fld,0,x4) |
| 82 | + |
| 83 | +inst_9: |
| 84 | +// imm_val == 184, |
| 85 | +// opcode:c.fld; op1:x15; dest:f15; immval:0xb8; align:0; flagreg:x4 |
| 86 | +TEST_LOAD_F(x1,x2,159,x15,f15,0xb8,c.fld,0,x4) |
| 87 | + |
| 88 | +inst_10: |
| 89 | +// imm_val == 120, |
| 90 | +// opcode:c.fld; op1:x15; dest:f15; immval:0x78; align:0; flagreg:x4 |
| 91 | +TEST_LOAD_F(x1,x2,159,x15,f15,0x78,c.fld,0,x4) |
| 92 | + |
| 93 | +inst_11: |
| 94 | +// imm_val == 32, |
| 95 | +// opcode:c.fld; op1:x15; dest:f15; immval:0x20; align:0; flagreg:x4 |
| 96 | +TEST_LOAD_F(x1,x2,159,x15,f15,0x20,c.fld,0,x4) |
| 97 | + |
| 98 | +inst_12: |
| 99 | +// imm_val == 64, |
| 100 | +// opcode:c.fld; op1:x15; dest:f15; immval:0x40; align:0; flagreg:x4 |
| 101 | +TEST_LOAD_F(x1,x2,159,x15,f15,0x40,c.fld,0,x4) |
| 102 | + |
| 103 | +inst_13: |
| 104 | +// imm_val == 128, |
| 105 | +// opcode:c.fld; op1:x15; dest:f15; immval:0x80; align:0; flagreg:x4 |
| 106 | +TEST_LOAD_F(x1,x2,159,x15,f15,0x80,c.fld,0,x4) |
| 107 | +#endif |
| 108 | + |
| 109 | + |
| 110 | +RVTEST_CODE_END |
| 111 | +RVMODEL_HALT |
| 112 | + |
| 113 | +RVTEST_DATA_BEGIN |
| 114 | +.align 4 |
| 115 | +rvtest_data: |
| 116 | +.word 0xbabecafe |
| 117 | +.word 0xabecafeb |
| 118 | +.word 0xbecafeba |
| 119 | +.word 0xecafebab |
| 120 | +test_dataset_0: |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | + |
| 135 | +RVTEST_DATA_END |
| 136 | + |
| 137 | +RVMODEL_DATA_BEGIN |
| 138 | +rvtest_sig_begin: |
| 139 | +sig_begin_canary: |
| 140 | +CANARY; |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | +signature_x1_0: |
| 145 | + .fill 0*((SIGALIGN)/4),4,0xdeadbeef |
| 146 | + |
| 147 | + |
| 148 | +signature_x1_1: |
| 149 | + .fill 28*((SIGALIGN)/4),4,0xdeadbeef |
| 150 | + |
| 151 | +#ifdef rvtest_mtrap_routine |
| 152 | +tsig_begin_canary: |
| 153 | +CANARY; |
| 154 | + |
| 155 | +mtrap_sigptr: |
| 156 | + .fill 64*XLEN/32,4,0xdeadbeef |
| 157 | + |
| 158 | +tsig_end_canary: |
| 159 | +CANARY; |
| 160 | +#endif |
| 161 | + |
| 162 | +#ifdef rvtest_gpr_save |
| 163 | + |
| 164 | +gpr_save: |
| 165 | + .fill 32*XLEN/32,4,0xdeadbeef |
| 166 | + |
| 167 | +#endif |
| 168 | + |
| 169 | + |
| 170 | +sig_end_canary: |
| 171 | +CANARY; |
| 172 | +rvtest_sig_end: |
| 173 | +RVMODEL_DATA_END |
0 commit comments