Front page | perl.perl6.internals |
Postings from September 2002
[PATCH] lsr for ARM jit
Thread Previous
|
Thread Next
From:
Nicholas Clark
Date:
September 7, 2002 08:44
Subject:
[PATCH] lsr for ARM jit
Message ID:
20020907153951.GF277@Bagpuss.unfortu.net
On Mon, Aug 19, 2002 at 09:24:47PM +0000, Jason Gloudon wrote:
> # New Ticket Created by Jason Gloudon
> # Please include the string: [perl #16308]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=16308 >
>
>
>
> This adds logical shift right opcodes. They are essential for bit shifting
> negative values without sign extension getting in the way.
Here are logical shift right opcodes for the ARM jit.
(Cargo cult coding)
I probably shouldn't have bothered with Parrot_lsr_i_ic_ic, particularly
as I feel that all two integer constant input permutation of integer binary
ops should not be autogenerated.
Nicholas Clark
--
Even better than the real thing: http://nms-cgi.sourceforge.net/
--- jit/arm/core.jit~ Tue Aug 13 22:56:23 2002
+++ jit/arm/core.jit Sat Sep 7 15:56:06 2002
@@ -506,6 +506,39 @@ Parrot_shr_i_ic_ic {
Parrot_jit_int_store(jit_info, interpreter, cond_AL, 1, r0);
}
+Parrot_lsr_i_i_i {
+ Parrot_jit_int_load(jit_info, interpreter, cond_AL, 2, r0);
+ Parrot_jit_int_load(jit_info, interpreter, cond_AL, 3, r1);
+ jit_info->native_ptr
+ = emit_arith_reg_shift_reg (jit_info->native_ptr, cond_AL,
+ MOV, 0, r2, 0, r0, shift_LSR, r1);
+ Parrot_jit_int_store(jit_info, interpreter, cond_AL, 1, r2);
+}
+Parrot_lsr_i_i_ic {
+ Parrot_jit_int_load(jit_info, interpreter, cond_AL, 2, r0);
+ jit_info->native_ptr
+ = emit_arith_reg_shift_const (jit_info->native_ptr, cond_AL,
+ MOV, 0, r2, 0, r0, shift_LSR,
+ *INT_CONST[3]);
+ Parrot_jit_int_store(jit_info, interpreter, cond_AL, 1, r2);
+}
+Parrot_lsr_i_ic_i {
+ Parrot_jit_int_load(jit_info, interpreter, cond_AL, 2, r0);
+ Parrot_jit_int_load(jit_info, interpreter, cond_AL, 3, r1);
+ jit_info->native_ptr
+ = emit_arith_reg_shift_reg (jit_info->native_ptr, cond_AL,
+ MOV, 0, r2, 0, r0, shift_LSR, r1);
+ Parrot_jit_int_store(jit_info, interpreter, cond_AL, 1, r2);
+}
+Parrot_lsr_i_ic_ic {
+ jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
+ interpreter,
+ cond_AL,
+ ((UINTVAL)*INT_CONST[2]) >> *INT_CONST[3],
+ r0);
+ Parrot_jit_int_store(jit_info, interpreter, cond_AL, 1, r0);
+}
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; logical ops
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Thread Previous
|
Thread Next