Simple optimizatiaon problem -- signed word to integer coercion.
From: Szymon (r5z-u28s_g1d_at_o2.pl)
Date: 10/29/04
- Next message: David Steuber: "Re: Do academics really love Lisp? I doubt!"
- Previous message: Pascal Costanza: "Re: why C++ STILL sucks for games"
- Next in thread: szymon: "[btw] Simple optimizatiaon problem [.....]"
- Reply: szymon: "[btw] Simple optimizatiaon problem [.....]"
- Reply: Thomas A. Russ: "Re: Simple optimizatiaon problem -- signed word to integer coercion."
- Reply: Kalle Olavi Niemitalo: "Re: Simple optimizatiaon problem -- signed word to integer coercion."
- Reply: Alan Crowe: "Re: Simple optimizatiaon problem -- signed word to integer coercion."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Oct 2004 11:12:11 +0200
Hi.
Example code:
(defun is-in-simple-string-p (ch str)
(declare
(optimize speed) (inline is-in-simple-string-p) (type character ch) (type simple-string str))
(prog ((index -1) (str-len (length str)))
(declare
(type fixnum index str-len))
|TAG| (if (not (eql (schar str (if (eql (incf index) str-len) (return NIL) index)) ch))
(go |TAG|)
(return T))))
Compiler(SBCL)=>luser output:
; in: LAMBDA NIL
; (INCF INDEX)
; --> LET* SETQ
; ==>
; (THE #<SB-KERNEL:NUMERIC-TYPE FIXNUM> #:G0)
;
; note: doing signed word to integer coercion (cost 20), for:
; the first argument of CHECK-FIXNUM
; compilation unit finished
How to get rid of this? I declared index FIXNUM...
TIA, Szymon.
- Next message: David Steuber: "Re: Do academics really love Lisp? I doubt!"
- Previous message: Pascal Costanza: "Re: why C++ STILL sucks for games"
- Next in thread: szymon: "[btw] Simple optimizatiaon problem [.....]"
- Reply: szymon: "[btw] Simple optimizatiaon problem [.....]"
- Reply: Thomas A. Russ: "Re: Simple optimizatiaon problem -- signed word to integer coercion."
- Reply: Kalle Olavi Niemitalo: "Re: Simple optimizatiaon problem -- signed word to integer coercion."
- Reply: Alan Crowe: "Re: Simple optimizatiaon problem -- signed word to integer coercion."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|