From 7e0ae2e984d9602560ed86314a1a43bdbd35ed39 Mon Sep 17 00:00:00 2001 From: sergei Date: Thu, 13 Jun 2013 23:50:20 +0000 Subject: [PATCH] * MIPS: fixed cgsize2subreg to return correct result for float registers. - TCGMIPS.getfpuregister override is no longer necessary with the above fix. git-svn-id: trunk@24893 - --- compiler/mips/cgcpu.pas | 10 ---------- compiler/mips/cpubase.pas | 13 ++++++++++--- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/compiler/mips/cgcpu.pas b/compiler/mips/cgcpu.pas index 6d445eae7c..cfdab214e9 100644 --- a/compiler/mips/cgcpu.pas +++ b/compiler/mips/cgcpu.pas @@ -39,7 +39,6 @@ type procedure init_register_allocators; override; procedure done_register_allocators; override; - function getfpuregister(list: tasmlist; size: Tcgsize): Tregister; override; /// { needed by cg64 } procedure make_simple_ref(list: tasmlist; var ref: treference); procedure handle_reg_const_reg(list: tasmlist; op: Tasmop; src: tregister; a: tcgint; dst: tregister); @@ -445,15 +444,6 @@ begin end; -function TCGMIPS.getfpuregister(list: tasmlist; size: Tcgsize): Tregister; -begin - if size = OS_F64 then - Result := rg[R_FPUREGISTER].getregister(list, R_SUBFD) - else - Result := rg[R_FPUREGISTER].getregister(list, R_SUBFS); -end; - - procedure TCGMIPS.a_loadfpu_ref_cgpara(list: tasmlist; size: tcgsize; const ref: treference; const paraloc: TCGPara); var href, href2: treference; diff --git a/compiler/mips/cpubase.pas b/compiler/mips/cpubase.pas index 6258e11cf1..ea5032613c 100644 --- a/compiler/mips/cpubase.pas +++ b/compiler/mips/cpubase.pas @@ -296,10 +296,17 @@ unit cpubase; function cgsize2subreg(regtype: tregistertype; s:tcgsize):tsubregister; begin - if s in [OS_64,OS_S64] then - cgsize2subreg:=R_SUBQ + case regtype of + R_FPUREGISTER: + if s=OS_F32 then + result:=R_SUBFS + else if s=OS_F64 then + result:=R_SUBFD + else + internalerror(2013021301); else - cgsize2subreg:=R_SUBWHOLE; + result:=R_SUBWHOLE; + end; end;