Renaming and cleanup
git-svn-id: svn://svn.cc65.org/cc65/trunk@3137 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -1410,7 +1410,7 @@ void g_scale (unsigned flags, long val)
|
|||||||
} else if (val > 0) {
|
} else if (val > 0) {
|
||||||
|
|
||||||
/* Scale up */
|
/* Scale up */
|
||||||
if ((p2 = powerof2 (val)) > 0 && p2 <= 4) {
|
if ((p2 = PowerOf2 (val)) > 0 && p2 <= 4) {
|
||||||
|
|
||||||
/* Factor is 2, 4, 8 and 16, use special function */
|
/* Factor is 2, 4, 8 and 16, use special function */
|
||||||
switch (flags & CF_TYPE) {
|
switch (flags & CF_TYPE) {
|
||||||
@@ -1465,7 +1465,7 @@ void g_scale (unsigned flags, long val)
|
|||||||
|
|
||||||
/* Scale down */
|
/* Scale down */
|
||||||
val = -val;
|
val = -val;
|
||||||
if ((p2 = powerof2 (val)) > 0 && p2 <= 4) {
|
if ((p2 = PowerOf2 (val)) > 0 && p2 <= 4) {
|
||||||
|
|
||||||
/* Factor is 2, 4, 8 and 16 use special function */
|
/* Factor is 2, 4, 8 and 16 use special function */
|
||||||
switch (flags & CF_TYPE) {
|
switch (flags & CF_TYPE) {
|
||||||
@@ -2600,7 +2600,7 @@ void g_mul (unsigned flags, unsigned long val)
|
|||||||
int p2;
|
int p2;
|
||||||
|
|
||||||
/* Do strength reduction if the value is constant and a power of two */
|
/* Do strength reduction if the value is constant and a power of two */
|
||||||
if (flags & CF_CONST && (p2 = powerof2 (val)) >= 0) {
|
if (flags & CF_CONST && (p2 = PowerOf2 (val)) >= 0) {
|
||||||
/* Generate a shift instead */
|
/* Generate a shift instead */
|
||||||
g_asl (flags, p2);
|
g_asl (flags, p2);
|
||||||
return;
|
return;
|
||||||
@@ -2709,7 +2709,7 @@ void g_div (unsigned flags, unsigned long val)
|
|||||||
|
|
||||||
/* Do strength reduction if the value is constant and a power of two */
|
/* Do strength reduction if the value is constant and a power of two */
|
||||||
int p2;
|
int p2;
|
||||||
if ((flags & CF_CONST) && (p2 = powerof2 (val)) >= 0) {
|
if ((flags & CF_CONST) && (p2 = PowerOf2 (val)) >= 0) {
|
||||||
/* Generate a shift instead */
|
/* Generate a shift instead */
|
||||||
g_asr (flags, p2);
|
g_asr (flags, p2);
|
||||||
} else {
|
} else {
|
||||||
@@ -2737,7 +2737,7 @@ void g_mod (unsigned flags, unsigned long val)
|
|||||||
int p2;
|
int p2;
|
||||||
|
|
||||||
/* Check if we can do some cost reduction */
|
/* Check if we can do some cost reduction */
|
||||||
if ((flags & CF_CONST) && (flags & CF_UNSIGNED) && val != 0xFFFFFFFF && (p2 = powerof2 (val)) >= 0) {
|
if ((flags & CF_CONST) && (flags & CF_UNSIGNED) && val != 0xFFFFFFFF && (p2 = PowerOf2 (val)) >= 0) {
|
||||||
/* We can do that with an AND operation */
|
/* We can do that with an AND operation */
|
||||||
g_and (flags, val - 1);
|
g_and (flags, val - 1);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -45,7 +45,6 @@
|
|||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "funcdesc.h"
|
#include "funcdesc.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "util.h"
|
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* C pre-processor functions.
|
* C pre-processor functions.
|
||||||
* Portions of this code are copyright (C) 1989 John R. Dunning.
|
* Portions of this code are copyright (C) 1989 John R. Dunning.
|
||||||
* See copyleft.jrd for license information.
|
* See copyleft.jrd for license information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -29,7 +29,6 @@
|
|||||||
#include "preproc.h"
|
#include "preproc.h"
|
||||||
#include "scanner.h"
|
#include "scanner.h"
|
||||||
#include "standard.h"
|
#include "standard.h"
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,6 @@
|
|||||||
#include "scanner.h"
|
#include "scanner.h"
|
||||||
#include "standard.h"
|
#include "standard.h"
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user