summaryrefslogtreecommitdiff
path: root/cgiwas.c
diff options
context:
space:
mode:
authorJohn van Groningen2007-05-10 10:11:32 +0000
committerJohn van Groningen2007-05-10 10:11:32 +0000
commit74ff3fabc28497d3e48c88ed6e7468f2838a3a0c (patch)
treee1b3d2008b1f5419d8d0b60c26824d9ad5a46fc4 /cgiwas.c
parentpass {#Int} and {#Real} using centry, (diff)
rename IMOVEW as IMOVEDB,
add sincosR instruction for IA32, add 32 bit integer and real arrays for AI64
Diffstat (limited to 'cgiwas.c')
-rw-r--r--cgiwas.c56
1 files changed, 50 insertions, 6 deletions
diff --git a/cgiwas.c b/cgiwas.c
index d59dc6e..2fa7cfd 100644
--- a/cgiwas.c
+++ b/cgiwas.c
@@ -2843,6 +2843,47 @@ static void w_as_monadic_float_instruction (struct instruction *instruction,char
#endif
}
+static void w_as_fsincos_instruction (struct instruction *instruction)
+{
+ int f_reg1,f_reg2;
+
+ f_reg1=instruction->instruction_parameters[0].parameter_data.reg.r;
+ f_reg2=instruction->instruction_parameters[1].parameter_data.reg.r;
+
+ if (f_reg1!=0){
+ w_as_opcode ("fxch");
+ w_as_fp_register_newline (f_reg1);
+ }
+
+ w_as_opcode ("fsincos");
+ w_as_newline();
+
+ if (f_reg1==0){
+#ifdef FP_STACK_OPTIMIZATIONS
+ fstpl_instruction (f_reg2,instruction);
+#else
+ w_as_opcode ("fstp");
+ w_as_fp_register_newline (f_reg2+1);
+#endif
+ } else if (f_reg2==0){
+ w_as_opcode ("fxch");
+ w_as_fp_register_newline (1);
+
+#ifdef FP_STACK_OPTIMIZATIONS
+ fstpl_instruction (f_reg1,instruction);
+#else
+ w_as_opcode ("fstp");
+ w_as_fp_register_newline (f_reg1+1);
+#endif
+ } else {
+ w_as_opcode ("fstp");
+ w_as_fp_register_newline (f_reg2+1);
+
+ w_as_opcode ("fxch");
+ w_as_fp_register_newline (f_reg1);
+ }
+}
+
static struct instruction *w_as_fmove_instruction (struct instruction *instruction)
{
switch (instruction->instruction_parameters[1].parameter_type){
@@ -3376,7 +3417,7 @@ static void w_as_instructions (register struct instruction *instruction)
case IBTST:
w_as_btst_instruction (instruction);
break;
- case IMOVEW:
+ case IMOVEDB:
w_as_move_instruction (instruction,SIZE_WORD);
break;
case IMOVEB:
@@ -3505,17 +3546,20 @@ static void w_as_instructions (register struct instruction *instruction)
case IFCNE:
w_as_convert_float_condition_instruction (instruction,3);
break;
-#ifdef FP_STACK_OPTIMIZATIONS
- case IFEXG:
- w_as_fexg (instruction);
- break;
-#endif
case IWORD:
w_as_word_instruction (instruction);
break;
case IRTSI:
w_as_rtsi_instruction (instruction);
break;
+#ifdef FP_STACK_OPTIMIZATIONS
+ case IFEXG:
+ w_as_fexg (instruction);
+ break;
+#endif
+ case IFSINCOS:
+ w_as_fsincos_instruction (instruction);
+ break;
case IFTST:
default:
internal_error_in_function ("w_as_instructions");