aboutsummaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@college-de-france.fr>2020-02-27 10:04:43 +0100
committerXavier Leroy <xavierleroy@users.noreply.github.com>2020-03-02 10:30:15 +0100
commit78d76b65b417b2724cc54a7e5fc5d434d8fc57b5 (patch)
treeecbdb641dee79e190c4e26ba4a0d207a6104e2b6 /backend
parente66be6e05b190c51b38d628884ef3e015ebf73fd (diff)
downloadcompcert-78d76b65b417b2724cc54a7e5fc5d434d8fc57b5.tar.gz
compcert-78d76b65b417b2724cc54a7e5fc5d434d8fc57b5.zip
Define IRC.class_of_type for types Tany32, Tany64
Until now the types Tany32 and Tany64 were not used prior to register allocation, so IRC.class_of_type did not need to be defined for those types. However, there are possible uses of stack slots of type Tany32 and Tany64 to specify calling conventions. For this purpose, we need to define class_of_type for Tany32 and Tany64. We follow the informal convention that Tany32 goes in integer registers and Tany64 goes into integer registers if 64-bit wide, or FP registers otherwise.
Diffstat (limited to 'backend')
-rw-r--r--backend/IRC.ml3
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/IRC.ml b/backend/IRC.ml
index 43955897..b359da35 100644
--- a/backend/IRC.ml
+++ b/backend/IRC.ml
@@ -240,7 +240,8 @@ type graph = {
let class_of_type = function
| Tint | Tlong -> 0
| Tfloat | Tsingle -> 1
- | Tany32 | Tany64 -> assert false
+ | Tany32 -> 0
+ | Tany64 -> if Archi.ptr64 then 0 else 1
let class_of_reg r =
if Conventions1.is_float_reg r then 1 else 0