diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2011-06-07 12:28:21 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2011-06-07 12:28:21 +0000 |
commit | da10ba6f2b652db9667261bbd838e20a63c355d5 (patch) | |
tree | 51730047f4fb38001f0df0514d094841a2fea9ab /powerpc | |
parent | ed975ca89e79ea8b046365a8ef7a2f3557b126c0 (diff) | |
download | compcert-da10ba6f2b652db9667261bbd838e20a63c355d5.tar.gz compcert-da10ba6f2b652db9667261bbd838e20a63c355d5.zip |
Oaddrsymbol and small data area
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1667 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'powerpc')
-rw-r--r-- | powerpc/Asmgen.v | 7 | ||||
-rw-r--r-- | powerpc/Asmgenproof1.v | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/powerpc/Asmgen.v b/powerpc/Asmgen.v index 5e3d39b3..6b47d750 100644 --- a/powerpc/Asmgen.v +++ b/powerpc/Asmgen.v @@ -252,8 +252,11 @@ Definition transl_op | Ofloatconst f, nil => Plfi (freg_of r) f :: k | Oaddrsymbol s ofs, nil => - Paddis GPR12 GPR0 (Csymbol_high s ofs) :: - Paddi (ireg_of r) GPR12 (Csymbol_low s ofs) :: k + if symbol_is_small_data s ofs then + Paddi (ireg_of r) GPR0 (Csymbol_sda s ofs) :: k + else + Paddis GPR12 GPR0 (Csymbol_high s ofs) :: + Paddi (ireg_of r) GPR12 (Csymbol_low s ofs) :: k | Oaddrstack n, nil => addimm (ireg_of r) GPR1 n k | Ocast8signed, a1 :: nil => diff --git a/powerpc/Asmgenproof1.v b/powerpc/Asmgenproof1.v index a0cdeabc..8f6f7255 100644 --- a/powerpc/Asmgenproof1.v +++ b/powerpc/Asmgenproof1.v @@ -1198,6 +1198,14 @@ Proof. (* Oaddrsymbol *) change (find_symbol_offset ge i i0) with (symbol_offset ge i i0) in LD. set (v' := symbol_offset ge i i0) in *. + caseEq (symbol_is_small_data i i0); intro SD. + (* small data *) + exists (nextinstr (rs#(ireg_of res) <- v')); split. + apply exec_straight_one; auto. simpl. + rewrite (small_data_area_addressing _ _ _ SD). unfold v', symbol_offset. + destruct (Genv.find_symbol ge i); auto. rewrite Int.add_zero; auto. + eauto with ppcgen. + (* not small data *) pose (rs1 := nextinstr (rs#GPR12 <- (high_half v'))). exists (nextinstr (rs1#(ireg_of res) <- v')). split. apply exec_straight_two with rs1 m'. |