summaryrefslogtreecommitdiff
path: root/src/arch/arm/insts
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:15 -0500
committerGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:15 -0500
commitefbceff96abafc76f7b4e9cb7b3bb5fcee3681e6 (patch)
treede3d6c8884a1e2a432432481d0d821cb2fea4227 /src/arch/arm/insts
parent1b3b75ee681b1fe83ccf1240bf5d1afa174c6421 (diff)
downloadgem5-efbceff96abafc76f7b4e9cb7b3bb5fcee3681e6.tar.xz
ARM: Add barriers that make sure FP operations happen where they're supposed to.
Diffstat (limited to 'src/arch/arm/insts')
-rw-r--r--src/arch/arm/insts/vfp.hh16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/arch/arm/insts/vfp.hh b/src/arch/arm/insts/vfp.hh
index ceeaaa3cd..5a0ecf828 100644
--- a/src/arch/arm/insts/vfp.hh
+++ b/src/arch/arm/insts/vfp.hh
@@ -110,21 +110,21 @@ vfpFpSToFixed(float val, bool isSigned, bool half, uint8_t imm)
feclearexcept(FeAllExceptions);
if (isSigned) {
if (half) {
- if (val < (int16_t)(1 << 15)) {
+ if ((double)val < (int16_t)(1 << 15)) {
feraiseexcept(FeInvalid);
return (int16_t)(1 << 15);
}
- if (val > (int16_t)mask(15)) {
+ if ((double)val > (int16_t)mask(15)) {
feraiseexcept(FeInvalid);
return (int16_t)mask(15);
}
return (int16_t)val;
} else {
- if (val < (int32_t)(1 << 31)) {
+ if ((double)val < (int32_t)(1 << 31)) {
feraiseexcept(FeInvalid);
return (int32_t)(1 << 31);
}
- if (val > (int32_t)mask(31)) {
+ if ((double)val > (int32_t)mask(31)) {
feraiseexcept(FeInvalid);
return (int32_t)mask(31);
}
@@ -132,21 +132,21 @@ vfpFpSToFixed(float val, bool isSigned, bool half, uint8_t imm)
}
} else {
if (half) {
- if (val < 0) {
+ if ((double)val < 0) {
feraiseexcept(FeInvalid);
return 0;
}
- if (val > (mask(16))) {
+ if ((double)val > (mask(16))) {
feraiseexcept(FeInvalid);
return mask(16);
}
return (uint16_t)val;
} else {
- if (val < 0) {
+ if ((double)val < 0) {
feraiseexcept(FeInvalid);
return 0;
}
- if (val > (mask(32))) {
+ if ((double)val > (mask(32))) {
feraiseexcept(FeInvalid);
return mask(32);
}