summaryrefslogtreecommitdiff
path: root/src/arch/arm/isa/formats/fp.isa
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
commitaa05e5401c37c7e60f28e13f8e6de5c5f74e904d (patch)
tree29f57669d184808df45280d9a7928899803a7ca3 /src/arch/arm/isa/formats/fp.isa
parent86a1093992e686cac81db2555c477e2b4cad0c63 (diff)
downloadgem5-aa05e5401c37c7e60f28e13f8e6de5c5f74e904d.tar.xz
ARM: Implement the floating/fixed point VCVT instructions.
Diffstat (limited to 'src/arch/arm/isa/formats/fp.isa')
-rw-r--r--src/arch/arm/isa/formats/fp.isa84
1 files changed, 80 insertions, 4 deletions
diff --git a/src/arch/arm/isa/formats/fp.isa b/src/arch/arm/isa/formats/fp.isa
index e553b180d..3d40caf9e 100644
--- a/src/arch/arm/isa/formats/fp.isa
+++ b/src/arch/arm/isa/formats/fp.isa
@@ -683,9 +683,47 @@ let {{
}
}
case 0xa:
+ {
+ const bool half = (bits(machInst, 7) == 0);
+ const uint32_t imm = bits(machInst, 5) |
+ (bits(machInst, 3, 0) << 1);
+ const uint32_t size =
+ (bits(machInst, 7) == 0 ? 16 : 32) - imm;
+ if (single) {
+ if (half) {
+ return new VcvtSHFixedFpS(machInst, vd, vd, size);
+ } else {
+ return new VcvtSFixedFpS(machInst, vd, vd, size);
+ }
+ } else {
+ if (half) {
+ return new VcvtSHFixedFpD(machInst, vd, vd, size);
+ } else {
+ return new VcvtSFixedFpD(machInst, vd, vd, size);
+ }
+ }
+ }
case 0xb:
- // Between FP and fixed point.
- return new WarnUnimplemented("vcvt", machInst);
+ {
+ const bool half = (bits(machInst, 7) == 0);
+ const uint32_t imm = bits(machInst, 5) |
+ (bits(machInst, 3, 0) << 1);
+ const uint32_t size =
+ (bits(machInst, 7) == 0 ? 16 : 32) - imm;
+ if (single) {
+ if (half) {
+ return new VcvtUHFixedFpS(machInst, vd, vd, size);
+ } else {
+ return new VcvtUFixedFpS(machInst, vd, vd, size);
+ }
+ } else {
+ if (half) {
+ return new VcvtUHFixedFpD(machInst, vd, vd, size);
+ } else {
+ return new VcvtUFixedFpD(machInst, vd, vd, size);
+ }
+ }
+ }
case 0xc:
if (single) {
return new VcvtFpUIntS(machInst, vd, vm);
@@ -703,9 +741,47 @@ let {{
return new VcvtFpSIntD(machInst, vd, vm);
}
case 0xe:
+ {
+ const bool half = (bits(machInst, 7) == 0);
+ const uint32_t imm = bits(machInst, 5) |
+ (bits(machInst, 3, 0) << 1);
+ const uint32_t size =
+ (bits(machInst, 7) == 0 ? 16 : 32) - imm;
+ if (single) {
+ if (half) {
+ return new VcvtFpSHFixedS(machInst, vd, vd, size);
+ } else {
+ return new VcvtFpSFixedS(machInst, vd, vd, size);
+ }
+ } else {
+ if (half) {
+ return new VcvtFpSHFixedD(machInst, vd, vd, size);
+ } else {
+ return new VcvtFpSFixedD(machInst, vd, vd, size);
+ }
+ }
+ }
case 0xf:
- // Between FP and fixed point.
- return new WarnUnimplemented("vcvt", machInst);
+ {
+ const bool half = (bits(machInst, 7) == 0);
+ const uint32_t imm = bits(machInst, 5) |
+ (bits(machInst, 3, 0) << 1);
+ const uint32_t size =
+ (bits(machInst, 7) == 0 ? 16 : 32) - imm;
+ if (single) {
+ if (half) {
+ return new VcvtFpUHFixedS(machInst, vd, vd, size);
+ } else {
+ return new VcvtFpUFixedS(machInst, vd, vd, size);
+ }
+ } else {
+ if (half) {
+ return new VcvtFpUHFixedD(machInst, vd, vd, size);
+ } else {
+ return new VcvtFpUFixedD(machInst, vd, vd, size);
+ }
+ }
+ }
}
break;
}