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; |
1347 } else { 1348 Rd_sd = (int32_t)fs1; |
1349 } 1350 }}, FloatCvtOp); 1351 0x1: fcvt_wu_s({{ 1352 uint32_t temp; 1353 float fs1 = reinterpret_cast<float&>(temp = Fs1_bits); 1354 |
1355 if (std::isnan(fs1)) { 1356 Rd = numeric_limits<uint64_t>::max(); 1357 FFLAGS |= FloatInvalid; 1358 } else if (fs1 < 0.0) { |
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; |
1364 } else { 1365 Rd = (uint32_t)fs1; |
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; |
1381 } else { 1382 Rd_sd = (int64_t)fs1; |
1383 } 1384 }}, FloatCvtOp); 1385 0x3: fcvt_lu_s({{ 1386 uint32_t temp; 1387 float fs1 = reinterpret_cast<float&>(temp = Fs1_bits); 1388 |
1389 if (std::isnan(fs1)) { 1390 Rd = numeric_limits<uint64_t>::max(); 1391 FFLAGS |= FloatInvalid; 1392 } else if (fs1 < 0.0) { |
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; |
1398 } else { 1399 Rd = (uint64_t)fs1; |
1400 } 1401 }}, FloatCvtOp); 1402 } 1403 0x61: decode CONV_SGN { 1404 0x0: fcvt_w_d({{ |
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; |
1416 } 1417 }}, FloatCvtOp); 1418 0x1: fcvt_wu_d({{ |
1419 if (std::isnan(Fs1)) { 1420 Rd = numeric_limits<uint64_t>::max(); 1421 FFLAGS |= FloatInvalid; 1422 } else if (Fs1 < 0) { |
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; |
1428 } else { 1429 Rd = (uint32_t)Fs1; |
1430 } 1431 }}, FloatCvtOp); 1432 0x2: fcvt_l_d({{ |
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; |
1444 } 1445 }}, FloatCvtOp); 1446 0x3: fcvt_lu_d({{ |
1447 if (std::isnan(Fs1)) { 1448 Rd = numeric_limits<uint64_t>::max(); 1449 FFLAGS |= FloatInvalid; 1450 } else if (Fs1 < 0) { |
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; |
1456 } else { |
1457 Rd = Fs1; |
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 --- |