aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/mcode/ortho_code-x86-insns.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-11-12 07:02:47 +0100
committerTristan Gingold <tgingold@free.fr>2015-11-12 07:02:47 +0100
commit02dbf10ab326793ed997b91e4647218cab01fe3b (patch)
treea9ecc2d48d11e5f053b8ad5cdabd8cb7f61cf86e /src/ortho/mcode/ortho_code-x86-insns.adb
parentd311f82ce7a565123f31bfab734489bcf4a51895 (diff)
downloadghdl-02dbf10ab326793ed997b91e4647218cab01fe3b.tar.gz
ghdl-02dbf10ab326793ed997b91e4647218cab01fe3b.tar.bz2
ghdl-02dbf10ab326793ed997b91e4647218cab01fe3b.zip
mcode x86: enable sse.
Diffstat (limited to 'src/ortho/mcode/ortho_code-x86-insns.adb')
-rw-r--r--src/ortho/mcode/ortho_code-x86-insns.adb21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/ortho/mcode/ortho_code-x86-insns.adb b/src/ortho/mcode/ortho_code-x86-insns.adb
index 7560abc00..d57938a1d 100644
--- a/src/ortho/mcode/ortho_code-x86-insns.adb
+++ b/src/ortho/mcode/ortho_code-x86-insns.adb
@@ -1658,16 +1658,25 @@ package body Ortho_Code.X86.Insns is
return Insert_Intrinsic (Stmt, R_Edx_Eax, Pnum);
when Mode_F32
| Mode_F64 =>
- Reg_Res := Get_Reg_Any (Mode);
+ if Abi.Flag_Sse2 then
+ if Reg in Regs_Xmm then
+ Reg_Res := Reg;
+ else
+ Reg_Res := R_Any_Xmm;
+ end if;
+ else
+ Reg_Res := R_St0;
+ end if;
+ Right := Gen_Insn (Right, R_Irm, Num);
Left := Gen_Insn (Left, Reg_Res, Num);
- Right := Gen_Insn (Right, R_Rm, Num);
+ Right := Reload (Right, R_Irm, Num);
Left := Reload (Left, Reg_Res, Num);
- Set_Expr_Left (Stmt, Left);
+ Reg_Res := Get_Expr_Reg (Left);
Set_Expr_Right (Stmt, Right);
+ Set_Expr_Left (Stmt, Left);
+ Set_Expr_Reg (Stmt, Reg_Res);
+ Renum_Reg (Reg_Res, Stmt, Pnum);
Free_Insn_Regs (Right);
- Free_Insn_Regs (Left);
- Reg_Res := Get_Expr_Reg (Left);
- Set_Expr_Reg (Stmt, Alloc_Reg (Reg_Res, Stmt, Pnum));
Link_Stmt (Stmt);
return Stmt;
when others =>