decoder.isa (12428:ddc6b7179c81) decoder.isa (12444:06e9f1927cc7)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2015 RISC-V Foundation
4// Copyright (c) 2017 The University of Virginia
5// All rights reserved.
6//
7// Redistribution and use in source and binary forms, with or without
8// modification, are permitted provided that the following conditions are

--- 1324 unchanged lines hidden (view full) ---

1333 0x60: decode CONV_SGN {
1334 0x0: fcvt_w_s({{
1335 uint32_t temp;
1336 float fs1 = reinterpret_cast<float&>(temp = Fs1_bits);
1337
1338 if (std::isnan(fs1)) {
1339 Rd_sd = numeric_limits<int32_t>::max();
1340 FFLAGS |= FloatInvalid;
1// -*- mode:c++ -*-
2
3// Copyright (c) 2015 RISC-V Foundation
4// Copyright (c) 2017 The University of Virginia
5// All rights reserved.
6//
7// Redistribution and use in source and binary forms, with or without
8// modification, are permitted provided that the following conditions are

--- 1324 unchanged lines hidden (view full) ---

1333 0x60: decode CONV_SGN {
1334 0x0: fcvt_w_s({{
1335 uint32_t temp;
1336 float fs1 = reinterpret_cast<float&>(temp = Fs1_bits);
1337
1338 if (std::isnan(fs1)) {
1339 Rd_sd = numeric_limits<int32_t>::max();
1340 FFLAGS |= FloatInvalid;
1341 } else if (fs1 >= numeric_limits<int32_t>::max()) {
1342 Rd_sd = numeric_limits<int32_t>::max();
1343 FFLAGS |= FloatInvalid;
1344 } else if (fs1 <= numeric_limits<int32_t>::min()) {
1345 Rd_sd = numeric_limits<int32_t>::min();
1346 FFLAGS |= FloatInvalid;
1341 } else {
1342 Rd_sd = (int32_t)fs1;
1347 } else {
1348 Rd_sd = (int32_t)fs1;
1343 if (fetestexcept(FE_INVALID)) {
1344 if (signbit(fs1)) {
1345 Rd_sd = numeric_limits<int32_t>::min();
1346 } else {
1347 Rd_sd = numeric_limits<int32_t>::max();
1348 }
1349 feclearexcept(FE_INEXACT);
1350 }
1351 }
1352 }}, FloatCvtOp);
1353 0x1: fcvt_wu_s({{
1354 uint32_t temp;
1355 float fs1 = reinterpret_cast<float&>(temp = Fs1_bits);
1356
1349 }
1350 }}, FloatCvtOp);
1351 0x1: fcvt_wu_s({{
1352 uint32_t temp;
1353 float fs1 = reinterpret_cast<float&>(temp = Fs1_bits);
1354
1357 if (fs1 < 0.0) {
1355 if (std::isnan(fs1)) {
1356 Rd = numeric_limits<uint64_t>::max();
1357 FFLAGS |= FloatInvalid;
1358 } else if (fs1 < 0.0) {
1358 Rd = 0;
1359 FFLAGS |= FloatInvalid;
1359 Rd = 0;
1360 FFLAGS |= FloatInvalid;
1361 } else if (fs1 > numeric_limits<uint32_t>::max()) {
1362 Rd = numeric_limits<uint64_t>::max();
1363 FFLAGS |= FloatInvalid;
1360 } else {
1361 Rd = (uint32_t)fs1;
1364 } else {
1365 Rd = (uint32_t)fs1;
1362 if (fetestexcept(FE_INVALID)) {
1363 Rd = numeric_limits<uint64_t>::max();
1364 feclearexcept(FE_INEXACT);
1365 }
1366 }
1367 }}, FloatCvtOp);
1368 0x2: fcvt_l_s({{
1369 uint32_t temp;
1370 float fs1 = reinterpret_cast<float&>(temp = Fs1_bits);
1371
1372 if (std::isnan(fs1)) {
1373 Rd_sd = numeric_limits<int64_t>::max();
1374 FFLAGS |= FloatInvalid;
1366 }
1367 }}, FloatCvtOp);
1368 0x2: fcvt_l_s({{
1369 uint32_t temp;
1370 float fs1 = reinterpret_cast<float&>(temp = Fs1_bits);
1371
1372 if (std::isnan(fs1)) {
1373 Rd_sd = numeric_limits<int64_t>::max();
1374 FFLAGS |= FloatInvalid;
1375 } else if (fs1 > numeric_limits<int64_t>::max()) {
1376 Rd_sd = numeric_limits<int64_t>::max();
1377 FFLAGS |= FloatInvalid;
1378 } else if (fs1 < numeric_limits<int64_t>::min()) {
1379 Rd_sd = numeric_limits<int64_t>::min();
1380 FFLAGS |= FloatInvalid;
1375 } else {
1376 Rd_sd = (int64_t)fs1;
1381 } else {
1382 Rd_sd = (int64_t)fs1;
1377 if (fetestexcept(FE_INVALID)) {
1378 if (signbit(fs1)) {
1379 Rd_sd = numeric_limits<int64_t>::min();
1380 } else {
1381 Rd_sd = numeric_limits<int64_t>::max();
1382 }
1383 feclearexcept(FE_INEXACT);
1384 }
1385 }
1386 }}, FloatCvtOp);
1387 0x3: fcvt_lu_s({{
1388 uint32_t temp;
1389 float fs1 = reinterpret_cast<float&>(temp = Fs1_bits);
1390
1383 }
1384 }}, FloatCvtOp);
1385 0x3: fcvt_lu_s({{
1386 uint32_t temp;
1387 float fs1 = reinterpret_cast<float&>(temp = Fs1_bits);
1388
1391 if (fs1 < 0.0) {
1389 if (std::isnan(fs1)) {
1390 Rd = numeric_limits<uint64_t>::max();
1391 FFLAGS |= FloatInvalid;
1392 } else if (fs1 < 0.0) {
1392 Rd = 0;
1393 FFLAGS |= FloatInvalid;
1393 Rd = 0;
1394 FFLAGS |= FloatInvalid;
1395 } else if (fs1 > numeric_limits<uint64_t>::max()) {
1396 Rd = numeric_limits<uint64_t>::max();
1397 FFLAGS |= FloatInvalid;
1394 } else {
1395 Rd = (uint64_t)fs1;
1398 } else {
1399 Rd = (uint64_t)fs1;
1396 if (fetestexcept(FE_INVALID)) {
1397 Rd = numeric_limits<uint64_t>::max();
1398 feclearexcept(FE_INEXACT);
1399 }
1400 }
1401 }}, FloatCvtOp);
1402 }
1403 0x61: decode CONV_SGN {
1404 0x0: fcvt_w_d({{
1400 }
1401 }}, FloatCvtOp);
1402 }
1403 0x61: decode CONV_SGN {
1404 0x0: fcvt_w_d({{
1405 Rd_sd = (int32_t)Fs1;
1406 if (fetestexcept(FE_INVALID)) {
1407 if (Fs1 < 0.0) {
1408 Rd_sd = numeric_limits<int32_t>::min();
1409 } else {
1410 Rd_sd = numeric_limits<int32_t>::max();
1411 }
1412 feclearexcept(FE_INEXACT);
1405 if (std::isnan(Fs1)) {
1406 Rd_sd = numeric_limits<int32_t>::max();
1407 FFLAGS |= FloatInvalid;
1408 } else if (Fs1 > numeric_limits<int32_t>::max()) {
1409 Rd_sd = numeric_limits<int32_t>::max();
1410 FFLAGS |= FloatInvalid;
1411 } else if (Fs1 < numeric_limits<int32_t>::min()) {
1412 Rd_sd = numeric_limits<int32_t>::min();
1413 FFLAGS |= FloatInvalid;
1414 } else {
1415 Rd_sd = (int32_t)Fs1;
1413 }
1414 }}, FloatCvtOp);
1415 0x1: fcvt_wu_d({{
1416 }
1417 }}, FloatCvtOp);
1418 0x1: fcvt_wu_d({{
1416 if (Fs1 < 0.0) {
1419 if (std::isnan(Fs1)) {
1420 Rd = numeric_limits<uint64_t>::max();
1421 FFLAGS |= FloatInvalid;
1422 } else if (Fs1 < 0) {
1417 Rd = 0;
1418 FFLAGS |= FloatInvalid;
1423 Rd = 0;
1424 FFLAGS |= FloatInvalid;
1425 } else if (Fs1 > numeric_limits<uint32_t>::max()) {
1426 Rd = numeric_limits<uint64_t>::max();
1427 FFLAGS |= FloatInvalid;
1419 } else {
1420 Rd = (uint32_t)Fs1;
1428 } else {
1429 Rd = (uint32_t)Fs1;
1421 if (fetestexcept(FE_INVALID)) {
1422 Rd = numeric_limits<uint64_t>::max();
1423 feclearexcept(FE_INEXACT);
1424 }
1425 }
1426 }}, FloatCvtOp);
1427 0x2: fcvt_l_d({{
1430 }
1431 }}, FloatCvtOp);
1432 0x2: fcvt_l_d({{
1428 Rd_sd = Fs1;
1429 if (fetestexcept(FE_INVALID)) {
1430 if (Fs1 < 0.0) {
1431 Rd_sd = numeric_limits<int64_t>::min();
1432 } else {
1433 Rd_sd = numeric_limits<int64_t>::max();
1434 }
1435 feclearexcept(FE_INEXACT);
1433 if (std::isnan(Fs1)) {
1434 Rd_sd = numeric_limits<int64_t>::max();
1435 FFLAGS |= FloatInvalid;
1436 } else if (Fs1 > numeric_limits<int64_t>::max()) {
1437 Rd_sd = numeric_limits<int64_t>::max();
1438 FFLAGS |= FloatInvalid;
1439 } else if (Fs1 < numeric_limits<int64_t>::min()) {
1440 Rd_sd = numeric_limits<int64_t>::min();
1441 FFLAGS |= FloatInvalid;
1442 } else {
1443 Rd_sd = Fs1;
1436 }
1437 }}, FloatCvtOp);
1438 0x3: fcvt_lu_d({{
1444 }
1445 }}, FloatCvtOp);
1446 0x3: fcvt_lu_d({{
1439 if (Fs1 < 0.0) {
1447 if (std::isnan(Fs1)) {
1448 Rd = numeric_limits<uint64_t>::max();
1449 FFLAGS |= FloatInvalid;
1450 } else if (Fs1 < 0) {
1440 Rd = 0;
1441 FFLAGS |= FloatInvalid;
1451 Rd = 0;
1452 FFLAGS |= FloatInvalid;
1453 } else if (Fs1 > numeric_limits<uint64_t>::max()) {
1454 Rd = numeric_limits<uint64_t>::max();
1455 FFLAGS |= FloatInvalid;
1442 } else {
1456 } else {
1443 Rd = (uint64_t)Fs1;
1444 if (fetestexcept(FE_INVALID)) {
1445 Rd = numeric_limits<uint64_t>::max();
1446 feclearexcept(FE_INEXACT);
1447 }
1457 Rd = Fs1;
1448 }
1449 }}, FloatCvtOp);
1450 }
1451 0x68: decode CONV_SGN {
1452 0x0: fcvt_s_w({{
1453 float temp = (float)Rs1_sw;
1454 Fd_bits = (uint64_t)reinterpret_cast<uint32_t&>(temp);
1455 }}, FloatCvtOp);

--- 246 unchanged lines hidden ---
1458 }
1459 }}, FloatCvtOp);
1460 }
1461 0x68: decode CONV_SGN {
1462 0x0: fcvt_s_w({{
1463 float temp = (float)Rs1_sw;
1464 Fd_bits = (uint64_t)reinterpret_cast<uint32_t&>(temp);
1465 }}, FloatCvtOp);

--- 246 unchanged lines hidden ---